@bluxcc/core 0.1.19 → 0.1.20

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.
@@ -34,9 +34,9 @@ const t=mr(),r=fr(),n=Or(),o=Ir(),i=Rr(),s=kr(),a=Mr(),c=Ar(),u=BigInt("57896044
34
34
  */function Zr(){return Hr||(Hr=1,function(e){const t=function(){if(Ur)return qr;Ur=1,qr.byteLength=function(e){var t=i(e),r=t[0],n=t[1];return 3*(r+n)/4-n},qr.toByteArray=function(e){var n,o,s=i(e),a=s[0],c=s[1],u=new r(function(e,t,r){return 3*(t+r)/4-r}(0,a,c)),l=0,f=c>0?a-4:a;for(o=0;o<f;o+=4)n=t[e.charCodeAt(o)]<<18|t[e.charCodeAt(o+1)]<<12|t[e.charCodeAt(o+2)]<<6|t[e.charCodeAt(o+3)],u[l++]=n>>16&255,u[l++]=n>>8&255,u[l++]=255&n;return 2===c&&(n=t[e.charCodeAt(o)]<<2|t[e.charCodeAt(o+1)]>>4,u[l++]=255&n),1===c&&(n=t[e.charCodeAt(o)]<<10|t[e.charCodeAt(o+1)]<<4|t[e.charCodeAt(o+2)]>>2,u[l++]=n>>8&255,u[l++]=255&n),u},qr.fromByteArray=function(t){for(var r,n=t.length,o=n%3,i=[],s=16383,c=0,u=n-o;c<u;c+=s)i.push(a(t,c,c+s>u?u:c+s));return 1===o?(r=t[n-1],i.push(e[r>>2]+e[r<<4&63]+"==")):2===o&&(r=(t[n-2]<<8)+t[n-1],i.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"=")),i.join("")};for(var e=[],t=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)e[o]=n[o],t[n.charCodeAt(o)]=o;function i(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function a(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(s(n));return o.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,qr}(),r=Xr(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=function(e){+e!=e&&(e=0);return s.alloc(+e)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function i(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|h(e,t);let n=i(r);const o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(G(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(G(e,ArrayBuffer)||e&&G(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(G(e,SharedArrayBuffer)||e&&G(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return s.from(n,t,r);const o=function(e){if(s.isBuffer(e)){const t=0|d(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||X(e.length)?i(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),i(e<0?0:0|d(e))}function l(e){const t=e.length<0?0:0|d(e.length),r=i(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,s.prototype),n}function d(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||G(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(o)return n?-1:H(e).length;t=(""+t).toLowerCase(),o=!0}}function p(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,o){let i,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){let n=-1;for(i=r;i<a;i++)if(u(e,i)===u(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===c)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){let r=!0;for(let n=0;n<c;n++)if(u(e,i+n)!==u(t,n)){r=!1;break}if(r)return i}return-1}function b(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(X(n))return s;e[r+s]=n}return s}function v(e,t,r,n){return W(H(t,e.length-r),e,r,n)}function w(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function x(e,t,r,n){return W(K(t),e,r,n)}function S(e,t,r,n){return W(function(e,t){let r,n,o;const i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function A(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,s=t>239?4:t>223?3:t>191?2:1;if(o+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(i=c));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:r=e[o+1],n=e[o+2],a=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}e.kMaxLength=o,s.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,r){return a(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)}(e,t,r)},s.allocUnsafe=function(e){return u(e)},s.allocUnsafeSlow=function(e){return u(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(G(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),G(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},s.isEncoding=function(e){switch(String(e).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}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=s.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(G(t,Uint8Array))o+t.length>n.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!s.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},s.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},s.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},s.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,o){if(G(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const c=Math.min(i,a),u=this.slice(n,o),l=e.slice(t,r);for(let e=0;e<c;++e)if(u[e]!==l[e]){i=u[e],a=l[e];break}return i<a?-1:a<i?1:0},s.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},s.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function O(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function C(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Z[e[n]];return o}function I(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function _(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,n,o,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,o){F(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function N(e,t,r,n,o){F(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function B(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,n,o,i){return t=+t,n>>>=0,i||B(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function M(e,t,n,o,i){return t=+t,n>>>=0,i||B(e,0,n,8),r.write(e,t,n,o,52,8),n+8}s.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=Q(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),s.prototype.readBigUInt64BE=Q(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||_(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||_(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=Q(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),s.prototype.readBigInt64BE=Q(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||_(e,4,this.length),r.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||_(e,4,this.length),r.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||_(e,8,this.length),r.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||_(e,8,this.length),r.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){P(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){P(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigUInt64LE=Q(function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Q(function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}let o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigInt64LE=Q(function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Q(function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},s.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=s.isBuffer(e)?e:s.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const L={};function U(e,t,r){L[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new L.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||q(t,e.length-(r+1))}(n,o,i)}function z(e,t){if("number"!=typeof e)throw new L.ERR_INVALID_ARG_TYPE(t,"number",e)}function q(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new L.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new L.ERR_BUFFER_OUT_OF_BOUNDS;throw new L.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),U("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=D(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=D(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const V=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function K(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function G(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Q(e){return"undefined"==typeof BigInt?Y:e}function Y(){throw new Error("BigInt not supported")}}(zr)),zr}
35
35
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */function Qr(){if(Wr)return Dr.exports;Wr=1;var e=65536,t=4294967295;var r=(Kr||(Kr=1,function(e,t){var r=Zr(),n=r.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i),i.prototype=Object.create(n.prototype),o(n,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var o=n(e);return void 0!==t?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(Fr,Fr.exports)),Fr.exports).Buffer,n=z.crypto||z.msCrypto;return n&&n.getRandomValues?Dr.exports=function(o,i){if(o>t)throw new RangeError("requested too many random bytes");var s=r.allocUnsafe(o);if(o>0)if(o>e)for(var a=0;a<o;a+=e)n.getRandomValues(s.slice(a,a+e));else n.getRandomValues(s);if("function"==typeof i)return process.nextTick(function(){i(null,s)});return s}:Dr.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},Dr.exports}var Yr,Jr,$r={};var en,tn,rn,nn={},on="6.6.1",sn={},an={exports:{}},cn=an.exports;function un(){return en||(en=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Le.Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var o=0,i=Math.min(e.length,r),s=t;s<i;s++){var a=e.charCodeAt(s)-48;o*=n,o+=a>=49?a-49+10:a>=17?a-17+10:a}return o}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,n):(this._parseBase(e,t,o),"le"===n&&this._initArray(this.toArray(),t,n)))},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,s,a=0;if("be"===n)for(o=e.length-1,i=0;o>=0;o-=3)s=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===n)for(o=0,i=0;o<e.length;o+=3)s=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=a(e,t,n)<<i,this.words[s]|=67108863&o,i>=18?(i-=18,s+=1,this.words[s]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=a(e,t,n)<<i,this.words[s]|=67108863&o,i>=18?(i-=18,s+=1,this.words[s]|=o>>>26):i+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,s=i%n,a=Math.min(i,i-s)+r,u=0,l=r;l<a;l+=n)u=c(e,l,l+n,t),this.imuln(o),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=c(e,l,e.length,t),l=0;l<s;l++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],s=o*i,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,f=67108863&c,d=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=d;h++){var p=u-h|0;l+=(s=(o=0|e.words[p])*(i=0|t.words[h])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<o|i)).toString(16);i=a>>>24-o&16777215,(o+=2)>=26&&(o-=26,s--),n=0!==i||s!==this.length-1?u[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],h=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?y+n:u[d-y.length]+y+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r(void 0!==i),this.toArrayLike(i,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(i),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<i;a++)u[a]=0}else{for(a=0;a<i-o;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[i-a-1]=s}return u},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return r(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return r(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return r(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,s=0;s<n.length;s++)i=(t=(0|r.words[s])-(0|n.words[s])+i)>>26,this.words[s]=67108863&t;for(;0!==i&&s<r.length;s++)i=(t=(0|r.words[s])+i)>>26,this.words[s]=67108863&t;if(0===i&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,r){var n,o,i,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],f=8191&l,d=l>>>13,h=0|s[1],p=8191&h,y=h>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,S=0|s[4],E=8191&S,A=S>>>13,k=0|s[5],O=8191&k,T=k>>>13,C=0|s[6],I=8191&C,_=C>>>13,P=0|s[7],R=8191&P,N=P>>>13,B=0|s[8],j=8191&B,M=B>>>13,L=0|s[9],U=8191&L,D=L>>>13,F=0|a[0],z=8191&F,q=F>>>13,V=0|a[1],H=8191&V,K=V>>>13,W=0|a[2],G=8191&W,X=W>>>13,Z=0|a[3],Q=8191&Z,Y=Z>>>13,J=0|a[4],$=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,oe=0|a[6],ie=8191&oe,se=oe>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],fe=8191&le,de=le>>>13,he=0|a[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(f,z))|0)+((8191&(o=(o=Math.imul(f,q))+Math.imul(d,z)|0))<<13)|0;u=((i=Math.imul(d,q))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,z),o=(o=Math.imul(p,q))+Math.imul(y,z)|0,i=Math.imul(y,q);var me=(u+(n=n+Math.imul(f,H)|0)|0)+((8191&(o=(o=o+Math.imul(f,K)|0)+Math.imul(d,H)|0))<<13)|0;u=((i=i+Math.imul(d,K)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,z),o=(o=Math.imul(m,q))+Math.imul(b,z)|0,i=Math.imul(b,q),n=n+Math.imul(p,H)|0,o=(o=o+Math.imul(p,K)|0)+Math.imul(y,H)|0,i=i+Math.imul(y,K)|0;var be=(u+(n=n+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,X)|0)+Math.imul(d,G)|0))<<13)|0;u=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,z),o=(o=Math.imul(w,q))+Math.imul(x,z)|0,i=Math.imul(x,q),n=n+Math.imul(m,H)|0,o=(o=o+Math.imul(m,K)|0)+Math.imul(b,H)|0,i=i+Math.imul(b,K)|0,n=n+Math.imul(p,G)|0,o=(o=o+Math.imul(p,X)|0)+Math.imul(y,G)|0,i=i+Math.imul(y,X)|0;var ve=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(o=(o=o+Math.imul(f,Y)|0)+Math.imul(d,Q)|0))<<13)|0;u=((i=i+Math.imul(d,Y)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,z),o=(o=Math.imul(E,q))+Math.imul(A,z)|0,i=Math.imul(A,q),n=n+Math.imul(w,H)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(x,H)|0,i=i+Math.imul(x,K)|0,n=n+Math.imul(m,G)|0,o=(o=o+Math.imul(m,X)|0)+Math.imul(b,G)|0,i=i+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,Y)|0;var we=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;u=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,z),o=(o=Math.imul(O,q))+Math.imul(T,z)|0,i=Math.imul(T,q),n=n+Math.imul(E,H)|0,o=(o=o+Math.imul(E,K)|0)+Math.imul(A,H)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(w,G)|0,o=(o=o+Math.imul(w,X)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,X)|0,n=n+Math.imul(m,Q)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(b,Q)|0,i=i+Math.imul(b,Y)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0;var xe=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(o=(o=o+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(I,z),o=(o=Math.imul(I,q))+Math.imul(_,z)|0,i=Math.imul(_,q),n=n+Math.imul(O,H)|0,o=(o=o+Math.imul(O,K)|0)+Math.imul(T,H)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(E,G)|0,o=(o=o+Math.imul(E,X)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,X)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,Y)|0)+Math.imul(x,Q)|0,i=i+Math.imul(x,Y)|0,n=n+Math.imul(m,$)|0,o=(o=o+Math.imul(m,ee)|0)+Math.imul(b,$)|0,i=i+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0;var Se=(u+(n=n+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,se)|0)+Math.imul(d,ie)|0))<<13)|0;u=((i=i+Math.imul(d,se)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(R,z),o=(o=Math.imul(R,q))+Math.imul(N,z)|0,i=Math.imul(N,q),n=n+Math.imul(I,H)|0,o=(o=o+Math.imul(I,K)|0)+Math.imul(_,H)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(O,G)|0,o=(o=o+Math.imul(O,X)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,X)|0,n=n+Math.imul(E,Q)|0,o=(o=o+Math.imul(E,Y)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,Y)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(x,$)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(m,re)|0,o=(o=o+Math.imul(m,ne)|0)+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,se)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,se)|0;var Ee=(u+(n=n+Math.imul(f,ce)|0)|0)+((8191&(o=(o=o+Math.imul(f,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((i=i+Math.imul(d,ue)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,z),o=(o=Math.imul(j,q))+Math.imul(M,z)|0,i=Math.imul(M,q),n=n+Math.imul(R,H)|0,o=(o=o+Math.imul(R,K)|0)+Math.imul(N,H)|0,i=i+Math.imul(N,K)|0,n=n+Math.imul(I,G)|0,o=(o=o+Math.imul(I,X)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,X)|0,n=n+Math.imul(O,Q)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,Y)|0,n=n+Math.imul(E,$)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(m,ie)|0,o=(o=o+Math.imul(m,se)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,ue)|0;var Ae=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,z),o=(o=Math.imul(U,q))+Math.imul(D,z)|0,i=Math.imul(D,q),n=n+Math.imul(j,H)|0,o=(o=o+Math.imul(j,K)|0)+Math.imul(M,H)|0,i=i+Math.imul(M,K)|0,n=n+Math.imul(R,G)|0,o=(o=o+Math.imul(R,X)|0)+Math.imul(N,G)|0,i=i+Math.imul(N,X)|0,n=n+Math.imul(I,Q)|0,o=(o=o+Math.imul(I,Y)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,Y)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,n=n+Math.imul(E,re)|0,o=(o=o+Math.imul(E,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,se)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,se)|0,n=n+Math.imul(m,ce)|0,o=(o=o+Math.imul(m,ue)|0)+Math.imul(b,ce)|0,i=i+Math.imul(b,ue)|0,n=n+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0;var ke=(u+(n=n+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;u=((i=i+Math.imul(d,ye)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,H),o=(o=Math.imul(U,K))+Math.imul(D,H)|0,i=Math.imul(D,K),n=n+Math.imul(j,G)|0,o=(o=o+Math.imul(j,X)|0)+Math.imul(M,G)|0,i=i+Math.imul(M,X)|0,n=n+Math.imul(R,Q)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(N,Q)|0,i=i+Math.imul(N,Y)|0,n=n+Math.imul(I,$)|0,o=(o=o+Math.imul(I,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(O,re)|0,o=(o=o+Math.imul(O,ne)|0)+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,n=n+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,se)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,se)|0,n=n+Math.imul(w,ce)|0,o=(o=o+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,ue)|0,n=n+Math.imul(m,fe)|0,o=(o=o+Math.imul(m,de)|0)+Math.imul(b,fe)|0,i=i+Math.imul(b,de)|0;var Oe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;u=((i=i+Math.imul(y,ye)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,G),o=(o=Math.imul(U,X))+Math.imul(D,G)|0,i=Math.imul(D,X),n=n+Math.imul(j,Q)|0,o=(o=o+Math.imul(j,Y)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,Y)|0,n=n+Math.imul(R,$)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(N,$)|0,i=i+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,o=(o=o+Math.imul(I,ne)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,se)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,se)|0,n=n+Math.imul(E,ce)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,i=i+Math.imul(A,ue)|0,n=n+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(x,fe)|0,i=i+Math.imul(x,de)|0;var Te=(u+(n=n+Math.imul(m,pe)|0)|0)+((8191&(o=(o=o+Math.imul(m,ye)|0)+Math.imul(b,pe)|0))<<13)|0;u=((i=i+Math.imul(b,ye)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,Q),o=(o=Math.imul(U,Y))+Math.imul(D,Q)|0,i=Math.imul(D,Y),n=n+Math.imul(j,$)|0,o=(o=o+Math.imul(j,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,n=n+Math.imul(R,re)|0,o=(o=o+Math.imul(R,ne)|0)+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,n=n+Math.imul(I,ie)|0,o=(o=o+Math.imul(I,se)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,se)|0,n=n+Math.imul(O,ce)|0,o=(o=o+Math.imul(O,ue)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,ue)|0,n=n+Math.imul(E,fe)|0,o=(o=o+Math.imul(E,de)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,de)|0;var Ce=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ye)|0)+Math.imul(x,pe)|0))<<13)|0;u=((i=i+Math.imul(x,ye)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(U,$),o=(o=Math.imul(U,ee))+Math.imul(D,$)|0,i=Math.imul(D,ee),n=n+Math.imul(j,re)|0,o=(o=o+Math.imul(j,ne)|0)+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,n=n+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,se)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,se)|0,n=n+Math.imul(I,ce)|0,o=(o=o+Math.imul(I,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,n=n+Math.imul(O,fe)|0,o=(o=o+Math.imul(O,de)|0)+Math.imul(T,fe)|0,i=i+Math.imul(T,de)|0;var Ie=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,ye)|0)+Math.imul(A,pe)|0))<<13)|0;u=((i=i+Math.imul(A,ye)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,re),o=(o=Math.imul(U,ne))+Math.imul(D,re)|0,i=Math.imul(D,ne),n=n+Math.imul(j,ie)|0,o=(o=o+Math.imul(j,se)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,se)|0,n=n+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,ue)|0,n=n+Math.imul(I,fe)|0,o=(o=o+Math.imul(I,de)|0)+Math.imul(_,fe)|0,i=i+Math.imul(_,de)|0;var _e=(u+(n=n+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,ye)|0)+Math.imul(T,pe)|0))<<13)|0;u=((i=i+Math.imul(T,ye)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(U,ie),o=(o=Math.imul(U,se))+Math.imul(D,ie)|0,i=Math.imul(D,se),n=n+Math.imul(j,ce)|0,o=(o=o+Math.imul(j,ue)|0)+Math.imul(M,ce)|0,i=i+Math.imul(M,ue)|0,n=n+Math.imul(R,fe)|0,o=(o=o+Math.imul(R,de)|0)+Math.imul(N,fe)|0,i=i+Math.imul(N,de)|0;var Pe=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(o=(o=o+Math.imul(I,ye)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,ye)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,ce),o=(o=Math.imul(U,ue))+Math.imul(D,ce)|0,i=Math.imul(D,ue),n=n+Math.imul(j,fe)|0,o=(o=o+Math.imul(j,de)|0)+Math.imul(M,fe)|0,i=i+Math.imul(M,de)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,ye)|0)+Math.imul(N,pe)|0))<<13)|0;u=((i=i+Math.imul(N,ye)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,fe),o=(o=Math.imul(U,de))+Math.imul(D,fe)|0,i=Math.imul(D,de);var Ne=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(o=(o=o+Math.imul(j,ye)|0)+Math.imul(M,pe)|0))<<13)|0;u=((i=i+Math.imul(M,ye)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Be=(u+(n=Math.imul(U,pe))|0)+((8191&(o=(o=Math.imul(U,ye))+Math.imul(D,pe)|0))<<13)|0;return u=((i=Math.imul(D,ye))+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ge,c[1]=me,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Se,c[7]=Ee,c[8]=Ae,c[9]=ke,c[10]=Oe,c[11]=Te,c[12]=Ce,c[13]=Ie,c[14]=_e,c[15]=Pe,c[16]=Re,c[17]=Ne,c[18]=Be,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(h=d),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var s=o;o=0;for(var a=67108863&n,c=Math.min(i,t.length-1),u=Math.max(0,i-e.length+1);u<=c;u++){var l=i-u,f=(0|e.words[l])*(0|t.words[u]),d=67108863&f;a=67108863&(d=d+a|0),o+=(s=(s=s+(f/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[i]=a,n=s,s=o}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},y.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,o=0;o<t;o++)n|=(1&e)<<t-o-1,e>>=1;return n},y.prototype.permute=function(e,t,r,n,o,i){for(var s=0;s<i;s++)n[s]=t[e[s]],o[s]=r[e[s]]},y.prototype.transform=function(e,t,r,n,o,i){this.permute(i,e,t,r,n,o);for(var s=1;s<o;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<o;l+=a)for(var f=c,d=u,h=0;h<s;h++){var p=r[l+h],y=n[l+h],g=r[l+h+s],m=n[l+h+s],b=f*g-d*m;m=f*m+d*g,g=b,r[l+h]=p+g,n[l+h]=y+m,r[l+h+s]=p-g,n[l+h+s]=y-m,h!==a&&(b=c*f-u*d,d=c*d+u*f,f=b)}},y.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,o=0;for(r=r/2|0;r;r>>>=1)o++;return 1<<o+1+n},y.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var o=e[n];e[n]=e[r-n-1],e[r-n-1]=o,o=t[n],t[n]=-t[r-n-1],t[r-n-1]=-o}},y.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var o=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&o,r=o<67108864?0:o/67108864|0}return e},y.prototype.convert13b=function(e,t,n,o){for(var i=0,s=0;s<t;s++)i+=0|e[s],n[2*s]=8191&i,i>>>=13,n[2*s+1]=8191&i,i>>>=13;for(s=2*t;s<o;++s)n[s]=0;r(0===i),r(!(-8192&i))},y.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},y.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(n),i=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,i,a,c,n,o),this.transform(u,i,l,f,n,o);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*f[h];c[h]=a[h]*f[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,d,i,n,o),this.conjugate(d,i,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),p(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,i=(67108863&o)+(67108863&t);t>>=26,t+=o/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this.length=0===e?1:this.length,this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,o=r%26;t[r]=(e.words[n]&1<<o)>>>o}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&i,c=(0|this.words[t])-a<<n;this.words[t]=c|s,s=a>>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this.strip()},o.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,n){var o;r("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,s=Math.min((e-i)/26,this.length),a=67108863^67108863>>>i<<i,c=n;if(o-=s,o=Math.max(0,o),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=o);u--){var f=0|this.words[u];this.words[u]=l<<26-i|f>>>i,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<<t;return!(this.length<=n||!(this.words[n]&o))},o.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,n){var o,i,s=e.length+n;this._expand(s);var a=0;for(o=0;o<e.length;o++){i=(0|this.words[o+n])+a;var c=(0|e.words[o])*t;a=((i-=67108863&c)>>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)a=(i=(0|this.words[o+n])+a)>>26,this.words[o+n]=67108863&i;if(0===a)return this.strip();for(r(-1===a),a=0,o=0;o<this.length;o++)a=(i=-(0|this.words[o])+a)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var f=c-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(t*n+(0|this.words[o]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*t;this.words[n]=o/e|0,t=o%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0===(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(n.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,s=n;0!==i&&s<this.length;s++){var a=0|this.words[s];i=(a+=i)>>>26,a&=67108863,this.words[s]=a}return 0!==i&&(this.words[s]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},n(b,m),b.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var s=0|e.words[o];e.words[o-10]=(s&r)<<4|i>>>22,i=s}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(v,m),n(w,m),n(x,m),x.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return g[e]=t,t},S.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var y=h,g=0;0!==y.cmp(a);g++)y=y.redSqr();r(g<p);var m=this.pow(f,new o(1).iushln(p-g-1));d=d.redMul(m),f=m.redSqr(),h=h.redMul(f),p=g}return d},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},n(E,S),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(an,cn)),an.exports}function ln(){if(rn)return tn;function e(e,t){if(!e)throw new Error(t||"Assertion failed")}return rn=1,tn=e,e.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)},tn}var fn,dn,hn={};function pn(){return fn||(fn=1,function(e){var t=e;function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n<e.length;n++)t+=r(e[n].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),i=o>>8,s=255&o;i?r.push(i,s):r.push(s)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}(hn)),hn}function yn(){return dn||(dn=1,function(e){var t=e,r=un(),n=ln(),o=pn();t.assert=n,t.toArray=o.toArray,t.zero2=o.zero2,t.toHex=o.toHex,t.encode=o.encode,t.getNAF=function(e,t,r){var n,o=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<o.length;n+=1)o[n]=0;var i=1<<t+1,s=e.clone();for(n=0;n<o.length;n++){var a,c=s.andln(i-1);s.isOdd()?(a=c>(i>>1)-1?(i>>1)-c:c,s.isubn(a)):a=0,o[n]=a,s.iushrn(1)}return o},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var s,a,c=e.andln(3)+o&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),s=1&c?3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?c:-c:0,r[0].push(s),a=1&u?3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?u:-u:0,r[1].push(a),2*o===s+1&&(o=1-o),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new r(e,"hex","le")}}(sn)),sn}var gn,mn={exports:{}};function bn(){if(gn)return mn.exports;var e;function t(e){this.rand=e}if(gn=1,mn.exports=function(r){return e||(e=new t(null)),e.generate(r)},mn.exports.Rand=t,t.prototype.generate=function(e){return this._rand(e)},t.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=Le;if("function"!=typeof r.randomBytes)throw new Error("Not supported");t.prototype._rand=function(e){return r.randomBytes(e)}}catch(e){}return mn.exports}var vn,wn,xn={};function Sn(){if(wn)return vn;wn=1;var e=un(),t=yn(),r=t.getNAF,n=t.getJSF,o=t.assert;function i(t,r){this.type=t,this.p=new e(r.p,16),this.red=r.prime?e.red(r.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=r.n&&new e(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(e,t){this.curve=e,this.type=t,this.precomputed=null}return vn=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(e,t){o(e.precomputed);var n=e._getDoubles(),i=r(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2==0?2:1);s/=3;var a,c,u=[];for(a=0;a<i.length;a+=n.step){c=0;for(var l=a+n.step-1;l>=a;l--)c=(c<<1)+i[l];u.push(c)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=s;h>0;h--){for(a=0;a<u.length;a++)(c=u[a])===h?d=d.mixedAdd(n.points[a]):c===-h&&(d=d.mixedAdd(n.points[a].neg()));f=f.add(d)}return f.toP()},i.prototype._wnafMul=function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=r(t,n,this._bitLength),c=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var l=0;u>=0&&0===a[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var f=a[u];o(0!==f),c="affine"===e.type?f>0?c.mixedAdd(s[f-1>>1]):c.mixedAdd(s[-f-1>>1].neg()):f>0?c.add(s[f-1>>1]):c.add(s[-f-1>>1].neg())}return"affine"===e.type?c.toP():c},i.prototype._wnafMulAdd=function(e,t,o,i,s){var a,c,u,l=this._wnafT1,f=this._wnafT2,d=this._wnafT3,h=0;for(a=0;a<i;a++){var p=(u=t[a])._getNAFPoints(e);l[a]=p.wnd,f[a]=p.points}for(a=i-1;a>=1;a-=2){var y=a-1,g=a;if(1===l[y]&&1===l[g]){var m=[t[y],null,null,t[g]];0===t[y].y.cmp(t[g].y)?(m[1]=t[y].add(t[g]),m[2]=t[y].toJ().mixedAdd(t[g].neg())):0===t[y].y.cmp(t[g].y.redNeg())?(m[1]=t[y].toJ().mixedAdd(t[g]),m[2]=t[y].add(t[g].neg())):(m[1]=t[y].toJ().mixedAdd(t[g]),m[2]=t[y].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=n(o[y],o[g]);for(h=Math.max(v[0].length,h),d[y]=new Array(h),d[g]=new Array(h),c=0;c<h;c++){var w=0|v[0][c],x=0|v[1][c];d[y][c]=b[3*(w+1)+(x+1)],d[g][c]=0,f[y]=m}}else d[y]=r(o[y],l[y],this._bitLength),d[g]=r(o[g],l[g],this._bitLength),h=Math.max(d[y].length,h),h=Math.max(d[g].length,h)}var S=this.jpoint(null,null,null),E=this._wnafT4;for(a=h;a>=0;a--){for(var A=0;a>=0;){var k=!0;for(c=0;c<i;c++)E[c]=0|d[c][a],0!==E[c]&&(k=!1);if(!k)break;A++,a--}if(a>=0&&A++,S=S.dblp(A),a<0)break;for(c=0;c<i;c++){var O=E[c];0!==O&&(O>0?u=f[c][O-1>>1]:O<0&&(u=f[c][-O-1>>1].neg()),S="affine"===u.type?S.mixedAdd(u):S.add(u))}}for(a=0;a<i;a++)f[a]=null;return s?S:S.toP()},i.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},i.prototype.decodePoint=function(e,r){e=t.toArray(e,r);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*n)return 6===e[0]?o(e[e.length-1]%2==0):7===e[0]&&o(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(e){return this.encode(e,!0)},s.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},s.prototype.encode=function(e,r){return t.encode(this._encode(r),e)},s.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},s.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},s.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},s.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t},vn}var En,An,kn,On,Tn,Cn,In,_n,Pn={exports:{}};function Rn(){return En||(En=1,"function"==typeof Object.create?Pn.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Pn.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),Pn.exports}function Nn(){return _n||(_n=1,function(e){var t=e;t.base=Sn(),t.short=function(){if(kn)return An;kn=1;var e=yn(),t=un(),r=Rn(),n=Sn(),o=e.assert;function i(e){n.call(this,"short",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function s(e,r,o,i){n.BasePoint.call(this,e,"affine"),null===r&&null===o?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(r,16),this.y=new t(o,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function a(e,r,o,i){n.BasePoint.call(this,e,"jacobian"),null===r&&null===o&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(r,16),this.y=new t(o,16),this.z=new t(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(i,n),An=i,i.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,n;if(e.beta)r=new t(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=(r=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)n=new t(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))?n=s[0]:(n=s[1],o(0===this.g.mul(n).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:n,basis:e.basis?e.basis.map(function(e){return{a:new t(e.a,16),b:new t(e.b,16)}}):this._getEndoBasis(n)}}},i.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:t.mont(e),n=new t(2).toRed(r).redInvm(),o=n.redNeg(),i=new t(3).toRed(r).redNeg().redSqrt().redMul(n);return[o.redAdd(i).fromRed(),o.redSub(i).fromRed()]},i.prototype._getEndoBasis=function(e){for(var r,n,o,i,s,a,c,u,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new t(1),y=new t(0),g=new t(0),m=new t(1),b=0;0!==d.cmpn(0);){var v=h.div(d);u=h.sub(v.mul(d)),l=g.sub(v.mul(p));var w=m.sub(v.mul(y));if(!o&&u.cmp(f)<0)r=c.neg(),n=p,o=u.neg(),i=l;else if(o&&2===++b)break;c=u,h=d,d=u,g=p,p=l,m=y,y=w}s=u.neg(),a=l;var x=o.sqr().add(i.sqr());return s.sqr().add(a.sqr()).cmp(x)>=0&&(s=r,a=n),o.negative&&(o=o.neg(),i=i.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:o,b:i},{a:s,b:a}]},i.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),s=o.mul(r.a),a=i.mul(n.a),c=o.mul(r.b),u=i.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},i.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),o=n.redSqrt();if(0!==o.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=o.fromRed().isOdd();return(r&&!i||!r&&i)&&(o=o.redNeg()),this.point(e,o)},i.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},i.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var s=this._endoSplit(t[i]),a=e[i],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*i]=a,n[2*i+1]=c,o[2*i]=s.k1,o[2*i+1]=s.k2}for(var u=this._wnafMulAdd(1,n,o,2*i,r),l=0;l<2*i;l++)n[l]=null,o[l]=null;return u},r(s,n.BasePoint),i.prototype.point=function(e,t,r){return new s(this,e,t,r)},i.prototype.pointFromJSON=function(e,t){return s.fromJSON(this,e,t)},s.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},s.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},s.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return this.inf},s.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},s.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),s=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.prototype.mul=function(e){return e=new t(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},s.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},s.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},s.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},s.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(a,n.BasePoint),i.prototype.jpoint=function(e,t,r){return new a(this,e,t,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(o),c=i.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),f=n.redMul(u),d=c.redSqr().redIAdd(l).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(i.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,h,p)},a.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=o.redSub(i);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(l).redISub(l),d=a.redMul(l.redISub(f)).redISub(o.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(f,d,h)},a.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=i.redSqr(),f=u.redSqr(),d=f.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=i.redMul(f),y=h.redSqr().redISub(p.redAdd(p)),g=p.redISub(y),m=h.redMul(g);m=m.redIAdd(m).redISub(d);var b=u.redMul(a);t+1<e&&(c=c.redMul(d)),i=y,a=b,u=m}return this.curve.jpoint(i,u.redMul(o),a)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),h=this.x.redAdd(f).redSqr().redISub(l).redISub(d);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),y=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),e=y.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},a.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var g=f.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=h.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},a.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=t.redSqr(),s=r.redSqr(),a=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),f=u.redISub(l),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=a.redMul(f).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=o.redIAdd(s).redSqr().redISub(i).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(a).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,d,h)},a.prototype.mul=function(e,r){return e=new t(e,r),this.curve._wnafMul(this,e)},a.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},a.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},a.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},An}(),t.mont=function(){if(Tn)return On;Tn=1;var e=un(),t=Rn(),r=Sn(),n=yn();function o(t){r.call(this,"mont",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(t,n,o){r.BasePoint.call(this,t,"projective"),null===n&&null===o?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(n,16),this.z=new e(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(o,r),On=o,o.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},t(i,r.BasePoint),o.prototype.decodePoint=function(e,t){return this.point(n.toArray(e,t),1)},o.prototype.point=function(e,t){return new i(this,e,t)},o.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(e,t){return new i(e,t[0],t[1]||e.one)},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),o=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,o)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(r),s=o.redMul(n),a=t.z.redMul(i.redAdd(s).redSqr()),c=t.x.redMul(i.redISub(s).redSqr());return this.curve.point(a,c)},i.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var i=o.length-1;i>=0;i--)0===o[i]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},On}(),t.edwards=function(){if(In)return Cn;In=1;var e=yn(),t=un(),r=Rn(),n=Sn(),o=e.assert;function i(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,n.call(this,"edwards",e),this.a=new t(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function s(e,r,o,i,s){n.BasePoint.call(this,e,"projective"),null===r&&null===o&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(r,16),this.y=new t(o,16),this.z=i?new t(i,16):this.curve.one,this.t=s&&new t(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(i,n),Cn=i,i.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},i.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},i.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},i.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),o=this.c2.redSub(this.a.redMul(n)),i=this.one.redSub(this.c2.redMul(this.d).redMul(n)),s=o.redMul(i.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(r&&!c||!r&&c)&&(a=a.redNeg()),this.point(e,a)},i.prototype.pointFromY=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),o=n.redSub(this.c2),i=n.redMul(this.d).redMul(this.c2).redSub(this.a),s=o.redMul(i.redInvm());if(0===s.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)},i.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(o)},r(s,n.BasePoint),i.prototype.pointFromJSON=function(e){return s.fromJSON(this,e)},i.prototype.point=function(e,t,r,n){return new s(this,e,t,r,n)},s.fromJSON=function(e,t){return new s(e,t[0],t[1],t[2])},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},s.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=n.redAdd(t),s=i.redSub(r),a=n.redSub(t),c=o.redMul(s),u=i.redMul(a),l=o.redMul(a),f=s.redMul(i);return this.curve.point(c,u,f,l)},s.prototype._projDbl=function(){var e,t,r,n,o,i,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(o=this.z.redSqr(),i=u.redSub(o).redISub(o),e=s.redSub(a).redISub(c).redMul(i),t=u.redMul(n.redSub(c)),r=u.redMul(i))}else n=a.redAdd(c),o=this.curve._mulC(this.z).redSqr(),i=n.redSub(o).redSub(o),e=this.curve._mulC(s.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(i);return this.curve.point(e,t,r)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),s=o.redSub(n),a=o.redAdd(n),c=r.redAdd(t),u=i.redMul(s),l=a.redMul(c),f=i.redMul(c),d=s.redMul(a);return this.curve.point(u,l,d,f)},s.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),o=n.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(i).redMul(s),c=o.redSub(a),u=o.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),f=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(i))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(i)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,t,r)},s.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},s.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},s.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},s.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},s.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add,Cn}()}(xn)),xn}var Bn,jn={},Mn={},Ln={};function Un(){if(Bn)return Ln;Bn=1;var e=ln(),t=Rn();function r(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function n(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function i(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}return Ln.inherits=t,Ln.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)n.push(parseInt(e[i]+e[i+1],16))}else for(var o=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?n[o++]=s:s<2048?(n[o++]=s>>6|192,n[o++]=63&s|128):r(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),n[o++]=s>>18|240,n[o++]=s>>12&63|128,n[o++]=s>>6&63|128,n[o++]=63&s|128):(n[o++]=s>>12|224,n[o++]=s>>6&63|128,n[o++]=63&s|128)}else for(i=0;i<e.length;i++)n[i]=0|e[i];return n},Ln.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=o(e[r].toString(16));return t},Ln.htonl=n,Ln.toHex32=function(e,t){for(var r="",o=0;o<e.length;o++){var s=e[o];"little"===t&&(s=n(s)),r+=i(s.toString(16))}return r},Ln.zero2=o,Ln.zero8=i,Ln.join32=function(t,r,n,o){var i=n-r;e(i%4==0);for(var s=new Array(i/4),a=0,c=r;a<s.length;a++,c+=4){var u;u="big"===o?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],s[a]=u>>>0}return s},Ln.split32=function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n<e.length;n++,o+=4){var i=e[n];"big"===t?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},Ln.rotr32=function(e,t){return e>>>t|e<<32-t},Ln.rotl32=function(e,t){return e<<t|e>>>32-t},Ln.sum32=function(e,t){return e+t>>>0},Ln.sum32_3=function(e,t,r){return e+t+r>>>0},Ln.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},Ln.sum32_5=function(e,t,r,n,o){return e+t+r+n+o>>>0},Ln.sum64=function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,s=(i<n?1:0)+r+o;e[t]=s>>>0,e[t+1]=i},Ln.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},Ln.sum64_lo=function(e,t,r,n){return t+n>>>0},Ln.sum64_4_hi=function(e,t,r,n,o,i,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+i>>>0)<i?1:0,e+r+o+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},Ln.sum64_4_lo=function(e,t,r,n,o,i,s,a){return t+n+i+a>>>0},Ln.sum64_5_hi=function(e,t,r,n,o,i,s,a,c,u){var l=0,f=t;return l+=(f=f+n>>>0)<t?1:0,l+=(f=f+i>>>0)<i?1:0,l+=(f=f+a>>>0)<a?1:0,e+r+o+s+c+(l+=(f=f+u>>>0)<u?1:0)>>>0},Ln.sum64_5_lo=function(e,t,r,n,o,i,s,a,c,u){return t+n+i+a+u>>>0},Ln.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},Ln.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},Ln.shr64_hi=function(e,t,r){return e>>>r},Ln.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},Ln}var Dn,Fn={};function zn(){if(Dn)return Fn;Dn=1;var e=Un(),t=ln();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return Fn.BlockHash=r,r.prototype.update=function(t,r){if(t=e.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=e.join32(t,0,t.length-n,this.endian);for(var o=0;o<t.length;o+=this._delta32)this._update(t,o,o+this._delta32)}return this},r.prototype.digest=function(e){return this.update(this._pad()),t(null===this.pending),this._digest(e)},r.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n},Fn}var qn,Vn,Hn,Kn,Wn,Gn,Xn,Zn,Qn,Yn,Jn,$n,eo={},to={};function ro(){if(qn)return to;qn=1;var e=Un().rotr32;function t(e,t,r){return e&t^~e&r}function r(e,t,r){return e&t^e&r^t&r}function n(e,t,r){return e^t^r}return to.ft_1=function(e,o,i,s){return 0===e?t(o,i,s):1===e||3===e?n(o,i,s):2===e?r(o,i,s):void 0},to.ch32=t,to.maj32=r,to.p32=n,to.s0_256=function(t){return e(t,2)^e(t,13)^e(t,22)},to.s1_256=function(t){return e(t,6)^e(t,11)^e(t,25)},to.g0_256=function(t){return e(t,7)^e(t,18)^t>>>3},to.g1_256=function(t){return e(t,17)^e(t,19)^t>>>10},to}function no(){if(Wn)return Kn;Wn=1;var e=Un(),t=zn(),r=ro(),n=ln(),o=e.sum32,i=e.sum32_4,s=e.sum32_5,a=r.ch32,c=r.maj32,u=r.s0_256,l=r.s1_256,f=r.g0_256,d=r.g1_256,h=t.BlockHash,p=[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 y(){if(!(this instanceof y))return new y;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return e.inherits(y,h),Kn=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,h=0;h<16;h++)r[h]=e[t+h];for(;h<r.length;h++)r[h]=i(d(r[h-2]),r[h-7],f(r[h-15]),r[h-16]);var p=this.h[0],y=this.h[1],g=this.h[2],m=this.h[3],b=this.h[4],v=this.h[5],w=this.h[6],x=this.h[7];for(n(this.k.length===r.length),h=0;h<r.length;h++){var S=s(x,l(b),a(b,v,w),this.k[h],r[h]),E=o(u(p),c(p,y,g));x=w,w=v,v=b,b=o(m,S),m=g,g=y,y=p,p=o(S,E)}this.h[0]=o(this.h[0],p),this.h[1]=o(this.h[1],y),this.h[2]=o(this.h[2],g),this.h[3]=o(this.h[3],m),this.h[4]=o(this.h[4],b),this.h[5]=o(this.h[5],v),this.h[6]=o(this.h[6],w),this.h[7]=o(this.h[7],x)},y.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},Kn}function oo(){if(Qn)return Zn;Qn=1;var e=Un(),t=zn(),r=ln(),n=e.rotr64_hi,o=e.rotr64_lo,i=e.shr64_hi,s=e.shr64_lo,a=e.sum64,c=e.sum64_hi,u=e.sum64_lo,l=e.sum64_4_hi,f=e.sum64_4_lo,d=e.sum64_5_hi,h=e.sum64_5_lo,p=t.BlockHash,y=[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 g(){if(!(this instanceof g))return new g;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function m(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function b(e,t,r,n,o,i){var s=t&n^~t&i;return s<0&&(s+=4294967296),s}function v(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function w(e,t,r,n,o,i){var s=t&n^t&i^n&i;return s<0&&(s+=4294967296),s}function x(e,t){var r=n(e,t,28)^n(t,e,2)^n(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=n(e,t,14)^n(e,t,18)^n(t,e,9);return r<0&&(r+=4294967296),r}function A(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}function k(e,t){var r=n(e,t,1)^n(e,t,8)^i(e,t,7);return r<0&&(r+=4294967296),r}function O(e,t){var r=o(e,t,1)^o(e,t,8)^s(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=n(e,t,19)^n(t,e,29)^i(e,t,6);return r<0&&(r+=4294967296),r}function C(e,t){var r=o(e,t,19)^o(t,e,29)^s(e,t,6);return r<0&&(r+=4294967296),r}return e.inherits(g,p),Zn=g,g.blockSize=1024,g.outSize=512,g.hmacStrength=192,g.padLength=128,g.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var o=T(r[n-4],r[n-3]),i=C(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=k(r[n-30],r[n-29]),u=O(r[n-30],r[n-29]),d=r[n-32],h=r[n-31];r[n]=l(o,i,s,a,c,u,d,h),r[n+1]=f(o,i,s,a,c,u,d,h)}},g.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,o=this.h[0],i=this.h[1],s=this.h[2],l=this.h[3],f=this.h[4],p=this.h[5],y=this.h[6],g=this.h[7],k=this.h[8],O=this.h[9],T=this.h[10],C=this.h[11],I=this.h[12],_=this.h[13],P=this.h[14],R=this.h[15];r(this.k.length===n.length);for(var N=0;N<n.length;N+=2){var B=P,j=R,M=E(k,O),L=A(k,O),U=m(k,O,T,C,I),D=b(k,O,T,C,I,_),F=this.k[N],z=this.k[N+1],q=n[N],V=n[N+1],H=d(B,j,M,L,U,D,F,z,q,V),K=h(B,j,M,L,U,D,F,z,q,V);B=x(o,i),j=S(o,i),M=v(o,i,s,l,f),L=w(o,i,s,l,f,p);var W=c(B,j,M,L),G=u(B,j,M,L);P=I,R=_,I=T,_=C,T=k,C=O,k=c(y,g,H,K),O=u(g,g,H,K),y=f,g=p,f=s,p=l,s=o,l=i,o=c(H,K,W,G),i=u(H,K,W,G)}a(this.h,0,o,i),a(this.h,2,s,l),a(this.h,4,f,p),a(this.h,6,y,g),a(this.h,8,k,O),a(this.h,10,T,C),a(this.h,12,I,_),a(this.h,14,P,R)},g.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},Zn}function io(){return $n||($n=1,eo.sha1=function(){if(Hn)return Vn;Hn=1;var e=Un(),t=zn(),r=ro(),n=e.rotl32,o=e.sum32,i=e.sum32_5,s=r.ft_1,a=t.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function u(){if(!(this instanceof u))return new u;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(u,a),Vn=u,u.blockSize=512,u.outSize=160,u.hmacStrength=80,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.W,a=0;a<16;a++)r[a]=e[t+a];for(;a<r.length;a++)r[a]=n(r[a-3]^r[a-8]^r[a-14]^r[a-16],1);var u=this.h[0],l=this.h[1],f=this.h[2],d=this.h[3],h=this.h[4];for(a=0;a<r.length;a++){var p=~~(a/20),y=i(n(u,5),s(p,l,f,d),h,r[a],c[p]);h=d,d=f,f=n(l,30),l=u,u=y}this.h[0]=o(this.h[0],u),this.h[1]=o(this.h[1],l),this.h[2]=o(this.h[2],f),this.h[3]=o(this.h[3],d),this.h[4]=o(this.h[4],h)},u.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},Vn}(),eo.sha224=function(){if(Xn)return Gn;Xn=1;var e=Un(),t=no();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return e.inherits(r,t),Gn=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,7),"big"):e.split32(this.h.slice(0,7),"big")},Gn}(),eo.sha256=no(),eo.sha384=function(){if(Jn)return Yn;Jn=1;var e=Un(),t=oo();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return e.inherits(r,t),Yn=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,12),"big"):e.split32(this.h.slice(0,12),"big")},Yn}(),eo.sha512=oo()),eo}var so,ao,co,uo,lo,fo,ho,po,yo,go,mo,bo,vo,wo,xo,So,Eo,Ao,ko,Oo,To,Co,Io,_o,Po,Ro,No,Bo,jo={};function Mo(){return uo||(uo=1,function(e){var t=e;t.utils=Un(),t.common=zn(),t.sha=io(),t.ripemd=function(){if(so)return jo;so=1;var e=Un(),t=zn(),r=e.rotl32,n=e.sum32,o=e.sum32_3,i=e.sum32_4,s=t.BlockHash;function a(){if(!(this instanceof a))return new a;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function u(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}e.inherits(a,s),jo.ripemd160=a,a.blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(e,t){for(var s=this.h[0],a=this.h[1],y=this.h[2],g=this.h[3],m=this.h[4],b=s,v=a,w=y,x=g,S=m,E=0;E<80;E++){var A=n(r(i(s,c(E,a,y,g),e[f[E]+t],u(E)),h[E]),m);s=m,m=g,g=r(y,10),y=a,a=A,A=n(r(i(b,c(79-E,v,w,x),e[d[E]+t],l(E)),p[E]),S),b=S,S=x,x=r(w,10),w=v,v=A}A=o(this.h[1],y,x),this.h[1]=o(this.h[2],g,S),this.h[2]=o(this.h[3],m,b),this.h[3]=o(this.h[4],s,v),this.h[4]=o(this.h[0],a,w),this.h[0]=A},a.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"little"):e.split32(this.h,"little")};var f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],d=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return jo}(),t.hmac=function(){if(co)return ao;co=1;var e=Un(),t=ln();function r(t,n,o){if(!(this instanceof r))return new r(t,n,o);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(e.toArray(n,o))}return ao=r,r.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),t(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=(new this.Hash).update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=(new this.Hash).update(e)},r.prototype.update=function(e,t){return this.inner.update(e,t),this},r.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},ao}(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(Mn)),Mn}function Lo(){return ho||(ho=1,function(e){var t,r=e,n=Mo(),o=Nn(),i=yn().assert;function s(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new s(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=s,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=fo?lo:(fo=1,lo={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(jn)),jn}function Uo(){if(xo)return wo;xo=1;var e=un(),t=function(){if(yo)return po;yo=1;var e=Mo(),t=pn(),r=ln();function n(e){if(!(this instanceof n))return new n(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var o=t.toArray(e.entropy,e.entropyEnc||"hex"),i=t.toArray(e.nonce,e.nonceEnc||"hex"),s=t.toArray(e.pers,e.persEnc||"hex");r(o.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(o,i,s)}return po=n,n.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},n.prototype._hmac=function(){return new e.hmac(this.hash,this.K)},n.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},n.prototype.reseed=function(e,n,o,i){"string"!=typeof n&&(i=o,o=n,n=null),e=t.toArray(e,n),o=t.toArray(o,i),r(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(o||[])),this._reseed=1},n.prototype.generate=function(e,r,n,o){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(o=n,n=r,r=null),n&&(n=t.toArray(n,o||"hex"),this._update(n));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var s=i.slice(0,e);return this._update(n),this._reseed++,t.encode(s,r)},po}(),r=yn(),n=Lo(),o=bn(),i=r.assert,s=function(){if(mo)return go;mo=1;var e=un(),t=yn().assert;function r(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}return go=r,r.fromPublic=function(e,t,n){return t instanceof r?t:new r(e,{pub:t,pubEnc:n})},r.fromPrivate=function(e,t,n){return t instanceof r?t:new r(e,{priv:t,privEnc:n})},r.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},r.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(t,r){this.priv=new e(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(e,r){if(e.x||e.y)return"mont"===this.ec.curve.type?t(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||t(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,r)},r.prototype.derive=function(e){return e.validate()||t(e.validate(),"public point not validated"),e.mul(this.priv).getX()},r.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},r.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},go}(),a=function(){if(vo)return bo;vo=1;var e=un(),t=yn(),r=t.assert;function n(t,o){if(t instanceof n)return t;this._importDER(t,o)||(r(t.r&&t.s,"Signature without r or s"),this.r=new e(t.r,16),this.s=new e(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function o(){this.place=0}function i(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var o=0,i=0,s=t.place;i<n;i++,s++)o<<=8,o|=e[s],o>>>=0;return!(o<=127)&&(t.place=s,o)}function s(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function a(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}return bo=n,n.prototype._importDER=function(r,n){r=t.toArray(r,n);var s=new o;if(48!==r[s.place++])return!1;var a=i(r,s);if(!1===a)return!1;if(a+s.place!==r.length)return!1;if(2!==r[s.place++])return!1;var c=i(r,s);if(!1===c)return!1;if(128&r[s.place])return!1;var u=r.slice(s.place,c+s.place);if(s.place+=c,2!==r[s.place++])return!1;var l=i(r,s);if(!1===l)return!1;if(r.length!==l+s.place)return!1;if(128&r[s.place])return!1;var f=r.slice(s.place,l+s.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new e(u),this.s=new e(f),this.recoveryParam=null,!0},n.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&n[0]&&(n=[0].concat(n)),r=s(r),n=s(n);!(n[0]||128&n[1]);)n=n.slice(1);var o=[2];a(o,r.length),(o=o.concat(r)).push(2),a(o,n.length);var i=o.concat(n),c=[48];return a(c,i.length),c=c.concat(i),t.encode(c,e)},bo}();function c(e){if(!(this instanceof c))return new c(e);"string"==typeof e&&(i(Object.prototype.hasOwnProperty.call(n,e),"Unknown curve "+e),e=n[e]),e instanceof n.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}return wo=c,c.prototype.keyPair=function(e){return new s(this,e)},c.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},c.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},c.prototype.genKeyPair=function(r){r||(r={});for(var n=new t({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||o(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),s=this.n.sub(new e(2));;){var a=new e(n.generate(i));if(!(a.cmp(s)>0))return a.iaddn(1),this.keyFromPrivate(a)}},c.prototype._truncateToN=function(t,r,n){var o;if(e.isBN(t)||"number"==typeof t)o=(t=new e(t,16)).byteLength();else if("object"==typeof t)o=t.length,t=new e(t,16);else{var i=t.toString();o=i.length+1>>>1,t=new e(i,16)}"number"!=typeof n&&(n=8*o);var s=n-this.n.bitLength();return s>0&&(t=t.ushrn(s)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},c.prototype.sign=function(r,n,o,s){if("object"==typeof o&&(s=o,o=null),s||(s={}),"string"!=typeof r&&"number"!=typeof r&&!e.isBN(r)){i("object"==typeof r&&r&&"number"==typeof r.length,"Expected message to be an array-like, a hex string, or a BN instance"),i(r.length>>>0===r.length);for(var c=0;c<r.length;c++)i((255&r[c])===r[c])}n=this.keyFromPrivate(n,o),r=this._truncateToN(r,!1,s.msgBitLength),i(!r.isNeg(),"Can not sign a negative message");var u=this.n.byteLength(),l=n.getPrivate().toArray("be",u),f=r.toArray("be",u);i(new e(f).eq(r),"Can not sign message");for(var d=new t({hash:this.hash,entropy:l,nonce:f,pers:s.pers,persEnc:s.persEnc||"utf8"}),h=this.n.sub(new e(1)),p=0;;p++){var y=s.k?s.k(p):new e(d.generate(this.n.byteLength()));if(!((y=this._truncateToN(y,!0)).cmpn(1)<=0||y.cmp(h)>=0)){var g=this.g.mul(y);if(!g.isInfinity()){var m=g.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var v=y.invm(this.n).mul(b.mul(n.getPrivate()).iadd(r));if(0!==(v=v.umod(this.n)).cmpn(0)){var w=(g.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return s.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),w^=1),new a({r:b,s:v,recoveryParam:w})}}}}}},c.prototype.verify=function(e,t,r,n,o){o||(o={}),e=this._truncateToN(e,!1,o.msgBitLength),r=this.keyFromPublic(r,n);var i=(t=new a(t,"hex")).r,s=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var c,u=s.invm(this.n),l=u.mul(e).umod(this.n),f=u.mul(i).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(l,r.getPublic(),f)).isInfinity()&&c.eqXToP(i):!(c=this.g.mulAdd(l,r.getPublic(),f)).isInfinity()&&0===c.getX().umod(this.n).cmp(i)},c.prototype.recoverPubKey=function(t,r,n,o){i((3&n)===n,"The recovery param is more than two bits"),r=new a(r,o);var s=this.n,c=new e(t),u=r.r,l=r.s,f=1&n,d=n>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");u=d?this.curve.pointFromX(u.add(this.curve.n),f):this.curve.pointFromX(u,f);var h=r.r.invm(s),p=s.sub(c).mul(h).umod(s),y=l.mul(h).umod(s);return this.g.mulAdd(p,u,y)},c.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new a(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")},wo}function Do(){if(To)return Oo;To=1;var e=Mo(),t=Lo(),r=yn(),n=r.assert,o=r.parseBytes,i=function(){if(Eo)return So;Eo=1;var e=yn(),t=e.assert,r=e.parseBytes,n=e.cachedProperty;function o(e,t){this.eddsa=e,this._secret=r(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=r(t.pub)}return o.fromPublic=function(e,t){return t instanceof o?t:new o(e,{pub:t})},o.fromSecret=function(e,t){return t instanceof o?t:new o(e,{secret:t})},o.prototype.secret=function(){return this._secret},n(o,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),n(o,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),n(o,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),n(o,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),n(o,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),n(o,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),o.prototype.sign=function(e){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},o.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},o.prototype.getSecret=function(r){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),r)},o.prototype.getPublic=function(t){return e.encode(this.pubBytes(),t)},So=o}(),s=function(){if(ko)return Ao;ko=1;var e=un(),t=yn(),r=t.assert,n=t.cachedProperty,o=t.parseBytes;function i(t,n){this.eddsa=t,"object"!=typeof n&&(n=o(n)),Array.isArray(n)&&(r(n.length===2*t.encodingLength,"Signature has invalid size"),n={R:n.slice(0,t.encodingLength),S:n.slice(t.encodingLength)}),r(n.R&&n.S,"Signature without R or S"),t.isPoint(n.R)&&(this._R=n.R),n.S instanceof e&&(this._S=n.S),this._Rencoded=Array.isArray(n.R)?n.R:n.Rencoded,this._Sencoded=Array.isArray(n.S)?n.S:n.Sencoded}return n(i,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),n(i,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),n(i,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),n(i,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),i.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},i.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},Ao=i}();function a(r){if(n("ed25519"===r,"only tested with ed25519 so far"),!(this instanceof a))return new a(r);r=t[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=e.sha512}return Oo=a,a.prototype.sign=function(e,t){e=o(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),s=this.encodePoint(i),a=this.hashInt(s,r.pubBytes(),e).mul(r.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:s})},a.prototype.verify=function(e,t,r){if(e=o(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(s)},a.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return r.intFromLE(e.digest()).umod(this.curve.n)},a.prototype.keyFromPublic=function(e){return i.fromPublic(this,e)},a.prototype.keyFromSecret=function(e){return i.fromSecret(this,e)},a.prototype.makeSignature=function(e){return e instanceof s?e:new s(this,e)},a.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},a.prototype.decodePoint=function(e){var t=(e=r.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),o=!!(128&e[t]),i=r.intFromLE(n);return this.curve.pointFromY(i,o)},a.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},a.prototype.decodeInt=function(e){return r.intFromLE(e)},a.prototype.isPoint=function(e){return e instanceof this.pointClass},Oo}function Fo(){if(_o)return Io;_o=1;const e=(Co||(Co=1,function(e){var t=e;t.version=on,t.utils=yn(),t.rand=bn(),t.curve=Nn(),t.curves=Lo(),t.ec=Uo(),t.eddsa=Do()}(nn)),nn).ec,t=new e("secp256k1"),r=t.curve,n=r.n.constructor;function o(e){const o=e[0];switch(o){case 2:case 3:return 33!==e.length?null:function(e,o){let i=new n(o);if(i.cmp(r.p)>=0)return null;i=i.toRed(r.red);let s=i.redSqr().redIMul(i).redIAdd(r.b).redSqrt();3===e!==s.isOdd()&&(s=s.redNeg());const a=i.redSqr().redIMul(i);return s.redSqr().redISub(a.redIAdd(r.b)).isZero()?t.keyPair({pub:{x:i,y:s}}):null}(o,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,o,i){let s=new n(o),a=new n(i);if(s.cmp(r.p)>=0||a.cmp(r.p)>=0)return null;if(s=s.toRed(r.red),a=a.toRed(r.red),(6===e||7===e)&&a.isOdd()!==(7===e))return null;const c=s.redSqr().redIMul(s);return a.redSqr().redISub(c.redIAdd(r.b)).isZero()?t.keyPair({pub:{x:s,y:a}}):null}(o,e.subarray(1,33),e.subarray(33,65));default:return null}}function i(e,t){const r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}return Io={contextRandomize:()=>0,privateKeyVerify(e){const t=new n(e);return t.cmp(r.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new n(e),o=r.n.sub(t).umod(r.n).toArrayLike(Uint8Array,"be",32);return e.set(o),0},privateKeyTweakAdd(e,t){const o=new n(t);if(o.cmp(r.n)>=0)return 1;if(o.iadd(new n(e)),o.cmp(r.n)>=0&&o.isub(r.n),o.isZero())return 1;const i=o.toArrayLike(Uint8Array,"be",32);return e.set(i),0},privateKeyTweakMul(e,t){let o=new n(t);if(o.cmp(r.n)>=0||o.isZero())return 1;o.imul(new n(e)),o.cmp(r.n)>=0&&(o=o.umod(r.n));const i=o.toArrayLike(Uint8Array,"be",32);return e.set(i),0},publicKeyVerify:e=>null===o(e)?1:0,publicKeyCreate(e,o){const s=new n(o);if(s.cmp(r.n)>=0||s.isZero())return 1;return i(e,t.keyFromPrivate(o).getPublic()),0},publicKeyConvert(e,t){const r=o(t);if(null===r)return 1;return i(e,r.getPublic()),0},publicKeyNegate(e,t){const r=o(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),i(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=o(t[e]),null===r[e])return 1;let n=r[0].getPublic();for(let e=1;e<r.length;++e)n=n.add(r[e].pub);return n.isInfinity()?2:(i(e,n),0)},publicKeyTweakAdd(e,t,s){const a=o(t);if(null===a)return 1;if((s=new n(s)).cmp(r.n)>=0)return 2;const c=a.getPublic().add(r.g.mul(s));return c.isInfinity()?2:(i(e,c),0)},publicKeyTweakMul(e,t,s){const a=o(t);if(null===a)return 1;if((s=new n(s)).cmp(r.n)>=0||s.isZero())return 2;return i(e,a.getPublic().mul(s)),0},signatureNormalize(e){const o=new n(e.subarray(0,32)),i=new n(e.subarray(32,64));return o.cmp(r.n)>=0||i.cmp(r.n)>=0?1:(1===i.cmp(t.nh)&&e.set(r.n.sub(i).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const o=t.subarray(0,32),i=t.subarray(32,64);if(new n(o).cmp(r.n)>=0)return 1;if(new n(i).cmp(r.n)>=0)return 1;const{output:s}=e;let a=s.subarray(4,37);a[0]=0,a.set(o,1);let c=33,u=0;for(;c>1&&0===a[u]&&!(128&a[u+1]);--c,++u);if(a=a.subarray(u),128&a[0])return 1;if(c>1&&0===a[0]&&!(128&a[1]))return 1;let l=s.subarray(39,72);l[0]=0,l.set(i,1);let f=33,d=0;for(;f>1&&0===l[d]&&!(128&l[d+1]);--f,++d);return l=l.subarray(d),128&l[0]||f>1&&0===l[0]&&!(128&l[1])?1:(e.outputlen=6+c+f,s[0]=48,s[1]=e.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+c]=2,s[5+c]=l.length,s.set(l,6+c),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const o=t[3];if(0===o)return 1;if(5+o>=t.length)return 1;if(2!==t[4+o])return 1;const i=t[5+o];if(0===i)return 1;if(6+o+i!==t.length)return 1;if(128&t[4])return 1;if(o>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[o+6])return 1;if(i>1&&0===t[o+6]&&!(128&t[o+7]))return 1;let s=t.subarray(4,4+o);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=t.subarray(6+o);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let c=new n(s);c.cmp(r.n)>=0&&(c=new n(0));let u=new n(t.subarray(6+o));return u.cmp(r.n)>=0&&(u=new n(0)),e.set(c.toArrayLike(Uint8Array,"be",32),0),e.set(u.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,o,i,s,a){if(a){const e=a;a=t=>{const r=e(o,i,null,s,t);if(!(r instanceof Uint8Array&&32===r.length))throw new Error("This is the way");return new n(r)}}const c=new n(i);if(c.cmp(r.n)>=0||c.isZero())return 1;let u;try{u=t.sign(o,i,{canonical:!0,k:a,pers:s})}catch(e){return 1}return e.signature.set(u.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(u.s.toArrayLike(Uint8Array,"be",32),32),e.recid=u.recoveryParam,0},ecdsaVerify(e,i,s){const a={r:e.subarray(0,32),s:e.subarray(32,64)},c=new n(a.r),u=new n(a.s);if(c.cmp(r.n)>=0||u.cmp(r.n)>=0)return 1;if(1===u.cmp(t.nh)||c.isZero()||u.isZero())return 3;const l=o(s);if(null===l)return 2;const f=l.getPublic();return t.verify(i,a,f)?0:3},ecdsaRecover(e,o,s,a){const c={r:o.slice(0,32),s:o.slice(32,64)},u=new n(c.r),l=new n(c.s);if(u.cmp(r.n)>=0||l.cmp(r.n)>=0)return 1;if(u.isZero()||l.isZero())return 2;let f;try{f=t.recoverPubKey(a,c,s)}catch(e){return 2}return i(e,f),0},ecdh(e,i,s,a,c,u,l){const f=o(i);if(null===f)return 1;const d=new n(s);if(d.cmp(r.n)>=0||d.isZero())return 2;const h=f.getPublic().mul(d);if(void 0===c){const r=h.encode(null,!0),n=t.hash().update(r).digest();for(let t=0;t<32;++t)e[t]=n[t]}else{u||(u=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)u[e]=t[e];l||(l=new Uint8Array(32));const r=h.getY().toArray("be",32);for(let e=0;e<32;++e)l[e]=r[e];const n=c(u,l,a);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}},Io}function zo(){return Ro||(Ro=1,Po=function(){if(Jr)return Yr;Jr=1;const e="Impossible case. Please create issue.",t="The tweak was out of range or the resulted private key is invalid",r="The tweak was out of range or equal to zero",n="Unknow error on context randomization",o="Private Key is invalid",i="Public Key could not be parsed",s="Public Key serialization error",a="The sum of the public keys is not valid",c="Signature could not be parsed",u="The nonce generation function failed, or the private key was invalid",l="Public key could not be recover",f="Scalar was invalid (zero or overflow)";function d(e,t){if(!e)throw new Error(t)}function h(e,t,r){if(d(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;d(r.includes(t.length),n)}else{const n=`Expected ${e} to be an Uint8Array with length ${r}`;d(t.length===r,n)}}function p(e){d("Boolean"===g(e),"Expected compressed to be a Boolean")}function y(e=e=>new Uint8Array(e),t){return"function"==typeof e&&(e=e(t)),h("output",e,t),e}function g(e){return Object.prototype.toString.call(e).slice(8,-1)}return Yr=m=>({contextRandomize(e){if(d(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&h("seed",e,32),1===m.contextRandomize(e))throw new Error(n)},privateKeyVerify:e=>(h("private key",e,32),0===m.privateKeyVerify(e)),privateKeyNegate(t){switch(h("private key",t,32),m.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(e)}},privateKeyTweakAdd(e,r){switch(h("private key",e,32),h("tweak",r,32),m.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(t)}},privateKeyTweakMul(e,t){switch(h("private key",e,32),h("tweak",t,32),m.privateKeyTweakMul(e,t)){case 0:return e;case 1:throw new Error(r)}},publicKeyVerify:e=>(h("public key",e,[33,65]),0===m.publicKeyVerify(e)),publicKeyCreate(e,t=!0,r){switch(h("private key",e,32),p(t),r=y(r,t?33:65),m.publicKeyCreate(r,e)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(s)}},publicKeyConvert(e,t=!0,r){switch(h("public key",e,[33,65]),p(t),r=y(r,t?33:65),m.publicKeyConvert(r,e)){case 0:return r;case 1:throw new Error(i);case 2:throw new Error(s)}},publicKeyNegate(t,r=!0,n){switch(h("public key",t,[33,65]),p(r),n=y(n,r?33:65),m.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error(e);case 3:throw new Error(s)}},publicKeyCombine(e,t=!0,r){d(Array.isArray(e),"Expected public keys to be an Array"),d(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)h("public key",t,[33,65]);switch(p(t),r=y(r,t?33:65),m.publicKeyCombine(r,e)){case 0:return r;case 1:throw new Error(i);case 2:throw new Error(a);case 3:throw new Error(s)}},publicKeyTweakAdd(e,r,n=!0,o){switch(h("public key",e,[33,65]),h("tweak",r,32),p(n),o=y(o,n?33:65),m.publicKeyTweakAdd(o,e,r)){case 0:return o;case 1:throw new Error(i);case 2:throw new Error(t)}},publicKeyTweakMul(e,t,n=!0,o){switch(h("public key",e,[33,65]),h("tweak",t,32),p(n),o=y(o,n?33:65),m.publicKeyTweakMul(o,e,t)){case 0:return o;case 1:throw new Error(i);case 2:throw new Error(r)}},signatureNormalize(e){switch(h("signature",e,64),m.signatureNormalize(e)){case 0:return e;case 1:throw new Error(c)}},signatureExport(t,r){h("signature",t,64);const n={output:r=y(r,72),outputlen:72};switch(m.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(c);case 2:throw new Error(e)}},signatureImport(t,r){switch(h("signature",t),r=y(r,64),m.signatureImport(r,t)){case 0:return r;case 1:throw new Error(c);case 2:throw new Error(e)}},ecdsaSign(t,r,n={},o){h("message",t,32),h("private key",r,32),d("Object"===g(n),"Expected options to be an Object"),void 0!==n.data&&h("options.data",n.data),void 0!==n.noncefn&&d("Function"===g(n.noncefn),"Expected options.noncefn to be a Function");const i={signature:o=y(o,64),recid:null};switch(m.ecdsaSign(i,t,r,n.data,n.noncefn)){case 0:return i;case 1:throw new Error(u);case 2:throw new Error(e)}},ecdsaVerify(e,t,r){switch(h("signature",e,64),h("message",t,32),h("public key",r,[33,65]),m.ecdsaVerify(e,t,r)){case 0:return!0;case 3:return!1;case 1:throw new Error(c);case 2:throw new Error(i)}},ecdsaRecover(t,r,n,o=!0,i){switch(h("signature",t,64),d("Number"===g(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),h("message",n,32),p(o),i=y(i,o?33:65),m.ecdsaRecover(i,t,r,n)){case 0:return i;case 1:throw new Error(c);case 2:throw new Error(l);case 3:throw new Error(e)}},ecdh(e,t,r={},n){switch(h("public key",e,[33,65]),h("private key",t,32),d("Object"===g(r),"Expected options to be an Object"),void 0!==r.data&&h("options.data",r.data),void 0!==r.hashfn?(d("Function"===g(r.hashfn),"Expected options.hashfn to be a Function"),void 0!==r.xbuf&&h("options.xbuf",r.xbuf,32),void 0!==r.ybuf&&h("options.ybuf",r.ybuf,32),h("output",n)):n=y(n,32),m.ecdh(n,e,t,r.data,r.hashfn,r.xbuf,r.ybuf)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error(f)}}}),Yr}()(Fo())),Po}function qo(){if(No)return $r;No=1;var e=$r&&$r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($r,"__esModule",{value:!0}),$r.PublicKey=void 0;const t=$t(),r=Lr(),n=e(zo()),o=ze();class i{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class s extends i{enum;ed25519Key;secp256k1Key;constructor(e){const t=function(e){switch(e){case o.KeyType.ED25519:return"ed25519Key";case o.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?s.fromString(e):e}static fromString(e){const r=e.split(":");let n,i;if(1===r.length)n=r[0];else{if(2!==r.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");n=r[1],i=function(e){switch(e.toLowerCase()){case"ed25519":return o.KeyType.ED25519;case"secp256k1":return o.KeyType.SECP256K1;default:throw new Error(`Unknown key type ${e}`)}}(r[0])}const a=(0,t.baseDecode)(n);i||(i=a.length===o.KeySize.SECP256k1_PUBLIC_KEY?o.KeyType.SECP256K1:o.KeyType.ED25519);const c=i===o.KeyType.ED25519?o.KeySize.ED25519_PUBLIC_KEY:o.KeySize.SECP256k1_PUBLIC_KEY;if(a.length!==c)throw new Error(`Invalid public key size (${a.length}), must be ${c}`);return new s({keyType:i,data:a})}toString(){const e=(0,t.baseEncode)(this.data);return`${function(e){switch(e){case o.KeyType.ED25519:return"ed25519";case o.KeyType.SECP256K1:return"secp256k1";default:throw new Error(`Unknown key type ${e}`)}}(this.keyType)}:${e}`}verify(e,t){const i=this.keyType,s=this.data;switch(i){case o.KeyType.ED25519:return r.ed25519.verify(t,e,s);case o.KeyType.SECP256K1:return n.default.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...s]));default:throw new Error(`Unknown key type: ${i}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}return $r.PublicKey=s,$r}function Vo(){if(Bo)return Ge;Bo=1;var e=Ge&&Ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.KeyPairEd25519=void 0;const t=$t(),r=Lr(),n=e(Qr()),o=ze(),i=Ke(),s=qo();class a extends i.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const n=(0,t.baseDecode)(e),i=new Uint8Array(n.slice(0,o.KeySize.SECRET_KEY)),a=r.ed25519.getPublicKey(new Uint8Array(i));this.publicKey=new s.PublicKey({keyType:o.KeyType.ED25519,data:a}),this.secretKey=(0,t.baseEncode)(i),this.extendedSecretKey=e}static fromRandom(){const e=(0,n.default)(o.KeySize.SECRET_KEY),i=r.ed25519.getPublicKey(new Uint8Array(e)),s=new Uint8Array([...e,...i]);return new a((0,t.baseEncode)(s))}sign(e){return{signature:r.ed25519.sign(e,(0,t.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return Ge.KeyPairEd25519=a,Ge}var Ho,Ko,Wo,Go,Xo={};function Zo(){if(Ho)return Xo;Ho=1;var e=Xo&&Xo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.KeyPairSecp256k1=void 0;const t=$t(),r=e(Qr()),n=e(zo()),o=ze(),i=Ke(),s=qo();class a extends i.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const r=(0,t.baseDecode)(e),i=new Uint8Array(r.slice(0,o.KeySize.SECRET_KEY)),a=n.default.publicKeyCreate(new Uint8Array(i),!1),c=a.subarray(1,a.length);this.publicKey=new s.PublicKey({keyType:o.KeyType.SECP256K1,data:c}),this.secretKey=(0,t.baseEncode)(i),this.extendedSecretKey=e}static fromRandom(){const e=(0,r.default)(o.KeySize.SECRET_KEY),i=n.default.publicKeyCreate(new Uint8Array(e),!1),s=i.subarray(1,i.length),c=new Uint8Array([...e,...s]);return new a((0,t.baseEncode)(c))}sign(e){const{signature:r,recid:o}=n.default.ecdsaSign(e,(0,t.baseDecode)(this.secretKey));return{signature:new Uint8Array([...r,o]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return Xo.KeyPairSecp256k1=a,Xo}function Qo(){return Wo||(Wo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.KeyPairSecp256k1=e.KeyPairEd25519=e.KeyPair=e.KeyType=void 0;var t=ze();Object.defineProperty(e,"KeyType",{enumerable:!0,get:function(){return t.KeyType}});var r=function(){if(Ko)return Ve;Ko=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.KeyPair=void 0;const e=Ke(),t=Vo(),r=Zo();class n extends e.KeyPairBase{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return t.KeyPairEd25519.fromRandom();case"SECP256K1":return r.KeyPairSecp256k1.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const n=e.split(":");if(2!==n.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");switch(n[0].toUpperCase()){case"ED25519":return new t.KeyPairEd25519(n[1]);case"SECP256K1":return new r.KeyPairSecp256k1(n[1]);default:throw new Error(`Unknown curve: ${n[0]}`)}}}return Ve.KeyPair=n,Ve}();Object.defineProperty(e,"KeyPair",{enumerable:!0,get:function(){return r.KeyPair}});var n=Vo();Object.defineProperty(e,"KeyPairEd25519",{enumerable:!0,get:function(){return n.KeyPairEd25519}});var o=Zo();Object.defineProperty(e,"KeyPairSecp256k1",{enumerable:!0,get:function(){return o.KeyPairSecp256k1}});var i=qo();Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return i.PublicKey}})}(De)),De}function Yo(){return Go||(Go=1,function(e){var t=we&&we.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=we&&we.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=we&&we.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(n,e,o);return r(n,e),n},o=we&&we.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.authPayloadSchema=e.AuthPayload=void 0,e.verifySignature=function(t,r){const n=new u(t),o=i.serialize(e.authPayloadSchema,n),a=Uint8Array.from(s.default.sha256.array(o));let l=new Uint8Array(Buffer.from(r.signature,"base64"));return c.PublicKey.from(r.publicKey).verify(a,l)};const i=n(function(){if(Ne)return xe;Ne=1;var e=xe&&xe.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=xe&&xe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=xe&&xe.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n};xe.__esModule=!0,xe.deserialize=xe.serialize=void 0;var n=function(){if(Ie)return Se;Ie=1;var e=Se&&Se.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Se&&Se.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n};Se.__esModule=!0,Se.BorshSerializer=void 0;var n=Ae(),o=Te(),i=r(Pe()),s=function(){function e(e){this.encoded=new o.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(n.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&i.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&i.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),o=0;o<r;o++)n[o]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&i.expect_type(e,"string",this.fieldPath);for(var t=e,r=[],n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?r.push(o):o<2048?r.push(192|o>>6,128|63&o):o<55296||o>=57344?r.push(224|o>>12,128|o>>6&63,128|63&o):(n++,o=65536+((1023&o)<<10|1023&t.charCodeAt(n)),r.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|63&o))}this.encoded.store_value(r.length,"u32"),this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_boolean=function(e){this.checkTypes&&i.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&i.expect_enum(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var o=t.enum[n];if(r===Object.keys(o.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,o)}throw new Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(i.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw new Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?i.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?i.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&i.expect_type(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,o=r;n<o.length;n++){var s=o[n];this.encode_value(s,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&i.expect_type(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var o=0,s=n;o<s.length;o++){var a=s[o];this.encode_value(a,t.map.key),this.encode_value(r?e.get(a):e[a],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&i.expect_type(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var o=n[r];this.fieldPath.push(o),this.encode_value(e[o],t.struct[o]),this.fieldPath.pop()}},e}();return Se.BorshSerializer=s,Se}(),o=function(){if(Re)return Be;Re=1,Be.__esModule=!0,Be.BorshDeserializer=void 0;var e=Ae(),t=Te(),r=function(){function r(e){this.buffer=new t.DecodeBuffer(e)}return r.prototype.decode=function(e){return this.decode_value(e)},r.prototype.decode_value=function(t){if("string"==typeof t){if(e.integers.includes(t))return this.decode_integer(t);if("string"===t)return this.decode_string();if("bool"===t)return this.decode_boolean()}if("object"==typeof t){if("option"in t)return this.decode_option(t);if("enum"in t)return this.decode_enum(t);if("array"in t)return this.decode_array(t);if("set"in t)return this.decode_set(t);if("map"in t)return this.decode_map(t);if("struct"in t)return this.decode_struct(t)}throw new Error("Unsupported type: ".concat(t))},r.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},r.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),o=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(o))):BigInt("0x".concat(o))},r.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e)),r=[],n=0;n<e;++n){var o=t[n];if(o<128)r.push(o);else if(o<224)r.push((31&o)<<6|63&t[++n]);else if(o<240)r.push((15&o)<<12|(63&t[++n])<<6|63&t[++n]);else{var i=(7&o)<<18|(63&t[++n])<<12|(63&t[++n])<<6|63&t[++n];r.push(i)}}return String.fromCodePoint.apply(String,r)},r.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},r.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw new Error("Invalid option ".concat(t));return null},r.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw new Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,o=Object.keys(n)[0];return(t={})[o]=this.decode_value(n[o]),t},r.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},r.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},r.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var o=this.decode_value(e.map.key),i=this.decode_value(e.map.value);r.set(o,i)}return r},r.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},r}();return Be.BorshDeserializer=r,Be}(),i=r(Pe());return xe.serialize=function(e,t,r){return void 0===r&&(r=!0),r&&i.validate_schema(e),new n.BorshSerializer(r).encode(t,e)},xe.deserialize=function(e,t,r){return void 0===r&&(r=!0),r&&i.validate_schema(e),new o.BorshDeserializer(t).decode(e)},xe}()),s=o((je||(je=1,a=Me,function(){var e="input is invalid type",t="object"==typeof window,r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var n=!t&&"object"==typeof self,o=!r.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&"renderer"!=process.type;o?r=z:n&&(r=self);var i=!r.JS_SHA256_NO_COMMON_JS&&a.exports,s=!r.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],l=[24,16,8,0],f=[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],d=["hex","array","digest","arrayBuffer"],h=[];!r.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!s||!r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var p=function(e,t){return function(r){return new v(t,!0).update(r)[e]()}},y=function(e){var t=p("hex",e);o&&(t=g(t,e)),t.create=function(){return new v(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<d.length;++r){var n=d[r];t[n]=p(n,e)}return t},g=function(t,n){var o,i=Le,s=Le.Buffer,a=n?"sha224":"sha256";return o=s.from&&!r.JS_SHA256_NO_BUFFER_FROM?s.from:function(e){return new s(e)},function(r){if("string"==typeof r)return i.createHash(a).update(r,"utf8").digest("hex");if(null==r)throw new Error(e);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===s?i.createHash(a).update(o(r)).digest("hex"):t(r)}},m=function(e,t){return function(r,n){return new w(r,t,!0).update(n)[e]()}},b=function(e){var t=m("hex",e);t.create=function(t){return new w(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<d.length;++r){var n=d[r];t[n]=m(n,e)}return t};function v(e,t){t?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function w(t,r,n){var o,i=typeof t;if("string"===i){var a,c=[],u=t.length,l=0;for(o=0;o<u;++o)(a=t.charCodeAt(o))<128?c[l++]=a:a<2048?(c[l++]=192|a>>>6,c[l++]=128|63&a):a<55296||a>=57344?(c[l++]=224|a>>>12,c[l++]=128|a>>>6&63,c[l++]=128|63&a):(a=65536+((1023&a)<<10|1023&t.charCodeAt(++o)),c[l++]=240|a>>>18,c[l++]=128|a>>>12&63,c[l++]=128|a>>>6&63,c[l++]=128|63&a);t=c}else{if("object"!==i)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e)}t.length>64&&(t=new v(r,!0).update(t).array());var f=[],d=[];for(o=0;o<64;++o){var h=t[o]||0;f[o]=92^h,d[o]=54^h}v.call(this,r,n),this.update(d),this.oKeyPad=f,this.inner=!0,this.sharedMemory=n}v.prototype.update=function(t){if(!this.finalized){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var o,i,a=0,c=t.length,u=this.blocks;a<c;){if(this.hashed&&(this.hashed=!1,u[0]=this.block,this.block=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0),r)for(i=this.start;a<c&&i<64;++a)u[i>>>2]|=t[a]<<l[3&i++];else for(i=this.start;a<c&&i<64;++a)(o=t.charCodeAt(a))<128?u[i>>>2]|=o<<l[3&i++]:o<2048?(u[i>>>2]|=(192|o>>>6)<<l[3&i++],u[i>>>2]|=(128|63&o)<<l[3&i++]):o<55296||o>=57344?(u[i>>>2]|=(224|o>>>12)<<l[3&i++],u[i>>>2]|=(128|o>>>6&63)<<l[3&i++],u[i>>>2]|=(128|63&o)<<l[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++a)),u[i>>>2]|=(240|o>>>18)<<l[3&i++],u[i>>>2]|=(128|o>>>12&63)<<l[3&i++],u[i>>>2]|=(128|o>>>6&63)<<l[3&i++],u[i>>>2]|=(128|63&o)<<l[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=u[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=u[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},v.prototype.hash=function(){var e,t,r,n,o,i,s,a,c,u=this.h0,l=this.h1,d=this.h2,h=this.h3,p=this.h4,y=this.h5,g=this.h6,m=this.h7,b=this.blocks;for(e=16;e<64;++e)t=((o=b[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=b[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,b[e]=b[e-16]+t+b[e-7]+r|0;for(c=l&d,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,m=(o=b[0]-1413257819)-150054599|0,h=o+24177077|0):(i=704751109,m=(o=b[0]-210244248)-1521486534|0,h=o+143694565|0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(i=u&l)^u&d^c,m=h+(o=m+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&y^~p&g)+f[e]+b[e])|0,h=o+(t+n)|0),t=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(s=h&u)^h&l^i,g=d+(o=g+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&p^~m&y)+f[e+1]+b[e+1])|0,t=((d=o+(t+n)|0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),n=(a=d&h)^d&u^s,y=l+(o=y+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&m^~g&p)+f[e+2]+b[e+2])|0,t=((l=o+(t+n)|0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(c=l&d)^l&h^a,p=u+(o=p+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&g^~y&m)+f[e+3]+b[e+3])|0,u=o+(t+n)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+u|0,this.h1=this.h1+l|0,this.h2=this.h2+d|0,this.h3=this.h3+h|0,this.h4=this.h4+p|0,this.h5=this.h5+y|0,this.h6=this.h6+g|0,this.h7=this.h7+m|0},v.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,u=c[e>>>28&15]+c[e>>>24&15]+c[e>>>20&15]+c[e>>>16&15]+c[e>>>12&15]+c[e>>>8&15]+c[e>>>4&15]+c[15&e]+c[t>>>28&15]+c[t>>>24&15]+c[t>>>20&15]+c[t>>>16&15]+c[t>>>12&15]+c[t>>>8&15]+c[t>>>4&15]+c[15&t]+c[r>>>28&15]+c[r>>>24&15]+c[r>>>20&15]+c[r>>>16&15]+c[r>>>12&15]+c[r>>>8&15]+c[r>>>4&15]+c[15&r]+c[n>>>28&15]+c[n>>>24&15]+c[n>>>20&15]+c[n>>>16&15]+c[n>>>12&15]+c[n>>>8&15]+c[n>>>4&15]+c[15&n]+c[o>>>28&15]+c[o>>>24&15]+c[o>>>20&15]+c[o>>>16&15]+c[o>>>12&15]+c[o>>>8&15]+c[o>>>4&15]+c[15&o]+c[i>>>28&15]+c[i>>>24&15]+c[i>>>20&15]+c[i>>>16&15]+c[i>>>12&15]+c[i>>>8&15]+c[i>>>4&15]+c[15&i]+c[s>>>28&15]+c[s>>>24&15]+c[s>>>20&15]+c[s>>>16&15]+c[s>>>12&15]+c[s>>>8&15]+c[s>>>4&15]+c[15&s];return this.is224||(u+=c[a>>>28&15]+c[a>>>24&15]+c[a>>>20&15]+c[a>>>16&15]+c[a>>>12&15]+c[a>>>8&15]+c[a>>>4&15]+c[15&a]),u},v.prototype.toString=v.prototype.hex,v.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o,i>>>24&255,i>>>16&255,i>>>8&255,255&i,s>>>24&255,s>>>16&255,s>>>8&255,255&s];return this.is224||c.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),c},v.prototype.array=v.prototype.digest,v.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},w.prototype=new v,w.prototype.finalize=function(){if(v.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();v.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),v.prototype.finalize.call(this)}};var x=y();x.sha256=x,x.sha224=y(!0),x.sha256.hmac=b(),x.sha224.hmac=b(!0),i?a.exports=x:(r.sha256=x.sha256,r.sha224=x.sha224)}()),Me.exports));var a;const c=Qo();class u{message;recipient;nonce;callbackUrl;tag;constructor({message:e,nonce:t,recipient:r}){this.tag=2147484061,this.message=e,this.nonce=t,this.recipient=r}}e.AuthPayload=u,e.authPayloadSchema={struct:{tag:"u32",message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}}}(we)),we}var Jo={};const $o=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function ei(e){return $o.test(e)}function ti(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.split(/[:\/]/g).pop().toLowerCase()}ti.valid=ei;var ri,ni,oi,ii,si,ai,ci,ui=V(Object.freeze({__proto__:null,default:ti,uuid4:ti,valid:ei})),li={},fi={exports:{}},di={exports:{}};function hi(){return ri||(ri=1,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&t.rotl(e,8)|4278255360&t.rotl(e,24);for(var r=0;r<e.length;r++)e[r]=t.endian(e[r]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?r.push(e.charAt(o>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(n))>>>6-2*o);return r}},di.exports=t),di.exports;var e,t}function pi(){if(oi)return ni;oi=1;var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};return ni=e}function yi(){return ii||(ii=1,function(){var e=hi(),t=pi().utf8,r=pi().bin,n=function(n,o){var i=e.wordsToBytes(function(r){r.constructor==String?r=t.stringToBytes(r):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(r)?r=Array.prototype.slice.call(r,0):Array.isArray(r)||(r=r.toString());var n=e.bytesToWords(r),o=8*r.length,i=[],s=1732584193,a=-271733879,c=-1732584194,u=271733878,l=-1009589776;n[o>>5]|=128<<24-o%32,n[15+(o+64>>>9<<4)]=o;for(var f=0;f<n.length;f+=16){for(var d=s,h=a,p=c,y=u,g=l,m=0;m<80;m++){if(m<16)i[m]=n[f+m];else{var b=i[m-3]^i[m-8]^i[m-14]^i[m-16];i[m]=b<<1|b>>>31}var v=(s<<5|s>>>27)+l+(i[m]>>>0)+(m<20?1518500249+(a&c|~a&u):m<40?1859775393+(a^c^u):m<60?(a&c|a&u|c&u)-1894007588:(a^c^u)-899497514);l=u,u=c,c=a<<30|a>>>2,a=s,s=v}s+=d,a+=h,c+=p,u+=y,l+=g}return[s,a,c,u,l]}(n));return o&&o.asBytes?i:o&&o.asString?r.bytesToString(i):e.bytesToHex(i)};n._blocksize=16,n._digestsize=20,fi.exports=n}()),fi.exports}function gi(){return ai||(ai=1,function(e){var t=Jo&&Jo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getExtension=e.RequestFailed=e.wait=void 0;const r=t(ui),n=$t(),o=(si||(si=1,function(e){var t=li&&li.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createRequest=e.computeRequestId=e.deleteRequest=e.getResponse=e.proxyApi=void 0;const r=t(yi()),n=t(ui),o=$t();e.proxyApi="https://h4n.app",e.getResponse=async t=>{const r=await fetch(`${e.proxyApi}/${t}/response`,{headers:{"content-type":"application/json"},method:"GET"});if(!1===r.ok)throw Error(await r.text());const{data:n}=await r.json();return JSON.parse(n)},e.deleteRequest=async t=>{const r=await fetch(`${e.proxyApi}/${t}`,{headers:{"content-type":"application/json"},method:"DELETE"});if(!1===r.ok)throw Error(await r.text())},e.computeRequestId=async e=>{const t=(0,o.baseEncode)(JSON.stringify({...e,_id:(0,n.default)()})),i=(0,r.default)(t);return{requestId:Buffer.from(i,"hex").toString("base64").replaceAll("/","_").replaceAll("-","+").slice(0,13),query:t}},e.createRequest=async(t,r)=>{const{query:n,requestId:o}=await(0,e.computeRequestId)(t),i=await fetch(`${e.proxyApi}/${o}/request`,{body:JSON.stringify({data:n}),headers:{"content-type":"application/json"},method:"POST",signal:r});if(!1===i.ok)throw Error(await i.text());return o}}(li)),li);e.wait=e=>new Promise(t=>setTimeout(t,e));class i extends Error{payload;name="RequestFailed";constructor(e){super(),this.payload=e}}e.RequestFailed=i;let s;e.getExtension=()=>"undefined"==typeof window?null:window.hotExtension,"undefined"!=typeof window&&window.addEventListener("message",e=>{"hot-close"===e.data&&(s?.remove(),s=void 0)});e.default=new class{walletId="https://t.me/herewalletbot/app";ancestorOrigins=["http://localhost:1234","https://my.herewallet.app","https://tgapp-dev.herewallet.app","https://tgapp.herewallet.app","https://beta.herewallet.app"];connection=new Promise(e=>"undefined"==typeof window||window?.self===window?.top?e(null):void this.injectedRequest("initialized",{}).then(e).catch(()=>e(null)));get isInjected(){return"undefined"!=typeof window&&(null!=window.hotExtension?window.hotExtension.autoRun:this.ancestorOrigins.includes(window.location.ancestorOrigins?.[0]))}openInHotBrowserUrl=null;toggleOpenInHotBrowser(e){this.openInHotBrowserUrl=e}customProvider;setupEthProvider(e){this.customProvider=e}async injectedRequest(e,t){const n=(0,r.default)();return new Promise((r,o)=>{const i=e=>{if(e.data.id===n)return window?.removeEventListener("message",i),e.data.success?r(e.data.payload):o(e.data.payload)};window?.parent.postMessage({$hot:!0,method:e,request:t,id:n},"*"),window?.addEventListener("message",i)})}subscribe(e,t){return window.hotExtension?window.hotExtension.subscribe(e,t):()=>{}}async request(t,a){if(null!=window.hotExtension)return window.hotExtension.request(t,a);if(this.isInjected)return this.injectedRequest(t,a);const c=(0,r.default)(),u=window?.Telegram?.WebApp,l=await(0,o.createRequest)({inside:!!this.openInHotBrowserUrl||"ethereum"===t&&null==this.customProvider,origin:"string"==typeof this.openInHotBrowserUrl?this.openInHotBrowserUrl:location.href,$hot:!0,method:t,request:a,id:c}),f=`${this.walletId}?startapp=hotconnect-${(0,n.baseEncode)(l)}`;if(u)u?.openTelegramLink(f);else{(e=>{s?.remove(),s=document.createElement("div");const t=document.createElement("iframe");s?.appendChild(t),t.src=e,t.allow="usb",t.style.border="none",t.style.borderRadius="16px",t.style.background="#fff",t.style.overflow="hidden",t.style.background="#1D1F20",t.style.border="1px solid #2C3034",t.style.width="375px",t.style.height="560px",t.onclick=e=>e.stopPropagation(),s.style.padding="16px",s.style.zIndex="100000000000000",s.style.position="fixed",s.style.display="flex",s.style.justifyContent="center",s.style.alignItems="center",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.background="rgba(0, 0, 0, 0.1)",s.style.backdropFilter="blur(24px)",s.onclick=()=>{s?.remove(),s=void 0},document.body.appendChild(s)})(`${"https://hot-labs.org/hot-widget/index.html"}?hotconnect-${(0,n.baseEncode)(l)}`)}const d=async()=>{await(0,e.wait)(3e3);const t=await(0,o.getResponse)(l).catch(()=>null);if(null==t)return await d();if(t.success)return t.payload;throw new i(t.payload)},h=await d();return s?.remove(),h}}}(Jo)),Jo}var mi=(ci||(ci=1,function(e){var t=ve&&ve.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.RequestFailed=e.HOT=e.authPayloadSchema=e.AuthPayload=e.verifySignature=void 0;var r=Yo();Object.defineProperty(e,"verifySignature",{enumerable:!0,get:function(){return r.verifySignature}}),Object.defineProperty(e,"AuthPayload",{enumerable:!0,get:function(){return r.AuthPayload}}),Object.defineProperty(e,"authPayloadSchema",{enumerable:!0,get:function(){return r.authPayloadSchema}});var n=gi();Object.defineProperty(e,"HOT",{enumerable:!0,get:function(){return t(n).default}}),Object.defineProperty(e,"RequestFailed",{enumerable:!0,get:function(){return n.RequestFailed}})}(ve)),ve),bi=mi.HOT,vi={name:oe.Hot,website:"https://hot-labs.org/",connect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,bi.request("stellar:getAddress",{})];case 1:return[2,e.sent().address];case 2:throw e.sent(),new Error("Failed to connect to Hana wallet.");case 3:return[2]}})})},disconnect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2]})})},getNetwork:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("HotWallet does not support the getNetwork function")})})},isAvailable:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2,"undefined"!=typeof window&&!!window.hotExtension]})})},signAuthEntry:function(e,t){return d(void 0,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,bi.request("stellar:signAuthEntry",{authEntry:e,accountToSign:t.address})];case 1:return[2,r.sent().signedAuthEntry];case 2:throw r.sent(),new Error("Failed to signAuthEntry using HotWallet");case 3:return[2]}})})},signMessage:function(e,t){return d(void 0,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,bi.request("stellar:signMessage",{message:e,accountToSign:t.address})];case 1:return[2,r.sent().signedMessage];case 2:throw r.sent(),new Error("Failed to signMessage using HotWallet");case 3:return[2]}})})},signTransaction:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return d(void 0,w([e],t,!0),void 0,function(e,t){return void 0===t&&(t={}),h(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,bi.request("stellar:signTransaction",{xdr:e,accountToSign:t.address})];case 1:return[2,r.sent().signedTxXdr];case 2:throw r.sent(),new Error("Failed to signTransaction using HotWallet");case 3:return[2]}})})}},wi={name:oe.Hana,website:"https://www.hanawallet.io/",connect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,window.hanaWallet.stellar.getPublicKey()];case 1:if(!e.sent())throw new Error("Hana Wallet is not installed or connected.");return[4,window.hanaWallet.stellar.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("Failed to connect to HanaWallet.");case 4:return[2]}})})},disconnect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2]})})},getNetwork:function(){return d(void 0,void 0,void 0,function(){var e,t;return h(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!(null===(t=window.hanaWallet)||void 0===t?void 0:t.stellar))throw new Error("Hana Wallet is not installed.");return[4,window.hanaWallet.stellar.getNetworkDetails()];case 1:return[2,{network:(e=r.sent()).network,passphrase:e.networkPassphrase}];case 2:throw r.sent(),new Error("Failed to getNetwork using HanaWallet");case 3:return[2]}})})},isAvailable:function(){return d(void 0,void 0,void 0,function(){var e;return h(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.hanaWallet)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return d(void 0,void 0,void 0,function(){var r;return h(this,function(n){switch(n.label){case 0:if(!("undefined"!=typeof window&&!!(null===(r=window.hanaWallet)||void 0===r?void 0:r.stellar)))throw new Error("Failed to signAuthEntry using HanaWallet");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,window.hanaWallet.stellar.signAuthEntry({xdr:e,accountToSign:t.address})];case 2:return[2,n.sent()];case 3:throw n.sent(),new Error("Failed to signAuthEntry using HanaWallet");case 4:return[2]}})})},signMessage:function(e,t){return d(void 0,void 0,void 0,function(){var r;return h(this,function(n){switch(n.label){case 0:if(!("undefined"!=typeof window&&!!(null===(r=window.hanaWallet)||void 0===r?void 0:r.stellar)))throw new Error("Failed to signMessage using HanaWallet");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,window.hanaWallet.stellar.signMessage({message:e,accountToSign:t.address})];case 2:return[2,n.sent()];case 3:throw n.sent(),new Error("Failed to signMessage using HanaWallet");case 4:return[2]}})})},signTransaction:function(e,t){return d(void 0,void 0,void 0,function(){var r,n,o,i;return h(this,function(s){switch(s.label){case 0:if(!("undefined"!=typeof window&&!!(null===(n=window.hanaWallet)||void 0===n?void 0:n.stellar)))throw new Error("Failed to signTransaction using HanaWallet");s.label=1;case 1:if(s.trys.push([1,3,,4]),"function"!=typeof(r=null===(i=null===(o=null===window||void 0===window?void 0:window.hanaWallet)||void 0===o?void 0:o.stellar)||void 0===i?void 0:i.signTransaction))throw new Error("Failed to signTransaction using HanaWallet");return[4,r({xdr:e,address:t.address,networkPassphrase:t.network})];case 2:return[2,s.sent()];case 3:throw s.sent(),new Error("Failed to signTransaction using HanaWallet");case 4:return[2]}})})}},xi={name:oe.Rabet,website:"https://rabet.io",connect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.connect()];case 1:return[2,e.sent().publicKey];case 2:throw e.sent(),new Error("Failed to connect to Rabet.");case 3:return[2]}})})},disconnect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");window.rabet.disconnect()}catch(e){}return[2]})})},getNetwork:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.getNetwork()];case 1:return[2,e.sent()];case 2:throw e.sent(),new Error("Failed to getNetwork from Rabet");case 3:return[2]}})})},isAvailable:function(){return new Promise(function(e){setTimeout(function(){return e("undefined"!=typeof window&&!!window.rabet)},150)})},signAuthEntry:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("Rabet does not support the signAuthEntry function")})})},signMessage:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("Rabet does not support the signMessage function")})})},signTransaction:function(e,t){return d(void 0,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.sign(e,t.network===ie.PUBLIC?"mainnet":"testnet")];case 1:return[2,r.sent().xdr];case 2:throw r.sent(),new Error("Failed to sign the transaction with Rabet.");case 3:return[2]}})})}},Si={name:oe.Xbull,website:"https://xbull.app",connect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:if(e.trys.push([0,3,,4]),!window.xBullSDK)throw new Error("xBull Wallet is not installed");return[4,window.xBullSDK.connect({canRequestPublicKey:!0,canRequestSign:!0})];case 1:return e.sent(),[4,window.xBullSDK.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("Failed to connect to xBull");case 4:return[2]}})})},disconnect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2]})})},getNetwork:function(){return d(void 0,void 0,void 0,function(){var e;return h(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("xBull Wallet is not installed");return[4,window.xBullSDK.getNetwork()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("Error getting network from Rabet");case 3:return[2]}})})},isAvailable:function(){return new Promise(function(e){setTimeout(function(){e("undefined"!=typeof window&&!!window.xBullSDK)},150)})},signAuthEntry:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("xBull does not support the signAuthEntry function")})})},signMessage:function(e,t){return d(void 0,void 0,void 0,function(){var r;return h(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("xBull Wallet is not installed");return[4,window.xBullSDK.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:if((r=n.sent()).error)throw new Error("Failed to signMessage using xBull");return[2,r.signedMessage];case 2:throw n.sent(),new Error("Failed to signMessage using xBull");case 3:return[2]}})})},signTransaction:function(e,t){return d(void 0,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("xBull Wallet is not installed.");return[4,window.xBullSDK.signXDR(e,{network:t.network,publicKey:t.address})];case 1:return[2,r.sent()];case 2:throw r.sent(),new Error("Failed to sign the transaction with xBull.");case 3:return[2]}})})}};function Ei(){const e=new Uint32Array(4);if("undefined"!=typeof crypto&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let t=0;t<e.length;t++)e[t]=Math.floor(4294967295*Math.random());return Array.from(e).map(e=>e.toString(36)).join("")}const Ai={public_key:{title:"View public key",description:"Requests account public key. It's a simple way of authentication for Stellar-based applications. The response ensures that a user owns the corresponding secret key.",implicitFlow:!1,params:{token:{description:"Verification token generated by the application (should be unique or random).",type:"string",required:!1},callback:{description:"Optional URL callback where Albedo will POST a signed token and public key.",type:"string",required:!1},require_existing:{description:"Allow existing Albedo accounts only.",type:"boolean",required:!1}},returns:{pubkey:{description:"User-selected public key.",type:"string"},signed_message:{description:"HEX-encoded authentication message derived from the public key and verification token.",type:"string"},signature:{description:"HEX-encoded ED25519 signature of the authentication message that can be further used to verify user's keypair ownership.",type:"string"}}},sign_message:{title:"Sign text message",description:"Requests arbitrary message signing. Can be used to implement identity/ownership verification.",implicitFlow:!0,params:{message:{description:"Text message to sign.",type:"string",required:!0},pubkey:{description:"Specific public key requested by the application.",type:"string",required:!1},callback:{description:"Optional URL callback where Albedo will POST a signed message.",type:"string",required:!1}},returns:{pubkey:{description:"User-selected public key.",type:"string"},original_message:{description:"Text message to sign from request.",type:"string"},signed_message:{description:"HEX-encoded message derived from the public key and original message.",type:"string"},message_signature:{description:"HEX-encoded ED25519 signature of the signed message.",type:"string"}}},tx:{title:"Sign transaction",description:"Requests a signature for the transaction. Returns the signed transaction envelope that can be submitted to the network or used for multi-sig coordination.",implicitFlow:!0,params:{xdr:{description:"XDR-encoded transaction envelope to sign.",type:"string",required:!0},pubkey:{description:"Specific public key requested by the application.",type:"string",required:!1},network:{description:"Stellar network identifier.",type:"string",required:!1},callback:{description:"Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon.",type:"string",required:!1},description:{description:"Optional human-friendly short transaction description provided by developers.",type:"string",required:!1},submit:{description:"If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.",type:"boolean",required:!1}},returns:{xdr:{description:"XDR-encoded transaction envelope from request.",type:"string"},tx_hash:{description:"HEX-encoded transaction hash.",type:"string"},signed_envelope_xdr:{description:"XDR-encoded transaction envelope with new signatures.",type:"string"},network:{description:"Stellar network identifier.",type:"string"},result:{description:"Optional response from Horizon if the transaction has been submitted automatically.",type:"object"}}},pay:{title:"Make payment",description:"Requests a payment from a user. Works with any Stellar asset, supports transaction memo.",implicitFlow:!0,params:{amount:{description:"Requested payment amount.",type:"string",required:!0},destination:{description:"Payment destination address.",type:"string",required:!0},asset_code:{description:"Asset code (skip for XLM).",type:"string",required:!1},asset_issuer:{description:"Asset issuer (skip for XLM).",type:"string",required:!1},memo:{description:"Transaction memo (required for exchanges and some anchors).",type:"string",required:!1},memo_type:{description:"Transaction memo type.",type:"string",required:!1},pubkey:{description:"Specific public key requested by the application.",type:"string",required:!1},network:{description:"Stellar network identifier or private network passphrase.",type:"string",required:!1},callback:{description:"Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon. ",type:"string",required:!1},submit:{description:"If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.",type:"boolean",required:!1}},returns:{amount:{description:"Payment amount from request.",type:"string"},destination:{description:"Payment destination address from request.",type:"string"},asset_code:{description:"Asset code from request.",type:"string"},asset_issuer:{description:"Asset issuer from request.",type:"string"},memo:{description:"Transaction memo from request.",type:"string"},memo_type:{description:"Transaction memo type from request.",type:"string"},tx_hash:{description:"HEX-encoded transaction hash.",type:"string"},signed_envelope_xdr:{description:"XDR-encoded transaction envelope with new signatures.",type:"string"},pubkey:{description:"User-selected public key.",type:"string"},network:{description:"Stellar network identifier.",type:"string"},result:{description:"Optional response from Horizon if the transaction has been submitted automatically.",type:"object"}}},trust:{title:"Establish trustline",description:"Requests permission to create a trustline to a given Stellar asset. Gradually simplifies the process of creating trustlines for anchors, ICOs, and airdrops.",implicitFlow:!0,params:{asset_code:{description:"Trustline asset code.",type:"string",required:!0},asset_issuer:{description:"Trustline asset issuer address.",type:"string",required:!0},limit:{description:"Trust limit.",type:"string",required:!1},memo:{description:"Transaction memo (required for exchanges and some anchors).",type:"string",required:!1},memo_type:{description:"Transaction memo type.",type:"string",required:!1},pubkey:{description:"Specific public key requested by the application.",type:"string",required:!1},network:{description:"Stellar network identifier or private network passphrase.",type:"string",required:!1},callback:{description:"Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon. ",type:"string",required:!1},submit:{description:"If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.",type:"boolean",required:!1}},returns:{asset_code:{description:"Trustline asset code from request.",type:"string"},asset_issuer:{description:"Trustline asset issuer address from request.",type:"string"},limit:{description:"Trust limit from request.",type:"string"},tx_hash:{description:"HEX-encoded transaction hash.",type:"string"},signed_envelope_xdr:{description:"XDR-encoded transaction envelope with new signatures.",type:"string"},pubkey:{description:"User-selected public key.",type:"string"},network:{description:"Stellar network identifier.",type:"string"},result:{description:"Optional response from Horizon if the transaction has been submitted automatically.",type:"object"}}},exchange:{title:"Swap tokens",description:"Requests permission to buy tokens on Stellar DEX at market price.",implicitFlow:!1,params:{amount:{description:"The amount of asset to buy.",type:"string",required:!0},max_price:{description:"Maximum price the user willing to pay.",type:"string",required:!0},sell_asset_code:{description:"Asset code of the asset to sell.",type:"string",required:!1},sell_asset_issuer:{description:"Issuer account of the asset to sell.",type:"string",required:!1},buy_asset_code:{description:"Asset code of the asset to buy.",type:"string",required:!1},buy_asset_issuer:{description:"Issuer account of the asset to buy.",type:"string",required:!1},memo:{description:"Transaction memo (required for exchanges and some anchors).",type:"string",required:!1},memo_type:{description:"Transaction memo type.",type:"string",required:!1},pubkey:{description:"Specific public key requested by the application.",type:"string",required:!1},network:{description:"Stellar network identifier or private network passphrase.",type:"string",required:!1},callback:{description:"Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon.",type:"string",required:!1},submit:{description:"If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.",type:"boolean",required:!1}},returns:{amount:{description:"The amount of asset to buy from request.",type:"string"},max_price:{description:"Maximum price the user willing to pay from request.",type:"string"},sell_asset_code:{description:"Asset code of the asset to sell from request.",type:"string"},sell_asset_issuer:{description:"Issuer account of the asset to sell from request.",type:"string"},buy_asset_code:{description:"Asset code of the asset to buy from request.",type:"string"},buy_asset_issuer:{description:"Issuer account of the asset to buy from request.",type:"string"},tx_hash:{description:"HEX-encoded transaction hash.",type:"string"},signed_envelope_xdr:{description:"XDR-encoded transaction envelope with new signatures.",type:"string"},pubkey:{description:"User-selected public key.",type:"string"},network:{description:"Stellar network identifier.",type:"string"},result:{description:"Optional response from Horizon if the transaction has been submitted automatically.",type:"object"}}},implicit_flow:{title:"Implicit permissions",description:'Requests temporary access token for one or more intents that can be used to execute actions without explicit confirmation from the user. In order to be executed implicitly, an implicit flow permissions for a given intent should be granted and "pubkey" parameter set.',implicitFlow:!1,params:{intents:{description:"Requested implicit flow intents.",type:"string|string[]",required:!0},network:{description:"Stellar network identifier or private network passphrase.",type:"string",required:!1}},returns:{granted:{description:"Whether a user granted permissions or not.",type:"boolean"},intents:{description:"Requested implicit flow intents.",type:"string[]"},grants:{description:"Implicit flow intents that have been granted.",type:"string[]"},session:{description:"Unique implicit session id.",type:"string"},valid_until:{description:"Session expiration timestamp.",type:"number"},pubkey:{description:"User-selected public key.",type:"string"},network:{description:"Stellar network identifier.",type:"string"}}},manage_account:{title:"Open account settings",description:"Opens account settings window for a given account.",implicitFlow:!1,params:{pubkey:{description:"Specific public key requested by the application.",type:"string",required:!0},network:{description:"Stellar network identifier or private network passphrase.",type:"string",required:!1}},returns:{pubkey:{description:"Public key from intent request.",type:"string"}}},batch:{title:"Intents batch",description:"Requests execution of several tx intents bundled together. This intent is atomic – a user confirms or rejects all bundled requests at once, with the same account and the same Stellar network.",implicitFlow:!0,params:{intents:{description:"Requested tx intents that should be executed together.",type:"object[]",required:!0},pubkey:{description:"Specific public key requested by the application.",type:"string",required:!1},network:{description:"Stellar network identifier or private network passphrase.",type:"string",required:!1}},returns:{intents:{description:"Requested tx intents.",type:"object[]"},results:{description:"Array of results for each requested intent.",type:"object[]"},pubkey:{description:"User-selected public key.",type:"string"},network:{description:"Stellar network identifier.",type:"string"}}}},ki={unhandledError:{message:"Unhandled error occurred. If this error persists, please contact Albedo support.",code:-1},externalError:{message:"External error occurred.",code:-2},invalidIntentRequest:{message:"Intent request is invalid.",code:-3},actionRejectedByUser:{message:"Action request was rejected by the user.",code:-4},horizonError:{message:"Transaction failed when submitted to Stellar network.",code:-5},callbackError:{message:"Callback redirect failed.",code:-6}};function Oi(e,t=!1){this.windowHandler=e,this.ephemeral=!!t,this.isLoaded=!1,this.pendingRequests={},this.preprocessRequestParams=null,this.onLoaded=new Promise((e,t)=>this.onLoadedCallback=e).then(()=>this),this.messageHandler=this.messageHandler.bind(this),window.addEventListener("message",this.messageHandler,!1)}function Ti(e,t,r){r.error?t(r):e(r)}Oi.prototype={isLoaded:!1,protocolVersion:3,markLoaded(){const{onLoadedCallback:e}=this;e&&(this.onLoadedCallback=null,this.isLoaded=!0,e())},messageHandler({data:e}){if(e.albedo)return this.matchProtocolVersion(e.albedo.protocol),this.markLoaded();if(e.albedoIntentResult){const{__reqid:t,...r}=e.albedoIntentResult,n=this.pendingRequests[t];n&&(delete this.pendingRequests[t],n(r),this.ephemeral&&(window.removeEventListener("message",this.messageHandler,!1),this.windowHandler.close()))}},transportCloseHandler(){for(let e in this.pendingRequests)if(this.pendingRequests.hasOwnProperty(e)){const t=this.pendingRequests[e];delete this.pendingRequests[e],t(ki.actionRejectedByUser)}},postMessage(e){const t=Ei();return new Promise((r,n)=>{this.onLoaded.then(()=>{this.pendingRequests[t]=Ti.bind(this,r,n),e=Object.assign({__reqid:t,__albedo_intent_version:this.protocolVersion},e),this.preprocessRequestParams&&(e=this.preprocessRequestParams(e)),this.windowHandler.postMessage(e,"*")})})},matchProtocolVersion(e){const t=e-this.protocolVersion;if(0===t)return;const r=`@albedo-link/intent module protocol version (${this.protocolVersion}) is incompatible with current Albedo protocol version ${e}.`;if(t>0)console.warn(r+" Please update @albedo-link/intent module to avoid possible connection problems.");else if(t<0)throw this.windowHandler.close(),new Error(r)}};let Ci=null;function Ii(e){if(!Ci){const t=document.createElement("iframe");t.style.border="none",Object.assign(t,{width:"0",height:"0",frameBorder:"0",referrerPolicy:"origin",src:`${e}`}),document.body.appendChild(t),Ci=new Oi(t.contentWindow)}return Ci.onLoaded}function _i({session:e,pubkey:t,grants:r,valid_until:n}){this.key=e,this.pubkey=t,this.grants=r.slice(),this.validUntil=n,Object.freeze(this),Object.freeze(this.grants)}_i.prototype={key:"",pubkey:"",grants:[],validUntil:0,get isExpired(){return this.validUntil-2e3<(new Date).getTime()},toJSON(){return{session:this.key,pubkey:this.pubkey,grants:this.grants.slice(),valid_until:this.validUntil}}};const Pi="albedo_session_";function Ri(){return window.sessionStorage}function Ni(e){let t;{const r=Ri().getItem(Pi+e);r&&(t=new _i(JSON.parse(r)))}return t?t.isExpired?(ji(e),null):t:null}function Bi(e,t){const r=Ni(t);return r&&r.grants.includes(e)?r:null}function ji(e){Ri().removeItem(Pi+e)}function Mi(e){return Object.assign(new Error,ki.invalidIntentRequest,{ext:e})}function Li(e,t){try{const{intent:r}=e;if(!r)throw Mi('Parameter "intent" is required.');const n=Ai[r];if(!n)throw Mi(`Unknown intent: "${r}".`);const o=function(e,t){if("object"!=typeof t)throw Mi("Intent parameters expected.");const{intent:r,pubkey:n}=t,o={intent:r};if(n&&!/^G[0-9A-Z]{55}$/.test(n))throw Mi('Invalid "pubkey" parameter. Stellar account public key expected.');for(const n in e.params){const i=e.params[n],s=t[n];if(s)o[n]=s;else if(i.required)throw Mi(`Parameter "${n}" is required for intent "${r}".`)}return o}(n,e);return function(e,t){if(e.pubkey){const r=Bi(e.intent,e.pubkey);if(r)return e.session=r.key,Ii(t)}return setTimeout(()=>{"implicit_flow"===e.intent&&Ii(t)},200),function(e){const t=`${e}/confirm`,r=void 0!==window.screenLeft?window.screenLeft:window.screenX,n=void 0!==window.screenTop?window.screenTop:window.screenY,o=(window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width)/2-240+r,i=(window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height)/2-300+n;return new Oi(window.open(t,"auth.albedo.link",`height=600,width=480,top=${i},left=${o},menubar=0,toolbar=0,location=0,status=0,personalbar=0,scrollbars=0,dependent=1`),!0).onLoaded}(t)}(o,t).then(e=>function(e,t){return t.postMessage(e).then(e=>("implicit_flow"===e.intent&&e.granted&&function(e){const t=new _i(e);Ri().setItem(Pi+t.pubkey,JSON.stringify(t))}(e),e))}(o,e))}catch(e){const{code:t=-1,message:r,ext:n}=e,o={message:r,code:t};return n&&(o.ext=n),Promise.reject(o)}}if("object"==typeof window&&"function"!=typeof window.fetch)throw new Error("Browser FetchAPI is not available. For legacy browsers support use polyfills such as whatwg-fetch.");function Ui(){}Ui.prototype={frontendUrl:"https://albedo.link",intentInterface:Ai,intentErrors:ki,request(e,t){return Li(Object.assign(t||{},{intent:e}),this.frontendUrl)},implicitFlow(e){return this.request("implicit_flow",e)},publicKey(e){return(e=Object.assign({},e)).token||(e.token=Ei()),this.request("public_key",e)},tx(e){return this.request("tx",e)},batch(e){return this.request("batch",e)},pay(e){return this.request("pay",e)},trust(e){return this.request("trust",e)},exchange(e){return this.request("exchange",e)},signMessage(e){return e=Object.assign({},e,function(e){e instanceof Uint8Array&&(e=e.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""));return{message:e,binary:!0}}(e.message)),this.request("sign_message",e)},manageAccount(e){return this.request("manage_account",e)},generateRandomToken:()=>Ei(),isImplicitSessionAllowed:(e,t)=>!!Bi(e,t),listImplicitSessions:()=>function(){const e=Ri();return Object.keys(e).filter(e=>0===e.indexOf(Pi)).map(e=>Ni(e.substr(15))).filter(e=>!!e)}(),forgetImplicitSession(e){ji(e)}};const Di=new Ui;var Fi;Di.default=Di,Fi=Di,"undefined"!=typeof document&&document.addEventListener&&document.addEventListener("click",function(e){if("A"!==e.target.tagName||0!==(e.target.href||"").indexOf("web+stellar:"))return;e.preventDefault(),e.stopImmediatePropagation();const{pathname:t,search:r}=new URL(e.target.href);if(!["tx","pay"].includes(t))return void alert(`Invalid operation requested: ${t}. It's likely an external application error. Please contact support team of ${window.location.origin}.`);const n=function(e=null){null===e&&(e=window.location.search),"?"===e[0]&&(e=e.substr(1));const t={};for(let r of e.split("&")){const[e,n]=r.split("=").map(e=>decodeURIComponent(e));t[e]=n}return t}(r);Fi.request(t,n)},!1);var zi,qi={name:oe.Albedo,website:"https://albedo.link",connect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,Di.publicKey({token:"Connect to Albedo"})];case 1:return[2,e.sent().pubkey];case 2:throw e.sent(),new Error("Failed to connect to Albedo.");case 3:return[2]}})})},disconnect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2]})})},getNetwork:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("Albedo does not support the getNetwork function")})})},isAvailable:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2,!0]})})},signAuthEntry:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("Albedo does not support the signAuthEntry function")})})},signMessage:function(e,t){return d(void 0,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return[4,Di.signMessage({message:e,pubkey:t.address})];case 1:return[2,r.sent().signed_message]}})})},signTransaction:function(e,t){return d(void 0,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Di.tx({xdr:e,pubkey:t.address,network:t.network})];case 1:return[2,r.sent().signed_envelope_xdr];case 2:throw r.sent(),new Error("Failed to sign the transaction with Albedo.");case 3:return[2]}})})}},Vi={name:oe.Klever,website:"https://klever.io",connect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.getAddress()];case 1:return[2,e.sent().address];case 2:throw e.sent(),new Error("Failed to connect to Klever");case 3:return[2]}})})},disconnect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2]})})},getNetwork:function(){return d(void 0,void 0,void 0,function(){var e;return h(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.getNetwork()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("Failed to getNetwork from Klever");case 3:return[2]}})})},isAvailable:function(){return d(void 0,void 0,void 0,function(){var e;return h(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.kleverWallet)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return d(void 0,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedAuthEntry];case 2:throw r.sent(),new Error("Failed to signAuthEntry using Klever");case 3:return[2]}})})},signMessage:function(e,t){return d(void 0,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedMessage];case 2:throw r.sent(),new Error("Failed to signMessage using Klever");case 3:return[2]}})})},signTransaction:function(e,t){return d(void 0,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signTransaction(e,t)];case 1:return[2,r.sent().signedTxXdr];case 2:throw r.sent(),new Error("Failed to signTransaction using Klever");case 3:return[2]}})})}},Hi={exports:{}};var Ki,Wi=(zi||(zi=1,Hi.exports=(()=>{var e,t,r,n={d:(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};n.r(o),n.d(o,{default:()=>f,getPublicKey:()=>a,isBrowser:()=>l,isConnected:()=>u,signTransaction:()=>c}),function(e){e.LOAD_STATE="LOAD_STATE",e.LOGIN="LOGIN",e.LOGOUT="LOGOUT",e.SIGN_TRANSACTION="SIGN_TRANSACTION",e.REJECT_TRANSACTION="REJECT_TRANSACTION",e.GRANT_ACCESS="GRANT_ACCESS",e.REJECT_ACCESS="REJECT_ACCESS"}(e||(e={})),function(e){e.REQUEST_ACCESS="REQUEST_ACCESS",e.SIGN_TRANSACTION="SUBMIT_TRANSACTION",e.REQUEST_CONNECTION_STATUS="REQUEST_CONNECTION_STATUS"}(t||(t={})),function(e){e.pending="pending",e.signed="signed",e.rejected="rejected"}(r||(r={}));const i="LOBSTR_CONNECTION_KEY",s=e=>{const r=Date.now()+Math.random();return window.postMessage({source:"LOBSTR_EXTERNAL_MSG_REQUEST",messageId:r,...e},window.location.origin),new Promise(n=>{let o=0;e.type===t.REQUEST_CONNECTION_STATUS&&(o=setTimeout(()=>{n({isConnected:!1}),window.removeEventListener("message",i)},2e3));const i=e=>{var t,s;e.source===window&&"LOBSTR_EXTERNAL_MSG_RESPONSE"===(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source)&&(null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.messagedId)===r&&(n(e.data),window.removeEventListener("message",i),clearTimeout(o))};window.addEventListener("message",i,!1)})},a=async()=>{if(!l)return"";const{publicKey:e,connectionKey:r}=await(async()=>{let e={publicKey:"",error:"",connectionKey:""};try{e=await s({type:t.REQUEST_ACCESS})}catch(e){console.error(e)}const{publicKey:r,connectionKey:n,error:o}=e;if(o)throw o;return{publicKey:r,connectionKey:n}})();return(e=>{var t;null===(t=null===window||void 0===window?void 0:window.sessionStorage)||void 0===t||t.setItem(i,e)})(r),e},c=async e=>{if(!l)return"";const r=(null===(n=null===window||void 0===window?void 0:window.sessionStorage)||void 0===n?void 0:n.getItem(i))||"";var n;return await(async(e,r)=>{let n={signedTransaction:"",error:""};try{n=await s({transactionXdr:e,connectionKey:r,type:t.SIGN_TRANSACTION})}catch(e){throw console.error(e),e}const{signedTransaction:o,error:i}=n;if(i)throw i;return o})(e,r)},u=async()=>!!l&&(window.lobstrSignerExtension?window.lobstrSignerExtension:await(async()=>{let e={isConnected:!1};try{e=await s({type:t.REQUEST_CONNECTION_STATUS})}catch(e){console.error(e)}return e.isConnected})()),l="undefined"!=typeof window,f={getPublicKey:a,signTransaction:c,isConnected:u};return o})()),Hi.exports),Gi=q(Wi),Xi={name:oe.Lobstr,website:"https://lobstr.co",connect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,Gi.isConnected()];case 1:if(!e.sent())throw new Error("LOBSTR Wallet is not installed or connected.");return[4,Gi.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("Failed to connect to LOBSTR.");case 4:return[2]}})})},disconnect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2]})})},getNetwork:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("Failed to get network from LOBSTR")})})},isAvailable:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:return[4,Gi.isConnected()];case 1:return[2,e.sent()]}})})},signAuthEntry:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("LOBSTR does not support the signAuthEntry function")})})},signMessage:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("LOBSTR does not support the signMessage function")})})},signTransaction:function(e){return d(void 0,void 0,void 0,function(){return h(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!Gi.signTransaction)throw new Error("LOBSTR Wallet does not support signing transactions.");return[4,Gi.signTransaction(e)];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("Failed to sign the transaction with LOBSTR.");case 3:return[2]}})})}},Zi={exports:{}};var Qi,Yi,Ji,$i=(Ki||(Ki=1,Qi=Zi,function(e,t){Qi.exports=t()}(0,()=>(()=>{var e,t,r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};r.r(n),r.d(n,{WatchWalletChanges:()=>S,addToken:()=>d,default:()=>A,getAddress:()=>f,getNetwork:()=>m,getNetworkDetails:()=>b,isAllowed:()=>v,isBrowser:()=>E,isConnected:()=>g,requestAccess:()=>x,setAllowed:()=>w,signAuthEntry:()=>y,signMessage:()=>p,signTransaction:()=>h}),function(e){e.CREATE_ACCOUNT="CREATE_ACCOUNT",e.FUND_ACCOUNT="FUND_ACCOUNT",e.ADD_ACCOUNT="ADD_ACCOUNT",e.IMPORT_ACCOUNT="IMPORT_ACCOUNT",e.IMPORT_HARDWARE_WALLET="IMPORT_HARDWARE_WALLET",e.LOAD_ACCOUNT="LOAD_ACCOUNT",e.MAKE_ACCOUNT_ACTIVE="MAKE_ACCOUNT_ACTIVE",e.UPDATE_ACCOUNT_NAME="UPDATE_ACCOUNT_NAME",e.GET_MNEMONIC_PHRASE="GET_MNEMONIC_PHRASE",e.CONFIRM_MNEMONIC_PHRASE="CONFIRM_MNEMONIC_PHRASE",e.CONFIRM_MIGRATED_MNEMONIC_PHRASE="CONFIRM_MIGRATED_MNEMONIC_PHRASE",e.RECOVER_ACCOUNT="RECOVER_ACCOUNT",e.CONFIRM_PASSWORD="CONFIRM_PASSWORD",e.REJECT_ACCESS="REJECT_ACCESS",e.GRANT_ACCESS="GRANT_ACCESS",e.ADD_TOKEN="ADD_TOKEN",e.SIGN_TRANSACTION="SIGN_TRANSACTION",e.SIGN_BLOB="SIGN_BLOB",e.SIGN_AUTH_ENTRY="SIGN_AUTH_ENTRY",e.HANDLE_SIGNED_HW_PAYLOAD="HANDLE_SIGNED_HW_PAYLOAD",e.REJECT_TRANSACTION="REJECT_TRANSACTION",e.SIGN_FREIGHTER_TRANSACTION="SIGN_FREIGHTER_TRANSACTION",e.SIGN_FREIGHTER_SOROBAN_TRANSACTION="SIGN_FREIGHTER_SOROBAN_TRANSACTION",e.ADD_RECENT_ADDRESS="ADD_RECENT_ADDRESS",e.LOAD_RECENT_ADDRESSES="LOAD_RECENT_ADDRESSES",e.LOAD_LAST_USED_ACCOUNT="LOAD_LAST_USED_ACCOUNT",e.SIGN_OUT="SIGN_OUT",e.SHOW_BACKUP_PHRASE="SHOW_BACKUP_PHRASE",e.SAVE_ALLOWLIST="SAVE_ALLOWLIST",e.SAVE_SETTINGS="SAVE_SETTINGS",e.SAVE_EXPERIMENTAL_FEATURES="SAVE_EXPERIMENTAL_FEATURES",e.LOAD_SETTINGS="LOAD_SETTINGS",e.GET_CACHED_ASSET_ICON="GET_CACHED_ASSET_ICON",e.CACHE_ASSET_ICON="CACHE_ASSET_ICON",e.GET_CACHED_ASSET_DOMAIN="GET_CACHED_ASSET_DOMAIN",e.CACHE_ASSET_DOMAIN="CACHE_ASSET_DOMAIN",e.GET_MEMO_REQUIRED_ACCOUNTS="GET_MEMO_REQUIRED_ACCOUNTS",e.ADD_CUSTOM_NETWORK="ADD_CUSTOM_NETWORK",e.CHANGE_NETWORK="CHANGE_NETWORK",e.REMOVE_CUSTOM_NETWORK="REMOVE_CUSTOM_NETWORK",e.EDIT_CUSTOM_NETWORK="EDIT_CUSTOM_NETWORK",e.RESET_EXP_DATA="RESET_EXP_DATA",e.ADD_TOKEN_ID="ADD_TOKEN_ID",e.GET_TOKEN_IDS="GET_TOKEN_IDS",e.REMOVE_TOKEN_ID="REMOVE_TOKEN_ID",e.GET_MIGRATABLE_ACCOUNTS="GET_MIGRATABLE_ACCOUNTS",e.GET_MIGRATED_MNEMONIC_PHRASE="GET_MIGRATED_MNEMONIC_PHRASE",e.MIGRATE_ACCOUNTS="MIGRATE_ACCOUNTS",e.ADD_ASSETS_LIST="ADD_ASSETS_LIST",e.MODIFY_ASSETS_LIST="MODIFY_ASSETS_LIST",e.CHANGE_ASSET_VISIBILITY="CHANGE_ASSET_VISIBILITY",e.GET_HIDDEN_ASSETS="GET_HIDDEN_ASSETS",e.GET_IS_ACCOUNT_MISMATCH="GET_IS_ACCOUNT_MISMATCH"}(e||(e={})),function(e){e.REQUEST_ACCESS="REQUEST_ACCESS",e.REQUEST_PUBLIC_KEY="REQUEST_PUBLIC_KEY",e.SUBMIT_TOKEN="SUBMIT_TOKEN",e.SUBMIT_TRANSACTION="SUBMIT_TRANSACTION",e.SUBMIT_BLOB="SUBMIT_BLOB",e.SUBMIT_AUTH_ENTRY="SUBMIT_AUTH_ENTRY",e.REQUEST_NETWORK="REQUEST_NETWORK",e.REQUEST_NETWORK_DETAILS="REQUEST_NETWORK_DETAILS",e.REQUEST_CONNECTION_STATUS="REQUEST_CONNECTION_STATUS",e.REQUEST_ALLOWED_STATUS="REQUEST_ALLOWED_STATUS",e.SET_ALLOWED_STATUS="SET_ALLOWED_STATUS",e.REQUEST_USER_INFO="REQUEST_USER_INFO"}(t||(t={}));const o=e=>{const r=Date.now()+Math.random();return window.postMessage({source:"FREIGHTER_EXTERNAL_MSG_REQUEST",messageId:r,...e},window.location.origin),new Promise(n=>{let o=0;e.type!==t.REQUEST_CONNECTION_STATUS&&e.type!==t.REQUEST_PUBLIC_KEY||(o=setTimeout(()=>{n({isConnected:!1,publicKey:""}),window.removeEventListener("message",i)},2e3));const i=e=>{var t,s;e.source===window&&"FREIGHTER_EXTERNAL_MSG_RESPONSE"===(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source)&&(null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.messagedId)===r&&(n(e.data),window.removeEventListener("message",i),clearTimeout(o))};window.addEventListener("message",i,!1)})},i={code:-1,message:"Node environment is not supported"},s={code:-1,message:"The wallet encountered an internal error. Please try again or contact the wallet if the problem persists."},a=async()=>{let e;try{e=await o({type:t.REQUEST_ACCESS})}catch(e){console.error(e)}const{publicKey:r}=e||{publicKey:""};return{publicKey:r,error:null==e?void 0:e.apiError}},c=async()=>{let e;try{e=await o({type:t.REQUEST_PUBLIC_KEY})}catch(e){console.error(e)}return{publicKey:(null==e?void 0:e.publicKey)||"",error:null==e?void 0:e.apiError}},u=async()=>{let e;try{e=await o({type:t.REQUEST_NETWORK_DETAILS})}catch(e){console.error(e)}const{networkDetails:r,apiError:n}=e||{networkDetails:{network:"",networkName:"",networkUrl:"",networkPassphrase:"",sorobanRpcUrl:void 0,apiError:""}},{network:i,networkUrl:s,networkPassphrase:a,sorobanRpcUrl:c}=r;return{network:i,networkUrl:s,networkPassphrase:a,sorobanRpcUrl:c,error:n}},l=async()=>{let e;try{e=await o({type:t.REQUEST_ALLOWED_STATUS})}catch(e){console.error(e)}const{isAllowed:r}=e||{isAllowed:!1};return{isAllowed:r,error:null==e?void 0:e.apiError}},f=async()=>{let e="";if(E){const t=await c();return e=t.publicKey,t.error?{address:e,error:t.error}:{address:e}}return{address:e,error:i}},d=async e=>{if(E){const r=await(async e=>{let r;try{r=await o({contractId:e.contractId,networkPassphrase:e.networkPassphrase,type:t.SUBMIT_TOKEN})}catch(e){return{error:s}}return{contractId:r.contractId,error:null==r?void 0:r.apiError}})(e);return r.error?{contractId:"",error:r.error}:{contractId:r.contractId||""}}return{contractId:"",error:i}},h=async(e,r)=>{if(E){const n=await(async(e,r)=>{let n,i,a,c;"object"==typeof r?(i=r.accountToSign,a=r.networkPassphrase):(n=r,i=void 0);try{c=await o({transactionXdr:e,network:n,networkPassphrase:a,accountToSign:i,type:t.SUBMIT_TRANSACTION})}catch(e){return{signedTransaction:"",signerAddress:"",error:s}}const{signedTransaction:u,signerAddress:l}=c;return{signedTransaction:u,signerAddress:l,error:null==c?void 0:c.apiError}})(e,r);return n.error?{signedTxXdr:"",signerAddress:"",error:n.error}:{signedTxXdr:n.signedTransaction,signerAddress:n.signerAddress}}return{signedTxXdr:"",signerAddress:"",error:i}},p=async(e,r)=>{if(E){const{isAllowed:n}=await l();if(!n){const e=await a();if(e.error)return{signedMessage:null,signerAddress:"",error:e.error}}const i=await(async(e,r,n)=>{let i;const a=(n||{}).address;try{i=await o({blob:e,accountToSign:a,apiVersion:"5.0.0",networkPassphrase:null==n?void 0:n.networkPassphrase,type:t.SUBMIT_BLOB})}catch(e){return{signedMessage:null,signerAddress:"",error:s}}const{signedBlob:c,signerAddress:u}=i;return{signedMessage:c||null,signerAddress:u,error:null==i?void 0:i.apiError}})(e,0,r);return i.error?{signedMessage:null,signerAddress:"",error:i.error}:{signedMessage:i.signedMessage,signerAddress:i.signerAddress}}return{signedMessage:null,signerAddress:"",error:i}},y=async(e,r)=>{if(E){const{isAllowed:n}=await l();if(!n){const e=await a();if(e.error)return{signedAuthEntry:null,signerAddress:"",error:e.error}}const i=await(async(e,r,n)=>{const i=(n||{}).address;let a;try{a=await o({entryXdr:e,accountToSign:i,apiVersion:"5.0.0",networkPassphrase:null==n?void 0:n.networkPassphrase,type:t.SUBMIT_AUTH_ENTRY})}catch(e){return console.error(e),{signedAuthEntry:null,signerAddress:"",error:s}}const{signedAuthEntry:c,signerAddress:u}=a;return{signedAuthEntry:c||null,signerAddress:u,error:null==a?void 0:a.apiError}})(e,0,r);return i.error?{signedAuthEntry:null,signerAddress:"",error:i.error}:{signedAuthEntry:i.signedAuthEntry,signerAddress:i.signerAddress}}return{signedAuthEntry:null,signerAddress:"",error:i}},g=async()=>E?window.freighter?Promise.resolve({isConnected:window.freighter}):(async()=>{let e={isConnected:!1};try{e=await o({type:t.REQUEST_CONNECTION_STATUS})}catch(e){console.error(e)}return{isConnected:e.isConnected}})():{isConnected:!1,error:i},m=async()=>{if(E){const e=await(async()=>{let e;try{e=await o({type:t.REQUEST_NETWORK_DETAILS})}catch(e){console.error(e)}const{networkDetails:r}=e||{networkDetails:{network:"",networkPassphrase:""}};return{network:null==r?void 0:r.network,networkPassphrase:null==r?void 0:r.networkPassphrase,error:null==e?void 0:e.apiError}})();return e.error?{network:"",networkPassphrase:"",error:e.error}:{network:e.network,networkPassphrase:e.networkPassphrase}}return{network:"",networkPassphrase:"",error:i}},b=async()=>{if(E){const e=await u();return e.error?{network:"",networkUrl:"",networkPassphrase:"",error:e.error}:{network:e.network,networkUrl:e.networkUrl,networkPassphrase:e.networkPassphrase,sorobanRpcUrl:e.sorobanRpcUrl}}return{network:"",networkUrl:"",networkPassphrase:"",error:i}},v=async()=>{let e=!1;if(E){const t=await l();return e=t.isAllowed,t.error?{isAllowed:e,error:t.error}:{isAllowed:e}}return{isAllowed:e,error:i}},w=async()=>{let e=!1;if(E){const r=await(async()=>{let e;try{e=await o({type:t.SET_ALLOWED_STATUS})}catch(e){console.error(e)}const{isAllowed:r}=e||{isAllowed:!1};return{isAllowed:r,error:null==e?void 0:e.apiError}})();return e=r.isAllowed,r.error?{isAllowed:e,error:r.error}:{isAllowed:e}}return{isAllowed:e,error:i}},x=async()=>{let e="";if(E){const t=await a();return e=t.publicKey,t.error?{address:e,error:t.error}:{address:e}}return{address:e,error:i}};class S{constructor(e=3e3){this.fetchInfo=async e=>{if(!this.isRunning)return;const t=await c(),r=await u();(t.error||r.error)&&e({address:"",network:"",networkPassphrase:"",error:t.error||r.error}),this.currentAddress===t.publicKey&&this.currentNetwork===r.network&&this.currentNetworkPassphrase===r.networkPassphrase||(this.currentAddress=t.publicKey,this.currentNetwork=r.network,this.currentNetworkPassphrase=r.networkPassphrase,e({address:t.publicKey,network:r.network,networkPassphrase:r.networkPassphrase})),setTimeout(()=>this.fetchInfo(e),this.timeout)},this.timeout=e,this.currentAddress="",this.currentNetwork="",this.currentNetworkPassphrase="",this.isRunning=!1}watch(e){return E?(this.isRunning=!0,this.fetchInfo(e),{}):{error:i}}stop(){this.isRunning=!1}}const E="undefined"!=typeof window,A={getAddress:f,addToken:d,signTransaction:h,signMessage:p,signAuthEntry:y,isConnected:g,getNetwork:m,getNetworkDetails:b,isAllowed:v,setAllowed:w,requestAccess:x,WatchWalletChanges:S};return n})())),Zi.exports),es=q($i),ts={name:oe.Freighter,website:"https://freighter.app",connect:function(){return d(void 0,void 0,void 0,function(){var e;return h(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,6]),[4,$i.isConnected()];case 1:if(!t.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,$i.requestAccess()];case 2:if((e=t.sent()).error&&"The user rejected this request."===e.error.message)throw new Error("Failed to connect to Freighter");if(""===e.address.trim())throw new Error("Failed to connect to Freighter.");return[2,e.address];case 3:return"Failed to connect to Freighter."!==t.sent().message?[3,5]:[4,ts.connect()];case 4:return[2,t.sent()];case 5:throw new Error("Failed to connect to Freighter.");case 6:return[2]}})})},disconnect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2]})})},getNetwork:function(){return d(void 0,void 0,void 0,function(){var e;return h(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,$i.isConnected()];case 1:if(!t.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,es.getNetwork()];case 2:if((e=t.sent()).error)throw new Error("Failed to get network from Freighter");return[2,{network:e.network,passphrase:e.networkPassphrase}];case 3:throw t.sent(),new Error("Failed to disconnect from Rabet.");case 4:return[2]}})})},isAvailable:function(){return new Promise(function(e){var t=setTimeout(function(){e(!1)},700);setTimeout(function(){return d(void 0,void 0,void 0,function(){return h(this,function(r){try{$i.isConnected().then(function(r){var n=r.isConnected,o=r.error;n?(clearTimeout(t),e(!o&&n)):setTimeout(function(){$i.isConnected().then(function(r){var n=r.isConnected,o=r.error;clearTimeout(t),e(!o&&n)})},350)}).catch(function(){clearTimeout(t),e(!1)})}catch(t){e(!1)}return[2]})})},450)})},signAuthEntry:function(e,t){return d(void 0,void 0,void 0,function(){var r,n,o;return h(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,$i.isConnected()];case 1:if(!i.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,$i.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 2:if(r=i.sent(),n=r.error,o=r.signedAuthEntry,n||!o)throw new Error("Could not signedAuthEntry using Freighter");return[2,Buffer.from(o).toString("base64")];case 3:throw i.sent(),new Error("Failed to sign the transaction with Freighter.");case 4:return[2]}})})},signMessage:function(e,t){return d(void 0,void 0,void 0,function(){var r,n;return h(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,$i.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:if(r=o.sent(),n=r.signedMessage,r.error||!n)throw new Error("Failed to sign message using Freighter");return[2,"string"==typeof n?n:Buffer.from(n).toString("base64")];case 2:throw o.sent(),new Error("Failed to sign message using Freighter");case 3:return[2]}})})},signTransaction:function(e,t){return d(void 0,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,$i.isConnected()];case 1:if(!r.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,$i.signTransaction(e,{address:t.address,networkPassphrase:t.network})];case 2:return[2,r.sent().signedTxXdr];case 3:throw r.sent(),new Error("Failed to sign the transaction with Freighter.");case 4:return[2]}})})}},rs="__BLUX__RECENT_CONNECTION_METHODS",ns="stellar:pubnet",os="stellar:testnet",is={name:oe.WalletConnect,website:"https://walletconnect.com",isAvailable:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2,!!pe().config.walletConnect]})})},connect:function(){return d(void 0,void 0,void 0,function(){var e,t,r;return h(this,function(n){switch(n.label){case 0:if(!(e=pe().walletConnect)||!e.client)throw new Error("WalletConnect client is not set up. Please check your store configuration.");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.connection.approval()];case 2:if(t=n.sent(),!(r=t.namespaces.stellar)||!r.accounts[0])throw new Error("Wallet did not approve the required Stellar namespace/account.");return[2,r.accounts[0].split(":").pop()];case 3:throw n.sent(),new Error("Failed to connect to Wallet. Ensure your wallet supports Stellar WalletConnect.");case 4:return[2]}})})},disconnect:function(){return d(void 0,void 0,void 0,function(){var e,t;return h(this,function(r){switch(r.label){case 0:if(!(e=pe().walletConnect)||!e.client)throw new Error("WalletConnect client is not set up.");r.label=1;case 1:return r.trys.push([1,3,,4]),0===(t=e.client.session.getAll()).length?[2]:[4,e.client.disconnect({topic:t[0].topic,reason:{code:6e3,message:"User explicitly disconnected."}})];case 2:return r.sent(),[3,4];case 3:throw r.sent(),new Error("Failed to disconnect from Wallet Connect. Try closing the session in your mobile wallet.");case 4:return[2]}})})},getNetwork:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("Cannot reliably get the active network from WalletConnect without a specific session request.")})})},signTransaction:function(e,t){return d(void 0,void 0,void 0,function(){var r,n,o,i;return h(this,function(s){switch(s.label){case 0:if(!(r=pe().walletConnect)||!r.client)throw new Error("WalletConnect client is not set up.");s.label=1;case 1:if(s.trys.push([1,3,,4]),0===(n=r.client.session.getAll()).length)throw new Error("WalletConnect not connected. Please connect first.");return o=n[0],i=t.network===ie.PUBLIC?ns:os,[4,r.client.request({topic:o.topic,chainId:i,request:{method:"stellar_signXDR",params:{xdr:e}}})];case 2:return[2,s.sent()];case 3:throw s.sent(),new Error("Failed to sign and submit the transaction with Wallet Connect.");case 4:return[2]}})})},signMessage:function(e,t){return d(void 0,void 0,void 0,function(){var r,n,o,i,s,a;return h(this,function(c){switch(c.label){case 0:if(!(r=pe().walletConnect)||!r.client)throw new Error("WalletConnect client is not set up.");c.label=1;case 1:if(c.trys.push([1,3,,4]),0===(n=r.client.session.getAll()).length)throw new Error("WalletConnect not connected. Please connect first.");return o=n[0],i=t.network===ie.PUBLIC?ns:os,s=(null===(a=o.namespaces.stellar.chains)||void 0===a?void 0:a[0])||i,[4,r.client.request({topic:o.topic,chainId:s,request:{method:"stellar_signMessage",params:{message:e}}})];case 2:return[2,c.sent()];case 3:throw c.sent(),new Error("Failed to sign message with Wallet Connect.");case 4:return[2]}})})},signAuthEntry:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("Stellar Auth Entry signing is not supported via standard WalletConnect methods.")})})}};var ss=function(){if(Ji)return Yi;Ji=1;const e=2147483648;var t=function(e){if(!Array.isArray(e))throw new Error("Input must be an Array");if(0===e.length)throw new Error("Path must contain at least one level");for(var t=0;t<e.length;t++)if("number"!=typeof e[t])throw new Error("Path element is not a number");this.path=e};return t.validatePathArray=function(e){try{return t.fromPathArray(e),!0}catch(e){return!1}},t.validateString=function(e,r){try{return t.fromString(e,r),!0}catch(e){return!1}},t.fromPathArray=function(e){return new t(e)},t.fromString=function(r,n){if(/^m\//i.test(r))r=r.slice(2);else if(n)throw new Error("Root element is required");for(var o=r.split("/"),i=new Array(o.length),s=0;s<o.length;s++){var a=/(\d+)([hH\']?)/.exec(o[s]);if(null===a)throw new Error("Invalid input");if(i[s]=parseInt(a[1],10),i[s]>=e)throw new Error("Invalid child index");if("h"===a[2]||"H"===a[2]||"'"===a[2])i[s]+=e;else if(0!=a[2].length)throw new Error("Invalid modifier")}return new t(i)},t.prototype.toPathArray=function(){return this.path},t.prototype.toString=function(t,r){for(var n=new Array(this.path.length),o=0;o<this.path.length;o++){var i=this.path[o];n[o]=i&e?(i&~e)+(r?"h":"'"):i}return(t?"":"m/")+n.join("/")},t.prototype.inspect=function(){return"BIPPath <"+this.toString()+">"},Yi=t}(),as=q(ss);const cs=e=>{class t extends Error{cause;constructor(r,n,o){if(super(r||e,o),Object.setPrototypeOf(this,t.prototype),this.name=e,n)for(const e in n)this[e]=n[e];if(o&&"object"==typeof o&&"cause"in o&&!this.cause){const e=o.cause;this.cause=e,"stack"in e&&(this.stack=this.stack+"\nCAUSE: "+e.stack)}}}return t};const us=cs("DisconnectedDevice"),ls=cs("DisconnectedDeviceDuringOperation"),fs=cs("TransportOpenUserCancelled"),ds=cs("TransportInterfaceNotAvailable"),hs=cs("TransportRaceCondition"),ps=cs("TransportWebUSBGestureRequired");var ys;!function(e){e.Unknown="Unknown",e.LocationServicesDisabled="LocationServicesDisabled",e.LocationServicesUnauthorized="LocationServicesUnauthorized",e.BluetoothScanStartFailed="BluetoothScanStartFailed"}(ys||(ys={}));class gs extends Error{id;constructor(e,t){const r="TransportError";super(e||r),this.name=r,this.message=e,this.stack=new Error(e).stack,this.id=t}}const ms={ACCESS_CONDITION_NOT_FULFILLED:38916,ALGORITHM_NOT_SUPPORTED:38020,CLA_NOT_SUPPORTED:28160,CODE_BLOCKED:38976,CODE_NOT_INITIALIZED:38914,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,CONDITIONS_OF_USE_NOT_SATISFIED:27013,CONTRADICTION_INVALIDATION:38928,CONTRADICTION_SECRET_CODE_STATUS:38920,DEVICE_IN_RECOVERY_MODE:26159,CUSTOM_IMAGE_EMPTY:26158,FILE_ALREADY_EXISTS:27273,FILE_NOT_FOUND:37892,GP_AUTH_FAILED:25344,HALTED:28586,INCONSISTENT_FILE:37896,INCORRECT_DATA:27264,INCORRECT_LENGTH:26368,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,DEVICE_NOT_ONBOARDED:27911,DEVICE_NOT_ONBOARDED_2:26129,INVALID_KCV:38021,INVALID_OFFSET:37890,LICENSING:28482,LOCKED_DEVICE:21781,MAX_VALUE_REACHED:38992,MEMORY_PROBLEM:37440,MISSING_CRITICAL_PARAMETER:26624,NO_EF_SELECTED:37888,NOT_ENOUGH_MEMORY_SPACE:27268,OK:36864,PIN_REMAINING_ATTEMPTS:25536,REFERENCED_DATA_NOT_FOUND:27272,SECURITY_STATUS_NOT_SATISFIED:27010,TECHNICAL_PROBLEM:28416,UNKNOWN_APDU:27906,USER_REFUSED_ON_DEVICE:21761,NOT_ENOUGH_SPACE:20738,APP_NOT_FOUND_OR_INVALID_CONTEXT:20771,INVALID_APP_NAME_LENGTH:26378,GEN_AES_KEY_FAILED:21529,INTERNAL_CRYPTO_OPERATION_FAILED:21530,INTERNAL_COMPUTE_AES_CMAC_FAILED:21531,ENCRYPT_APP_STORAGE_FAILED:21532,INVALID_BACKUP_STATE:26178,PIN_NOT_SET:21762,INVALID_BACKUP_LENGTH:26419,INVALID_RESTORE_STATE:26179,INVALID_CHUNK_LENGTH:26420,INVALID_BACKUP_HEADER:26698,TRUSTCHAIN_WRONG_SEED:45063};class bs extends Error{statusCode;statusText;constructor(e,{canBeMappedToChildError:t=!0}={}){const r=Object.keys(ms).find(t=>ms[t]===e)||"UNKNOWN_ERROR",n=function(e){switch(e){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received";case 21781:return"Locked device"}if(28416<=e&&e<=28671)return"Internal error, please report"}(e)||r,o=`Ledger device: ${n} (0x${e.toString(16)})`;if(super(o),this.name="TransportStatusError",this.statusCode=e,this.statusText=r,Object.setPrototypeOf(this,bs.prototype),t&&e===ms.LOCKED_DEVICE)return new vs(o)}}class vs extends bs{constructor(e){super(ms.LOCKED_DEVICE,{canBeMappedToChildError:!1}),e&&(this.message=e),this.name="LockedDeviceError",Object.setPrototypeOf(this,vs.prototype)}}const ws=cs("StellarHashSigningNotEnabledError"),xs=cs("StellarDataParsingFailedError"),Ss=cs("StellarUserRefusedError"),Es=cs("StellarDataTooLargeError");class As{transport;constructor(e,t="l0v"){this.transport=e,e.decorateAppAPIMethods(this,["getAppConfiguration","getPublicKey","signTransaction","signSorobanAuthorization","signHash"],t)}async getAppConfiguration(){const e=await this.sendToDevice(6,Zr().Buffer.alloc(0)),[t,r,n,o,i,s]=e;return{hashSigningEnabled:1===t,version:`${r}.${n}.${o}`,maxDataSize:e.length>4?i<<8|s:void 0}}async getPublicKey(e,t=!1){const r=Os(e),n=t?1:0;try{return{rawPublicKey:(await this.transport.send(224,2,0,n,r)).slice(0,-2)}}catch(e){throw ks(e)}}async signTransaction(e,t){const r=Os(e),n=Zr().Buffer.concat([r,t]);return{signature:await this.sendToDevice(4,n)}}async signSorobanAuthorization(e,t){const r=Os(e),n=Zr().Buffer.concat([r,t]);return{signature:await this.sendToDevice(10,n)}}async signHash(e,t){const r=Os(e),n=Zr().Buffer.concat([r,t]);return{signature:await this.sendToDevice(8,n)}}async sendToDevice(e,t){let r=Zr().Buffer.alloc(0),n=t.length;for(;;){const o=n>255?255:n,i=n===t.length?0:128,s=n-o===0?0:128,a=t.slice(t.length-n,t.length-n+o);if(r=await this.transport.send(224,e,i,s,a).catch(e=>{throw ks(e)}),n-=o,0===n)break}return r.slice(0,-2)}}const ks=e=>{if(e)switch(e.statusCode){case 27013:return new Ss("User refused the request",void 0,{cause:e});case 45061:return new xs("Unable to parse the provided data",void 0,{cause:e});case 27750:return new ws("Hash signing not allowed. Have you enabled it in the app settings?",void 0,{cause:e});case 45060:return new Es("The provided data is too large for the device to process",void 0,{cause:e})}return e},Os=e=>{const t=e.split("/").map(e=>e.endsWith("'")||e.endsWith("h")?e:`${e}'`).join("/"),r=as.fromString(t).toPathArray();return Ts(r)},Ts=e=>{const t=Zr().Buffer.alloc(1+4*e.length);t.writeUInt8(e.length,0);for(const[r,n]of e.entries())t.writeUInt32BE(n,1+4*r);return t};var Cs,Is={exports:{}};var _s=function(){if(Cs)return Is.exports;Cs=1;var e,t="object"==typeof Reflect?Reflect:null,r=t&&"function"==typeof t.apply?t.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}Is.exports=o,Is.exports.once=function(e,t){return new Promise(function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}p(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&p(e,"error",t,r)}(e,o,{once:!0})})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var i=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,c,u;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),c=i[t]),void 0===c)c=i[t]=r,++e._eventsCount;else if("function"==typeof c?c=i[t]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),(o=a(e))>0&&c.length>o&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=c.length,u=l,console&&console.warn&&console.warn(u)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=u.bind(n);return o.listener=r,n.wrapFn=o,o}function f(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):h(o,o.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function p(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function o(i){n.once&&e.removeEventListener(t,o),r(i)})}}return Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(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},o.prototype.getMaxListeners=function(){return a(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var u=c.length,l=h(c,u);for(n=0;n<u;++n)r(l[n],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,o,i,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},Is.exports}(),Ps=q(_s);let Rs=0;const Ns=[],Bs=(e,t,r)=>{const n={type:e,id:String(++Rs),date:new Date};t&&(n.message=t),r&&(n.data=r),Ls(n)};class js{type;context;constructor(e,t){this.type=e,this.context=t}trace(e,t){(({type:e,message:t,data:r,context:n})=>{const o={type:e,id:String(++Rs),date:new Date};t&&(o.message=t),r&&(o.data=r),n&&(o.context=n),Ls(o)})({type:this.type,message:e,data:t,context:this.context})}getContext(){return this.context}setContext(e){this.context=e}updateContext(e){this.context={...this.context,...e}}getType(){return this.type}setType(e){this.type=e}withType(e){return new js(e,this.context)}withContext(e){return new js(this.type,e)}withUpdatedContext(e){return new js(this.type,{...this.context,...e})}}const Ms=e=>(Ns.push(e),()=>{const t=Ns.indexOf(e);-1!==t&&(Ns[t]=Ns[Ns.length-1],Ns.pop())});function Ls(e){for(let t=0;t<Ns.length;t++)try{Ns[t](e)}catch(e){console.error(e)}}"undefined"!=typeof window&&(window.__ledgerLogsListen=Ms);class Us{exchangeTimeout=3e4;unresponsiveTimeout=15e3;deviceModel=null;tracer;constructor({context:e,logType:t}={}){this.tracer=new js(t??"transport",e)}static isSupported;static list;static listen;static open;exchange(e,{abortTimeoutMs:t}={}){throw new Error("exchange not implemented")}exchangeBulk(e,t){let r=!1;return(async()=>{if(!r)for(const n of e){const e=await this.exchange(n);if(r)return;const o=e.readUInt16BE(e.length-2);if(o!==ms.OK)throw new bs(o);t.next(e)}})().then(()=>!r&&t.complete(),e=>!r&&t.error(e)),{unsubscribe:()=>{r=!0}}}setScrambleKey(e){}close(){return Promise.resolve()}_events=new Ps;on(e,t){this._events.on(e,t)}off(e,t){this._events.removeListener(e,t)}emit(e,...t){this._events.emit(e,...t)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}send=async(e,t,r,n,o=Zr().Buffer.alloc(0),i=[ms.OK],{abortTimeoutMs:s}={})=>{const a=this.tracer.withUpdatedContext({function:"send"});if(o.length>=256)throw a.trace("data.length exceeded 256 bytes limit",{dataLength:o.length}),new gs("data.length exceed 256 bytes limit. Got: "+o.length,"DataLengthTooBig");a.trace("Starting an exchange",{abortTimeoutMs:s});const c=await this.exchange(Zr().Buffer.concat([Buffer.from([e,t,r,n]),Buffer.from([o.length]),o]),{abortTimeoutMs:s});a.trace("Received response from exchange");const u=c.readUInt16BE(c.length-2);if(!i.some(e=>e===u))throw new bs(u);return c};static create(e=3e3,t){return new Promise((r,n)=>{let o=!1;const i=this.listen({next:t=>{o=!0,i&&i.unsubscribe(),s&&clearTimeout(s),this.open(t.descriptor,e).then(r,n)},error:e=>{s&&clearTimeout(s),n(e)},complete:()=>{s&&clearTimeout(s),o||n(new gs(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),s=t?setTimeout(()=>{i.unsubscribe(),n(new gs(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},t):null})}exchangeBusyPromise;async exchangeAtomicImpl(e){const t=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw t.trace("Atomic exchange is already busy"),new hs("An action was already pending on the Ledger device. Please deny or reconnect.");let r;const n=new Promise(e=>{r=e});this.exchangeBusyPromise=n;let o=!1;const i=setTimeout(()=>{t.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),o=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{const r=await e();return o&&(t.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),r}finally{t.trace("Finalize, clearing busy guard"),clearTimeout(i),r&&r(),this.exchangeBusyPromise=null}}decorateAppAPIMethods(e,t,r){for(const n of t)e[n]=this.decorateAppAPIMethod(n,e[n],e,r)}_appAPIlock=null;decorateAppAPIMethod(e,t,r,n){return async(...o)=>{const{_appAPIlock:i}=this;if(i)return Promise.reject(new gs("Ledger Device is busy (lock "+i+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(n),await t.apply(r,o)}finally{this._appAPIlock=null}}}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}static ErrorMessage_ListenTimeout="No Ledger device found (timeout)";static ErrorMessage_NoDeviceFound="No Ledger device found"}function Ds(e){const t=Zr().Buffer.alloc(2);return t.writeUInt16BE(e,0),t}const Fs={data:Zr().Buffer.alloc(0),dataLength:0,sequence:0};var zs,qs,Vs,Hs,Ks,Ws,Gs,Xs,Zs,Qs,Ys,Js,$s,ea,ta,ra,na,oa,ia,sa,aa,ca,ua,la,fa,da,ha,pa,ya,ga,ma,ba,va,wa,xa,Sa,Ea,Aa,ka,Oa,Ta,Ca,Ia,_a,Pa,Ra,Na,Ba,ja,Ma,La,Ua,Da,Fa,za,qa,Va,Ha,Ka,Wa,Ga,Xa,Za,Qa,Ya,Ja,$a,ec,tc,rc,nc,oc,ic,sc,ac,cc,uc,lc,fc,dc,hc,pc,yc,gc,mc,bc,vc,wc,xc,Sc={exports:{}};function Ec(){if(qs)return zs;qs=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return zs={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function Ac(){if(Hs)return Vs;Hs=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return Vs=e}function kc(){return Ks||(Ks=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=Ec(),i=Ac(),s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let f=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",o],[d,n]],p=(e,t,r)=>{const n=(e=>{for(const[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),o=f++;i(e,o,t),l[e]=o,c[o]=t,u[o]=n,s[o]=new RegExp(t,r?"g":void 0),a[o]=new RegExp(n,r?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),p("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${d}+`),p("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),p("FULL",`^${c[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),p("LOOSE",`^${c[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),p("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?`+`(?:${c[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[l.COERCE],!0),p("COERCERTLFULL",c[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Sc,Sc.exports)),Sc.exports}function Oc(){if(Gs)return Ws;Gs=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Ws=r=>r?"object"!=typeof r?e:r:t}function Tc(){if(Zs)return Xs;Zs=1;const e=/^[0-9]+$/,t=(t,r)=>{const n=e.test(t),o=e.test(r);return n&&o&&(t=+t,r=+r),t===r?0:n&&!o?-1:o&&!n?1:t<r?-1:1};return Xs={compareIdentifiers:t,rcompareIdentifiers:(e,r)=>t(r,e)},Xs}function Cc(){if(Ys)return Qs;Ys=1;const e=Ac(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Ec(),{safeRe:n,safeSrc:o,t:i}=kc(),s=Oc(),{compareIdentifiers:a}=Tc();class c{constructor(o,a){if(a=s(a),o instanceof c){if(o.loose===!!a.loose&&o.includePrerelease===!!a.includePrerelease)return o;o=o.version}else if("string"!=typeof o)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof o}".`);if(o.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",o,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const u=o.trim().match(a.loose?n[i.LOOSE]:n[i.FULL]);if(!u)throw new TypeError(`Invalid Version: ${o}`);if(this.raw=o,this.major=+u[1],this.minor=+u[2],this.patch=+u[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");u[4]?this.prerelease=u[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<r)return t}return e}):this.prerelease=[],this.build=u[5]?u[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof c)){if("string"==typeof t&&t===this.version)return 0;t=new c(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),a(this.major,e.major)||a(this.minor,e.minor)||a(this.patch,e.patch)}comparePre(t){if(t instanceof c||(t=new c(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],o=t.prerelease[r];if(e("prerelease compare",r,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return a(n,o)}while(++r)}compareBuild(t){t instanceof c||(t=new c(t,this.options));let r=0;do{const n=this.build[r],o=t.build[r];if(e("build compare",r,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return a(n,o)}while(++r)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=new RegExp(`^${this.options.loose?o[i.PRERELEASELOOSE]:o[i.PRERELEASE]}$`),r=`-${t}`.match(e);if(!r||r[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===a(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Qs=c}function Ic(){if($s)return Js;$s=1;const e=Cc();return Js=(t,r,n=!1)=>{if(t instanceof e)return t;try{return new e(t,r)}catch(e){if(!n)return null;throw e}},Js}function _c(){if(ma)return ga;ma=1;const e=Cc();return ga=(t,r,n)=>new e(t,n).compare(new e(r,n)),ga}function Pc(){if(Ea)return Sa;Ea=1;const e=Cc();return Sa=(t,r,n)=>{const o=new e(t,n),i=new e(r,n);return o.compare(i)||o.compareBuild(i)},Sa}function Rc(){if(Ia)return Ca;Ia=1;const e=_c();return Ca=(t,r,n)=>e(t,r,n)>0,Ca}function Nc(){if(Pa)return _a;Pa=1;const e=_c();return _a=(t,r,n)=>e(t,r,n)<0,_a}function Bc(){if(Na)return Ra;Na=1;const e=_c();return Ra=(t,r,n)=>0===e(t,r,n),Ra}function jc(){if(ja)return Ba;ja=1;const e=_c();return Ba=(t,r,n)=>0!==e(t,r,n),Ba}function Mc(){if(La)return Ma;La=1;const e=_c();return Ma=(t,r,n)=>e(t,r,n)>=0,Ma}function Lc(){if(Da)return Ua;Da=1;const e=_c();return Ua=(t,r,n)=>e(t,r,n)<=0,Ua}function Uc(){if(za)return Fa;za=1;const e=Bc(),t=jc(),r=Rc(),n=Mc(),o=Nc(),i=Lc();return Fa=(s,a,c,u)=>{switch(a){case"===":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s===c;case"!==":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s!==c;case"":case"=":case"==":return e(s,c,u);case"!=":return t(s,c,u);case">":return r(s,c,u);case">=":return n(s,c,u);case"<":return o(s,c,u);case"<=":return i(s,c,u);default:throw new TypeError(`Invalid operator: ${a}`)}},Fa}function Dc(){if(Ga)return Wa;Ga=1;const e=/\s+/g;class t{constructor(r,n){if(n=o(n),r instanceof t)return r.loose===!!n.loose&&r.includePrerelease===!!n.includePrerelease?r:new t(r.raw,n);if(r instanceof i)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=r.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!y(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+e,r=n.get(t);if(r)return r;const o=this.options.loose,a=o?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(a,C(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],l),s("comparator trim",e),e=e.replace(c[u.TILDETRIM],f),s("tilde trim",e),e=e.replace(c[u.CARETTRIM],d),s("caret trim",e);let g=e.split(" ").map(e=>b(e,this.options)).join(" ").split(/\s+/).map(e=>T(e,this.options));o&&(g=g.filter(e=>(s("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),s("range list",g);const m=new Map,v=g.map(e=>new i(e,this.options));for(const e of v){if(y(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const w=[...m.values()];return n.set(t,w),w}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>m(t,r)&&e.set.some(e=>m(e,r)&&t.every(t=>e.every(e=>t.intersects(e,r)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(I(this.set[t],e,this.options))return!0;return!1}}Wa=t;const r=(Ka||(Ka=1,Ha=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}),Ha),n=new r,o=Oc(),i=Fc(),s=Ac(),a=Cc(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:d}=kc(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=Ec(),y=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,m=(e,t)=>{let r=!0;const n=e.slice();let o=n.pop();for(;r&&n.length;)r=n.every(e=>o.intersects(e,t)),o=n.pop();return r},b=(e,t)=>(s("comp",e,t),e=S(e,t),s("caret",e),e=w(e,t),s("tildes",e),e=A(e,t),s("xrange",e),e=O(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(" "),x=(e,t)=>{const r=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(r,(t,r,n,o,i)=>{let a;return s("tilde",e,t,r,n,o,i),v(r)?a="":v(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:v(o)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:i?(s("replaceTilde pr",i),a=`>=${r}.${n}.${o}-${i} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${o} <${r}.${+n+1}.0-0`,s("tilde return",a),a})},S=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{s("caret",e,t);const r=t.loose?c[u.CARETLOOSE]:c[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,o,i,a)=>{let c;return s("caret",e,t,r,o,i,a),v(r)?c="":v(o)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(i)?c="0"===r?`>=${r}.${o}.0${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.0${n} <${+r+1}.0.0-0`:a?(s("replaceCaret pr",a),c="0"===r?"0"===o?`>=${r}.${o}.${i}-${a} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i}-${a} <${+r+1}.0.0-0`):(s("no pr"),c="0"===r?"0"===o?`>=${r}.${o}.${i}${n} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i} <${+r+1}.0.0-0`),s("caret return",c),c})},A=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();const r=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(r,(r,n,o,i,a,c)=>{s("xRange",e,r,n,o,i,a,c);const u=v(o),l=u||v(i),f=l||v(a),d=f;return"="===n&&d&&(n=""),c=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(l&&(i=0),a=0,">"===n?(n=">=",l?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",l?o=+o+1:i=+i+1),"<"===n&&(c="-0"),r=`${n+o}.${i}.${a}${c}`):l?r=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(r=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`),s("xRange return",r),r})},O=(e,t)=>(s("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),T=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),C=e=>(t,r,n,o,i,s,a,c,u,l,f,d)=>`${r=v(n)?"":v(o)?`>=${n}.0.0${e?"-0":""}`:v(i)?`>=${n}.${o}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=v(u)?"":v(l)?`<${+u+1}.0.0-0`:v(f)?`<${u}.${+l+1}.0-0`:d?`<=${u}.${l}.${f}-${d}`:e?`<${u}.${l}.${+f+1}-0`:`<=${c}`}`.trim(),I=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(s(e[r].semver),e[r].semver!==i.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return Wa}function Fc(){if(Za)return Xa;Za=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(n,o){if(o=r(o),n instanceof t){if(n.loose===!!o.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),s("comparator",n,o),this.options=o,this.loose=!!o.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const r=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],i=t.match(r);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==i[1]?i[1]:"","="===this.operator&&(this.operator=""),i[2]?this.semver=new a(i[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return i(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,n).test(e.semver):(!(n=r(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(i(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(i(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Xa=t;const r=Oc(),{safeRe:n,t:o}=kc(),i=Uc(),s=Ac(),a=Cc(),c=Dc();return Xa}function zc(){if(Ya)return Qa;Ya=1;const e=Dc();return Qa=(t,r,n)=>{try{r=new e(r,n)}catch(e){return!1}return r.test(t)},Qa}function qc(){if(ac)return sc;ac=1;const e=Dc();return sc=(t,r)=>{try{return new e(t,r).range||"*"}catch(e){return null}},sc}function Vc(){if(uc)return cc;uc=1;const e=Cc(),t=Fc(),{ANY:r}=t,n=Dc(),o=zc(),i=Rc(),s=Nc(),a=Lc(),c=Mc();return cc=(u,l,f,d)=>{let h,p,y,g,m;switch(u=new e(u,d),l=new n(l,d),f){case">":h=i,p=a,y=s,g=">",m=">=";break;case"<":h=s,p=c,y=i,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(u,l,d))return!1;for(let e=0;e<l.set.length;++e){const n=l.set[e];let o=null,i=null;if(n.forEach(e=>{e.semver===r&&(e=new t(">=0.0.0")),o=o||e,i=i||e,h(e.semver,o.semver,d)?o=e:y(e.semver,i.semver,d)&&(i=e)}),o.operator===g||o.operator===m)return!1;if((!i.operator||i.operator===g)&&p(u,i.semver))return!1;if(i.operator===m&&y(u,i.semver))return!1}return!0},cc}var Hc,Kc=function(){if(xc)return wc;xc=1;const e=kc(),t=Ec(),r=Cc(),n=Tc(),o=Ic(),i=function(){if(ta)return ea;ta=1;const e=Ic();return ea=(t,r)=>{const n=e(t,r);return n?n.version:null},ea}(),s=function(){if(na)return ra;na=1;const e=Ic();return ra=(t,r)=>{const n=e(t.trim().replace(/^[=v]+/,""),r);return n?n.version:null},ra}(),a=function(){if(ia)return oa;ia=1;const e=Cc();return oa=(t,r,n,o,i)=>{"string"==typeof n&&(i=o,o=n,n=void 0);try{return new e(t instanceof e?t.version:t,n).inc(r,o,i).version}catch(e){return null}},oa}(),c=function(){if(aa)return sa;aa=1;const e=Ic();return sa=(t,r)=>{const n=e(t,null,!0),o=e(r,null,!0),i=n.compare(o);if(0===i)return null;const s=i>0,a=s?n:o,c=s?o:n,u=!!a.prerelease.length;if(c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const l=u?"pre":"";return n.major!==o.major?l+"major":n.minor!==o.minor?l+"minor":n.patch!==o.patch?l+"patch":"prerelease"}}(),u=function(){if(ua)return ca;ua=1;const e=Cc();return ca=(t,r)=>new e(t,r).major,ca}(),l=function(){if(fa)return la;fa=1;const e=Cc();return la=(t,r)=>new e(t,r).minor,la}(),f=function(){if(ha)return da;ha=1;const e=Cc();return da=(t,r)=>new e(t,r).patch,da}(),d=function(){if(ya)return pa;ya=1;const e=Ic();return pa=(t,r)=>{const n=e(t,r);return n&&n.prerelease.length?n.prerelease:null},pa}(),h=_c(),p=function(){if(va)return ba;va=1;const e=_c();return ba=(t,r,n)=>e(r,t,n),ba}(),y=function(){if(xa)return wa;xa=1;const e=_c();return wa=(t,r)=>e(t,r,!0),wa}(),g=Pc(),m=function(){if(ka)return Aa;ka=1;const e=Pc();return Aa=(t,r)=>t.sort((t,n)=>e(t,n,r)),Aa}(),b=function(){if(Ta)return Oa;Ta=1;const e=Pc();return Oa=(t,r)=>t.sort((t,n)=>e(n,t,r)),Oa}(),v=Rc(),w=Nc(),x=Bc(),S=jc(),E=Mc(),A=Lc(),k=Uc(),O=function(){if(Va)return qa;Va=1;const e=Cc(),t=Ic(),{safeRe:r,t:n}=kc();return qa=(o,i)=>{if(o instanceof e)return o;if("number"==typeof o&&(o=String(o)),"string"!=typeof o)return null;let s=null;if((i=i||{}).rtl){const e=i.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let t;for(;(t=e.exec(o))&&(!s||s.index+s[0].length!==o.length);)s&&t.index+t[0].length===s.index+s[0].length||(s=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else s=o.match(i.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);if(null===s)return null;const a=s[2],c=s[3]||"0",u=s[4]||"0",l=i.includePrerelease&&s[5]?`-${s[5]}`:"",f=i.includePrerelease&&s[6]?`+${s[6]}`:"";return t(`${a}.${c}.${u}${l}${f}`,i)},qa}(),T=Fc(),C=Dc(),I=zc(),_=function(){if($a)return Ja;$a=1;const e=Dc();return Ja=(t,r)=>new e(t,r).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" ")),Ja}(),P=function(){if(tc)return ec;tc=1;const e=Cc(),t=Dc();return ec=(r,n,o)=>{let i=null,s=null,a=null;try{a=new t(n,o)}catch(e){return null}return r.forEach(t=>{a.test(t)&&(i&&-1!==s.compare(t)||(i=t,s=new e(i,o)))}),i},ec}(),R=function(){if(nc)return rc;nc=1;const e=Cc(),t=Dc();return rc=(r,n,o)=>{let i=null,s=null,a=null;try{a=new t(n,o)}catch(e){return null}return r.forEach(t=>{a.test(t)&&(i&&1!==s.compare(t)||(i=t,s=new e(i,o)))}),i},rc}(),N=function(){if(ic)return oc;ic=1;const e=Cc(),t=Dc(),r=Rc();return oc=(n,o)=>{n=new t(n,o);let i=new e("0.0.0");if(n.test(i))return i;if(i=new e("0.0.0-0"),n.test(i))return i;i=null;for(let t=0;t<n.set.length;++t){const o=n.set[t];let s=null;o.forEach(t=>{const n=new e(t.semver.version);switch(t.operator){case">":0===n.prerelease.length?n.patch++:n.prerelease.push(0),n.raw=n.format();case"":case">=":s&&!r(n,s)||(s=n);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}),!s||i&&!r(i,s)||(i=s)}return i&&n.test(i)?i:null},oc}(),B=qc(),j=Vc(),M=function(){if(fc)return lc;fc=1;const e=Vc();return lc=(t,r,n)=>e(t,r,">",n),lc}(),L=function(){if(hc)return dc;hc=1;const e=Vc();return dc=(t,r,n)=>e(t,r,"<",n),dc}(),U=function(){if(yc)return pc;yc=1;const e=Dc();return pc=(t,r,n)=>(t=new e(t,n),r=new e(r,n),t.intersects(r,n))}(),D=function(){if(mc)return gc;mc=1;const e=zc(),t=_c();return gc=(r,n,o)=>{const i=[];let s=null,a=null;const c=r.sort((e,r)=>t(e,r,o));for(const t of c)e(t,n,o)?(a=t,s||(s=t)):(a&&i.push([s,a]),a=null,s=null);s&&i.push([s,null]);const u=[];for(const[e,t]of i)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),f="string"==typeof n.raw?n.raw:String(n);return l.length<f.length?l:n},gc}(),F=function(){if(vc)return bc;vc=1;const e=Dc(),t=Fc(),{ANY:r}=t,n=zc(),o=_c(),i=[new t(">=0.0.0-0")],s=[new t(">=0.0.0")],a=(e,t,a)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===r){if(1===t.length&&t[0].semver===r)return!0;e=a.includePrerelease?i:s}if(1===t.length&&t[0].semver===r){if(a.includePrerelease)return!0;t=s}const l=new Set;let f,d,h,p,y,g,m;for(const t of e)">"===t.operator||">="===t.operator?f=c(f,t,a):"<"===t.operator||"<="===t.operator?d=u(d,t,a):l.add(t.semver);if(l.size>1)return null;if(f&&d){if(h=o(f.semver,d.semver,a),h>0)return null;if(0===h&&(">="!==f.operator||"<="!==d.operator))return null}for(const e of l){if(f&&!n(e,String(f),a))return null;if(d&&!n(e,String(d),a))return null;for(const r of t)if(!n(e,String(r),a))return!1;return!0}let b=!(!d||a.includePrerelease||!d.semver.prerelease.length)&&d.semver,v=!(!f||a.includePrerelease||!f.semver.prerelease.length)&&f.semver;b&&1===b.prerelease.length&&"<"===d.operator&&0===b.prerelease[0]&&(b=!1);for(const e of t){if(m=m||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,f)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if(p=c(f,e,a),p===e&&p!==f)return!1}else if(">="===f.operator&&!n(f.semver,String(e),a))return!1;if(d)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),"<"===e.operator||"<="===e.operator){if(y=u(d,e,a),y===e&&y!==d)return!1}else if("<="===d.operator&&!n(d.semver,String(e),a))return!1;if(!e.operator&&(d||f)&&0!==h)return!1}return!(f&&g&&!d&&0!==h||d&&m&&!f&&0!==h||v||b)},c=(e,t,r)=>{if(!e)return t;const n=o(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},u=(e,t,r)=>{if(!e)return t;const n=o(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};return bc=(t,r,n={})=>{if(t===r)return!0;t=new e(t,n),r=new e(r,n);let o=!1;e:for(const e of t.set){for(const t of r.set){const r=a(e,t,n);if(o=o||null!==r,r)continue e}if(o)return!1}return!0}}();return wc={parse:o,valid:i,clean:s,inc:a,diff:c,major:u,minor:l,patch:f,prerelease:d,compare:h,rcompare:p,compareLoose:y,compareBuild:g,sort:m,rsort:b,gt:v,lt:w,eq:x,neq:S,gte:E,lte:A,cmp:k,coerce:O,Comparator:T,Range:C,satisfies:I,toComparators:_,maxSatisfying:P,minSatisfying:R,minVersion:N,validRange:B,outside:j,gtr:M,ltr:L,intersects:U,simplifyRange:D,subset:F,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers}}(),Wc=q(Kc);!function(e){e.blue="blue",e.nanoS="nanoS",e.nanoSP="nanoSP",e.nanoX="nanoX",e.stax="stax",e.europa="europa",e.apex="apex"}(Hc||(Hc={}));const Gc={[Hc.blue]:{id:Hc.blue,productName:"Ledger Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[822083584,822149120],getBlockSize:e=>4096},[Hc.nanoS]:{id:Hc.nanoS,productName:"Ledger Nano S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:e=>Wc.lt(Wc.coerce(e)??"","2.0.0")?4096:2048},[Hc.nanoX]:{id:Hc.nanoX,productName:"Ledger Nano X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:e=>4096,bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},[Hc.nanoSP]:{id:Hc.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1569792,masks:[856686592],getBlockSize:e=>32},[Hc.apex]:{id:Hc.apex,productName:"Ledger Apex",productIdMM:128,legacyUsbProductId:8,usbOnly:!1,memorySize:1569792,masks:[859832320],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-8004-0000-4c6564676572",notifyUuid:"13d63400-2c97-8004-0001-4c6564676572",writeUuid:"13d63400-2c97-8004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-8004-0003-4c6564676572"}]},[Hc.stax]:{id:Hc.stax,productName:"Ledger Stax",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1569792,masks:[857735168],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},[Hc.europa]:{id:Hc.europa,productName:"Ledger Flex",productIdMM:112,legacyUsbProductId:7,usbOnly:!1,memorySize:1569792,masks:[858783744],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]}};Hc.blue,Hc.nanoS,Hc.nanoSP,Hc.nanoX,Hc.stax,Hc.europa;const Xc=Object.values(Gc),Zc=e=>{const t=Xc.find(t=>t.legacyUsbProductId===e);if(t)return t;const r=e>>8,n=Xc.find(e=>e.productIdMM===r);return n},Qc=[],Yc={};for(const e in Gc){const t=Gc[e],{bluetoothSpec:r}=t;if(r)for(let e=0;e<r.length;e++){const n=r[e];Qc.push(n.serviceUuid),Yc[n.serviceUuid]=Yc[n.serviceUuid.replace(/-/g,"")]={deviceModel:t,...n}}}const Jc=[{vendorId:11415}];async function $c(){return await navigator.usb.requestDevice({filters:Jc})}async function eu(){return(await navigator.usb.getDevices()).filter(e=>11415===e.vendorId)}const tu=()=>Promise.resolve(!!navigator&&!!navigator.usb&&"function"==typeof navigator.usb.getDevices);class ru extends Us{device;deviceModel;channel=Math.floor(65535*Math.random());packetSize=64;interfaceNumber;constructor(e,t){super(),this.device=e,this.interfaceNumber=t,this.deviceModel=Zc(e.productId)}static isSupported=tu;static list=eu;static listen=e=>{let t=!1;return async function(){const e=await eu();return e.length>0?e[0]:$c()}().then(r=>{if(!t){const t=Zc(r.productId);e.next({type:"add",descriptor:r,deviceModel:t}),e.complete()}},t=>{window.DOMException&&t instanceof window.DOMException&&18===t.code?e.error(new ps(t.message)):e.error(new fs(t.message))}),{unsubscribe:function(){t=!0}}};static async request(){const e=await $c();return ru.open(e)}static async openConnected(){const e=await eu();return 0===e.length?null:ru.open(e[0])}static async open(e){await e.open(),null===e.configuration&&await e.selectConfiguration(1),await nu(e);const t=e.configurations[0].interfaces.find(({alternates:e})=>e.some(e=>255===e.interfaceClass));if(!t)throw new ds("No WebUSB interface found for your Ledger device. Please upgrade firmware or contact techsupport.");const r=t.interfaceNumber;try{await e.claimInterface(r)}catch(t){throw await e.close(),new ds(t.message)}const n=new ru(e,r),o=t=>{e===t.device&&(navigator.usb.removeEventListener("disconnect",o),n._emitDisconnect(new us))};return navigator.usb.addEventListener("disconnect",o),n}_disconnectEmitted=!1;_emitDisconnect=e=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",e))};async close(){await this.exchangeBusyPromise,await this.device.releaseInterface(this.interfaceNumber),await nu(this.device),await this.device.close()}async exchange(e){const t=await this.exchangeAtomicImpl(async()=>{const{channel:t,packetSize:r}=this;Bs("apdu","=> "+e.toString("hex"));const n=((e,t)=>({makeBlocks(r){let n=Zr().Buffer.concat([Ds(r.length),r]);const o=t-5,i=Math.ceil(n.length/o);n=Zr().Buffer.concat([n,Zr().Buffer.alloc(i*o-n.length+1).fill(0)]);const s=[];for(let t=0;t<i;t++){const r=Zr().Buffer.alloc(5);r.writeUInt16BE(e,0),r.writeUInt8(5,2),r.writeUInt16BE(t,3);const i=n.slice(t*o,(t+1)*o);s.push(Zr().Buffer.concat([r,i]))}return s},reduceResponse(t,r){let{data:n,dataLength:o,sequence:i}=t||Fs;if(r.readUInt16BE(0)!==e)throw new gs("Invalid channel","InvalidChannel");if(5!==r.readUInt8(2))throw new gs("Invalid tag","InvalidTag");if(r.readUInt16BE(3)!==i)throw new gs("Invalid sequence","InvalidSequence");t||(o=r.readUInt16BE(5)),i++;const s=r.slice(t?5:7);return n=Zr().Buffer.concat([n,s]),n.length>o&&(n=n.slice(0,o)),{data:n,dataLength:o,sequence:i}},getReducedResult(e){if(e&&e.dataLength===e.data.length)return e.data}}))(t,r),o=n.makeBlocks(e);for(let e=0;e<o.length;e++)await this.device.transferOut(3,o[e]);let i,s;for(;!(i=n.getReducedResult(s));){const e=await this.device.transferIn(3,r),t=Buffer.from(e.data.buffer);s=n.reduceResponse(s,t)}return Bs("apdu","<= "+i.toString("hex")),i}).catch(e=>{if(e&&e.message&&e.message.includes("disconnected"))throw this._emitDisconnect(e),new ls(e.message);throw e});return t}setScrambleKey(){}}async function nu(e){try{await e.reset()}catch(e){console.warn(e)}}var ou,iu,su,au,cu,uu,lu={name:oe.Ledger,website:"https://www.ledger.com",connect:function(){return d(void 0,void 0,void 0,function(){var e,t;return h(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,ru.create()];case 1:return e=r.sent(),[4,new As(e).getPublicKey("44'/148'/0'")];case 2:return t=r.sent().rawPublicKey,[2,ae.StrKey.encodeEd25519PublicKey(t)];case 3:throw r.sent(),new Error("Failed to connect to Ledger.");case 4:return[2]}})})},disconnect:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return[2]})})},getNetwork:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("Failed to get network from ledger")})})},isAvailable:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:return[4,ru.isSupported()];case 1:return[2,e.sent()]}})})},signAuthEntry:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("ledger does not support the signAuthEntry function")})})},signMessage:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){throw new Error("ledger does not support the signMessage function")})})},signTransaction:function(e,t){return d(void 0,void 0,void 0,function(){var r,n,o,i,s,a;return h(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),r=new ae.Transaction(e,t.network),[4,ru.create()];case 1:return n=c.sent(),[4,new As(n).signTransaction("44'/148'/0'",r.signatureBase())];case 2:return o=c.sent().signature,i=ae.Keypair.fromPublicKey(t.address),s=i.signatureHint(),a=new ae.xdr.DecoratedSignature({hint:s,signature:o}),r.signatures.push(a),[2,r.toXDR()];case 3:throw c.sent(),new Error("Failed to sign the transaction with Ledger.");case 4:return[2]}})})}},fu=((ou={})[oe.Freighter]=ts,ou[oe.Rabet]=xi,ou[oe.WalletConnect]=is,ou[oe.Xbull]=Si,ou[oe.Hot]=vi,ou[oe.Hana]=wi,ou[oe.Lobstr]=Xi,ou[oe.Ledger]=lu,ou[oe.Albedo]=qi,ou[oe.Klever]=Vi,ou),du={mainnet:ae.Networks.PUBLIC,testnet:ae.Networks.TESTNET,sandbox:ae.Networks.SANDBOX,futurenet:ae.Networks.FUTURENET,standalone:ae.Networks.STANDALONE},hu=((iu={})[du.mainnet]={name:"Mainnet",horizon:"https://horizon.stellar.org",soroban:"https://mainnet.sorobanrpc.com"},iu[du.testnet]={name:"Testnet",horizon:"https://horizon-testnet.stellar.org",soroban:"https://soroban-testnet.stellar.org"},iu[du.futurenet]={name:"Futurenet",horizon:"https://horizon-futurenet.stellar.org",soroban:"https://rpc-futurenet.stellar.org"},iu),pu={steexp:(su={},su[du.mainnet]="https://steexp.com",su[du.testnet]="https://testnet.steexp.com",su.ledgerUrl="ledger",su.transactionUrl="tx",su.accountUrl="account",su),stellarexpert:(au={},au[du.mainnet]="https://stellar.expert/explorer/public",au[du.testnet]="https://stellar.expert/explorer/testnet",au.ledgerUrl="ledger",au.accountUrl="account",au.transactionUrl="tx",au),lumenscan:(cu={},cu[du.mainnet]="https://lumenscan.io",cu[du.testnet]="https://testnet.lumenscan.io",cu.ledgerUrl="ledgers",cu.accountUrl="account",cu.operationUrl="ops",cu.transactionUrl="txns",cu),stellarchain:(uu={},uu[du.mainnet]="https://stellarchain.io",uu[du.testnet]="https://testnet.stellarchain.io",uu[du.futurenet]="https://futurenet.stellarchain.io",uu.ledgerUrl="ledgers",uu.accountUrl="accounts",uu.operationUrl="operations",uu.transactionUrl="transactions",uu)},yu={logInOrSignUp:{en:"Log in or Sign up",es:"Inicia sesión o regístrate"},profile:{en:"Profile",es:"Perfil"},confirmation:{en:"Confirmation",es:"Confirmación"},send:{en:"Send",es:"Enviar"},activity:{en:"Activity",es:"Actividad"},swap:{en:"Swap",es:"Intercambiar"},receive:{en:"Receive",es:"Recibir"},wrongNetwork:{en:"Wrong Network",es:"Red incorrecta"},balances:{en:"Balances",es:"Saldos"},whatIsBlux:{en:"What is Blux",es:"Qué es Blux"},addToken:{en:"Add Token",es:"Agregar token"},signMessage:{en:"Sign Message",es:"Firmar mensaje"},selectAsset:{en:"Select Asset",es:"Seleccionar activo"},walletConnect:{en:"Wallet Connect",es:"Conectar billetera"},loading:{en:"Loading",es:"Cargando"},tryAgain:{en:"Try again",es:"Intenta de nuevo"},connecting:{en:"Connecting",es:"Conectando"},signing:{en:"Signing",es:"Firmando"},or:{en:"or",es:"o"},recent:{en:"Recent",es:"Reciente"},allStellarWallets:{en:"All Stellar wallets",es:"Todas las carteras Stellar"},email:{en:"Email",es:"Correo electrónico"},logInWithPasskey:{en:"Log in with Passkey",es:"Iniciar sesión con llave de acceso"},submit:{en:"Submit",es:"Enviar"},poweredByBlux:{en:"Powered by Blux.cc",es:"Desarrollado por Blux.cc"},connectionSuccessfulTitle:{en:"Connection Successful",es:"Conexión exitosa"},transactionSuccessfulTitle:{en:"Transaction Successful",es:"Transacción exitosa"},connectionSuccessfulMessage:{en:"Your account has been successfully connected to ${appName}",es:"Tu cuenta se ha conectado correctamente a ${appName}"},transactionSuccessfulMessage:{en:"Your transaction was successfully completed",es:"Tu transacción se completó con éxito"},seeInExplorer:{en:"See in explorer",es:"Ver en el explorador"},loggingIn:{en:"Logging In",es:"Iniciando sesión"},done:{en:"Done",es:"Hecho"},signTransactionPrompt:{en:"wants your permission to approve the following transaction.",es:"quiere tu permiso para aprobar la siguiente transacción."},invalidXdr:{en:"Invalid XDR",es:"XDR inválido"},lobstrWarning:{en:"Ensure that your LOBSTR wallet is set to the ${network} network. Otherwise, the transaction will definitely fail.",es:"Asegúrate de que tu cartera LOBSTR esté configurada en la red ${network}. De lo contrario, la transacción fallará."},yourWallet:{en:"Your wallet",es:"Tu cartera"},noAddressFound:{en:"No address found",es:"No se encontró ninguna dirección"},approve:{en:"Approve",es:"Aprobar"},loadingActivity:{en:"Loading activity...",es:"Cargando actividad..."},noActivityFound:{en:"No activity found",es:"No se encontró actividad"},multiOperation:{en:"Multi Operation",es:"Operación múltiple"},pathPaymentDescription:{en:"Path payment of ${amount} ${asset}",es:"Pago por ruta de ${amount} ${asset}"},seeAllInExplorer:{en:"See all in explorer",es:"Ver todo en el explorador"},enterConfirmationCodeTitle:{en:"Enter confirmation code",es:"Introduce el código de confirmación"},enterConfirmationCodeHelp:{en:"Please check your email and enter confirmation code below",es:"Por favor revisa tu correo electrónico e introduce el código de confirmación abajo"},invalidCodeError:{en:"Invalid code, please try again.",es:"Código inválido, por favor intenta de nuevo."},resendCode:{en:"Resend code",es:"Reenviar código"},copied:{en:"Copied!",es:"¡Copiado!"},logout:{en:"Logout",es:"Cerrar sesión"},search:{en:"Search",es:"Buscar"},noAssetsFound:{en:"No assets found",es:"No se encontraron activos"},amount:{en:"Amount",es:"Cantidad"},max:{en:"Max",es:"Máx"},to:{en:"To",es:"A"},enterAddress:{en:"Enter address",es:"Introduce la dirección"},addressRequired:{en:"Address is required",es:"La dirección es obligatoria"},addressInvalid:{en:"Address is invalid",es:"La dirección es inválida"},inactiveAccount:{en:"Account is inActive",es:"La cuenta está inactiva"},memo:{en:"Memo",es:"Memo"},enterMemo:{en:"Enter Memo",es:"Introduce una Memo"},optional:{en:"optional",es:"opcional"},paste:{en:"Paste",es:"Pegar"},amountRequired:{en:"Amount is required",es:"La cantidad es obligatoria"},amountExceedsBalance:{en:"Amount is greater than max balance",es:"La cantidad excede el saldo máximo"},sendButton:{en:"Send",es:"Enviar"},loginFailed:{en:"Login failed",es:"Fallo al iniciar sesión"},signingFailed:{en:"Signing with ${walletName} failed",es:"La firma con ${walletName} falló"},waitingFor:{en:"Waiting for ${walletName}",es:"Esperando a ${walletName}"},signingWith:{en:"Signing with ${walletName}",es:"Firmando con ${walletName}"},loginRetryMessage:{en:"Please try logging in again.",es:"Por favor intenta iniciar sesión nuevamente."},signingRetryMessage:{en:"Please try signing again.",es:"Por favor intenta firmar nuevamente."},acceptConnection:{en:"Accept connection",es:"Aceptar conexión"},signRequestInWallet:{en:"Sign the request in your wallet",es:"Firma la solicitud en tu cartera"},wrongNetworkMessage:{en:"You’re currently connected to the Stellar ${currentNetwork}. Please switch to the Stellar ${switchNetwork} to continue using this app.",es:"Actualmente estás conectado a la red de pruebas de Stellar (${currentNetwork}). Por favor cambia a la red principal de Stellar (${switchNetwork}) para continuar usando esta aplicación."},wallet_infra:{en:"Wallet Infrastructure for Stellar dapps",es:"Infraestructura de billeteras para dapps en Stellar"},blux_gateway:{en:"Blux is your gateway to Stellar. Create a wallet, manage assets, and sign transactions easily and securely.",es:"Blux es tu puerta de entrada a Stellar. Crea una billetera, gestiona activos y firma transacciones de manera fácil y segura."},enter_token_address:{en:"Enter token address",es:"Ingresar dirección del token"},enter_address:{en:"enter address",es:"ingresar dirección"},check:{en:"Check",es:"Verificar"},cancel:{en:"Cancel",es:"Cancelar"},add_token:{en:"Add token",es:"Agregar token"},network:{en:"Network",es:"Red"},address:{en:"Address",es:"Dirección"},market_cap:{en:"Market cap",es:"Capitalización de mercado"},total_volume:{en:"Total volume",es:"Volumen total"},all_time_high:{en:"All time high",es:"Máximo histórico"},copy_address:{en:"Copy address",es:"Copiar dirección"},address_copied:{en:"Address copied",es:"Dirección copiada"},add_new_token:{en:"Add new token",es:"Agregar nuevo token"},assets:{en:"Assets",es:"Activos"},tokens:{en:"Tokens",es:"Tokens"},nfts:{en:"NFTs",es:"NFTs"},sign_permission:{en:"wants your permission to sign the following message:",es:"solicita tu permiso para firmar el siguiente mensaje:"}},gu=function(e){return"native"===e.assetType?ae.Asset.native():new ae.Asset(e.assetCode,e.assetIssuer)},mu=function(e){var t={valueInCurrency:"0",assetBalance:e.balance||"0",assetType:e.asset_type};return"native"===e.asset_type?(t.assetCode="XLM",t.assetIssuer=""):"liquidity_pool_shares"===e.asset_type?(t.assetCode="LiquidtyPool",t.assetIssuer=""):(t.assetCode=e.asset_code,t.assetIssuer=e.asset_issuer),t},bu=function(e){var t;return"".concat(null===(t=e[0])||void 0===t?void 0:t.toUpperCase()).concat(e.slice(1))},vu=function(e){return navigator.clipboard.writeText(e)},wu=function(e){return"send"===e?se.SEND:se.SWAP},xu=function(e){var t=e.replace("#","");return(.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5?"#000000":"#FFFFFF"},Su=function(e,t,r,n){var o=pu[t];o||(o=pu.stellarchain);var i=o[e];return i?"".concat(i,"/").concat(o[r],"/").concat(n):null},Eu=function(){var e=localStorage.getItem(rs);if(!e)return[];try{return JSON.parse(e)}catch(e){return[]}},Au=function(e){var t=Object.entries(ie).find(function(t){return t[1]===e});if(!t)throw new Error("Unknown network passphrase: ".concat(e));return t[0].toLowerCase()},ku=function(e,t){var r=hu[e],n=t[e];if(!r&&!n)throw new Error("Custom network has no transports.");return!r&&n&&(r={name:"Custom Network",horizon:"",soroban:""}),n&&(n.horizon&&(r.horizon=n.horizon),n.soroban&&(r.soroban=n.soroban)),r},Ou=function(e){return d(void 0,void 0,void 0,function(){return h(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.getNetwork()];case 1:return[2,t.sent().passphrase];case 2:return t.sent(),[2,""];case 3:return[2]}})})},Tu=function(e,t){var r=parseInt(e.replace("#",""),16),n=r>>8&255,o=255&r;return"rgba(".concat(r>>16&255,", ").concat(n,", ").concat(o,", ").concat(t,")")},Cu=function(e,t){void 0===t&&(t=!1);var r="number"==typeof e?e:parseFloat(e);if(isNaN(r)||0===r)return"0";if(r<1e-6)return e.toString();if(t){if(r>=1e6)return"".concat((r/1e6).toFixed(2),"m");if(r>=1e3)return"".concat((r/1e3).toFixed(2),"k")}return ju(Bu(r))},Iu=function(e){var t=e.replace("#","");return!((.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5)},_u=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(o){switch(o.label){case 0:return s=function(e){"https://mobile.rabet.io"===e.origin&&"RABET/INSTALL"===e.data.type&&(new Function(e.data.message)(),window.removeEventListener("message",s))},window.addEventListener("message",s),[4,(i=e,d(void 0,void 0,void 0,function(){var e,t;return h(this,function(r){switch(r.label){case 0:return[4,Promise.all(Object.values(fu).map(function(e){return d(void 0,void 0,void 0,function(){var t;return h(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),i.includes(e.name.toLowerCase())?[2,{wallet:e,isAvailable:!1}]:[4,e.isAvailable()];case 1:return t=r.sent(),[2,{wallet:e,isAvailable:t}];case 2:return r.sent(),[2,{wallet:e,isAvailable:!1}];case 3:return[2]}})})}))];case 1:return e=r.sent(),t=e.filter(function(e){return!!e.isAvailable}),[2,t.map(function(e){return e.wallet})]}})}))];case 1:return t=o.sent(),r=function(e){for(var t=Eu(),r=new Map(e.map(function(e){return[e.name,e]})),o=[],i=new Set,s=0,a=t;s<a.length;s++){var c=a[s],u=r.get(c);u&&(o.push(u),i.add(c))}var l=e.filter(function(e){return!i.has(e.name)}),f=w(w([],o,!0),l,!0).map(function(e,t){return n(n({},e),{isRecent:0===t})});return f}(t),[2,r]}var i,s})})},Pu=function(e,t){return void 0===t&&(t=8),e.slice(0,t)+"..."+e.slice(-t)},Ru=function(e){return e.replace(/([A-Z])/g," $1").replace(/_/g," ").trim().replace(/\b\w/g,function(e){return e.toUpperCase()})},Nu=function(e,t){return void 0===t&&(t={}),e.replace(/\$\{(\w+)\}/g,function(e,r){return t[r]||""})},Bu=function(e){var t,r=e.toString().split("."),n=r[0],o=r[1],i=void 0===o?"":o;if(!i)return n;var s=null!==(t={0:8,1:7,2:6,3:5,4:4,5:3,6:2}[n.length])&&void 0!==t?t:0;if(s>0){var a="".concat(n,".").concat(i.slice(0,s)),c=parseFloat(a);return Number.isInteger(c)?n:c.toFixed(2)}return n},ju=function(e){var t=e.split("."),r=t[0],n=t[1];return n?"".concat(r.replace(/\B(?=(\d{3})+(?!\d))/g,","),".").concat(n):r.replace(/\B(?=(\d{3})+(?!\d))/g,",")},Mu=function(e,t){return"email"===e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t):""!==t.trim()},Lu=function(){return!!pe().stellar},Uu=function(e){var t=pe().user;if(!t&&!e)throw new Error("Address not found");return e||(null==t?void 0:t.address)},Du=function(e){var t,r=pe(),n=r.stellar,o=r.config;if(!e){if(n)return{horizon:n.servers.horizon,soroban:n.servers.soroban,networkPassphrase:n.activeNetwork};throw new Error("Custom network has no transports.")}var i=ku(e,null!==(t=o.transports)&&void 0!==t?t:{}),s=i.horizon,a=i.soroban;return{networkPassphrase:e,soroban:new ae.rpc.Server(a),horizon:new ae.Horizon.Server(s)}},Fu=function(e){var t,r=pe();if(0===r.config.networks.length)throw new Error("switchNetwork must be called after createConfig");if(!r.config.networks.includes(e))throw new Error("New network must be defined in config.networks");if(!r.stellar)throw new Error("Could not find the current activeNetwork");r.setStellar({activeNetwork:e,servers:null===(t=r.stellar)||void 0===t?void 0:t.servers})},zu=function(e,t,r){var n=Du(r.network).horizon,o=n[e].apply(n,t);return r.cursor&&o.cursor(r.cursor),r.limit&&o.limit(r.limit),r.order&&o.order(r.order),o},qu=function(e){return d(void 0,void 0,void 0,function(){var t,r,n,o,i,s;return h(this,function(a){switch(a.label){case 0:if(Lu(),t=Uu(e.address),r=Du(e.network).horizon,!ae.StrKey.isValidEd25519PublicKey(t))throw new Error("Invalid address");a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r.loadAccount(t)];case 2:return n=a.sent(),e.includeZeroBalances?[2,n.balances]:(o=n.balances.filter(function(e){return 0!==Number(e.balance)}),i=o.find(function(e){return"native"===e.asset_type}),s=o.filter(function(e){return"native"!==e.asset_type}),i?[2,w([i],s,!0)]:[2,s]);case 3:return a.sent(),[2,[]];case 4:return[2]}})})},Vu=function(e,t){return d(void 0,void 0,void 0,function(){var r,n;return h(this,function(o){switch(o.label){case 0:return Lu(),[4,(r=zu("strictReceivePaths",e,t)).call()];case 1:return n=o.sent(),[2,{builder:r,response:n}]}})})},Hu=function(e,t){return d(void 0,void 0,void 0,function(){var r,n;return h(this,function(o){switch(o.label){case 0:return Lu(),[4,(r=zu("strictSendPaths",e,t)).call()];case 1:return n=o.sent(),[2,{builder:r,response:n}]}})})},Ku=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("transactions",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},Wu={mainnet:ae.Networks.PUBLIC,testnet:ae.Networks.TESTNET,sandbox:ae.Networks.SANDBOX,futurenet:ae.Networks.FUTURENET,standalone:ae.Networks.STANDALONE},Gu=function(e,t,r,n){return d(void 0,void 0,void 0,function(){return h(this,function(o){switch(o.label){case 0:if(!(null==e?void 0:e.signMessage))throw new Error("Wallet does not support signMessage.");return[4,e.signMessage(t,{address:r,network:n})];case 1:return[2,o.sent()]}})})},Xu=function(e,t){try{var r=new ae.Transaction(e,t),n=r.operations[0],o=null;return o="payment"===n.type||"pathPaymentStrictSend"===n.type||"pathPaymentStrictReceive"===n.type?n.destination:"",{action:n.type,operations:r.operations.length,sender:r.source,receiver:o,estimatedFee:Number(r.fee)/1e7}}catch(e){return null}},Zu=function(e,t,r,n){return d(void 0,void 0,void 0,function(){return h(this,function(o){switch(o.label){case 0:if(!(null==e?void 0:e.signTransaction))throw new Error("Wallet does not support transaction signing.");return[4,e.signTransaction(t,{network:n,address:r})];case 1:return[2,o.sent()]}})})};function Qu(e,t,r){return d(this,void 0,void 0,function(){var n,o,i;return h(this,function(s){switch(s.label){case 0:if(!(n=ku(t,r).horizon))throw new Error("Horizon RPC was not found.");return o=new ae.Horizon.Server(n),i=new ae.Transaction(e,t),[4,o.submitTransaction(i)];case 1:return[2,s.sent()]}})})}var Yu,Ju,$u=function(e,t,r,n,o){return d(void 0,void 0,void 0,function(){return h(this,function(i){switch(i.label){case 0:return[4,Zu(e,t,r,n)];case 1:return[4,Qu(i.sent(),n,o||{})];case 2:return[2,i.sent()]}})})},el=function(e,t){return new Promise(function(r,n){var o=pe(),i=o.modal,s=o.authState,a=o.wallets,c=o.config,u=o.user,l=o.stellar,f=o.setSendTransaction;if(s.isAuthenticated&&l&&u)if(i.isOpen)n(new Error("Blux modal is open somewhere."));else{var d=l.activeNetwork;if(t&&t.network&&(d=t.network),Xu(e,d)){var h=a.find(function(e){return e.name===u.authValue});if(!h)throw new Error("Could not find the connected wallet.");f({xdr:e,wallet:h,rejecter:n,resolver:r,result:void 0,options:t||{network:d}},c.showWalletUIs),c.showWalletUIs||$u(h,e,u.address,d,c.transports||{}).then(function(e){r(e)}).catch(function(e){n(e)})}else n("Invalid XDR")}else n(new Error("User is not authenticated."))})},tl={login:function(){return d(void 0,void 0,void 0,function(){var e,t,r,n,o,i;return h(this,function(s){if(e=pe(),t=e.authState,r=e.openModal,n=e.modal,o=t.isReady,i=t.isAuthenticated,!o)throw new Error("Cannot connect when isReady is false.");if(i)throw new Error("Already connected.");return n.isOpen||r(se.ONBOARDING),[2]})})},logout:function(){(0,pe().logoutAction)()},profile:function(){var e=pe(),t=e.openModal,r=e.authState,n=e.modal;if(!r.isAuthenticated)throw new Error("User is not authenticated.");n.isOpen||t(se.PROFILE)},signMessage:function(e,t){return new Promise(function(r,n){var o=pe(),i=o.modal,s=o.authState,a=o.wallets,c=o.config,u=o.user,l=o.stellar,f=o.setSignMessage;if(s.isAuthenticated&&l&&u)if(i.isOpen)n(new Error("Blux modal is open somewhere."));else{var d=l.activeNetwork;t&&t.network&&(d=t.network);var h=a.find(function(e){return e.name===u.authValue});if(!h)throw new Error("Could not find the connected wallet.");f({message:e,wallet:h,options:t||{network:d},rejecter:n,resolver:r,result:void 0},c.showWalletUIs),c.showWalletUIs||Gu(h,e,u.address,d).then(function(e){r(e)}).catch(function(e){n(e)})}else n(new Error("User is not authenticated."))})},sendTransaction:el,get isReady(){return pe().authState.isReady},get isAuthenticated(){return pe().authState.isAuthenticated},get user(){return pe().user}},rl=pe().setAppearance,nl={exports:{}},ol={},il={exports:{}},sl={};function al(){return Ju||(Ju=1,il.exports=(Yu||(Yu=1,function(e){function t(e,t){var r=e.length;e.push(t);e:for(;0<r;){var n=r-1>>>1,i=e[n];if(!(0<o(i,t)))break e;e[n]=t,e[r]=i,r=n}}function r(e){return 0===e.length?null:e[0]}function n(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length,s=i>>>1;n<s;){var a=2*(n+1)-1,c=e[a],u=a+1,l=e[u];if(0>o(c,r))u<i&&0>o(l,c)?(e[n]=l,e[u]=r,n=u):(e[n]=c,e[a]=r,n=a);else{if(!(u<i&&0>o(l,r)))break e;e[n]=l,e[u]=r,n=u}}}return t}function o(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var c=[],u=[],l=1,f=null,d=3,h=!1,p=!1,y=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var o=r(u);null!==o;){if(null===o.callback)n(u);else{if(!(o.startTime<=e))break;n(u),o.sortIndex=o.expirationTime,t(c,o)}o=r(u)}}function x(e){if(y=!1,w(e),!p)if(null!==r(c))p=!0,E||(E=!0,S());else{var t=r(u);null!==t&&P(x,t.startTime-e)}}var S,E=!1,A=-1,k=5,O=-1;function T(){return!(!g&&e.unstable_now()-O<k)}function C(){if(g=!1,E){var t=e.unstable_now();O=t;var o=!0;try{e:{p=!1,y&&(y=!1,b(A),A=-1),h=!0;var i=d;try{t:{for(w(t),f=r(c);null!==f&&!(f.expirationTime>t&&T());){var s=f.callback;if("function"==typeof s){f.callback=null,d=f.priorityLevel;var a=s(f.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof a){f.callback=a,w(t),o=!0;break t}f===r(c)&&n(c),w(t)}else n(c);f=r(c)}if(null!==f)o=!0;else{var l=r(u);null!==l&&P(x,l.startTime-t),o=!1}}break e}finally{f=null,d=i,h=!1}o=void 0}}finally{o?S():E=!1}}}if("function"==typeof v)S=function(){v(C)};else if("undefined"!=typeof MessageChannel){var I=new MessageChannel,_=I.port2;I.port1.onmessage=C,S=function(){_.postMessage(null)}}else S=function(){m(C,0)};function P(t,r){A=m(function(){t(e.unstable_now())},r)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_next=function(e){switch(d){case 1:case 2:case 3:var t=3;break;default:t=d}var r=d;d=t;try{return e()}finally{d=r}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=d;d=e;try{return t()}finally{d=r}},e.unstable_scheduleCallback=function(n,o,i){var s=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?s+i:s,n){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return n={id:l++,callback:o,priorityLevel:n,startTime:i,expirationTime:a=i+a,sortIndex:-1},i>s?(n.sortIndex=i,t(u,n),null===r(c)&&n===r(u)&&(y?(b(A),A=-1):y=!0,P(x,i-s))):(n.sortIndex=a,t(c,n),p||h||(p=!0,E||(E=!0,S()))),n},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=d;return function(){var r=d;d=t;try{return e.apply(this,arguments)}finally{d=r}}}}(sl)),sl)),il.exports}var cl,ul,ll,fl,dl={exports:{}},hl={};function pl(){if(cl)return hl;cl=1;var e=Z();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return hl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,hl.createPortal=function(e,r){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!r||1!==r.nodeType&&9!==r.nodeType&&11!==r.nodeType)throw Error(t(299));return function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:o,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}(e,r,null,n)},hl.flushSync=function(e){var t=i.T,r=n.p;try{if(i.T=null,n.p=2,e)return e()}finally{i.T=t,n.p=r,n.d.f()}},hl.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,n.d.C(e,t))},hl.prefetchDNS=function(e){"string"==typeof e&&n.d.D(e)},hl.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var r=t.as,o=s(r,t.crossOrigin),i="string"==typeof t.integrity?t.integrity:void 0,a="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===r?n.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:o,integrity:i,fetchPriority:a}):"script"===r&&n.d.X(e,{crossOrigin:o,integrity:i,fetchPriority:a,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},hl.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var r=s(t.as,t.crossOrigin);n.d.M(e,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&n.d.M(e)},hl.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var r=t.as,o=s(r,t.crossOrigin);n.d.L(e,r,{crossOrigin:o,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},hl.preloadModule=function(e,t){if("string"==typeof e)if(t){var r=s(t.as,t.crossOrigin);n.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else n.d.m(e)},hl.requestFormReset=function(e){n.d.r(e)},hl.unstable_batchedUpdates=function(e,t){return e(t)},hl.useFormState=function(e,t,r){return i.H.useFormState(e,t,r)},hl.useFormStatus=function(){return i.H.useHostTransitionStatus()},hl.version="19.1.1",hl}function yl(){if(ll)return ol;ll=1;var e=al(),t=Z(),r=(ul||(ul=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),dl.exports=pl()),dl.exports);function n(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function i(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function s(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function a(e){if(i(e)!==e)throw Error(n(188))}function c(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=c(e)))return t;e=e.sibling}return null}var u=Object.assign,l=Symbol.for("react.element"),f=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),m=Symbol.for("react.consumer"),b=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),k=Symbol.for("react.memo_cache_sentinel"),O=Symbol.iterator;function T(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var C=Symbol.for("react.client.reference");function I(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===C?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case h:return"Fragment";case y:return"Profiler";case p:return"StrictMode";case w:return"Suspense";case x:return"SuspenseList";case A:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case d:return"Portal";case b:return(e.displayName||"Context")+".Provider";case m:return(e._context.displayName||"Context")+".Consumer";case v:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case S:return null!==(t=e.displayName||null)?t:I(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return I(e(t))}catch(e){}}return null}var _=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N={pending:!1,data:null,method:null,action:null},B=[],j=-1;function M(e){return{current:e}}function L(e){0>j||(e.current=B[j],B[j]=null,j--)}function U(e,t){j++,B[j]=e.current,e.current=t}var D=M(null),F=M(null),z=M(null),q=M(null);function V(e,t){switch(U(z,t),U(F,e),U(D,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?lf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=ff(t=lf(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(D),U(D,e)}function H(){L(D),L(F),L(z)}function K(e){null!==e.memoizedState&&U(q,e);var t=D.current,r=ff(t,e.type);t!==r&&(U(F,e),U(D,r))}function W(e){F.current===e&&(L(D),L(F)),q.current===e&&(L(q),ed._currentValue=N)}var G=Object.prototype.hasOwnProperty,X=e.unstable_scheduleCallback,Q=e.unstable_cancelCallback,Y=e.unstable_shouldYield,J=e.unstable_requestPaint,$=e.unstable_now,ee=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,re=e.unstable_UserBlockingPriority,ne=e.unstable_NormalPriority,oe=e.unstable_LowPriority,ie=e.unstable_IdlePriority,se=e.log,ae=e.unstable_setDisableYieldValue,ce=null,ue=null;function le(e){if("function"==typeof se&&ae(e),ue&&"function"==typeof ue.setStrictMode)try{ue.setStrictMode(ce,e)}catch(e){}}var fe=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(de(e)/he|0)|0},de=Math.log,he=Math.LN2;var pe=256,ye=4194304;function ge(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194048&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function me(e,t,r){var n=e.pendingLanes;if(0===n)return 0;var o=0,i=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var a=134217727&n;return 0!==a?0!==(n=a&~i)?o=ge(n):0!==(s&=a)?o=ge(s):r||0!==(r=a&~e)&&(o=ge(r)):0!==(a=n&~i)?o=ge(a):0!==s?o=ge(s):r||0!==(r=n&~e)&&(o=ge(r)),0===o?0:0!==t&&t!==o&&0===(t&i)&&((i=o&-o)>=(r=t&-t)||32===i&&4194048&r)?t:o}function be(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function ve(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=pe;return!(4194048&(pe<<=1))&&(pe=256),e}function xe(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Se(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ee(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ae(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-fe(t);e.entangledLanes|=t,e.entanglements[n]=1073741824|e.entanglements[n]|4194090&r}function ke(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-fe(r),o=1<<n;o&t|e[n]&t&&(e[n]|=t),r&=~o}}function Oe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Te(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function Ce(){var e=R.p;return 0!==e?e:void 0===(e=window.event)?32:yd(e.type)}var Ie=Math.random().toString(36).slice(2),_e="__reactFiber$"+Ie,Pe="__reactProps$"+Ie,Re="__reactContainer$"+Ie,Ne="__reactEvents$"+Ie,Be="__reactListeners$"+Ie,je="__reactHandles$"+Ie,Me="__reactResources$"+Ie,Le="__reactMarker$"+Ie;function Ue(e){delete e[_e],delete e[Pe],delete e[Ne],delete e[Be],delete e[je]}function De(e){var t=e[_e];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Re]||r[_e]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=kf(e);null!==e;){if(r=e[_e])return r;e=kf(e)}return t}r=(e=r).parentNode}return null}function Fe(e){if(e=e[_e]||e[Re]){var t=e.tag;if(5===t||6===t||13===t||26===t||27===t||3===t)return e}return null}function ze(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(n(33))}function qe(e){var t=e[Me];return t||(t=e[Me]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ve(e){e[Le]=!0}var He=new Set,Ke={};function We(e,t){Ge(e,t),Ge(e+"Capture",t)}function Ge(e,t){for(Ke[e]=t,e=0;e<t.length;e++)He.add(t[e])}var Xe,Ze,Qe=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ye={},Je={};function $e(e,t,r){if(o=t,G.call(Je,o)||!G.call(Ye,o)&&(Qe.test(o)?Je[o]=!0:(Ye[o]=!0,0)))if(null===r)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var n=t.toLowerCase().slice(0,5);if("data-"!==n&&"aria-"!==n)return void e.removeAttribute(t)}e.setAttribute(t,""+r)}var o}function et(e,t,r){if(null===r)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+r)}}function tt(e,t,r,n){if(null===n)e.removeAttribute(r);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(r)}e.setAttributeNS(t,r,""+n)}}function rt(e){if(void 0===Xe)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Xe=t&&t[1]||"",Ze=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+Xe+e+Ze}var nt=!1;function ot(e,t){if(!e||nt)return"";nt=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var r=function(){throw Error()};if(Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(r,[])}catch(e){var n=e}Reflect.construct(e,[],r)}else{try{r.call()}catch(e){n=e}e.call(r.prototype)}}else{try{throw Error()}catch(e){n=e}(r=e())&&"function"==typeof r.catch&&r.catch(function(){})}}catch(e){if(e&&n&&"string"==typeof e.stack)return[e.stack,n.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),s=i[0],a=i[1];if(s&&a){var c=s.split("\n"),u=a.split("\n");for(o=n=0;n<c.length&&!c[n].includes("DetermineComponentFrameRoot");)n++;for(;o<u.length&&!u[o].includes("DetermineComponentFrameRoot");)o++;if(n===c.length||o===u.length)for(n=c.length-1,o=u.length-1;1<=n&&0<=o&&c[n]!==u[o];)o--;for(;1<=n&&0<=o;n--,o--)if(c[n]!==u[o]){if(1!==n||1!==o)do{if(n--,0>--o||c[n]!==u[o]){var l="\n"+c[n].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=n&&0<=o);break}}}finally{nt=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?rt(r):""}function it(e){switch(e.tag){case 26:case 27:case 5:return rt(e.type);case 16:return rt("Lazy");case 13:return rt("Suspense");case 19:return rt("SuspenseList");case 0:case 15:return ot(e.type,!1);case 11:return ot(e.type.render,!1);case 1:return ot(e.type,!0);case 31:return rt("Activity");default:return""}}function st(e){try{var t="";do{t+=it(e),e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}function at(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ct(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ut(e){e._valueTracker||(e._valueTracker=function(e){var t=ct(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){n=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=ct(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function ft(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var dt=/[\n"\\]/g;function ht(e){return e.replace(dt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function pt(e,t,r,n,o,i,s,a){e.name="",null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?e.type=s:e.removeAttribute("type"),null!=t?"number"===s?(0===t&&""===e.value||e.value!=t)&&(e.value=""+at(t)):e.value!==""+at(t)&&(e.value=""+at(t)):"submit"!==s&&"reset"!==s||e.removeAttribute("value"),null!=t?gt(e,s,at(t)):null!=r?gt(e,s,at(r)):null!=n&&e.removeAttribute("value"),null==o&&null!=i&&(e.defaultChecked=!!i),null!=o&&(e.checked=o&&"function"!=typeof o&&"symbol"!=typeof o),null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a?e.name=""+at(a):e.removeAttribute("name")}function yt(e,t,r,n,o,i,s,a){if(null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i&&(e.type=i),null!=t||null!=r){if(("submit"===i||"reset"===i)&&null==t)return;r=null!=r?""+at(r):"",t=null!=t?""+at(t):r,a||t===e.value||(e.value=t),e.defaultValue=t}n="function"!=typeof(n=null!=n?n:o)&&"symbol"!=typeof n&&!!n,e.checked=a?e.checked:!!n,e.defaultChecked=!!n,null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s&&(e.name=s)}function gt(e,t,r){"number"===t&&ft(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function mt(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o<r.length;o++)t["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=t.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&n&&(e[r].defaultSelected=!0)}else{for(r=""+at(r),t=null,o=0;o<e.length;o++){if(e[o].value===r)return e[o].selected=!0,void(n&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function bt(e,t,r){null==t||((t=""+at(t))!==e.value&&(e.value=t),null!=r)?e.defaultValue=null!=r?""+at(r):"":e.defaultValue!==t&&(e.defaultValue=t)}function vt(e,t,r,o){if(null==t){if(null!=o){if(null!=r)throw Error(n(92));if(_(o)){if(1<o.length)throw Error(n(93));o=o[0]}r=o}null==r&&(r=""),t=r}r=at(t),e.defaultValue=r,(o=e.textContent)===r&&""!==o&&null!==o&&(e.value=o)}function wt(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var xt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function St(e,t,r){var n=0===t.indexOf("--");null==r||"boolean"==typeof r||""===r?n?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":n?e.setProperty(t,r):"number"!=typeof r||0===r||xt.has(t)?"float"===t?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Et(e,t,r){if(null!=t&&"object"!=typeof t)throw Error(n(62));if(e=e.style,null!=r){for(var o in r)!r.hasOwnProperty(o)||null!=t&&t.hasOwnProperty(o)||(0===o.indexOf("--")?e.setProperty(o,""):"float"===o?e.cssFloat="":e[o]="");for(var i in t)o=t[i],t.hasOwnProperty(i)&&r[i]!==o&&St(e,i,o)}else for(var s in t)t.hasOwnProperty(s)&&St(e,s,t[s])}function At(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kt=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ot=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Tt(e){return Ot.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Ct=null;function It(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var _t=null,Pt=null;function Rt(e){var t=Fe(e);if(t&&(e=t.stateNode)){var r=e[Pe]||null;e:switch(e=t.stateNode,t.type){case"input":if(pt(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+ht(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var o=r[t];if(o!==e&&o.form===e.form){var i=o[Pe]||null;if(!i)throw Error(n(90));pt(o,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<r.length;t++)(o=r[t]).form===e.form&&lt(o)}break e;case"textarea":bt(e,r.value,r.defaultValue);break e;case"select":null!=(t=r.value)&&mt(e,!!r.multiple,t,!1)}}}var Nt=!1;function Bt(e,t,r){if(Nt)return e(t,r);Nt=!0;try{return e(t)}finally{if(Nt=!1,(null!==_t||null!==Pt)&&(Fu(),_t&&(t=_t,e=Pt,Pt=_t=null,Rt(t),e)))for(t=0;t<e.length;t++)Rt(e[t])}}function jt(e,t){var r=e.stateNode;if(null===r)return null;var o=r[Pe]||null;if(null===o)return null;r=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(n(231,t,typeof r));return r}var Mt=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Lt=!1;if(Mt)try{var Ut={};Object.defineProperty(Ut,"passive",{get:function(){Lt=!0}}),window.addEventListener("test",Ut,Ut),window.removeEventListener("test",Ut,Ut)}catch(e){Lt=!1}var Dt=null,Ft=null,zt=null;function qt(){if(zt)return zt;var e,t,r=Ft,n=r.length,o="value"in Dt?Dt.value:Dt.textContent,i=o.length;for(e=0;e<n&&r[e]===o[e];e++);var s=n-e;for(t=1;t<=s&&r[n-t]===o[i-t];t++);return zt=o.slice(e,1<t?1-t:void 0)}function Vt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Ht(){return!0}function Kt(){return!1}function Wt(e){function t(t,r,n,o,i){for(var s in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(o):o[s]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?Ht:Kt,this.isPropagationStopped=Kt,this}return u(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Ht)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Ht)},persist:function(){},isPersistent:Ht}),t}var Gt,Xt,Zt,Qt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yt=Wt(Qt),Jt=u({},Qt,{view:0,detail:0}),$t=Wt(Jt),er=u({},Jt,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Zt&&(Zt&&"mousemove"===e.type?(Gt=e.screenX-Zt.screenX,Xt=e.screenY-Zt.screenY):Xt=Gt=0,Zt=e),Gt)},movementY:function(e){return"movementY"in e?e.movementY:Xt}}),tr=Wt(er),rr=Wt(u({},er,{dataTransfer:0})),nr=Wt(u({},Jt,{relatedTarget:0})),or=Wt(u({},Qt,{animationName:0,elapsedTime:0,pseudoElement:0})),ir=Wt(u({},Qt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),sr=Wt(u({},Qt,{data:0})),ar={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ur={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=ur[e])&&!!t[e]}function fr(){return lr}var dr=u({},Jt,{key:function(e){if(e.key){var t=ar[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Vt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?cr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fr,charCode:function(e){return"keypress"===e.type?Vt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Vt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),hr=Wt(dr),pr=Wt(u({},er,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),yr=Wt(u({},Jt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fr})),gr=Wt(u({},Qt,{propertyName:0,elapsedTime:0,pseudoElement:0})),mr=Wt(u({},er,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),br=Wt(u({},Qt,{newState:0,oldState:0})),vr=[9,13,27,32],wr=Mt&&"CompositionEvent"in window,xr=null;Mt&&"documentMode"in document&&(xr=document.documentMode);var Sr=Mt&&"TextEvent"in window&&!xr,Er=Mt&&(!wr||xr&&8<xr&&11>=xr),Ar=String.fromCharCode(32),kr=!1;function Or(e,t){switch(e){case"keyup":return-1!==vr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tr(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Cr=!1;var Ir={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ir[e.type]:"textarea"===t}function Pr(e,t,r,n){_t?Pt?Pt.push(n):Pt=[n]:_t=n,0<(t=Zl(t,"onChange")).length&&(r=new Yt("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Rr=null,Nr=null;function Br(e){zl(e,0)}function jr(e){if(lt(ze(e)))return e}function Mr(e,t){if("change"===e)return t}var Lr=!1;if(Mt){var Ur;if(Mt){var Dr="oninput"in document;if(!Dr){var Fr=document.createElement("div");Fr.setAttribute("oninput","return;"),Dr="function"==typeof Fr.oninput}Ur=Dr}else Ur=!1;Lr=Ur&&(!document.documentMode||9<document.documentMode)}function zr(){Rr&&(Rr.detachEvent("onpropertychange",qr),Nr=Rr=null)}function qr(e){if("value"===e.propertyName&&jr(Nr)){var t=[];Pr(t,Nr,e,It(e)),Bt(Br,t)}}function Vr(e,t,r){"focusin"===e?(zr(),Nr=r,(Rr=t).attachEvent("onpropertychange",qr)):"focusout"===e&&zr()}function Hr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return jr(Nr)}function Kr(e,t){if("click"===e)return jr(t)}function Wr(e,t){if("input"===e||"change"===e)return jr(t)}var Gr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function Xr(e,t){if(Gr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var o=r[n];if(!G.call(t,o)||!Gr(e[o],t[o]))return!1}return!0}function Zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qr(e,t){var r,n=Zr(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Zr(n)}}function Yr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Yr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Jr(e){for(var t=ft((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=ft((e=t.contentWindow).document)}return t}function $r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var en=Mt&&"documentMode"in document&&11>=document.documentMode,tn=null,rn=null,nn=null,on=!1;function sn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;on||null==tn||tn!==ft(n)||("selectionStart"in(n=tn)&&$r(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},nn&&Xr(nn,n)||(nn=n,0<(n=Zl(rn,"onSelect")).length&&(t=new Yt("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=tn)))}function an(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var cn={animationend:an("Animation","AnimationEnd"),animationiteration:an("Animation","AnimationIteration"),animationstart:an("Animation","AnimationStart"),transitionrun:an("Transition","TransitionRun"),transitionstart:an("Transition","TransitionStart"),transitioncancel:an("Transition","TransitionCancel"),transitionend:an("Transition","TransitionEnd")},un={},ln={};function fn(e){if(un[e])return un[e];if(!cn[e])return e;var t,r=cn[e];for(t in r)if(r.hasOwnProperty(t)&&t in ln)return un[e]=r[t];return e}Mt&&(ln=document.createElement("div").style,"AnimationEvent"in window||(delete cn.animationend.animation,delete cn.animationiteration.animation,delete cn.animationstart.animation),"TransitionEvent"in window||delete cn.transitionend.transition);var dn=fn("animationend"),hn=fn("animationiteration"),pn=fn("animationstart"),yn=fn("transitionrun"),gn=fn("transitionstart"),mn=fn("transitioncancel"),bn=fn("transitionend"),vn=new Map,wn="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xn(e,t){vn.set(e,t),We(t,[e])}wn.push("scrollEnd");var Sn=new WeakMap;function En(e,t){if("object"==typeof e&&null!==e){var r=Sn.get(e);return void 0!==r?r:(t={value:e,source:t,stack:st(t)},Sn.set(e,t),t)}return{value:e,source:t,stack:st(t)}}var An=[],kn=0,On=0;function Tn(){for(var e=kn,t=On=kn=0;t<e;){var r=An[t];An[t++]=null;var n=An[t];An[t++]=null;var o=An[t];An[t++]=null;var i=An[t];if(An[t++]=null,null!==n&&null!==o){var s=n.pending;null===s?o.next=o:(o.next=s.next,s.next=o),n.pending=o}0!==i&&Pn(r,o,i)}}function Cn(e,t,r,n){An[kn++]=e,An[kn++]=t,An[kn++]=r,An[kn++]=n,On|=n,e.lanes|=n,null!==(e=e.alternate)&&(e.lanes|=n)}function In(e,t,r,n){return Cn(e,t,r,n),Rn(e)}function _n(e,t){return Cn(e,null,null,t),Rn(e)}function Pn(e,t,r){e.lanes|=r;var n=e.alternate;null!==n&&(n.lanes|=r);for(var o=!1,i=e.return;null!==i;)i.childLanes|=r,null!==(n=i.alternate)&&(n.childLanes|=r),22===i.tag&&(null===(e=i.stateNode)||1&e._visibility||(o=!0)),e=i,i=i.return;return 3===e.tag?(i=e.stateNode,o&&null!==t&&(o=31-fe(r),null===(n=(e=i.hiddenUpdates)[o])?e[o]=[t]:n.push(t),t.lane=536870912|r),i):null}function Rn(e){if(50<Pu)throw Pu=0,Ru=null,Error(n(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Nn={};function Bn(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(e,t,r,n){return new Bn(e,t,r,n)}function Mn(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Ln(e,t){var r=e.alternate;return null===r?((r=jn(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=65011712&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Un(e,t){e.flags&=65011714;var r=e.alternate;return null===r?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Dn(e,t,r,o,i,s){var a=0;if(o=e,"function"==typeof e)Mn(e)&&(a=1);else if("string"==typeof e)a=function(e,t,r){if(1===r||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,r,D.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case A:return(e=jn(31,r,t,i)).elementType=A,e.lanes=s,e;case h:return Fn(r.children,i,s,t);case p:a=8,i|=24;break;case y:return(e=jn(12,r,t,2|i)).elementType=y,e.lanes=s,e;case w:return(e=jn(13,r,t,i)).elementType=w,e.lanes=s,e;case x:return(e=jn(19,r,t,i)).elementType=x,e.lanes=s,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case g:case b:a=10;break e;case m:a=9;break e;case v:a=11;break e;case S:a=14;break e;case E:a=16,o=null;break e}a=29,r=Error(n(130,null===e?"null":typeof e,"")),o=null}return(t=jn(a,r,t,i)).elementType=e,t.type=o,t.lanes=s,t}function Fn(e,t,r,n){return(e=jn(7,e,n,t)).lanes=r,e}function zn(e,t,r){return(e=jn(6,e,null,t)).lanes=r,e}function qn(e,t,r){return(t=jn(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vn=[],Hn=0,Kn=null,Wn=0,Gn=[],Xn=0,Zn=null,Qn=1,Yn="";function Jn(e,t){Vn[Hn++]=Wn,Vn[Hn++]=Kn,Kn=e,Wn=t}function $n(e,t,r){Gn[Xn++]=Qn,Gn[Xn++]=Yn,Gn[Xn++]=Zn,Zn=e;var n=Qn;e=Yn;var o=32-fe(n)-1;n&=~(1<<o),r+=1;var i=32-fe(t)+o;if(30<i){var s=o-o%5;i=(n&(1<<s)-1).toString(32),n>>=s,o-=s,Qn=1<<32-fe(t)+o|r<<o|n,Yn=i+e}else Qn=1<<i|r<<o|n,Yn=e}function eo(e){null!==e.return&&(Jn(e,1),$n(e,1,0))}function to(e){for(;e===Kn;)Kn=Vn[--Hn],Vn[Hn]=null,Wn=Vn[--Hn],Vn[Hn]=null;for(;e===Zn;)Zn=Gn[--Xn],Gn[Xn]=null,Yn=Gn[--Xn],Gn[Xn]=null,Qn=Gn[--Xn],Gn[Xn]=null}var ro=null,no=null,oo=!1,io=null,so=!1,ao=Error(n(519));function co(e){throw yo(En(Error(n(418,"")),e)),ao}function uo(e){var t=e.stateNode,r=e.type,n=e.memoizedProps;switch(t[_e]=e,t[Pe]=n,r){case"dialog":ql("cancel",t),ql("close",t);break;case"iframe":case"object":case"embed":ql("load",t);break;case"video":case"audio":for(r=0;r<Dl.length;r++)ql(Dl[r],t);break;case"source":ql("error",t);break;case"img":case"image":case"link":ql("error",t),ql("load",t);break;case"details":ql("toggle",t);break;case"input":ql("invalid",t),yt(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),ut(t);break;case"select":ql("invalid",t);break;case"textarea":ql("invalid",t),vt(t,n.value,n.defaultValue,n.children),ut(t)}"string"!=typeof(r=n.children)&&"number"!=typeof r&&"bigint"!=typeof r||t.textContent===""+r||!0===n.suppressHydrationWarning||tf(t.textContent,r)?(null!=n.popover&&(ql("beforetoggle",t),ql("toggle",t)),null!=n.onScroll&&ql("scroll",t),null!=n.onScrollEnd&&ql("scrollend",t),null!=n.onClick&&(t.onclick=rf),t=!0):t=!1,t||co(e)}function lo(e){for(ro=e.return;ro;)switch(ro.tag){case 5:case 13:return void(so=!1);case 27:case 3:return void(so=!0);default:ro=ro.return}}function fo(e){if(e!==ro)return!1;if(!oo)return lo(e),oo=!0,!1;var t,r=e.tag;if((t=3!==r&&27!==r)&&((t=5===r)&&(t=!("form"!==(t=e.type)&&"button"!==t)||df(e.type,e.memoizedProps)),t=!t),t&&no&&co(e),lo(e),13===r){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(n(317));e:{for(e=e.nextSibling,r=0;e;){if(8===e.nodeType)if("/$"===(t=e.data)){if(0===r){no=Ef(e.nextSibling);break e}r--}else"$"!==t&&"$!"!==t&&"$?"!==t||r++;e=e.nextSibling}no=null}}else 27===r?(r=no,vf(e.type)?(e=Af,Af=null,no=e):no=r):no=ro?Ef(e.stateNode.nextSibling):null;return!0}function ho(){no=ro=null,oo=!1}function po(){var e=io;return null!==e&&(null===bu?bu=e:bu.push.apply(bu,e),io=null),e}function yo(e){null===io?io=[e]:io.push(e)}var go=M(null),mo=null,bo=null;function vo(e,t,r){U(go,t._currentValue),t._currentValue=r}function wo(e){e._currentValue=go.current,L(go)}function xo(e,t,r){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function So(e,t,r,o){var i=e.child;for(null!==i&&(i.return=e);null!==i;){var s=i.dependencies;if(null!==s){var a=i.child;s=s.firstContext;e:for(;null!==s;){var c=s;s=i;for(var u=0;u<t.length;u++)if(c.context===t[u]){s.lanes|=r,null!==(c=s.alternate)&&(c.lanes|=r),xo(s.return,r,e),o||(a=null);break e}s=c.next}}else if(18===i.tag){if(null===(a=i.return))throw Error(n(341));a.lanes|=r,null!==(s=a.alternate)&&(s.lanes|=r),xo(a,r,e),a=null}else a=i.child;if(null!==a)a.return=i;else for(a=i;null!==a;){if(a===e){a=null;break}if(null!==(i=a.sibling)){i.return=a.return,a=i;break}a=a.return}i=a}}function Eo(e,t,r,o){e=null;for(var i=t,s=!1;null!==i;){if(!s)if(524288&i.flags)s=!0;else if(262144&i.flags)break;if(10===i.tag){var a=i.alternate;if(null===a)throw Error(n(387));if(null!==(a=a.memoizedProps)){var c=i.type;Gr(i.pendingProps.value,a.value)||(null!==e?e.push(c):e=[c])}}else if(i===q.current){if(null===(a=i.alternate))throw Error(n(387));a.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(null!==e?e.push(ed):e=[ed])}i=i.return}null!==e&&So(t,e,r,o),t.flags|=262144}function Ao(e){for(e=e.firstContext;null!==e;){if(!Gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ko(e){mo=e,bo=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Oo(e){return Co(mo,e)}function To(e,t){return null===mo&&ko(e),Co(e,t)}function Co(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},null===bo){if(null===e)throw Error(n(308));bo=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else bo=bo.next=t;return r}var Io="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},_o=e.unstable_scheduleCallback,Po=e.unstable_NormalPriority,Ro={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function No(){return{controller:new Io,data:new Map,refCount:0}}function Bo(e){e.refCount--,0===e.refCount&&_o(Po,function(){e.controller.abort()})}var jo=null,Mo=0,Lo=0,Uo=null;function Do(){if(0===--Mo&&null!==jo){null!==Uo&&(Uo.status="fulfilled");var e=jo;jo=null,Lo=0,Uo=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Fo=P.S;P.S=function(e,t){"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===jo){var r=jo=[];Mo=0,Lo=Bl(),Uo={status:"pending",value:void 0,then:function(e){r.push(e)}}}Mo++,t.then(Do,Do)}(0,t),null!==Fo&&Fo(e,t)};var zo=M(null);function qo(){var e=zo.current;return null!==e?e:ru.pooledCache}function Vo(e,t){U(zo,null===t?zo.current:t.pool)}function Ho(){var e=qo();return null===e?null:{parent:Ro._currentValue,pool:e}}var Ko=Error(n(460)),Wo=Error(n(474)),Go=Error(n(542)),Xo={then:function(){}};function Zo(e){return"fulfilled"===(e=e.status)||"rejected"===e}function Qo(){}function Yo(e,t,r){switch(void 0===(r=e[r])?e.push(t):r!==t&&(t.then(Qo,Qo),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw ei(e=t.reason),e;default:if("string"==typeof t.status)t.then(Qo,Qo);else{if(null!==(e=ru)&&100<e.shellSuspendCounter)throw Error(n(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var r=t;r.status="fulfilled",r.value=e}},function(e){if("pending"===t.status){var r=t;r.status="rejected",r.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw ei(e=t.reason),e}throw Jo=t,Ko}}var Jo=null;function $o(){if(null===Jo)throw Error(n(459));var e=Jo;return Jo=null,e}function ei(e){if(e===Ko||e===Go)throw Error(n(483))}var ti=!1;function ri(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ni(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function oi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ii(e,t,r){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,2&tu){var o=n.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),n.pending=t,t=Rn(e),Pn(e,null,r),t}return Cn(e,n,t,r),Rn(e)}function si(e,t,r){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,ke(e,r)}}function ai(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var o=null,i=null;if(null!==(r=r.firstBaseUpdate)){do{var s={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};null===i?o=i=s:i=i.next=s,r=r.next}while(null!==r);null===i?o=i=t:i=i.next=t}else o=i=t;return r={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var ci=!1;function ui(){if(ci){if(null!==Uo)throw Uo}}function li(e,t,r,n){ci=!1;var o=e.updateQueue;ti=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(null!==a){o.shared.pending=null;var c=a,l=c.next;c.next=null,null===s?i=l:s.next=l,s=c;var f=e.alternate;null!==f&&((a=(f=f.updateQueue).lastBaseUpdate)!==s&&(null===a?f.firstBaseUpdate=l:a.next=l,f.lastBaseUpdate=c))}if(null!==i){var d=o.baseState;for(s=0,f=l=c=null,a=i;;){var h=-536870913&a.lane,p=h!==a.lane;if(p?(ou&h)===h:(n&h)===h){0!==h&&h===Lo&&(ci=!0),null!==f&&(f=f.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var y=e,g=a;h=t;var m=r;switch(g.tag){case 1:if("function"==typeof(y=g.payload)){d=y.call(m,d,h);break e}d=y;break e;case 3:y.flags=-65537&y.flags|128;case 0:if(null==(h="function"==typeof(y=g.payload)?y.call(m,d,h):y))break e;d=u({},d,h);break e;case 2:ti=!0}}null!==(h=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=o.callbacks)?o.callbacks=[h]:p.push(h))}else p={lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===f?(l=f=p,c=d):f=f.next=p,s|=h;if(null===(a=a.next)){if(null===(a=o.shared.pending))break;a=(p=a).next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}null===f&&(c=d),o.baseState=c,o.firstBaseUpdate=l,o.lastBaseUpdate=f,null===i&&(o.shared.lanes=0),du|=s,e.lanes=s,e.memoizedState=d}}function fi(e,t){if("function"!=typeof e)throw Error(n(191,e));e.call(t)}function di(e,t){var r=e.callbacks;if(null!==r)for(e.callbacks=null,e=0;e<r.length;e++)fi(r[e],t)}var hi=M(null),pi=M(0);function yi(e,t){U(pi,e=lu),U(hi,t),lu=e|t.baseLanes}function gi(){U(pi,lu),U(hi,hi.current)}function mi(){lu=pi.current,L(hi),L(pi)}var bi=0,vi=null,wi=null,xi=null,Si=!1,Ei=!1,Ai=!1,ki=0,Oi=0,Ti=null,Ci=0;function Ii(){throw Error(n(321))}function _i(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Gr(e[r],t[r]))return!1;return!0}function Pi(e,t,r,n,o,i){return bi=i,vi=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=null===e||null===e.memoizedState?Ks:Ws,Ai=!1,i=r(n,o),Ai=!1,Ei&&(i=Ni(t,r,n,o)),Ri(e),i}function Ri(e){P.H=Hs;var t=null!==wi&&null!==wi.next;if(bi=0,xi=wi=vi=null,Si=!1,Oi=0,Ti=null,t)throw Error(n(300));null===e||Oa||null!==(e=e.dependencies)&&Ao(e)&&(Oa=!0)}function Ni(e,t,r,o){vi=e;var i=0;do{if(Ei&&(Ti=null),Oi=0,Ei=!1,25<=i)throw Error(n(301));if(i+=1,xi=wi=null,null!=e.updateQueue){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,null!=s.memoCache&&(s.memoCache.index=0)}P.H=Gs,s=t(r,o)}while(Ei);return s}function Bi(){var e=P.H,t=e.useState()[0];return t="function"==typeof t.then?Fi(t):t,e=e.useState()[0],(null!==wi?wi.memoizedState:null)!==e&&(vi.flags|=1024),t}function ji(){var e=0!==ki;return ki=0,e}function Mi(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Li(e){if(Si){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Si=!1}bi=0,xi=wi=vi=null,Ei=!1,Oi=ki=0,Ti=null}function Ui(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===xi?vi.memoizedState=xi=e:xi=xi.next=e,xi}function Di(){if(null===wi){var e=vi.alternate;e=null!==e?e.memoizedState:null}else e=wi.next;var t=null===xi?vi.memoizedState:xi.next;if(null!==t)xi=t,wi=e;else{if(null===e){if(null===vi.alternate)throw Error(n(467));throw Error(n(310))}e={memoizedState:(wi=e).memoizedState,baseState:wi.baseState,baseQueue:wi.baseQueue,queue:wi.queue,next:null},null===xi?vi.memoizedState=xi=e:xi=xi.next=e}return xi}function Fi(e){var t=Oi;return Oi+=1,null===Ti&&(Ti=[]),e=Yo(Ti,e,t),t=vi,null===(null===xi?t.memoizedState:xi.next)&&(t=t.alternate,P.H=null===t||null===t.memoizedState?Ks:Ws),e}function zi(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return Fi(e);if(e.$$typeof===b)return Oo(e)}throw Error(n(438,String(e)))}function qi(e){var t=null,r=vi.updateQueue;if(null!==r&&(t=r.memoCache),null==t){var n=vi.alternate;null!==n&&(null!==(n=n.updateQueue)&&(null!=(n=n.memoCache)&&(t={data:n.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===r&&(r={lastEffect:null,events:null,stores:null,memoCache:null},vi.updateQueue=r),r.memoCache=t,void 0===(r=t.data[t.index]))for(r=t.data[t.index]=Array(e),n=0;n<e;n++)r[n]=k;return t.index++,r}function Vi(e,t){return"function"==typeof t?t(e):t}function Hi(e){return Ki(Di(),wi,e)}function Ki(e,t,r){var o=e.queue;if(null===o)throw Error(n(311));o.lastRenderedReducer=r;var i=e.baseQueue,s=o.pending;if(null!==s){if(null!==i){var a=i.next;i.next=s.next,s.next=a}t.baseQueue=i=s,o.pending=null}if(s=e.baseState,null===i)e.memoizedState=s;else{var c=a=null,u=null,l=t=i.next,f=!1;do{var d=-536870913&l.lane;if(d!==l.lane?(ou&d)===d:(bi&d)===d){var h=l.revertLane;if(0===h)null!==u&&(u=u.next={lane:0,revertLane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),d===Lo&&(f=!0);else{if((bi&h)===h){l=l.next,h===Lo&&(f=!0);continue}d={lane:0,revertLane:l.revertLane,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null},null===u?(c=u=d,a=s):u=u.next=d,vi.lanes|=h,du|=h}d=l.action,Ai&&r(s,d),s=l.hasEagerState?l.eagerState:r(s,d)}else h={lane:d,revertLane:l.revertLane,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null},null===u?(c=u=h,a=s):u=u.next=h,vi.lanes|=d,du|=d;l=l.next}while(null!==l&&l!==t);if(null===u?a=s:u.next=c,!Gr(s,e.memoizedState)&&(Oa=!0,f&&null!==(r=Uo)))throw r;e.memoizedState=s,e.baseState=a,e.baseQueue=u,o.lastRenderedState=s}return null===i&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Wi(e){var t=Di(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=r.dispatch,i=r.pending,s=t.memoizedState;if(null!==i){r.pending=null;var a=i=i.next;do{s=e(s,a.action),a=a.next}while(a!==i);Gr(s,t.memoizedState)||(Oa=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),r.lastRenderedState=s}return[s,o]}function Gi(e,t,r){var o=vi,i=Di(),s=oo;if(s){if(void 0===r)throw Error(n(407));r=r()}else r=t();var a=!Gr((wi||i).memoizedState,r);if(a&&(i.memoizedState=r,Oa=!0),i=i.queue,gs(2048,8,Qi.bind(null,o,i,e),[e]),i.getSnapshot!==t||a||null!==xi&&1&xi.memoizedState.tag){if(o.flags|=2048,hs(9,{destroy:void 0,resource:void 0},Zi.bind(null,o,i,r,t),null),null===ru)throw Error(n(349));s||124&bi||Xi(o,t,r)}return r}function Xi(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},null===(t=vi.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},vi.updateQueue=t,t.stores=[e]):null===(r=t.stores)?t.stores=[e]:r.push(e)}function Zi(e,t,r,n){t.value=r,t.getSnapshot=n,Yi(t)&&Ji(e)}function Qi(e,t,r){return r(function(){Yi(t)&&Ji(e)})}function Yi(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Gr(e,r)}catch(e){return!0}}function Ji(e){var t=_n(e,2);null!==t&&ju(t,e,2)}function $i(e){var t=Ui();if("function"==typeof e){var r=e;if(e=r(),Ai){le(!0);try{r()}finally{le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:e},t}function es(e,t,r,n){return e.baseState=r,Ki(e,wi,"function"==typeof n?n:Vi)}function ts(e,t,r,o,i){if(zs(e))throw Error(n(485));if(null!==(e=t.action)){var s={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){s.listeners.push(e)}};null!==P.T?r(!0):s.isTransition=!1,o(s),null===(r=t.pending)?(s.next=t.pending=s,rs(t,s)):(s.next=r.next,t.pending=r.next=s)}}function rs(e,t){var r=t.action,n=t.payload,o=e.state;if(t.isTransition){var i=P.T,s={};P.T=s;try{var a=r(o,n),c=P.S;null!==c&&c(s,a),ns(e,t,a)}catch(r){is(e,t,r)}finally{P.T=i}}else try{ns(e,t,i=r(o,n))}catch(r){is(e,t,r)}}function ns(e,t,r){null!==r&&"object"==typeof r&&"function"==typeof r.then?r.then(function(r){os(e,t,r)},function(r){return is(e,t,r)}):os(e,t,r)}function os(e,t,r){t.status="fulfilled",t.value=r,ss(t),e.state=r,null!==(t=e.pending)&&((r=t.next)===t?e.pending=null:(r=r.next,t.next=r,rs(e,r)))}function is(e,t,r){var n=e.pending;if(e.pending=null,null!==n){n=n.next;do{t.status="rejected",t.reason=r,ss(t),t=t.next}while(t!==n)}e.action=null}function ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function as(e,t){return t}function cs(e,t){if(oo){var r=ru.formState;if(null!==r){e:{var n=vi;if(oo){if(no){t:{for(var o=no,i=so;8!==o.nodeType;){if(!i){o=null;break t}if(null===(o=Ef(o.nextSibling))){o=null;break t}}o="F!"===(i=o.data)||"F"===i?o:null}if(o){no=Ef(o.nextSibling),n="F!"===o.data;break e}}co(n)}n=!1}n&&(t=r[0])}}return(r=Ui()).memoizedState=r.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:t},r.queue=n,r=Us.bind(null,vi,n),n.dispatch=r,n=$i(!1),i=Fs.bind(null,vi,!1,n.queue),o={state:t,dispatch:null,action:e,pending:null},(n=Ui()).queue=o,r=ts.bind(null,vi,o,i,r),o.dispatch=r,n.memoizedState=e,[t,r,!1]}function us(e){return ls(Di(),wi,e)}function ls(e,t,r){if(t=Ki(e,t,as)[0],e=Hi(Vi)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var n=Fi(t)}catch(e){if(e===Ko)throw Go;throw e}else n=t;var o=(t=Di()).queue,i=o.dispatch;return r!==t.memoizedState&&(vi.flags|=2048,hs(9,{destroy:void 0,resource:void 0},fs.bind(null,o,r),null)),[n,i,e]}function fs(e,t){e.action=t}function ds(e){var t=Di(),r=wi;if(null!==r)return ls(t,r,e);Di(),t=t.memoizedState;var n=(r=Di()).queue.dispatch;return r.memoizedState=e,[t,n,!1]}function hs(e,t,r,n){return e={tag:e,create:r,deps:n,inst:t,next:null},null===(t=vi.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},vi.updateQueue=t),null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function ps(){return Di().memoizedState}function ys(e,t,r,n){var o=Ui();n=void 0===n?null:n,vi.flags|=e,o.memoizedState=hs(1|t,{destroy:void 0,resource:void 0},r,n)}function gs(e,t,r,n){var o=Di();n=void 0===n?null:n;var i=o.memoizedState.inst;null!==wi&&null!==n&&_i(n,wi.memoizedState.deps)?o.memoizedState=hs(t,i,r,n):(vi.flags|=e,o.memoizedState=hs(1|t,i,r,n))}function ms(e,t){ys(8390656,8,e,t)}function bs(e,t){gs(2048,8,e,t)}function vs(e,t){return gs(4,2,e,t)}function ws(e,t){return gs(4,4,e,t)}function xs(e,t){if("function"==typeof t){e=e();var r=t(e);return function(){"function"==typeof r?r():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Ss(e,t,r){r=null!=r?r.concat([e]):null,gs(4,4,xs.bind(null,t,e),r)}function Es(){}function As(e,t){var r=Di();t=void 0===t?null:t;var n=r.memoizedState;return null!==t&&_i(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function ks(e,t){var r=Di();t=void 0===t?null:t;var n=r.memoizedState;if(null!==t&&_i(t,n[1]))return n[0];if(n=e(),Ai){le(!0);try{e()}finally{le(!1)}}return r.memoizedState=[n,t],n}function Os(e,t,r){return void 0===r||1073741824&bi?e.memoizedState=t:(e.memoizedState=r,e=Bu(),vi.lanes|=e,du|=e,r)}function Ts(e,t,r,n){return Gr(r,t)?r:null!==hi.current?(e=Os(e,r,n),Gr(e,t)||(Oa=!0),e):42&bi?(e=Bu(),vi.lanes|=e,du|=e,t):(Oa=!0,e.memoizedState=r)}function Cs(e,t,r,n,o){var i=R.p;R.p=0!==i&&8>i?i:8;var s,a,c,u=P.T,l={};P.T=l,Fs(e,!1,t,r);try{var f=o(),d=P.S;if(null!==d&&d(l,f),null!==f&&"object"==typeof f&&"function"==typeof f.then){var h=(s=n,a=[],c={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},f.then(function(){c.status="fulfilled",c.value=s;for(var e=0;e<a.length;e++)(0,a[e])(s)},function(e){for(c.status="rejected",c.reason=e,e=0;e<a.length;e++)(0,a[e])(void 0)}),c);Ds(e,t,h,Nu())}else Ds(e,t,n,Nu())}catch(r){Ds(e,t,{then:function(){},status:"rejected",reason:r},Nu())}finally{R.p=i,P.T=u}}function Is(){}function _s(e,t,r,o){if(5!==e.tag)throw Error(n(476));var i=Ps(e).queue;Cs(e,i,t,N,null===r?Is:function(){return Rs(e),r(o)})}function Ps(e){var t=e.memoizedState;if(null!==t)return t;var r={};return(t={memoizedState:N,baseState:N,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:N},next:null}).next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:r},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function Rs(e){Ds(e,Ps(e).next.queue,{},Nu())}function Ns(){return Oo(ed)}function Bs(){return Di().memoizedState}function js(){return Di().memoizedState}function Ms(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var r=Nu(),n=ii(t,e=oi(r),r);return null!==n&&(ju(n,t,r),si(n,t,r)),t={cache:No()},void(e.payload=t)}t=t.return}}function Ls(e,t,r){var n=Nu();r={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},zs(e)?qs(t,r):null!==(r=In(e,t,r,n))&&(ju(r,e,n),Vs(r,t,n))}function Us(e,t,r){Ds(e,t,r,Nu())}function Ds(e,t,r,n){var o={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(zs(e))qs(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var s=t.lastRenderedState,a=i(s,r);if(o.hasEagerState=!0,o.eagerState=a,Gr(a,s))return Cn(e,t,o,0),null===ru&&Tn(),!1}catch(e){}if(null!==(r=In(e,t,o,n)))return ju(r,e,n),Vs(r,t,n),!0}return!1}function Fs(e,t,r,o){if(o={lane:2,revertLane:Bl(),action:o,hasEagerState:!1,eagerState:null,next:null},zs(e)){if(t)throw Error(n(479))}else null!==(t=In(e,r,o,2))&&ju(t,e,2)}function zs(e){var t=e.alternate;return e===vi||null!==t&&t===vi}function qs(e,t){Ei=Si=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Vs(e,t,r){if(4194048&r){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,ke(e,r)}}var Hs={readContext:Oo,use:zi,useCallback:Ii,useContext:Ii,useEffect:Ii,useImperativeHandle:Ii,useLayoutEffect:Ii,useInsertionEffect:Ii,useMemo:Ii,useReducer:Ii,useRef:Ii,useState:Ii,useDebugValue:Ii,useDeferredValue:Ii,useTransition:Ii,useSyncExternalStore:Ii,useId:Ii,useHostTransitionStatus:Ii,useFormState:Ii,useActionState:Ii,useOptimistic:Ii,useMemoCache:Ii,useCacheRefresh:Ii},Ks={readContext:Oo,use:zi,useCallback:function(e,t){return Ui().memoizedState=[e,void 0===t?null:t],e},useContext:Oo,useEffect:ms,useImperativeHandle:function(e,t,r){r=null!=r?r.concat([e]):null,ys(4194308,4,xs.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ys(4194308,4,e,t)},useInsertionEffect:function(e,t){ys(4,2,e,t)},useMemo:function(e,t){var r=Ui();t=void 0===t?null:t;var n=e();if(Ai){le(!0);try{e()}finally{le(!1)}}return r.memoizedState=[n,t],n},useReducer:function(e,t,r){var n=Ui();if(void 0!==r){var o=r(t);if(Ai){le(!0);try{r(t)}finally{le(!1)}}}else o=t;return n.memoizedState=n.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},n.queue=e,e=e.dispatch=Ls.bind(null,vi,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},Ui().memoizedState=e},useState:function(e){var t=(e=$i(e)).queue,r=Us.bind(null,vi,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:Es,useDeferredValue:function(e,t){return Os(Ui(),e,t)},useTransition:function(){var e=$i(!1);return e=Cs.bind(null,vi,e.queue,!0,!1),Ui().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var o=vi,i=Ui();if(oo){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===ru)throw Error(n(349));124&ou||Xi(o,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,ms(Qi.bind(null,o,s,e),[e]),o.flags|=2048,hs(9,{destroy:void 0,resource:void 0},Zi.bind(null,o,s,r,t),null),r},useId:function(){var e=Ui(),t=ru.identifierPrefix;if(oo){var r=Yn;t="«"+t+"R"+(r=(Qn&~(1<<32-fe(Qn)-1)).toString(32)+r),0<(r=ki++)&&(t+="H"+r.toString(32)),t+="»"}else t="«"+t+"r"+(r=Ci++).toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Ns,useFormState:cs,useActionState:cs,useOptimistic:function(e){var t=Ui();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=Fs.bind(null,vi,!0,r),r.dispatch=t,[e,t]},useMemoCache:qi,useCacheRefresh:function(){return Ui().memoizedState=Ms.bind(null,vi)}},Ws={readContext:Oo,use:zi,useCallback:As,useContext:Oo,useEffect:bs,useImperativeHandle:Ss,useInsertionEffect:vs,useLayoutEffect:ws,useMemo:ks,useReducer:Hi,useRef:ps,useState:function(){return Hi(Vi)},useDebugValue:Es,useDeferredValue:function(e,t){return Ts(Di(),wi.memoizedState,e,t)},useTransition:function(){var e=Hi(Vi)[0],t=Di().memoizedState;return["boolean"==typeof e?e:Fi(e),t]},useSyncExternalStore:Gi,useId:Bs,useHostTransitionStatus:Ns,useFormState:us,useActionState:us,useOptimistic:function(e,t){return es(Di(),0,e,t)},useMemoCache:qi,useCacheRefresh:js},Gs={readContext:Oo,use:zi,useCallback:As,useContext:Oo,useEffect:bs,useImperativeHandle:Ss,useInsertionEffect:vs,useLayoutEffect:ws,useMemo:ks,useReducer:Wi,useRef:ps,useState:function(){return Wi(Vi)},useDebugValue:Es,useDeferredValue:function(e,t){var r=Di();return null===wi?Os(r,e,t):Ts(r,wi.memoizedState,e,t)},useTransition:function(){var e=Wi(Vi)[0],t=Di().memoizedState;return["boolean"==typeof e?e:Fi(e),t]},useSyncExternalStore:Gi,useId:Bs,useHostTransitionStatus:Ns,useFormState:ds,useActionState:ds,useOptimistic:function(e,t){var r=Di();return null!==wi?es(r,0,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:qi,useCacheRefresh:js},Xs=null,Zs=0;function Qs(e){var t=Zs;return Zs+=1,null===Xs&&(Xs=[]),Yo(Xs,e,t)}function Ys(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function Js(e,t){if(t.$$typeof===l)throw Error(n(525));throw e=Object.prototype.toString.call(t),Error(n(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $s(e){return(0,e._init)(e._payload)}function ea(e){function t(t,r){if(e){var n=t.deletions;null===n?(t.deletions=[r],t.flags|=16):n.push(r)}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function o(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function i(e,t){return(e=Ln(e,t)).index=0,e.sibling=null,e}function s(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags|=67108866,r):n:(t.flags|=67108866,r):(t.flags|=1048576,r)}function a(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function c(e,t,r,n){return null===t||6!==t.tag?((t=zn(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function u(e,t,r,n){var o=r.type;return o===h?p(e,t,r.props.children,n,r.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===E&&$s(o)===t.type)?(Ys(t=i(t,r.props),r),t.return=e,t):(Ys(t=Dn(r.type,r.key,r.props,null,e.mode,n),r),t.return=e,t)}function l(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=qn(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function p(e,t,r,n,o){return null===t||7!==t.tag?((t=Fn(r,e.mode,n,o)).return=e,t):((t=i(t,r)).return=e,t)}function y(e,t,r){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=zn(""+t,e.mode,r)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case f:return Ys(r=Dn(t.type,t.key,t.props,null,e.mode,r),t),r.return=e,r;case d:return(t=qn(t,e.mode,r)).return=e,t;case E:return y(e,t=(0,t._init)(t._payload),r)}if(_(t)||T(t))return(t=Fn(t,e.mode,r,null)).return=e,t;if("function"==typeof t.then)return y(e,Qs(t),r);if(t.$$typeof===b)return y(e,To(e,t),r);Js(e,t)}return null}function g(e,t,r,n){var o=null!==t?t.key:null;if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return null!==o?null:c(e,t,""+r,n);if("object"==typeof r&&null!==r){switch(r.$$typeof){case f:return r.key===o?u(e,t,r,n):null;case d:return r.key===o?l(e,t,r,n):null;case E:return g(e,t,r=(o=r._init)(r._payload),n)}if(_(r)||T(r))return null!==o?null:p(e,t,r,n,null);if("function"==typeof r.then)return g(e,t,Qs(r),n);if(r.$$typeof===b)return g(e,t,To(e,r),n);Js(e,r)}return null}function m(e,t,r,n,o){if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return c(t,e=e.get(r)||null,""+n,o);if("object"==typeof n&&null!==n){switch(n.$$typeof){case f:return u(t,e=e.get(null===n.key?r:n.key)||null,n,o);case d:return l(t,e=e.get(null===n.key?r:n.key)||null,n,o);case E:return m(e,t,r,n=(0,n._init)(n._payload),o)}if(_(n)||T(n))return p(t,e=e.get(r)||null,n,o,null);if("function"==typeof n.then)return m(e,t,r,Qs(n),o);if(n.$$typeof===b)return m(e,t,r,To(t,n),o);Js(t,n)}return null}function v(c,u,l,p){if("object"==typeof l&&null!==l&&l.type===h&&null===l.key&&(l=l.props.children),"object"==typeof l&&null!==l){switch(l.$$typeof){case f:e:{for(var w=l.key;null!==u;){if(u.key===w){if((w=l.type)===h){if(7===u.tag){r(c,u.sibling),(p=i(u,l.props.children)).return=c,c=p;break e}}else if(u.elementType===w||"object"==typeof w&&null!==w&&w.$$typeof===E&&$s(w)===u.type){r(c,u.sibling),Ys(p=i(u,l.props),l),p.return=c,c=p;break e}r(c,u);break}t(c,u),u=u.sibling}l.type===h?((p=Fn(l.props.children,c.mode,p,l.key)).return=c,c=p):(Ys(p=Dn(l.type,l.key,l.props,null,c.mode,p),l),p.return=c,c=p)}return a(c);case d:e:{for(w=l.key;null!==u;){if(u.key===w){if(4===u.tag&&u.stateNode.containerInfo===l.containerInfo&&u.stateNode.implementation===l.implementation){r(c,u.sibling),(p=i(u,l.children||[])).return=c,c=p;break e}r(c,u);break}t(c,u),u=u.sibling}(p=qn(l,c.mode,p)).return=c,c=p}return a(c);case E:return v(c,u,l=(w=l._init)(l._payload),p)}if(_(l))return function(n,i,a,c){for(var u=null,l=null,f=i,d=i=0,h=null;null!==f&&d<a.length;d++){f.index>d?(h=f,f=null):h=f.sibling;var p=g(n,f,a[d],c);if(null===p){null===f&&(f=h);break}e&&f&&null===p.alternate&&t(n,f),i=s(p,i,d),null===l?u=p:l.sibling=p,l=p,f=h}if(d===a.length)return r(n,f),oo&&Jn(n,d),u;if(null===f){for(;d<a.length;d++)null!==(f=y(n,a[d],c))&&(i=s(f,i,d),null===l?u=f:l.sibling=f,l=f);return oo&&Jn(n,d),u}for(f=o(f);d<a.length;d++)null!==(h=m(f,n,d,a[d],c))&&(e&&null!==h.alternate&&f.delete(null===h.key?d:h.key),i=s(h,i,d),null===l?u=h:l.sibling=h,l=h);return e&&f.forEach(function(e){return t(n,e)}),oo&&Jn(n,d),u}(c,u,l,p);if(T(l)){if("function"!=typeof(w=T(l)))throw Error(n(150));return function(i,a,c,u){if(null==c)throw Error(n(151));for(var l=null,f=null,d=a,h=a=0,p=null,b=c.next();null!==d&&!b.done;h++,b=c.next()){d.index>h?(p=d,d=null):p=d.sibling;var v=g(i,d,b.value,u);if(null===v){null===d&&(d=p);break}e&&d&&null===v.alternate&&t(i,d),a=s(v,a,h),null===f?l=v:f.sibling=v,f=v,d=p}if(b.done)return r(i,d),oo&&Jn(i,h),l;if(null===d){for(;!b.done;h++,b=c.next())null!==(b=y(i,b.value,u))&&(a=s(b,a,h),null===f?l=b:f.sibling=b,f=b);return oo&&Jn(i,h),l}for(d=o(d);!b.done;h++,b=c.next())null!==(b=m(d,i,h,b.value,u))&&(e&&null!==b.alternate&&d.delete(null===b.key?h:b.key),a=s(b,a,h),null===f?l=b:f.sibling=b,f=b);return e&&d.forEach(function(e){return t(i,e)}),oo&&Jn(i,h),l}(c,u,l=w.call(l),p)}if("function"==typeof l.then)return v(c,u,Qs(l),p);if(l.$$typeof===b)return v(c,u,To(c,l),p);Js(c,l)}return"string"==typeof l&&""!==l||"number"==typeof l||"bigint"==typeof l?(l=""+l,null!==u&&6===u.tag?(r(c,u.sibling),(p=i(u,l)).return=c,c=p):(r(c,u),(p=zn(l,c.mode,p)).return=c,c=p),a(c)):r(c,u)}return function(e,t,r,n){try{Zs=0;var o=v(e,t,r,n);return Xs=null,o}catch(t){if(t===Ko||t===Go)throw t;var i=jn(29,t,null,e.mode);return i.lanes=n,i.return=e,i}}}var ta=ea(!0),ra=ea(!1),na=M(null),oa=null;function ia(e){var t=e.alternate;U(ua,1&ua.current),U(na,e),null===oa&&(null===t||null!==hi.current||null!==t.memoizedState)&&(oa=e)}function sa(e){if(22===e.tag){if(U(ua,ua.current),U(na,e),null===oa){var t=e.alternate;null!==t&&null!==t.memoizedState&&(oa=e)}}else aa()}function aa(){U(ua,ua.current),U(na,na.current)}function ca(e){L(na),oa===e&&(oa=null),L(ua)}var ua=M(0);function la(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||Sf(r)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function fa(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:u({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var da={enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Nu(),o=oi(n);o.payload=t,null!=r&&(o.callback=r),null!==(t=ii(e,o,n))&&(ju(t,e,n),si(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Nu(),o=oi(n);o.tag=1,o.payload=t,null!=r&&(o.callback=r),null!==(t=ii(e,o,n))&&(ju(t,e,n),si(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Nu(),n=oi(r);n.tag=2,null!=t&&(n.callback=t),null!==(t=ii(e,n,r))&&(ju(t,e,r),si(t,e,r))}};function ha(e,t,r,n,o,i,s){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,i,s):!t.prototype||!t.prototype.isPureReactComponent||(!Xr(r,n)||!Xr(o,i))}function pa(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&da.enqueueReplaceState(t,t.state,null)}function ya(e,t){var r=t;if("ref"in t)for(var n in r={},t)"ref"!==n&&(r[n]=t[n]);if(e=e.defaultProps)for(var o in r===t&&(r=u({},r)),e)void 0===r[o]&&(r[o]=e[o]);return r}var ga="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function ma(e){ga(e)}function ba(e){console.error(e)}function va(e){ga(e)}function wa(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function xa(e,t,r){try{(0,e.onCaughtError)(r.value,{componentStack:r.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Sa(e,t,r){return(r=oi(r)).tag=3,r.payload={element:null},r.callback=function(){wa(e,t)},r}function Ea(e){return(e=oi(e)).tag=3,e}function Aa(e,t,r,n){var o=r.type.getDerivedStateFromError;if("function"==typeof o){var i=n.value;e.payload=function(){return o(i)},e.callback=function(){xa(t,r,n)}}var s=r.stateNode;null!==s&&"function"==typeof s.componentDidCatch&&(e.callback=function(){xa(t,r,n),"function"!=typeof o&&(null===Eu?Eu=new Set([this]):Eu.add(this));var e=n.stack;this.componentDidCatch(n.value,{componentStack:null!==e?e:""})})}var ka=Error(n(461)),Oa=!1;function Ta(e,t,r,n){t.child=null===e?ra(t,null,r,n):ta(t,e.child,r,n)}function Ca(e,t,r,n,o){r=r.render;var i=t.ref;if("ref"in n){var s={};for(var a in n)"ref"!==a&&(s[a]=n[a])}else s=n;return ko(t),n=Pi(e,t,r,s,i,o),a=ji(),null===e||Oa?(oo&&a&&eo(t),t.flags|=1,Ta(e,t,n,o),t.child):(Mi(e,t,o),Xa(e,t,o))}function Ia(e,t,r,n,o){if(null===e){var i=r.type;return"function"!=typeof i||Mn(i)||void 0!==i.defaultProps||null!==r.compare?((e=Dn(r.type,null,n,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,_a(e,t,i,n,o))}if(i=e.child,!Za(e,o)){var s=i.memoizedProps;if((r=null!==(r=r.compare)?r:Xr)(s,n)&&e.ref===t.ref)return Xa(e,t,o)}return t.flags|=1,(e=Ln(i,n)).ref=t.ref,e.return=t,t.child=e}function _a(e,t,r,n,o){if(null!==e){var i=e.memoizedProps;if(Xr(i,n)&&e.ref===t.ref){if(Oa=!1,t.pendingProps=n=i,!Za(e,o))return t.lanes=e.lanes,Xa(e,t,o);131072&e.flags&&(Oa=!0)}}return Ba(e,t,r,n,o)}function Pa(e,t,r){var n=t.pendingProps,o=n.children,i=null!==e?e.memoizedState:null;if("hidden"===n.mode){if(128&t.flags){if(n=null!==i?i.baseLanes|r:r,null!==e){for(o=t.child=e.child,i=0;null!==o;)i=i|o.lanes|o.childLanes,o=o.sibling;t.childLanes=i&~n}else t.childLanes=0,t.child=null;return Ra(e,t,n,r)}if(!(536870912&r))return t.lanes=t.childLanes=536870912,Ra(e,t,null!==i?i.baseLanes|r:r,r);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&Vo(0,null!==i?i.cachePool:null),null!==i?yi(t,i):gi(),sa(t)}else null!==i?(Vo(0,i.cachePool),yi(t,i),aa(),t.memoizedState=null):(null!==e&&Vo(0,null),gi(),aa());return Ta(e,t,o,r),t.child}function Ra(e,t,r,n){var o=qo();return o=null===o?null:{parent:Ro._currentValue,pool:o},t.memoizedState={baseLanes:r,cachePool:o},null!==e&&Vo(0,null),gi(),sa(t),null!==e&&Eo(e,t,n,!0),null}function Na(e,t){var r=t.ref;if(null===r)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof r&&"object"!=typeof r)throw Error(n(284));null!==e&&e.ref===r||(t.flags|=4194816)}}function Ba(e,t,r,n,o){return ko(t),r=Pi(e,t,r,n,void 0,o),n=ji(),null===e||Oa?(oo&&n&&eo(t),t.flags|=1,Ta(e,t,r,o),t.child):(Mi(e,t,o),Xa(e,t,o))}function ja(e,t,r,n,o,i){return ko(t),t.updateQueue=null,r=Ni(t,n,r,o),Ri(e),n=ji(),null===e||Oa?(oo&&n&&eo(t),t.flags|=1,Ta(e,t,r,i),t.child):(Mi(e,t,i),Xa(e,t,i))}function Ma(e,t,r,n,o){if(ko(t),null===t.stateNode){var i=Nn,s=r.contextType;"object"==typeof s&&null!==s&&(i=Oo(s)),i=new r(n,i),t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,i.updater=da,t.stateNode=i,i._reactInternals=t,(i=t.stateNode).props=n,i.state=t.memoizedState,i.refs={},ri(t),s=r.contextType,i.context="object"==typeof s&&null!==s?Oo(s):Nn,i.state=t.memoizedState,"function"==typeof(s=r.getDerivedStateFromProps)&&(fa(t,r,s,n),i.state=t.memoizedState),"function"==typeof r.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(s=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),s!==i.state&&da.enqueueReplaceState(i,i.state,null),li(t,n,i,o),ui(),i.state=t.memoizedState),"function"==typeof i.componentDidMount&&(t.flags|=4194308),n=!0}else if(null===e){i=t.stateNode;var a=t.memoizedProps,c=ya(r,a);i.props=c;var u=i.context,l=r.contextType;s=Nn,"object"==typeof l&&null!==l&&(s=Oo(l));var f=r.getDerivedStateFromProps;l="function"==typeof f||"function"==typeof i.getSnapshotBeforeUpdate,a=t.pendingProps!==a,l||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(a||u!==s)&&pa(t,i,n,s),ti=!1;var d=t.memoizedState;i.state=d,li(t,n,i,o),ui(),u=t.memoizedState,a||d!==u||ti?("function"==typeof f&&(fa(t,r,f,n),u=t.memoizedState),(c=ti||ha(t,r,c,n,d,u,s))?(l||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4194308)):("function"==typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),i.props=n,i.state=u,i.context=s,n=c):("function"==typeof i.componentDidMount&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,ni(e,t),l=ya(r,s=t.memoizedProps),i.props=l,f=t.pendingProps,d=i.context,u=r.contextType,c=Nn,"object"==typeof u&&null!==u&&(c=Oo(u)),(u="function"==typeof(a=r.getDerivedStateFromProps)||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==f||d!==c)&&pa(t,i,n,c),ti=!1,d=t.memoizedState,i.state=d,li(t,n,i,o),ui();var h=t.memoizedState;s!==f||d!==h||ti||null!==e&&null!==e.dependencies&&Ao(e.dependencies)?("function"==typeof a&&(fa(t,r,a,n),h=t.memoizedState),(l=ti||ha(t,r,l,n,d,h,c)||null!==e&&null!==e.dependencies&&Ao(e.dependencies))?(u||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(n,h,c),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(n,h,c)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=h),i.props=n,i.state=h,i.context=c,n=l):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,Na(e,t),n=!!(128&t.flags),i||n?(i=t.stateNode,r=n&&"function"!=typeof r.getDerivedStateFromError?null:i.render(),t.flags|=1,null!==e&&n?(t.child=ta(t,e.child,null,o),t.child=ta(t,null,r,o)):Ta(e,t,r,o),t.memoizedState=i.state,e=t.child):e=Xa(e,t,o),e}function La(e,t,r,n){return ho(),t.flags|=256,Ta(e,t,r,n),t.child}var Ua={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Da(e){return{baseLanes:e,cachePool:Ho()}}function Fa(e,t,r){return e=null!==e?e.childLanes&~r:0,t&&(e|=yu),e}function za(e,t,r){var o,i=t.pendingProps,s=!1,a=!!(128&t.flags);if((o=a)||(o=(null===e||null!==e.memoizedState)&&!!(2&ua.current)),o&&(s=!0,t.flags&=-129),o=!!(32&t.flags),t.flags&=-33,null===e){if(oo){if(s?ia(t):aa(),oo){var c,u=no;if(c=u){e:{for(c=u,u=so;8!==c.nodeType;){if(!u){u=null;break e}if(null===(c=Ef(c.nextSibling))){u=null;break e}}u=c}null!==u?(t.memoizedState={dehydrated:u,treeContext:null!==Zn?{id:Qn,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},(c=jn(18,null,null,0)).stateNode=u,c.return=t,t.child=c,ro=t,no=null,c=!0):c=!1}c||co(t)}if(null!==(u=t.memoizedState)&&null!==(u=u.dehydrated))return Sf(u)?t.lanes=32:t.lanes=536870912,null;ca(t)}return u=i.children,i=i.fallback,s?(aa(),u=Va({mode:"hidden",children:u},s=t.mode),i=Fn(i,s,r,null),u.return=t,i.return=t,u.sibling=i,t.child=u,(s=t.child).memoizedState=Da(r),s.childLanes=Fa(e,o,r),t.memoizedState=Ua,i):(ia(t),qa(t,u))}if(null!==(c=e.memoizedState)&&null!==(u=c.dehydrated)){if(a)256&t.flags?(ia(t),t.flags&=-257,t=Ha(e,t,r)):null!==t.memoizedState?(aa(),t.child=e.child,t.flags|=128,t=null):(aa(),s=i.fallback,u=t.mode,i=Va({mode:"visible",children:i.children},u),(s=Fn(s,u,r,null)).flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,ta(t,e.child,null,r),(i=t.child).memoizedState=Da(r),i.childLanes=Fa(e,o,r),t.memoizedState=Ua,t=s);else if(ia(t),Sf(u)){if(o=u.nextSibling&&u.nextSibling.dataset)var l=o.dgst;o=l,(i=Error(n(419))).stack="",i.digest=o,yo({value:i,source:null,stack:null}),t=Ha(e,t,r)}else if(Oa||Eo(e,t,r,!1),o=0!==(r&e.childLanes),Oa||o){if(null!==(o=ru)&&(0!==(i=0!==((i=42&(i=r&-r)?1:Oe(i))&(o.suspendedLanes|r))?0:i)&&i!==c.retryLane))throw c.retryLane=i,_n(e,i),ju(o,e,i),ka;"$?"===u.data||Wu(),t=Ha(e,t,r)}else"$?"===u.data?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,no=Ef(u.nextSibling),ro=t,oo=!0,io=null,so=!1,null!==e&&(Gn[Xn++]=Qn,Gn[Xn++]=Yn,Gn[Xn++]=Zn,Qn=e.id,Yn=e.overflow,Zn=t),(t=qa(t,i.children)).flags|=4096);return t}return s?(aa(),s=i.fallback,u=t.mode,l=(c=e.child).sibling,(i=Ln(c,{mode:"hidden",children:i.children})).subtreeFlags=65011712&c.subtreeFlags,null!==l?s=Ln(l,s):(s=Fn(s,u,r,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,null===(u=e.child.memoizedState)?u=Da(r):(null!==(c=u.cachePool)?(l=Ro._currentValue,c=c.parent!==l?{parent:l,pool:l}:c):c=Ho(),u={baseLanes:u.baseLanes|r,cachePool:c}),s.memoizedState=u,s.childLanes=Fa(e,o,r),t.memoizedState=Ua,i):(ia(t),e=(r=e.child).sibling,(r=Ln(r,{mode:"visible",children:i.children})).return=t,r.sibling=null,null!==e&&(null===(o=t.deletions)?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=r,t.memoizedState=null,r)}function qa(e,t){return(t=Va({mode:"visible",children:t},e.mode)).return=e,e.child=t}function Va(e,t){return(e=jn(22,e,null,t)).lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Ha(e,t,r){return ta(t,e.child,null,r),(e=qa(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ka(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),xo(e.return,t,r)}function Wa(e,t,r,n,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=o)}function Ga(e,t,r){var n=t.pendingProps,o=n.revealOrder,i=n.tail;if(Ta(e,t,n.children,r),2&(n=ua.current))n=1&n|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ka(e,r,t);else if(19===e.tag)Ka(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}switch(U(ua,n),o){case"forwards":for(r=t.child,o=null;null!==r;)null!==(e=r.alternate)&&null===la(e)&&(o=r),r=r.sibling;null===(r=o)?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),Wa(t,!1,o,r,i);break;case"backwards":for(r=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===la(e)){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}Wa(t,!0,r,null,i);break;case"together":Wa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xa(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),du|=t.lanes,0===(r&t.childLanes)){if(null===e)return null;if(Eo(e,t,r,!1),0===(r&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Ln(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Ln(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Za(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!Ao(e))}function Qa(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps)Oa=!0;else{if(!(Za(e,r)||128&t.flags))return Oa=!1,function(e,t,r){switch(t.tag){case 3:V(t,t.stateNode.containerInfo),vo(0,Ro,e.memoizedState.cache),ho();break;case 27:case 5:K(t);break;case 4:V(t,t.stateNode.containerInfo);break;case 10:vo(0,t.type,t.memoizedProps.value);break;case 13:var n=t.memoizedState;if(null!==n)return null!==n.dehydrated?(ia(t),t.flags|=128,null):0!==(r&t.child.childLanes)?za(e,t,r):(ia(t),null!==(e=Xa(e,t,r))?e.sibling:null);ia(t);break;case 19:var o=!!(128&e.flags);if((n=0!==(r&t.childLanes))||(Eo(e,t,r,!1),n=0!==(r&t.childLanes)),o){if(n)return Ga(e,t,r);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),U(ua,ua.current),n)break;return null;case 22:case 23:return t.lanes=0,Pa(e,t,r);case 24:vo(0,Ro,e.memoizedState.cache)}return Xa(e,t,r)}(e,t,r);Oa=!!(131072&e.flags)}else Oa=!1,oo&&1048576&t.flags&&$n(t,Wn,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var o=t.elementType,i=o._init;if(o=i(o._payload),t.type=o,"function"!=typeof o){if(null!=o){if((i=o.$$typeof)===v){t.tag=11,t=Ca(null,t,o,e,r);break e}if(i===S){t.tag=14,t=Ia(null,t,o,e,r);break e}}throw t=I(o)||o,Error(n(306,t,""))}Mn(o)?(e=ya(o,e),t.tag=1,t=Ma(null,t,o,e,r)):(t.tag=0,t=Ba(null,t,o,e,r))}return t;case 0:return Ba(e,t,t.type,t.pendingProps,r);case 1:return Ma(e,t,o=t.type,i=ya(o,t.pendingProps),r);case 3:e:{if(V(t,t.stateNode.containerInfo),null===e)throw Error(n(387));o=t.pendingProps;var s=t.memoizedState;i=s.element,ni(e,t),li(t,o,null,r);var a=t.memoizedState;if(o=a.cache,vo(0,Ro,o),o!==s.cache&&So(t,[Ro],r,!0),ui(),o=a.element,s.isDehydrated){if(s={element:o,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=La(e,t,o,r);break e}if(o!==i){yo(i=En(Error(n(424)),t)),t=La(e,t,o,r);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(no=Ef(e.firstChild),ro=t,oo=!0,io=null,so=!0,r=ra(t,null,o,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(ho(),o===i){t=Xa(e,t,r);break e}Ta(e,t,o,r)}t=t.child}return t;case 26:return Na(e,t),null===e?(r=Bf(t.type,null,t.pendingProps,null))?t.memoizedState=r:oo||(r=t.type,e=t.pendingProps,(o=uf(z.current).createElement(r))[_e]=t,o[Pe]=e,sf(o,r,e),Ve(o),t.stateNode=o):t.memoizedState=Bf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return K(t),null===e&&oo&&(o=t.stateNode=Of(t.type,t.pendingProps,z.current),ro=t,so=!0,i=no,vf(t.type)?(Af=i,no=Ef(o.firstChild)):no=i),Ta(e,t,t.pendingProps.children,r),Na(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&oo&&((i=o=no)&&(o=function(e,t,r,n){for(;1===e.nodeType;){var o=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(n){if(!e[Le])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(i=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(i!==o.rel||e.getAttribute("href")!==(null==o.href||""===o.href?null:o.href)||e.getAttribute("crossorigin")!==(null==o.crossOrigin?null:o.crossOrigin)||e.getAttribute("title")!==(null==o.title?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((i=e.getAttribute("src"))!==(null==o.src?null:o.src)||e.getAttribute("type")!==(null==o.type?null:o.type)||e.getAttribute("crossorigin")!==(null==o.crossOrigin?null:o.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var i=null==o.name?null:""+o.name;if("hidden"===o.type&&e.getAttribute("name")===i)return e}if(null===(e=Ef(e.nextSibling)))break}return null}(o,t.type,t.pendingProps,so),null!==o?(t.stateNode=o,ro=t,no=Ef(o.firstChild),so=!1,i=!0):i=!1),i||co(t)),K(t),i=t.type,s=t.pendingProps,a=null!==e?e.memoizedProps:null,o=s.children,df(i,s)?o=null:null!==a&&df(i,a)&&(t.flags|=32),null!==t.memoizedState&&(i=Pi(e,t,Bi,null,null,r),ed._currentValue=i),Na(e,t),Ta(e,t,o,r),t.child;case 6:return null===e&&oo&&((e=r=no)&&(null!==(r=function(e,t,r){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!r)return null;if(null===(e=Ef(e.nextSibling)))return null}return e}(r,t.pendingProps,so))?(t.stateNode=r,ro=t,no=null,e=!0):e=!1),e||co(t)),null;case 13:return za(e,t,r);case 4:return V(t,t.stateNode.containerInfo),o=t.pendingProps,null===e?t.child=ta(t,null,o,r):Ta(e,t,o,r),t.child;case 11:return Ca(e,t,t.type,t.pendingProps,r);case 7:return Ta(e,t,t.pendingProps,r),t.child;case 8:case 12:return Ta(e,t,t.pendingProps.children,r),t.child;case 10:return o=t.pendingProps,vo(0,t.type,o.value),Ta(e,t,o.children,r),t.child;case 9:return i=t.type._context,o=t.pendingProps.children,ko(t),o=o(i=Oo(i)),t.flags|=1,Ta(e,t,o,r),t.child;case 14:return Ia(e,t,t.type,t.pendingProps,r);case 15:return _a(e,t,t.type,t.pendingProps,r);case 19:return Ga(e,t,r);case 31:return o=t.pendingProps,r=t.mode,o={mode:o.mode,children:o.children},null===e?((r=Va(o,r)).ref=t.ref,t.child=r,r.return=t,t=r):((r=Ln(e.child,o)).ref=t.ref,t.child=r,r.return=t,t=r),t;case 22:return Pa(e,t,r);case 24:return ko(t),o=Oo(Ro),null===e?(null===(i=qo())&&(i=ru,s=No(),i.pooledCache=s,s.refCount++,null!==s&&(i.pooledCacheLanes|=r),i=s),t.memoizedState={parent:o,cache:i},ri(t),vo(0,Ro,i)):(0!==(e.lanes&r)&&(ni(e,t),li(t,null,null,r),ui()),i=e.memoizedState,s=t.memoizedState,i.parent!==o?(i={parent:o,cache:o},t.memoizedState=i,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=i),vo(0,Ro,o)):(o=s.cache,vo(0,Ro,o),o!==i.cache&&So(t,[Ro],r,!0))),Ta(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(n(156,t.tag))}function Ya(e){e.flags|=4}function Ja(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!Gf(t)){if(null!==(t=na.current)&&((4194048&ou)===ou?null!==oa:(62914560&ou)!==ou&&!(536870912&ou)||t!==oa))throw Jo=Xo,Wo;e.flags|=8192}}function $a(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?xe():536870912,e.lanes|=t,gu|=t)}function ec(e,t){if(!oo)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function tc(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var o=e.child;null!==o;)r|=o.lanes|o.childLanes,n|=65011712&o.subtreeFlags,n|=65011712&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)r|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function rc(e,t,r){var o=t.pendingProps;switch(to(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return tc(t),null;case 3:return r=t.stateNode,o=null,null!==e&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),wo(Ro),H(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(fo(t)?Ya(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,po())),tc(t),null;case 26:return r=t.memoizedState,null===e?(Ya(t),null!==r?(tc(t),Ja(t,r)):(tc(t),t.flags&=-16777217)):r?r!==e.memoizedState?(Ya(t),tc(t),Ja(t,r)):(tc(t),t.flags&=-16777217):(e.memoizedProps!==o&&Ya(t),tc(t),t.flags&=-16777217),null;case 27:W(t),r=z.current;var i=t.type;if(null!==e&&null!=t.stateNode)e.memoizedProps!==o&&Ya(t);else{if(!o){if(null===t.stateNode)throw Error(n(166));return tc(t),null}e=D.current,fo(t)?uo(t):(e=Of(i,o,r),t.stateNode=e,Ya(t))}return tc(t),null;case 5:if(W(t),r=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==o&&Ya(t);else{if(!o){if(null===t.stateNode)throw Error(n(166));return tc(t),null}if(e=D.current,fo(t))uo(t);else{switch(i=uf(z.current),e){case 1:e=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:e=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":e=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":e=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":(e=i.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e="string"==typeof o.is?i.createElement("select",{is:o.is}):i.createElement("select"),o.multiple?e.multiple=!0:o.size&&(e.size=o.size);break;default:e="string"==typeof o.is?i.createElement(r,{is:o.is}):i.createElement(r)}}e[_e]=t,e[Pe]=o;e:for(i=t.child;null!==i;){if(5===i.tag||6===i.tag)e.appendChild(i.stateNode);else if(4!==i.tag&&27!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;null===i.sibling;){if(null===i.return||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=e;e:switch(sf(e,r,o),r){case"button":case"input":case"select":case"textarea":e=!!o.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Ya(t)}}return tc(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==o&&Ya(t);else{if("string"!=typeof o&&null===t.stateNode)throw Error(n(166));if(e=z.current,fo(t)){if(e=t.stateNode,r=t.memoizedProps,o=null,null!==(i=ro))switch(i.tag){case 27:case 5:o=i.memoizedProps}e[_e]=t,(e=!!(e.nodeValue===r||null!==o&&!0===o.suppressHydrationWarning||tf(e.nodeValue,r)))||co(t)}else(e=uf(e).createTextNode(o))[_e]=t,t.stateNode=e}return tc(t),null;case 13:if(o=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=fo(t),null!==o&&null!==o.dehydrated){if(null===e){if(!i)throw Error(n(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(n(317));i[_e]=t}else ho(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;tc(t),i=!1}else i=po(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(ca(t),t):(ca(t),null)}if(ca(t),128&t.flags)return t.lanes=r,t;if(r=null!==o,e=null!==e&&null!==e.memoizedState,r){i=null,null!==(o=t.child).alternate&&null!==o.alternate.memoizedState&&null!==o.alternate.memoizedState.cachePool&&(i=o.alternate.memoizedState.cachePool.pool);var s=null;null!==o.memoizedState&&null!==o.memoizedState.cachePool&&(s=o.memoizedState.cachePool.pool),s!==i&&(o.flags|=2048)}return r!==e&&r&&(t.child.flags|=8192),$a(t,t.updateQueue),tc(t),null;case 4:return H(),null===e&&Kl(t.stateNode.containerInfo),tc(t),null;case 10:return wo(t.type),tc(t),null;case 19:if(L(ua),null===(i=t.memoizedState))return tc(t),null;if(o=!!(128&t.flags),null===(s=i.rendering))if(o)ec(i,!1);else{if(0!==fu||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=la(e))){for(t.flags|=128,ec(i,!1),e=s.updateQueue,t.updateQueue=e,$a(t,e),t.subtreeFlags=0,e=r,r=t.child;null!==r;)Un(r,e),r=r.sibling;return U(ua,1&ua.current|2),t.child}e=e.sibling}null!==i.tail&&$()>xu&&(t.flags|=128,o=!0,ec(i,!1),t.lanes=4194304)}else{if(!o)if(null!==(e=la(s))){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,$a(t,e),ec(i,!0),null===i.tail&&"hidden"===i.tailMode&&!s.alternate&&!oo)return tc(t),null}else 2*$()-i.renderingStartTime>xu&&536870912!==r&&(t.flags|=128,o=!0,ec(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=i.last)?e.sibling=s:t.child=s,i.last=s)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=$(),t.sibling=null,e=ua.current,U(ua,o?1&e|2:1&e),t):(tc(t),null);case 22:case 23:return ca(t),mi(),o=null!==t.memoizedState,null!==e?null!==e.memoizedState!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?!!(536870912&r)&&!(128&t.flags)&&(tc(t),6&t.subtreeFlags&&(t.flags|=8192)):tc(t),null!==(r=t.updateQueue)&&$a(t,r.retryQueue),r=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(r=e.memoizedState.cachePool.pool),o=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(o=t.memoizedState.cachePool.pool),o!==r&&(t.flags|=2048),null!==e&&L(zo),null;case 24:return r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),wo(Ro),tc(t),null;case 25:case 30:return null}throw Error(n(156,t.tag))}function nc(e,t){switch(to(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return wo(Ro),H(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return W(t),null;case 13:if(ca(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));ho()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return L(ua),null;case 4:return H(),null;case 10:return wo(t.type),null;case 22:case 23:return ca(t),mi(),null!==e&&L(zo),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return wo(Ro),null;default:return null}}function oc(e,t){switch(to(t),t.tag){case 3:wo(Ro),H();break;case 26:case 27:case 5:W(t);break;case 4:H();break;case 13:ca(t);break;case 19:L(ua);break;case 10:wo(t.type);break;case 22:case 23:ca(t),mi(),null!==e&&L(zo);break;case 24:wo(Ro)}}function ic(e,t){try{var r=t.updateQueue,n=null!==r?r.lastEffect:null;if(null!==n){var o=n.next;r=o;do{if((r.tag&e)===e){n=void 0;var i=r.create,s=r.inst;n=i(),s.destroy=n}r=r.next}while(r!==o)}}catch(e){yl(t,t.return,e)}}function sc(e,t,r){try{var n=t.updateQueue,o=null!==n?n.lastEffect:null;if(null!==o){var i=o.next;n=i;do{if((n.tag&e)===e){var s=n.inst,a=s.destroy;if(void 0!==a){s.destroy=void 0,o=t;var c=r,u=a;try{u()}catch(e){yl(o,c,e)}}}n=n.next}while(n!==i)}}catch(e){yl(t,t.return,e)}}function ac(e){var t=e.updateQueue;if(null!==t){var r=e.stateNode;try{di(t,r)}catch(t){yl(e,e.return,t)}}}function cc(e,t,r){r.props=ya(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(r){yl(e,t,r)}}function uc(e,t){try{var r=e.ref;if(null!==r){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;default:n=e.stateNode}"function"==typeof r?e.refCleanup=r(n):r.current=n}}catch(r){yl(e,t,r)}}function lc(e,t){var r=e.ref,n=e.refCleanup;if(null!==r)if("function"==typeof n)try{n()}catch(r){yl(e,t,r)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof r)try{r(null)}catch(r){yl(e,t,r)}else r.current=null}function fc(e){var t=e.type,r=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&n.focus();break e;case"img":r.src?n.src=r.src:r.srcSet&&(n.srcset=r.srcSet)}}catch(t){yl(e,e.return,t)}}function dc(e,t,r){try{var o=e.stateNode;!function(e,t,r,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,c=null,u=null,l=null,f=null;for(p in r){var d=r[p];if(r.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:o.hasOwnProperty(p)||nf(e,t,p,null,o,d)}}for(var h in o){var p=o[h];if(d=r[h],o.hasOwnProperty(h)&&(null!=p||null!=d))switch(h){case"type":s=p;break;case"name":i=p;break;case"checked":l=p;break;case"defaultChecked":f=p;break;case"value":a=p;break;case"defaultValue":c=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(n(137,t));break;default:p!==d&&nf(e,t,h,p,o,d)}}return void pt(e,a,c,u,l,f,s,i);case"select":for(s in p=a=c=h=null,r)if(u=r[s],r.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:o.hasOwnProperty(s)||nf(e,t,s,null,o,u)}for(i in o)if(s=o[i],u=r[i],o.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":h=s;break;case"defaultValue":c=s;break;case"multiple":a=s;default:s!==u&&nf(e,t,i,s,o,u)}return t=c,r=a,o=p,void(null!=h?mt(e,!!r,h,!1):!!o!=!!r&&(null!=t?mt(e,!!r,t,!0):mt(e,!!r,r?[]:"",!1)));case"textarea":for(c in p=h=null,r)if(i=r[c],r.hasOwnProperty(c)&&null!=i&&!o.hasOwnProperty(c))switch(c){case"value":case"children":break;default:nf(e,t,c,null,o,i)}for(a in o)if(i=o[a],s=r[a],o.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":h=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(n(91));break;default:i!==s&&nf(e,t,a,i,o,s)}return void bt(e,h,p);case"option":for(var y in r)if(h=r[y],r.hasOwnProperty(y)&&null!=h&&!o.hasOwnProperty(y))if("selected"===y)e.selected=!1;else nf(e,t,y,null,o,h);for(u in o)if(h=o[u],p=r[u],o.hasOwnProperty(u)&&h!==p&&(null!=h||null!=p))if("selected"===u)e.selected=h&&"function"!=typeof h&&"symbol"!=typeof h;else nf(e,t,u,h,o,p);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in r)h=r[g],r.hasOwnProperty(g)&&null!=h&&!o.hasOwnProperty(g)&&nf(e,t,g,null,o,h);for(l in o)if(h=o[l],p=r[l],o.hasOwnProperty(l)&&h!==p&&(null!=h||null!=p))switch(l){case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(n(137,t));break;default:nf(e,t,l,h,o,p)}return;default:if(At(t)){for(var m in r)h=r[m],r.hasOwnProperty(m)&&void 0!==h&&!o.hasOwnProperty(m)&&of(e,t,m,void 0,o,h);for(f in o)h=o[f],p=r[f],!o.hasOwnProperty(f)||h===p||void 0===h&&void 0===p||of(e,t,f,h,o,p);return}}for(var b in r)h=r[b],r.hasOwnProperty(b)&&null!=h&&!o.hasOwnProperty(b)&&nf(e,t,b,null,o,h);for(d in o)h=o[d],p=r[d],!o.hasOwnProperty(d)||h===p||null==h&&null==p||nf(e,t,d,h,o,p)}(o,e.type,r,t),o[Pe]=t}catch(t){yl(e,e.return,t)}}function hc(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&vf(e.type)||4===e.tag}function pc(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||hc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&vf(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function yc(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?(9===r.nodeType?r.body:"HTML"===r.nodeName?r.ownerDocument.body:r).insertBefore(e,t):((t=9===r.nodeType?r.body:"HTML"===r.nodeName?r.ownerDocument.body:r).appendChild(e),null!=(r=r._reactRootContainer)||null!==t.onclick||(t.onclick=rf));else if(4!==n&&(27===n&&vf(e.type)&&(r=e.stateNode,t=null),null!==(e=e.child)))for(yc(e,t,r),e=e.sibling;null!==e;)yc(e,t,r),e=e.sibling}function gc(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&(27===n&&vf(e.type)&&(r=e.stateNode),null!==(e=e.child)))for(gc(e,t,r),e=e.sibling;null!==e;)gc(e,t,r),e=e.sibling}function mc(e){var t=e.stateNode,r=e.memoizedProps;try{for(var n=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);sf(t,n,r),t[_e]=e,t[Pe]=r}catch(t){yl(e,e.return,t)}}var bc=!1,vc=!1,wc=!1,xc="function"==typeof WeakSet?WeakSet:Set,Sc=null;function Ec(e,t,r){var n=r.flags;switch(r.tag){case 0:case 11:case 15:Mc(e,r),4&n&&ic(5,r);break;case 1:if(Mc(e,r),4&n)if(e=r.stateNode,null===t)try{e.componentDidMount()}catch(e){yl(r,r.return,e)}else{var o=ya(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){yl(r,r.return,e)}}64&n&&ac(r),512&n&&uc(r,r.return);break;case 3:if(Mc(e,r),64&n&&null!==(e=r.updateQueue)){if(t=null,null!==r.child)switch(r.child.tag){case 27:case 5:case 1:t=r.child.stateNode}try{di(e,t)}catch(e){yl(r,r.return,e)}}break;case 27:null===t&&4&n&&mc(r);case 26:case 5:Mc(e,r),null===t&&4&n&&fc(r),512&n&&uc(r,r.return);break;case 12:Mc(e,r);break;case 13:Mc(e,r),4&n&&Ic(e,r),64&n&&(null!==(e=r.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var r=e.ownerDocument;if("$?"!==e.data||"complete"===r.readyState)t();else{var n=function(){t(),r.removeEventListener("DOMContentLoaded",n)};r.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}(e,r=vl.bind(null,r))));break;case 22:if(!(n=null!==r.memoizedState||bc)){t=null!==t&&null!==t.memoizedState||vc,o=bc;var i=vc;bc=n,(vc=t)&&!i?Uc(e,r,!!(8772&r.subtreeFlags)):Mc(e,r),bc=o,vc=i}break;case 30:break;default:Mc(e,r)}}function Ac(e){var t=e.alternate;null!==t&&(e.alternate=null,Ac(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Ue(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kc=null,Oc=!1;function Tc(e,t,r){for(r=r.child;null!==r;)Cc(e,t,r),r=r.sibling}function Cc(e,t,r){if(ue&&"function"==typeof ue.onCommitFiberUnmount)try{ue.onCommitFiberUnmount(ce,r)}catch(e){}switch(r.tag){case 26:vc||lc(r,t),Tc(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode).parentNode.removeChild(r);break;case 27:vc||lc(r,t);var n=kc,o=Oc;vf(r.type)&&(kc=r.stateNode,Oc=!1),Tc(e,t,r),Tf(r.stateNode),kc=n,Oc=o;break;case 5:vc||lc(r,t);case 6:if(n=kc,o=Oc,kc=null,Tc(e,t,r),Oc=o,null!==(kc=n))if(Oc)try{(9===kc.nodeType?kc.body:"HTML"===kc.nodeName?kc.ownerDocument.body:kc).removeChild(r.stateNode)}catch(e){yl(r,t,e)}else try{kc.removeChild(r.stateNode)}catch(e){yl(r,t,e)}break;case 18:null!==kc&&(Oc?(wf(9===(e=kc).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,r.stateNode),Nd(e)):wf(kc,r.stateNode));break;case 4:n=kc,o=Oc,kc=r.stateNode.containerInfo,Oc=!0,Tc(e,t,r),kc=n,Oc=o;break;case 0:case 11:case 14:case 15:vc||sc(2,r,t),vc||sc(4,r,t),Tc(e,t,r);break;case 1:vc||(lc(r,t),"function"==typeof(n=r.stateNode).componentWillUnmount&&cc(r,t,n)),Tc(e,t,r);break;case 21:Tc(e,t,r);break;case 22:vc=(n=vc)||null!==r.memoizedState,Tc(e,t,r),vc=n;break;default:Tc(e,t,r)}}function Ic(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Nd(e)}catch(e){yl(t,t.return,e)}}function _c(e,t){var r=function(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new xc),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new xc),t;default:throw Error(n(435,e.tag))}}(e);t.forEach(function(t){var n=wl.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))})}function Pc(e,t){var r=t.deletions;if(null!==r)for(var o=0;o<r.length;o++){var i=r[o],s=e,a=t,c=a;e:for(;null!==c;){switch(c.tag){case 27:if(vf(c.type)){kc=c.stateNode,Oc=!1;break e}break;case 5:kc=c.stateNode,Oc=!1;break e;case 3:case 4:kc=c.stateNode.containerInfo,Oc=!0;break e}c=c.return}if(null===kc)throw Error(n(160));Cc(s,a,i),kc=null,Oc=!1,null!==(s=i.alternate)&&(s.return=null),i.return=null}if(13878&t.subtreeFlags)for(t=t.child;null!==t;)Nc(t,e),t=t.sibling}var Rc=null;function Nc(e,t){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pc(t,e),Bc(e),4&o&&(sc(3,e,e.return),ic(3,e),sc(5,e,e.return));break;case 1:Pc(t,e),Bc(e),512&o&&(vc||null===r||lc(r,r.return)),64&o&&bc&&(null!==(e=e.updateQueue)&&(null!==(o=e.callbacks)&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===r?o:r.concat(o))));break;case 26:var i=Rc;if(Pc(t,e),Bc(e),512&o&&(vc||null===r||lc(r,r.return)),4&o){var s=null!==r?r.memoizedState:null;if(o=e.memoizedState,null===r)if(null===o)if(null===e.stateNode){e:{o=e.type,r=e.memoizedProps,i=i.ownerDocument||i;t:switch(o){case"title":(!(s=i.getElementsByTagName("title")[0])||s[Le]||s[_e]||"http://www.w3.org/2000/svg"===s.namespaceURI||s.hasAttribute("itemprop"))&&(s=i.createElement(o),i.head.insertBefore(s,i.querySelector("head > title"))),sf(s,o,r),s[_e]=e,Ve(s),o=s;break e;case"link":var a=Kf("link","href",i).get(o+(r.href||""));if(a)for(var c=0;c<a.length;c++)if((s=a[c]).getAttribute("href")===(null==r.href||""===r.href?null:r.href)&&s.getAttribute("rel")===(null==r.rel?null:r.rel)&&s.getAttribute("title")===(null==r.title?null:r.title)&&s.getAttribute("crossorigin")===(null==r.crossOrigin?null:r.crossOrigin)){a.splice(c,1);break t}sf(s=i.createElement(o),o,r),i.head.appendChild(s);break;case"meta":if(a=Kf("meta","content",i).get(o+(r.content||"")))for(c=0;c<a.length;c++)if((s=a[c]).getAttribute("content")===(null==r.content?null:""+r.content)&&s.getAttribute("name")===(null==r.name?null:r.name)&&s.getAttribute("property")===(null==r.property?null:r.property)&&s.getAttribute("http-equiv")===(null==r.httpEquiv?null:r.httpEquiv)&&s.getAttribute("charset")===(null==r.charSet?null:r.charSet)){a.splice(c,1);break t}sf(s=i.createElement(o),o,r),i.head.appendChild(s);break;default:throw Error(n(468,o))}s[_e]=e,Ve(s),o=s}e.stateNode=o}else Wf(i,e.type,e.stateNode);else e.stateNode=Ff(i,o,e.memoizedProps);else s!==o?(null===s?null!==r.stateNode&&(r=r.stateNode).parentNode.removeChild(r):s.count--,null===o?Wf(i,e.type,e.stateNode):Ff(i,o,e.memoizedProps)):null===o&&null!==e.stateNode&&dc(e,e.memoizedProps,r.memoizedProps)}break;case 27:Pc(t,e),Bc(e),512&o&&(vc||null===r||lc(r,r.return)),null!==r&&4&o&&dc(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Pc(t,e),Bc(e),512&o&&(vc||null===r||lc(r,r.return)),32&e.flags){i=e.stateNode;try{wt(i,"")}catch(t){yl(e,e.return,t)}}4&o&&null!=e.stateNode&&dc(e,i=e.memoizedProps,null!==r?r.memoizedProps:i),1024&o&&(wc=!0);break;case 6:if(Pc(t,e),Bc(e),4&o){if(null===e.stateNode)throw Error(n(162));o=e.memoizedProps,r=e.stateNode;try{r.nodeValue=o}catch(t){yl(e,e.return,t)}}break;case 3:if(Hf=null,i=Rc,Rc=_f(t.containerInfo),Pc(t,e),Rc=i,Bc(e),4&o&&null!==r&&r.memoizedState.isDehydrated)try{Nd(t.containerInfo)}catch(t){yl(e,e.return,t)}wc&&(wc=!1,jc(e));break;case 4:o=Rc,Rc=_f(e.stateNode.containerInfo),Pc(t,e),Bc(e),Rc=o;break;case 12:default:Pc(t,e),Bc(e);break;case 13:Pc(t,e),Bc(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==r&&null!==r.memoizedState)&&(wu=$()),4&o&&(null!==(o=e.updateQueue)&&(e.updateQueue=null,_c(e,o)));break;case 22:i=null!==e.memoizedState;var u=null!==r&&null!==r.memoizedState,l=bc,f=vc;if(bc=l||i,vc=f||u,Pc(t,e),vc=f,bc=l,Bc(e),8192&o)e:for(t=e.stateNode,t._visibility=i?-2&t._visibility:1|t._visibility,i&&(null===r||u||bc||vc||Lc(e)),r=null,t=e;;){if(5===t.tag||26===t.tag){if(null===r){u=r=t;try{if(s=u.stateNode,i)"function"==typeof(a=s.style).setProperty?a.setProperty("display","none","important"):a.display="none";else{c=u.stateNode;var d=u.memoizedProps.style,h=null!=d&&d.hasOwnProperty("display")?d.display:null;c.style.display=null==h||"boolean"==typeof h?"":(""+h).trim()}}catch(e){yl(u,u.return,e)}}}else if(6===t.tag){if(null===r){u=t;try{u.stateNode.nodeValue=i?"":u.memoizedProps}catch(e){yl(u,u.return,e)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}4&o&&(null!==(o=e.updateQueue)&&(null!==(r=o.retryQueue)&&(o.retryQueue=null,_c(e,r))));break;case 19:Pc(t,e),Bc(e),4&o&&(null!==(o=e.updateQueue)&&(e.updateQueue=null,_c(e,o)));case 30:case 21:}}function Bc(e){var t=e.flags;if(2&t){try{for(var r,o=e.return;null!==o;){if(hc(o)){r=o;break}o=o.return}if(null==r)throw Error(n(160));switch(r.tag){case 27:var i=r.stateNode;gc(e,pc(e),i);break;case 5:var s=r.stateNode;32&r.flags&&(wt(s,""),r.flags&=-33),gc(e,pc(e),s);break;case 3:case 4:var a=r.stateNode.containerInfo;yc(e,pc(e),a);break;default:throw Error(n(161))}}catch(t){yl(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function jc(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;jc(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Mc(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Ec(e,t.alternate,t),t=t.sibling}function Lc(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:sc(4,t,t.return),Lc(t);break;case 1:lc(t,t.return);var r=t.stateNode;"function"==typeof r.componentWillUnmount&&cc(t,t.return,r),Lc(t);break;case 27:Tf(t.stateNode);case 26:case 5:lc(t,t.return),Lc(t);break;case 22:null===t.memoizedState&&Lc(t);break;default:Lc(t)}e=e.sibling}}function Uc(e,t,r){for(r=r&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var n=t.alternate,o=e,i=t,s=i.flags;switch(i.tag){case 0:case 11:case 15:Uc(o,i,r),ic(4,i);break;case 1:if(Uc(o,i,r),"function"==typeof(o=(n=i).stateNode).componentDidMount)try{o.componentDidMount()}catch(e){yl(n,n.return,e)}if(null!==(o=(n=i).updateQueue)){var a=n.stateNode;try{var c=o.shared.hiddenCallbacks;if(null!==c)for(o.shared.hiddenCallbacks=null,o=0;o<c.length;o++)fi(c[o],a)}catch(e){yl(n,n.return,e)}}r&&64&s&&ac(i),uc(i,i.return);break;case 27:mc(i);case 26:case 5:Uc(o,i,r),r&&null===n&&4&s&&fc(i),uc(i,i.return);break;case 12:Uc(o,i,r);break;case 13:Uc(o,i,r),r&&4&s&&Ic(o,i);break;case 22:null===i.memoizedState&&Uc(o,i,r),uc(i,i.return);break;case 30:break;default:Uc(o,i,r)}t=t.sibling}}function Dc(e,t){var r=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(r=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==r&&(null!=e&&e.refCount++,null!=r&&Bo(r))}function Fc(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Bo(e))}function zc(e,t,r,n){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)qc(e,t,r,n),t=t.sibling}function qc(e,t,r,n){var o=t.flags;switch(t.tag){case 0:case 11:case 15:zc(e,t,r,n),2048&o&&ic(9,t);break;case 1:case 13:default:zc(e,t,r,n);break;case 3:zc(e,t,r,n),2048&o&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Bo(e)));break;case 12:if(2048&o){zc(e,t,r,n),e=t.stateNode;try{var i=t.memoizedProps,s=i.id,a=i.onPostCommit;"function"==typeof a&&a(s,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(e){yl(t,t.return,e)}}else zc(e,t,r,n);break;case 23:break;case 22:i=t.stateNode,s=t.alternate,null!==t.memoizedState?2&i._visibility?zc(e,t,r,n):Hc(e,t):2&i._visibility?zc(e,t,r,n):(i._visibility|=2,Vc(e,t,r,n,!!(10256&t.subtreeFlags))),2048&o&&Dc(s,t);break;case 24:zc(e,t,r,n),2048&o&&Fc(t.alternate,t)}}function Vc(e,t,r,n,o){for(o=o&&!!(10256&t.subtreeFlags),t=t.child;null!==t;){var i=e,s=t,a=r,c=n,u=s.flags;switch(s.tag){case 0:case 11:case 15:Vc(i,s,a,c,o),ic(8,s);break;case 23:break;case 22:var l=s.stateNode;null!==s.memoizedState?2&l._visibility?Vc(i,s,a,c,o):Hc(i,s):(l._visibility|=2,Vc(i,s,a,c,o)),o&&2048&u&&Dc(s.alternate,s);break;case 24:Vc(i,s,a,c,o),o&&2048&u&&Fc(s.alternate,s);break;default:Vc(i,s,a,c,o)}t=t.sibling}}function Hc(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var r=e,n=t,o=n.flags;switch(n.tag){case 22:Hc(r,n),2048&o&&Dc(n.alternate,n);break;case 24:Hc(r,n),2048&o&&Fc(n.alternate,n);break;default:Hc(r,n)}t=t.sibling}}var Kc=8192;function Wc(e){if(e.subtreeFlags&Kc)for(e=e.child;null!==e;)Gc(e),e=e.sibling}function Gc(e){switch(e.tag){case 26:Wc(e),e.flags&Kc&&null!==e.memoizedState&&function(e,t,r){if(null===Xf)throw Error(n(475));var o=Xf;if(!("stylesheet"!==t.type||"string"==typeof r.media&&!1===matchMedia(r.media).matches||4&t.state.loading)){if(null===t.instance){var i=jf(r.href),s=e.querySelector(Mf(i));if(s)return null!==(e=s._p)&&"object"==typeof e&&"function"==typeof e.then&&(o.count++,o=Qf.bind(o),e.then(o,o)),t.state.loading|=4,t.instance=s,void Ve(s);s=e.ownerDocument||e,r=Lf(r),(i=Cf.get(i))&&qf(r,i),Ve(s=s.createElement("link"));var a=s;a._p=new Promise(function(e,t){a.onload=e,a.onerror=t}),sf(s,"link",r),t.instance=s}null===o.stylesheets&&(o.stylesheets=new Map),o.stylesheets.set(t,e),(e=t.state.preload)&&!(3&t.state.loading)&&(o.count++,t=Qf.bind(o),e.addEventListener("load",t),e.addEventListener("error",t))}}(Rc,e.memoizedState,e.memoizedProps);break;case 5:default:Wc(e);break;case 3:case 4:var t=Rc;Rc=_f(e.stateNode.containerInfo),Wc(e),Rc=t;break;case 22:null===e.memoizedState&&(null!==(t=e.alternate)&&null!==t.memoizedState?(t=Kc,Kc=16777216,Wc(e),Kc=t):Wc(e))}}function Xc(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function Zc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var r=0;r<t.length;r++){var n=t[r];Sc=n,Jc(n,e)}Xc(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)Qc(e),e=e.sibling}function Qc(e){switch(e.tag){case 0:case 11:case 15:Zc(e),2048&e.flags&&sc(9,e,e.return);break;case 3:case 12:default:Zc(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,Yc(e)):Zc(e)}}function Yc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var r=0;r<t.length;r++){var n=t[r];Sc=n,Jc(n,e)}Xc(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:sc(8,t,t.return),Yc(t);break;case 22:2&(r=t.stateNode)._visibility&&(r._visibility&=-3,Yc(t));break;default:Yc(t)}e=e.sibling}}function Jc(e,t){for(;null!==Sc;){var r=Sc;switch(r.tag){case 0:case 11:case 15:sc(8,r,t);break;case 23:case 22:if(null!==r.memoizedState&&null!==r.memoizedState.cachePool){var n=r.memoizedState.cachePool.pool;null!=n&&n.refCount++}break;case 24:Bo(r.memoizedState.cache)}if(null!==(n=r.child))n.return=r,Sc=n;else e:for(r=e;null!==Sc;){var o=(n=Sc).sibling,i=n.return;if(Ac(n),n===r){Sc=null;break e}if(null!==o){o.return=i,Sc=o;break e}Sc=i}}}var $c={getCacheForType:function(e){var t=Oo(Ro),r=t.data.get(e);return void 0===r&&(r=e(),t.data.set(e,r)),r}},eu="function"==typeof WeakMap?WeakMap:Map,tu=0,ru=null,nu=null,ou=0,iu=0,su=null,au=!1,cu=!1,uu=!1,lu=0,fu=0,du=0,hu=0,pu=0,yu=0,gu=0,mu=null,bu=null,vu=!1,wu=0,xu=1/0,Su=null,Eu=null,Au=0,ku=null,Ou=null,Tu=0,Cu=0,Iu=null,_u=null,Pu=0,Ru=null;function Nu(){if(2&tu&&0!==ou)return ou&-ou;if(null!==P.T){return 0!==Lo?Lo:Bl()}return Ce()}function Bu(){0===yu&&(yu=536870912&ou&&!oo?536870912:we());var e=na.current;return null!==e&&(e.flags|=32),yu}function ju(e,t,r){(e!==ru||2!==iu&&9!==iu)&&null===e.cancelPendingCommit||(qu(e,0),Du(e,ou,yu,!1)),Ee(e,r),2&tu&&e===ru||(e===ru&&(!(2&tu)&&(hu|=r),4===fu&&Du(e,ou,yu,!1)),Tl(e))}function Mu(e,t,r){if(6&tu)throw Error(n(327));for(var o=!r&&!(124&t)&&0===(t&e.expiredLanes)||be(e,t),i=o?function(e,t){var r=tu;tu|=2;var o=Hu(),i=Ku();ru!==e||ou!==t?(Su=null,xu=$()+500,qu(e,t)):cu=be(e,t);e:for(;;)try{if(0!==iu&&null!==nu){t=nu;var s=su;t:switch(iu){case 1:iu=0,su=null,Ju(e,t,s,1);break;case 2:case 9:if(Zo(s)){iu=0,su=null,Yu(t);break}t=function(){2!==iu&&9!==iu||ru!==e||(iu=7),Tl(e)},s.then(t,t);break e;case 3:iu=7;break e;case 4:iu=5;break e;case 7:Zo(s)?(iu=0,su=null,Yu(t)):(iu=0,su=null,Ju(e,t,s,7));break;case 5:var a=null;switch(nu.tag){case 26:a=nu.memoizedState;case 5:case 27:var c=nu;if(!a||Gf(a)){iu=0,su=null;var u=c.sibling;if(null!==u)nu=u;else{var l=c.return;null!==l?(nu=l,$u(l)):nu=null}break t}}iu=0,su=null,Ju(e,t,s,5);break;case 6:iu=0,su=null,Ju(e,t,s,6);break;case 8:zu(),fu=6;break e;default:throw Error(n(462))}}Zu();break}catch(t){Vu(e,t)}return bo=mo=null,P.H=o,P.A=i,tu=r,null!==nu?0:(ru=null,ou=0,Tn(),fu)}(e,t):Gu(e,t,!0),s=o;;){if(0===i){cu&&!o&&Du(e,t,0,!1);break}if(r=e.current.alternate,!s||Uu(r)){if(2===i){if(s=t,e.errorRecoveryDisabledLanes&s)var a=0;else a=0!==(a=-536870913&e.pendingLanes)?a:536870912&a?536870912:0;if(0!==a){t=a;e:{var c=e;i=mu;var u=c.current.memoizedState.isDehydrated;if(u&&(qu(c,a).flags|=256),2!==(a=Gu(c,a,!1))){if(uu&&!u){c.errorRecoveryDisabledLanes|=s,hu|=s,i=4;break e}s=bu,bu=i,null!==s&&(null===bu?bu=s:bu.push.apply(bu,s))}i=a}if(s=!1,2!==i)continue}}if(1===i){qu(e,0),Du(e,t,0,!0);break}e:{switch(o=e,s=i){case 0:case 1:throw Error(n(345));case 4:if((4194048&t)!==t)break;case 6:Du(o,t,yu,!au);break e;case 2:bu=null;break;case 3:case 5:break;default:throw Error(n(329))}if((62914560&t)===t&&10<(i=wu+300-$())){if(Du(o,t,yu,!au),0!==me(o,0,!0))break e;o.timeoutHandle=pf(Lu.bind(null,o,r,bu,Su,vu,t,yu,hu,gu,au,s,2,-0,0),i)}else Lu(o,r,bu,Su,vu,t,yu,hu,gu,au,s,0,-0,0)}break}i=Gu(e,t,!1),s=!1}Tl(e)}function Lu(e,t,r,o,i,s,a,c,u,l,f,d,h,p){if(e.timeoutHandle=-1,(8192&(d=t.subtreeFlags)||!(16785408&~d))&&(Xf={stylesheets:null,count:0,unsuspend:Zf},Gc(t),null!==(d=function(){if(null===Xf)throw Error(n(475));var e=Xf;return e.stylesheets&&0===e.count&&Jf(e,e.stylesheets),0<e.count?function(t){var r=setTimeout(function(){if(e.stylesheets&&Jf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(r)}}:null}())))return e.cancelPendingCommit=d(tl.bind(null,e,t,s,r,o,i,a,c,u,f,1,h,p)),void Du(e,s,a,!l);tl(e,t,s,r,o,i,a,c,u)}function Uu(e){for(var t=e;;){var r=t.tag;if((0===r||11===r||15===r)&&16384&t.flags&&(null!==(r=t.updateQueue)&&null!==(r=r.stores)))for(var n=0;n<r.length;n++){var o=r[n],i=o.getSnapshot;o=o.value;try{if(!Gr(i(),o))return!1}catch(e){return!1}}if(r=t.child,16384&t.subtreeFlags&&null!==r)r.return=t,t=r;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Du(e,t,r,n){t&=~pu,t&=~hu,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var o=t;0<o;){var i=31-fe(o),s=1<<i;n[i]=-1,o&=~s}0!==r&&Ae(e,r,t)}function Fu(){return!!(6&tu)||(Cl(0,!1),!1)}function zu(){if(null!==nu){if(0===iu)var e=nu.return;else bo=mo=null,Li(e=nu),Xs=null,Zs=0,e=nu;for(;null!==e;)oc(e.alternate,e),e=e.return;nu=null}}function qu(e,t){var r=e.timeoutHandle;-1!==r&&(e.timeoutHandle=-1,yf(r)),null!==(r=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,r()),zu(),ru=e,nu=r=Ln(e.current,null),ou=t,iu=0,su=null,au=!1,cu=be(e,t),uu=!1,gu=yu=pu=hu=du=fu=0,bu=mu=null,vu=!1,8&t&&(t|=32&t);var n=e.entangledLanes;if(0!==n)for(e=e.entanglements,n&=t;0<n;){var o=31-fe(n),i=1<<o;t|=e[o],n&=~i}return lu=t,Tn(),r}function Vu(e,t){vi=null,P.H=Hs,t===Ko||t===Go?(t=$o(),iu=3):t===Wo?(t=$o(),iu=4):iu=t===ka?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,su=t,null===nu&&(fu=1,wa(e,En(t,e.current)))}function Hu(){var e=P.H;return P.H=Hs,null===e?Hs:e}function Ku(){var e=P.A;return P.A=$c,e}function Wu(){fu=4,au||(4194048&ou)!==ou&&null!==na.current||(cu=!0),!(134217727&du)&&!(134217727&hu)||null===ru||Du(ru,ou,yu,!1)}function Gu(e,t,r){var n=tu;tu|=2;var o=Hu(),i=Ku();ru===e&&ou===t||(Su=null,qu(e,t)),t=!1;var s=fu;e:for(;;)try{if(0!==iu&&null!==nu){var a=nu,c=su;switch(iu){case 8:zu(),s=6;break e;case 3:case 2:case 9:case 6:null===na.current&&(t=!0);var u=iu;if(iu=0,su=null,Ju(e,a,c,u),r&&cu){s=0;break e}break;default:u=iu,iu=0,su=null,Ju(e,a,c,u)}}Xu(),s=fu;break}catch(t){Vu(e,t)}return t&&e.shellSuspendCounter++,bo=mo=null,tu=n,P.H=o,P.A=i,null===nu&&(ru=null,ou=0,Tn()),s}function Xu(){for(;null!==nu;)Qu(nu)}function Zu(){for(;null!==nu&&!Y();)Qu(nu)}function Qu(e){var t=Qa(e.alternate,e,lu);e.memoizedProps=e.pendingProps,null===t?$u(e):nu=t}function Yu(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=ja(r,t,t.pendingProps,t.type,void 0,ou);break;case 11:t=ja(r,t,t.pendingProps,t.type.render,t.ref,ou);break;case 5:Li(t);default:oc(r,t),t=Qa(r,t=nu=Un(t,lu),lu)}e.memoizedProps=e.pendingProps,null===t?$u(e):nu=t}function Ju(e,t,r,o){bo=mo=null,Li(t),Xs=null,Zs=0;var i=t.return;try{if(function(e,t,r,o,i){if(r.flags|=32768,null!==o&&"object"==typeof o&&"function"==typeof o.then){if(null!==(t=r.alternate)&&Eo(t,r,i,!0),null!==(r=na.current)){switch(r.tag){case 13:return null===oa?Wu():null===r.alternate&&0===fu&&(fu=3),r.flags&=-257,r.flags|=65536,r.lanes=i,o===Xo?r.flags|=16384:(null===(t=r.updateQueue)?r.updateQueue=new Set([o]):t.add(o),gl(e,o,i)),!1;case 22:return r.flags|=65536,o===Xo?r.flags|=16384:(null===(t=r.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},r.updateQueue=t):null===(r=t.retryQueue)?t.retryQueue=new Set([o]):r.add(o),gl(e,o,i)),!1}throw Error(n(435,r.tag))}return gl(e,o,i),Wu(),!1}if(oo)return null!==(t=na.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=i,o!==ao&&yo(En(e=Error(n(422),{cause:o}),r))):(o!==ao&&yo(En(t=Error(n(423),{cause:o}),r)),(e=e.current.alternate).flags|=65536,i&=-i,e.lanes|=i,o=En(o,r),ai(e,i=Sa(e.stateNode,o,i)),4!==fu&&(fu=2)),!1;var s=Error(n(520),{cause:o});if(s=En(s,r),null===mu?mu=[s]:mu.push(s),4!==fu&&(fu=2),null===t)return!0;o=En(o,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=i&-i,r.lanes|=e,ai(r,e=Sa(r.stateNode,o,e)),!1;case 1:if(t=r.type,s=r.stateNode,!(128&r.flags||"function"!=typeof t.getDerivedStateFromError&&(null===s||"function"!=typeof s.componentDidCatch||null!==Eu&&Eu.has(s))))return r.flags|=65536,i&=-i,r.lanes|=i,Aa(i=Ea(i),e,r,o),ai(r,i),!1}r=r.return}while(null!==r);return!1}(e,i,t,r,ou))return fu=1,wa(e,En(r,e.current)),void(nu=null)}catch(t){if(null!==i)throw nu=i,t;return fu=1,wa(e,En(r,e.current)),void(nu=null)}32768&t.flags?(oo||1===o?e=!0:cu||536870912&ou?e=!1:(au=e=!0,(2===o||9===o||3===o||6===o)&&(null!==(o=na.current)&&13===o.tag&&(o.flags|=16384))),el(t,e)):$u(t)}function $u(e){var t=e;do{if(32768&t.flags)return void el(t,au);e=t.return;var r=rc(t.alternate,t,lu);if(null!==r)return void(nu=r);if(null!==(t=t.sibling))return void(nu=t);nu=t=e}while(null!==t);0===fu&&(fu=5)}function el(e,t){do{var r=nc(e.alternate,e);if(null!==r)return r.flags&=32767,void(nu=r);if(null!==(r=e.return)&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&null!==(e=e.sibling))return void(nu=e);nu=e=r}while(null!==e);fu=6,nu=null}function tl(e,t,r,o,i,s,a,c,u){e.cancelPendingCommit=null;do{cl()}while(0!==Au);if(6&tu)throw Error(n(327));if(null!==t){if(t===e.current)throw Error(n(177));if(s=t.lanes|t.childLanes,function(e,t,r,n,o,i){var s=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var a=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(r=s&~r;0<r;){var l=31-fe(r),f=1<<l;a[l]=0,c[l]=-1;var d=u[l];if(null!==d)for(u[l]=null,l=0;l<d.length;l++){var h=d[l];null!==h&&(h.lane&=-536870913)}r&=~f}0!==n&&Ae(e,n,0),0!==i&&0===o&&0!==e.tag&&(e.suspendedLanes|=i&~(s&~t))}(e,r,s|=On,a,c,u),e===ru&&(nu=ru=null,ou=0),Ou=t,ku=e,Tu=r,Cu=s,Iu=i,_u=o,10256&t.subtreeFlags||10256&t.flags?(e.callbackNode=null,e.callbackPriority=0,X(ne,function(){return fl(),null})):(e.callbackNode=null,e.callbackPriority=0),o=!!(13878&t.flags),13878&t.subtreeFlags||o){o=P.T,P.T=null,i=R.p,R.p=2,a=tu,tu|=4;try{!function(e,t){if(e=e.containerInfo,af=cd,$r(e=Jr(e))){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var o=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(o&&0!==o.rangeCount){r=o.anchorNode;var i=o.anchorOffset,s=o.focusNode;o=o.focusOffset;try{r.nodeType,s.nodeType}catch(e){r=null;break e}var a=0,c=-1,u=-1,l=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||0!==i&&3!==d.nodeType||(c=a+i),d!==s||0!==o&&3!==d.nodeType||(u=a+o),3===d.nodeType&&(a+=d.nodeValue.length),null!==(p=d.firstChild);)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++l===i&&(c=a),h===s&&++f===o&&(u=a),null!==(p=d.nextSibling))break;h=(d=h).parentNode}d=p}r=-1===c||-1===u?null:{start:c,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(cf={focusedElem:e,selectionRange:r},cd=!1,Sc=t;null!==Sc;)if(e=(t=Sc).child,1024&t.subtreeFlags&&null!==e)e.return=t,Sc=e;else for(;null!==Sc;){switch(s=(t=Sc).alternate,e=t.flags,t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==s){e=void 0,r=t,i=s.memoizedProps,s=s.memoizedState,o=r.stateNode;try{var y=ya(r.type,i,(r.elementType,r.type));e=o.getSnapshotBeforeUpdate(y,s),o.__reactInternalSnapshotBeforeUpdate=e}catch(e){yl(r,r.return,e)}}break;case 3:if(1024&e)if(9===(r=(e=t.stateNode.containerInfo).nodeType))xf(e);else if(1===r)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xf(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(n(163))}if(null!==(e=t.sibling)){e.return=t.return,Sc=e;break}Sc=t.return}}(e,t)}finally{tu=a,R.p=i,P.T=o}}Au=1,rl(),nl(),il()}}function rl(){if(1===Au){Au=0;var e=ku,t=Ou,r=!!(13878&t.flags);if(13878&t.subtreeFlags||r){r=P.T,P.T=null;var n=R.p;R.p=2;var o=tu;tu|=4;try{Nc(t,e);var i=cf,s=Jr(e.containerInfo),a=i.focusedElem,c=i.selectionRange;if(s!==a&&a&&a.ownerDocument&&Yr(a.ownerDocument.documentElement,a)){if(null!==c&&$r(a)){var u=c.start,l=c.end;if(void 0===l&&(l=u),"selectionStart"in a)a.selectionStart=u,a.selectionEnd=Math.min(l,a.value.length);else{var f=a.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var h=d.getSelection(),p=a.textContent.length,y=Math.min(c.start,p),g=void 0===c.end?y:Math.min(c.end,p);!h.extend&&y>g&&(s=g,g=y,y=s);var m=Qr(a,y),b=Qr(a,g);if(m&&b&&(1!==h.rangeCount||h.anchorNode!==m.node||h.anchorOffset!==m.offset||h.focusNode!==b.node||h.focusOffset!==b.offset)){var v=f.createRange();v.setStart(m.node,m.offset),h.removeAllRanges(),y>g?(h.addRange(v),h.extend(b.node,b.offset)):(v.setEnd(b.node,b.offset),h.addRange(v))}}}}for(f=[],h=a;h=h.parentNode;)1===h.nodeType&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;a<f.length;a++){var w=f[a];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}cd=!!af,cf=af=null}finally{tu=o,R.p=n,P.T=r}}e.current=t,Au=2}}function nl(){if(2===Au){Au=0;var e=ku,t=Ou,r=!!(8772&t.flags);if(8772&t.subtreeFlags||r){r=P.T,P.T=null;var n=R.p;R.p=2;var o=tu;tu|=4;try{Ec(e,t.alternate,t)}finally{tu=o,R.p=n,P.T=r}}Au=3}}function il(){if(4===Au||3===Au){Au=0,J();var e=ku,t=Ou,r=Tu,n=_u;10256&t.subtreeFlags||10256&t.flags?Au=5:(Au=0,Ou=ku=null,sl(e,e.pendingLanes));var o=e.pendingLanes;if(0===o&&(Eu=null),Te(r),t=t.stateNode,ue&&"function"==typeof ue.onCommitFiberRoot)try{ue.onCommitFiberRoot(ce,t,void 0,!(128&~t.current.flags))}catch(e){}if(null!==n){t=P.T,o=R.p,R.p=2,P.T=null;try{for(var i=e.onRecoverableError,s=0;s<n.length;s++){var a=n[s];i(a.value,{componentStack:a.stack})}}finally{P.T=t,R.p=o}}3&Tu&&cl(),Tl(e),o=e.pendingLanes,4194090&r&&42&o?e===Ru?Pu++:(Pu=0,Ru=e):Pu=0,Cl(0,!1)}}function sl(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,Bo(t)))}function cl(e){return rl(),nl(),il(),fl()}function fl(){if(5!==Au)return!1;var e=ku,t=Cu;Cu=0;var r=Te(Tu),o=P.T,i=R.p;try{R.p=32>r?32:r,P.T=null,r=Iu,Iu=null;var s=ku,a=Tu;if(Au=0,Ou=ku=null,Tu=0,6&tu)throw Error(n(331));var c=tu;if(tu|=4,Qc(s.current),qc(s,s.current,a,r),tu=c,Cl(0,!1),ue&&"function"==typeof ue.onPostCommitFiberRoot)try{ue.onPostCommitFiberRoot(ce,s)}catch(e){}return!0}finally{R.p=i,P.T=o,sl(e,t)}}function hl(e,t,r){t=En(r,t),null!==(e=ii(e,t=Sa(e.stateNode,t,2),2))&&(Ee(e,2),Tl(e))}function yl(e,t,r){if(3===e.tag)hl(e,e,r);else for(;null!==t;){if(3===t.tag){hl(t,e,r);break}if(1===t.tag){var n=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof n.componentDidCatch&&(null===Eu||!Eu.has(n))){e=En(r,e),null!==(n=ii(t,r=Ea(2),2))&&(Aa(r,n,t,e),Ee(n,2),Tl(n));break}}t=t.return}}function gl(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new eu;var o=new Set;n.set(t,o)}else void 0===(o=n.get(t))&&(o=new Set,n.set(t,o));o.has(r)||(uu=!0,o.add(r),e=ml.bind(null,e,t,r),t.then(e,e))}function ml(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,ru===e&&(ou&r)===r&&(4===fu||3===fu&&(62914560&ou)===ou&&300>$()-wu?!(2&tu)&&qu(e,0):pu|=r,gu===ou&&(gu=0)),Tl(e)}function bl(e,t){0===t&&(t=xe()),null!==(e=_n(e,t))&&(Ee(e,t),Tl(e))}function vl(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),bl(e,r)}function wl(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(n(314))}null!==o&&o.delete(t),bl(e,r)}var xl=null,Sl=null,El=!1,Al=!1,kl=!1,Ol=0;function Tl(e){e!==Sl&&null===e.next&&(null===Sl?xl=Sl=e:Sl=Sl.next=e),Al=!0,El||(El=!0,mf(function(){6&tu?X(te,Il):_l()}))}function Cl(e,t){if(!kl&&Al){kl=!0;do{for(var r=!1,n=xl;null!==n;){if(!t)if(0!==e){var o=n.pendingLanes;if(0===o)var i=0;else{var s=n.suspendedLanes,a=n.pingedLanes;i=(1<<31-fe(42|e)+1)-1,i=201326741&(i&=o&~(s&~a))?201326741&i|1:i?2|i:0}0!==i&&(r=!0,Nl(n,i))}else i=ou,!(3&(i=me(n,n===ru?i:0,null!==n.cancelPendingCommit||-1!==n.timeoutHandle)))||be(n,i)||(r=!0,Nl(n,i));n=n.next}}while(r);kl=!1}}function Il(){_l()}function _l(){Al=El=!1;var e=0;0!==Ol&&(function(){var e=window.event;if(e&&"popstate"===e.type)return e!==hf&&(hf=e,!0);return hf=null,!1}()&&(e=Ol),Ol=0);for(var t=$(),r=null,n=xl;null!==n;){var o=n.next,i=Pl(n,t);0===i?(n.next=null,null===r?xl=o:r.next=o,null===o&&(Sl=r)):(r=n,(0!==e||3&i)&&(Al=!0)),n=o}Cl(e,!1)}function Pl(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,i=-62914561&e.pendingLanes;0<i;){var s=31-fe(i),a=1<<s,c=o[s];-1===c?0!==(a&r)&&0===(a&n)||(o[s]=ve(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}if(r=ou,r=me(e,e===(t=ru)?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),n=e.callbackNode,0===r||e===t&&(2===iu||9===iu)||null!==e.cancelPendingCommit)return null!==n&&null!==n&&Q(n),e.callbackNode=null,e.callbackPriority=0;if(!(3&r)||be(e,r)){if((t=r&-r)===e.callbackPriority)return t;switch(null!==n&&Q(n),Te(r)){case 2:case 8:r=re;break;case 32:default:r=ne;break;case 268435456:r=ie}return n=Rl.bind(null,e),r=X(r,n),e.callbackPriority=t,e.callbackNode=r,t}return null!==n&&null!==n&&Q(n),e.callbackPriority=2,e.callbackNode=null,2}function Rl(e,t){if(0!==Au&&5!==Au)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(cl()&&e.callbackNode!==r)return null;var n=ou;return 0===(n=me(e,e===ru?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Mu(e,n,t),Pl(e,$()),null!=e.callbackNode&&e.callbackNode===r?Rl.bind(null,e):null)}function Nl(e,t){if(cl())return null;Mu(e,t,!0)}function Bl(){return 0===Ol&&(Ol=we()),Ol}function jl(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:Tt(""+e)}function Ml(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}for(var Ll=0;Ll<wn.length;Ll++){var Ul=wn[Ll];xn(Ul.toLowerCase(),"on"+(Ul[0].toUpperCase()+Ul.slice(1)))}xn(dn,"onAnimationEnd"),xn(hn,"onAnimationIteration"),xn(pn,"onAnimationStart"),xn("dblclick","onDoubleClick"),xn("focusin","onFocus"),xn("focusout","onBlur"),xn(yn,"onTransitionRun"),xn(gn,"onTransitionStart"),xn(mn,"onTransitionCancel"),xn(bn,"onTransitionEnd"),Ge("onMouseEnter",["mouseout","mouseover"]),Ge("onMouseLeave",["mouseout","mouseover"]),Ge("onPointerEnter",["pointerout","pointerover"]),Ge("onPointerLeave",["pointerout","pointerover"]),We("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),We("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),We("onBeforeInput",["compositionend","keypress","textInput","paste"]),We("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),We("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),We("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Fl=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dl));function zl(e,t){t=!!(4&t);for(var r=0;r<e.length;r++){var n=e[r],o=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var s=n.length-1;0<=s;s--){var a=n[s],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&o.isPropagationStopped())break e;i=a,o.currentTarget=u;try{i(o)}catch(e){ga(e)}o.currentTarget=null,i=c}else for(s=0;s<n.length;s++){if(c=(a=n[s]).instance,u=a.currentTarget,a=a.listener,c!==i&&o.isPropagationStopped())break e;i=a,o.currentTarget=u;try{i(o)}catch(e){ga(e)}o.currentTarget=null,i=c}}}}function ql(e,t){var r=t[Ne];void 0===r&&(r=t[Ne]=new Set);var n=e+"__bubble";r.has(n)||(Wl(t,e,2,!1),r.add(n))}function Vl(e,t,r){var n=0;t&&(n|=4),Wl(r,e,n,t)}var Hl="_reactListening"+Math.random().toString(36).slice(2);function Kl(e){if(!e[Hl]){e[Hl]=!0,He.forEach(function(t){"selectionchange"!==t&&(Fl.has(t)||Vl(t,!1,e),Vl(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Hl]||(t[Hl]=!0,Vl("selectionchange",!1,t))}}function Wl(e,t,r,n){switch(yd(t)){case 2:var o=ud;break;case 8:o=ld;break;default:o=fd}r=o.bind(null,t,r,e),o=void 0,!Lt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),n?void 0!==o?e.addEventListener(t,r,{capture:!0,passive:o}):e.addEventListener(t,r,!0):void 0!==o?e.addEventListener(t,r,{passive:o}):e.addEventListener(t,r,!1)}function Gl(e,t,r,n,o){var s=n;if(!(1&t||2&t||null===n))e:for(;;){if(null===n)return;var a=n.tag;if(3===a||4===a){var c=n.stateNode.containerInfo;if(c===o)break;if(4===a)for(a=n.return;null!==a;){var u=a.tag;if((3===u||4===u)&&a.stateNode.containerInfo===o)return;a=a.return}for(;null!==c;){if(null===(a=De(c)))return;if(5===(u=a.tag)||6===u||26===u||27===u){n=s=a;continue e}c=c.parentNode}}n=n.return}Bt(function(){var n=s,o=It(r),a=[];e:{var c=vn.get(e);if(void 0!==c){var u=Yt,l=e;switch(e){case"keypress":if(0===Vt(r))break e;case"keydown":case"keyup":u=hr;break;case"focusin":l="focus",u=nr;break;case"focusout":l="blur",u=nr;break;case"beforeblur":case"afterblur":u=nr;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=tr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=rr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=yr;break;case dn:case hn:case pn:u=or;break;case bn:u=gr;break;case"scroll":case"scrollend":u=$t;break;case"wheel":u=mr;break;case"copy":case"cut":case"paste":u=ir;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=pr;break;case"toggle":case"beforetoggle":u=br}var f=!!(4&t),d=!f&&("scroll"===e||"scrollend"===e),h=f?null!==c?c+"Capture":null:c;f=[];for(var p,y=n;null!==y;){var g=y;if(p=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===p||null===h||null!=(g=jt(y,h))&&f.push(Xl(y,g,p)),d)break;y=y.return}0<f.length&&(c=new u(c,l,null,r,o),a.push({event:c,listeners:f}))}}if(!(7&t)){if(u="mouseout"===e||"pointerout"===e,(!(c="mouseover"===e||"pointerover"===e)||r===Ct||!(l=r.relatedTarget||r.fromElement)||!De(l)&&!l[Re])&&(u||c)&&(c=o.window===o?o:(c=o.ownerDocument)?c.defaultView||c.parentWindow:window,u?(u=n,null!==(l=(l=r.relatedTarget||r.toElement)?De(l):null)&&(d=i(l),f=l.tag,l!==d||5!==f&&27!==f&&6!==f)&&(l=null)):(u=null,l=n),u!==l)){if(f=tr,g="onMouseLeave",h="onMouseEnter",y="mouse","pointerout"!==e&&"pointerover"!==e||(f=pr,g="onPointerLeave",h="onPointerEnter",y="pointer"),d=null==u?c:ze(u),p=null==l?c:ze(l),(c=new f(g,y+"leave",u,r,o)).target=d,c.relatedTarget=p,g=null,De(o)===n&&((f=new f(h,y+"enter",l,r,o)).target=p,f.relatedTarget=d,g=f),d=g,u&&l)e:{for(h=l,y=0,p=f=u;p;p=Ql(p))y++;for(p=0,g=h;g;g=Ql(g))p++;for(;0<y-p;)f=Ql(f),y--;for(;0<p-y;)h=Ql(h),p--;for(;y--;){if(f===h||null!==h&&f===h.alternate)break e;f=Ql(f),h=Ql(h)}f=null}else f=null;null!==u&&Yl(a,c,u,f,!1),null!==l&&null!==d&&Yl(a,d,l,f,!0)}if("select"===(u=(c=n?ze(n):window).nodeName&&c.nodeName.toLowerCase())||"input"===u&&"file"===c.type)var m=Mr;else if(_r(c))if(Lr)m=Wr;else{m=Hr;var b=Vr}else!(u=c.nodeName)||"input"!==u.toLowerCase()||"checkbox"!==c.type&&"radio"!==c.type?n&&At(n.elementType)&&(m=Mr):m=Kr;switch(m&&(m=m(e,n))?Pr(a,m,r,o):(b&&b(e,c,n),"focusout"===e&&n&&"number"===c.type&&null!=n.memoizedProps.value&&gt(c,"number",c.value)),b=n?ze(n):window,e){case"focusin":(_r(b)||"true"===b.contentEditable)&&(tn=b,rn=n,nn=null);break;case"focusout":nn=rn=tn=null;break;case"mousedown":on=!0;break;case"contextmenu":case"mouseup":case"dragend":on=!1,sn(a,r,o);break;case"selectionchange":if(en)break;case"keydown":case"keyup":sn(a,r,o)}var v;if(wr)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Cr?Or(e,r)&&(w="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(w="onCompositionStart");w&&(Er&&"ko"!==r.locale&&(Cr||"onCompositionStart"!==w?"onCompositionEnd"===w&&Cr&&(v=qt()):(Ft="value"in(Dt=o)?Dt.value:Dt.textContent,Cr=!0)),0<(b=Zl(n,w)).length&&(w=new sr(w,e,null,r,o),a.push({event:w,listeners:b}),v?w.data=v:null!==(v=Tr(r))&&(w.data=v))),(v=Sr?function(e,t){switch(e){case"compositionend":return Tr(t);case"keypress":return 32!==t.which?null:(kr=!0,Ar);case"textInput":return(e=t.data)===Ar&&kr?null:e;default:return null}}(e,r):function(e,t){if(Cr)return"compositionend"===e||!wr&&Or(e,t)?(e=qt(),zt=Ft=Dt=null,Cr=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Er&&"ko"!==t.locale?null:t.data}}(e,r))&&(0<(w=Zl(n,"onBeforeInput")).length&&(b=new sr("onBeforeInput","beforeinput",null,r,o),a.push({event:b,listeners:w}),b.data=v)),function(e,t,r,n,o){if("submit"===t&&r&&r.stateNode===o){var i=jl((o[Pe]||null).action),s=n.submitter;s&&null!==(t=(t=s[Pe]||null)?jl(t.formAction):s.getAttribute("formAction"))&&(i=t,s=null);var a=new Yt("action","action",null,n,o);e.push({event:a,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(0!==Ol){var e=s?Ml(o,s):new FormData(o);_s(r,{pending:!0,data:e,method:o.method,action:i},null,e)}}else"function"==typeof i&&(a.preventDefault(),e=s?Ml(o,s):new FormData(o),_s(r,{pending:!0,data:e,method:o.method,action:i},i,e))},currentTarget:o}]})}}(a,e,n,r,o)}zl(a,t)})}function Xl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Zl(e,t){for(var r=t+"Capture",n=[];null!==e;){var o=e,i=o.stateNode;if(5!==(o=o.tag)&&26!==o&&27!==o||null===i||(null!=(o=jt(e,r))&&n.unshift(Xl(e,o,i)),null!=(o=jt(e,t))&&n.push(Xl(e,o,i))),3===e.tag)return n;e=e.return}return[]}function Ql(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function Yl(e,t,r,n,o){for(var i=t._reactName,s=[];null!==r&&r!==n;){var a=r,c=a.alternate,u=a.stateNode;if(a=a.tag,null!==c&&c===n)break;5!==a&&26!==a&&27!==a||null===u||(c=u,o?null!=(u=jt(r,i))&&s.unshift(Xl(r,u,c)):o||null!=(u=jt(r,i))&&s.push(Xl(r,u,c))),r=r.return}0!==s.length&&e.push({event:t,listeners:s})}var Jl=/\r\n?/g,$l=/\u0000|\uFFFD/g;function ef(e){return("string"==typeof e?e:""+e).replace(Jl,"\n").replace($l,"")}function tf(e,t){return t=ef(t),ef(e)===t}function rf(){}function nf(e,t,r,o,i,s){switch(r){case"children":"string"==typeof o?"body"===t||"textarea"===t&&""===o||wt(e,o):("number"==typeof o||"bigint"==typeof o)&&"body"!==t&&wt(e,""+o);break;case"className":et(e,"class",o);break;case"tabIndex":et(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":et(e,r,o);break;case"style":Et(e,o,s);break;case"data":if("object"!==t){et(e,"data",o);break}case"src":case"href":if(""===o&&("a"!==t||"href"!==r)){e.removeAttribute(r);break}if(null==o||"function"==typeof o||"symbol"==typeof o||"boolean"==typeof o){e.removeAttribute(r);break}o=Tt(""+o),e.setAttribute(r,o);break;case"action":case"formAction":if("function"==typeof o){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"==typeof s&&("formAction"===r?("input"!==t&&nf(e,t,"name",i.name,i,null),nf(e,t,"formEncType",i.formEncType,i,null),nf(e,t,"formMethod",i.formMethod,i,null),nf(e,t,"formTarget",i.formTarget,i,null)):(nf(e,t,"encType",i.encType,i,null),nf(e,t,"method",i.method,i,null),nf(e,t,"target",i.target,i,null))),null==o||"symbol"==typeof o||"boolean"==typeof o){e.removeAttribute(r);break}o=Tt(""+o),e.setAttribute(r,o);break;case"onClick":null!=o&&(e.onclick=rf);break;case"onScroll":null!=o&&ql("scroll",e);break;case"onScrollEnd":null!=o&&ql("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=o){if("object"!=typeof o||!("__html"in o))throw Error(n(61));if(null!=(r=o.__html)){if(null!=i.children)throw Error(n(60));e.innerHTML=r}}break;case"multiple":e.multiple=o&&"function"!=typeof o&&"symbol"!=typeof o;break;case"muted":e.muted=o&&"function"!=typeof o&&"symbol"!=typeof o;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==o||"function"==typeof o||"boolean"==typeof o||"symbol"==typeof o){e.removeAttribute("xlink:href");break}r=Tt(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=o&&"function"!=typeof o&&"symbol"!=typeof o?e.setAttribute(r,""+o):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&"function"!=typeof o&&"symbol"!=typeof o?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":!0===o?e.setAttribute(r,""):!1!==o&&null!=o&&"function"!=typeof o&&"symbol"!=typeof o?e.setAttribute(r,o):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&!isNaN(o)&&1<=o?e.setAttribute(r,o):e.removeAttribute(r);break;case"rowSpan":case"start":null==o||"function"==typeof o||"symbol"==typeof o||isNaN(o)?e.removeAttribute(r):e.setAttribute(r,o);break;case"popover":ql("beforetoggle",e),ql("toggle",e),$e(e,"popover",o);break;case"xlinkActuate":tt(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":tt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":tt(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":tt(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":tt(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":tt(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":tt(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":tt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":tt(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":$e(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<r.length)||"o"!==r[0]&&"O"!==r[0]||"n"!==r[1]&&"N"!==r[1])&&$e(e,r=kt.get(r)||r,o)}}function of(e,t,r,o,i,s){switch(r){case"style":Et(e,o,s);break;case"dangerouslySetInnerHTML":if(null!=o){if("object"!=typeof o||!("__html"in o))throw Error(n(61));if(null!=(r=o.__html)){if(null!=i.children)throw Error(n(60));e.innerHTML=r}}break;case"children":"string"==typeof o?wt(e,o):("number"==typeof o||"bigint"==typeof o)&&wt(e,""+o);break;case"onScroll":null!=o&&ql("scroll",e);break;case"onScrollEnd":null!=o&&ql("scrollend",e);break;case"onClick":null!=o&&(e.onclick=rf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:Ke.hasOwnProperty(r)||("o"!==r[0]||"n"!==r[1]||(i=r.endsWith("Capture"),t=r.slice(2,i?r.length-7:void 0),"function"==typeof(s=null!=(s=e[Pe]||null)?s[r]:null)&&e.removeEventListener(t,s,i),"function"!=typeof o)?r in e?e[r]=o:!0===o?e.setAttribute(r,""):$e(e,r,o):("function"!=typeof s&&null!==s&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,o,i)))}}function sf(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ql("error",e),ql("load",e);var o,i=!1,s=!1;for(o in r)if(r.hasOwnProperty(o)){var a=r[o];if(null!=a)switch(o){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,t));default:nf(e,t,o,a,r,null)}}return s&&nf(e,t,"srcSet",r.srcSet,r,null),void(i&&nf(e,t,"src",r.src,r,null));case"input":ql("invalid",e);var c=o=a=s=null,u=null,l=null;for(i in r)if(r.hasOwnProperty(i)){var f=r[i];if(null!=f)switch(i){case"name":s=f;break;case"type":a=f;break;case"checked":u=f;break;case"defaultChecked":l=f;break;case"value":o=f;break;case"defaultValue":c=f;break;case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(n(137,t));break;default:nf(e,t,i,f,r,null)}}return yt(e,o,c,u,l,a,s,!1),void ut(e);case"select":for(s in ql("invalid",e),i=a=o=null,r)if(r.hasOwnProperty(s)&&null!=(c=r[s]))switch(s){case"value":o=c;break;case"defaultValue":a=c;break;case"multiple":i=c;default:nf(e,t,s,c,r,null)}return t=o,r=a,e.multiple=!!i,void(null!=t?mt(e,!!i,t,!1):null!=r&&mt(e,!!i,r,!0));case"textarea":for(a in ql("invalid",e),o=s=i=null,r)if(r.hasOwnProperty(a)&&null!=(c=r[a]))switch(a){case"value":i=c;break;case"defaultValue":s=c;break;case"children":o=c;break;case"dangerouslySetInnerHTML":if(null!=c)throw Error(n(91));break;default:nf(e,t,a,c,r,null)}return vt(e,i,s,o),void ut(e);case"option":for(u in r)if(r.hasOwnProperty(u)&&null!=(i=r[u]))if("selected"===u)e.selected=i&&"function"!=typeof i&&"symbol"!=typeof i;else nf(e,t,u,i,r,null);return;case"dialog":ql("beforetoggle",e),ql("toggle",e),ql("cancel",e),ql("close",e);break;case"iframe":case"object":ql("load",e);break;case"video":case"audio":for(i=0;i<Dl.length;i++)ql(Dl[i],e);break;case"image":ql("error",e),ql("load",e);break;case"details":ql("toggle",e);break;case"embed":case"source":case"link":ql("error",e),ql("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(l in r)if(r.hasOwnProperty(l)&&null!=(i=r[l]))switch(l){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,t));default:nf(e,t,l,i,r,null)}return;default:if(At(t)){for(f in r)r.hasOwnProperty(f)&&(void 0!==(i=r[f])&&of(e,t,f,i,r,void 0));return}}for(c in r)r.hasOwnProperty(c)&&(null!=(i=r[c])&&nf(e,t,c,i,r,null))}var af=null,cf=null;function uf(e){return 9===e.nodeType?e:e.ownerDocument}function lf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ff(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function df(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var hf=null;var pf="function"==typeof setTimeout?setTimeout:void 0,yf="function"==typeof clearTimeout?clearTimeout:void 0,gf="function"==typeof Promise?Promise:void 0,mf="function"==typeof queueMicrotask?queueMicrotask:void 0!==gf?function(e){return gf.resolve(null).then(e).catch(bf)}:pf;function bf(e){setTimeout(function(){throw e})}function vf(e){return"head"===e}function wf(e,t){var r=t,n=0,o=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&8===i.nodeType)if("/$"===(r=i.data)){if(0<n&&8>n){r=n;var s=e.ownerDocument;if(1&r&&Tf(s.documentElement),2&r&&Tf(s.body),4&r)for(Tf(r=s.head),s=r.firstChild;s;){var a=s.nextSibling,c=s.nodeName;s[Le]||"SCRIPT"===c||"STYLE"===c||"LINK"===c&&"stylesheet"===s.rel.toLowerCase()||r.removeChild(s),s=a}}if(0===o)return e.removeChild(i),void Nd(t);o--}else"$"===r||"$?"===r||"$!"===r?o++:n=r.charCodeAt(0)-48;else n=0;r=i}while(r);Nd(t)}function xf(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":xf(r),Ue(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===r.rel.toLowerCase())continue}e.removeChild(r)}}function Sf(e){return"$!"===e.data||"$?"===e.data&&"complete"===e.ownerDocument.readyState}function Ef(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"F!"===t||"F"===t)break;if("/$"===t)return null}}return e}var Af=null;function kf(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}function Of(e,t,r){switch(t=uf(r),e){case"html":if(!(e=t.documentElement))throw Error(n(452));return e;case"head":if(!(e=t.head))throw Error(n(453));return e;case"body":if(!(e=t.body))throw Error(n(454));return e;default:throw Error(n(451))}}function Tf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ue(e)}var Cf=new Map,If=new Set;function _f(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var Pf=R.d;R.d={f:function(){var e=Pf.f(),t=Fu();return e||t},r:function(e){var t=Fe(e);null!==t&&5===t.tag&&"form"===t.type?Rs(t):Pf.r(e)},D:function(e){Pf.D(e),Nf("dns-prefetch",e,null)},C:function(e,t){Pf.C(e,t),Nf("preconnect",e,t)},L:function(e,t,r){Pf.L(e,t,r);var n=Rf;if(n&&e&&t){var o='link[rel="preload"][as="'+ht(t)+'"]';"image"===t&&r&&r.imageSrcSet?(o+='[imagesrcset="'+ht(r.imageSrcSet)+'"]',"string"==typeof r.imageSizes&&(o+='[imagesizes="'+ht(r.imageSizes)+'"]')):o+='[href="'+ht(e)+'"]';var i=o;switch(t){case"style":i=jf(e);break;case"script":i=Uf(e)}Cf.has(i)||(e=u({rel:"preload",href:"image"===t&&r&&r.imageSrcSet?void 0:e,as:t},r),Cf.set(i,e),null!==n.querySelector(o)||"style"===t&&n.querySelector(Mf(i))||"script"===t&&n.querySelector(Df(i))||(sf(t=n.createElement("link"),"link",e),Ve(t),n.head.appendChild(t)))}},m:function(e,t){Pf.m(e,t);var r=Rf;if(r&&e){var n=t&&"string"==typeof t.as?t.as:"script",o='link[rel="modulepreload"][as="'+ht(n)+'"][href="'+ht(e)+'"]',i=o;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Uf(e)}if(!Cf.has(i)&&(e=u({rel:"modulepreload",href:e},t),Cf.set(i,e),null===r.querySelector(o))){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Df(i)))return}sf(n=r.createElement("link"),"link",e),Ve(n),r.head.appendChild(n)}}},X:function(e,t){Pf.X(e,t);var r=Rf;if(r&&e){var n=qe(r).hoistableScripts,o=Uf(e),i=n.get(o);i||((i=r.querySelector(Df(o)))||(e=u({src:e,async:!0},t),(t=Cf.get(o))&&Vf(e,t),Ve(i=r.createElement("script")),sf(i,"link",e),r.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(o,i))}},S:function(e,t,r){Pf.S(e,t,r);var n=Rf;if(n&&e){var o=qe(n).hoistableStyles,i=jf(e);t=t||"default";var s=o.get(i);if(!s){var a={loading:0,preload:null};if(s=n.querySelector(Mf(i)))a.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},r),(r=Cf.get(i))&&qf(e,r);var c=s=n.createElement("link");Ve(c),sf(c,"link",e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener("load",function(){a.loading|=1}),c.addEventListener("error",function(){a.loading|=2}),a.loading|=4,zf(s,t,n)}s={type:"stylesheet",instance:s,count:1,state:a},o.set(i,s)}}},M:function(e,t){Pf.M(e,t);var r=Rf;if(r&&e){var n=qe(r).hoistableScripts,o=Uf(e),i=n.get(o);i||((i=r.querySelector(Df(o)))||(e=u({src:e,async:!0,type:"module"},t),(t=Cf.get(o))&&Vf(e,t),Ve(i=r.createElement("script")),sf(i,"link",e),r.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(o,i))}}};var Rf="undefined"==typeof document?null:document;function Nf(e,t,r){var n=Rf;if(n&&"string"==typeof t&&t){var o=ht(t);o='link[rel="'+e+'"][href="'+o+'"]',"string"==typeof r&&(o+='[crossorigin="'+r+'"]'),If.has(o)||(If.add(o),e={rel:e,crossOrigin:r,href:t},null===n.querySelector(o)&&(sf(t=n.createElement("link"),"link",e),Ve(t),n.head.appendChild(t)))}}function Bf(e,t,r,o){var i=(i=z.current)?_f(i):null;if(!i)throw Error(n(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof r.precedence&&"string"==typeof r.href?(t=jf(r.href),(o=(r=qe(i).hoistableStyles).get(t))||(o={type:"style",instance:null,count:0,state:null},r.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===r.rel&&"string"==typeof r.href&&"string"==typeof r.precedence){e=jf(r.href);var s=qe(i).hoistableStyles,a=s.get(e);if(a||(i=i.ownerDocument||i,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,a),(s=i.querySelector(Mf(e)))&&!s._p&&(a.instance=s,a.state.loading=5),Cf.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Cf.set(e,r),s||function(e,t,r,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),sf(t,"link",r),Ve(t),e.head.appendChild(t))}(i,e,r,a.state))),t&&null===o)throw Error(n(528,""));return a}if(t&&null!==o)throw Error(n(529,""));return null;case"script":return t=r.async,"string"==typeof(r=r.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=Uf(r),(o=(r=qe(i).hoistableScripts).get(t))||(o={type:"script",instance:null,count:0,state:null},r.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,e))}}function jf(e){return'href="'+ht(e)+'"'}function Mf(e){return'link[rel="stylesheet"]['+e+"]"}function Lf(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function Uf(e){return'[src="'+ht(e)+'"]'}function Df(e){return"script[async]"+e}function Ff(e,t,r){if(t.count++,null===t.instance)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+ht(r.href)+'"]');if(o)return t.instance=o,Ve(o),o;var i=u({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return Ve(o=(e.ownerDocument||e).createElement("style")),sf(o,"style",i),zf(o,r.precedence,e),t.instance=o;case"stylesheet":i=jf(r.href);var s=e.querySelector(Mf(i));if(s)return t.state.loading|=4,t.instance=s,Ve(s),s;o=Lf(r),(i=Cf.get(i))&&qf(o,i),Ve(s=(e.ownerDocument||e).createElement("link"));var a=s;return a._p=new Promise(function(e,t){a.onload=e,a.onerror=t}),sf(s,"link",o),t.state.loading|=4,zf(s,r.precedence,e),t.instance=s;case"script":return s=Uf(r.src),(i=e.querySelector(Df(s)))?(t.instance=i,Ve(i),i):(o=r,(i=Cf.get(s))&&Vf(o=u({},r),i),Ve(i=(e=e.ownerDocument||e).createElement("script")),sf(i,"link",o),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(n(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(o=t.instance,t.state.loading|=4,zf(o,r.precedence,e));return t.instance}function zf(e,t,r){for(var n=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=n.length?n[n.length-1]:null,i=o,s=0;s<n.length;s++){var a=n[s];if(a.dataset.precedence===t)i=a;else if(i!==o)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=9===r.nodeType?r.head:r).insertBefore(e,t.firstChild)}function qf(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function Vf(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Hf=null;function Kf(e,t,r){if(null===Hf){var n=new Map,o=Hf=new Map;o.set(r,n)}else(n=(o=Hf).get(r))||(n=new Map,o.set(r,n));if(n.has(e))return n;for(n.set(e,null),r=r.getElementsByTagName(e),o=0;o<r.length;o++){var i=r[o];if(!(i[Le]||i[_e]||"link"===e&&"stylesheet"===i.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==i.namespaceURI){var s=i.getAttribute(t)||"";s=e+s;var a=n.get(s);a?a.push(i):n.set(s,[i])}}return n}function Wf(e,t,r){(e=e.ownerDocument||e).head.insertBefore(r,"title"===t?e.querySelector("head > title"):null)}function Gf(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var Xf=null;function Zf(){}function Qf(){if(this.count--,0===this.count)if(this.stylesheets)Jf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var Yf=null;function Jf(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,Yf=new Map,t.forEach($f,e),Yf=null,Qf.call(e))}function $f(e,t){if(!(4&t.state.loading)){var r=Yf.get(e);if(r)var n=r.get(null);else{r=new Map,Yf.set(e,r);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<o.length;i++){var s=o[i];"LINK"!==s.nodeName&&"not all"===s.getAttribute("media")||(r.set(s.dataset.precedence,s),n=s)}n&&r.set(null,n)}s=(o=t.instance).getAttribute("data-precedence"),(i=r.get(s)||n)===n&&r.set(null,o),r.set(s,o),this.count++,n=Qf.bind(this),o.addEventListener("load",n),o.addEventListener("error",n),i?i.parentNode.insertBefore(o,i.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(o,e.firstChild),t.state.loading|=4}}var ed={$$typeof:b,Provider:null,Consumer:null,_currentValue:N,_currentValue2:N,_threadCount:0};function td(e,t,r,n,o,i,s,a){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Se(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Se(0),this.hiddenUpdates=Se(null),this.identifierPrefix=n,this.onUncaughtError=o,this.onCaughtError=i,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=a,this.incompleteTransitions=new Map}function rd(e,t,r,n,o,i,s,a,c,u,l,f){return e=new td(e,t,r,s,a,c,u,f),t=1,!0===i&&(t|=24),i=jn(3,null,null,t),e.current=i,i.stateNode=e,(t=No()).refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:r,cache:t},ri(i),e}function nd(e){return e?e=Nn:Nn}function od(e,t,r,n,o,i){o=nd(o),null===n.context?n.context=o:n.pendingContext=o,(n=oi(t)).payload={element:r},null!==(i=void 0===i?null:i)&&(n.callback=i),null!==(r=ii(e,n,t))&&(ju(r,0,t),si(r,e,t))}function id(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function sd(e,t){id(e,t),(e=e.alternate)&&id(e,t)}function ad(e){if(13===e.tag){var t=_n(e,67108864);null!==t&&ju(t,0,67108864),sd(e,67108864)}}var cd=!0;function ud(e,t,r,n){var o=P.T;P.T=null;var i=R.p;try{R.p=2,fd(e,t,r,n)}finally{R.p=i,P.T=o}}function ld(e,t,r,n){var o=P.T;P.T=null;var i=R.p;try{R.p=8,fd(e,t,r,n)}finally{R.p=i,P.T=o}}function fd(e,t,r,n){if(cd){var o=dd(n);if(null===o)Gl(e,t,n,hd,r),Ad(e,n);else if(function(e,t,r,n,o){switch(t){case"focusin":return md=kd(md,e,t,r,n,o),!0;case"dragenter":return bd=kd(bd,e,t,r,n,o),!0;case"mouseover":return vd=kd(vd,e,t,r,n,o),!0;case"pointerover":var i=o.pointerId;return wd.set(i,kd(wd.get(i)||null,e,t,r,n,o)),!0;case"gotpointercapture":return i=o.pointerId,xd.set(i,kd(xd.get(i)||null,e,t,r,n,o)),!0}return!1}(o,e,t,r,n))n.stopPropagation();else if(Ad(e,n),4&t&&-1<Ed.indexOf(e)){for(;null!==o;){var i=Fe(o);if(null!==i)switch(i.tag){case 3:if((i=i.stateNode).current.memoizedState.isDehydrated){var s=ge(i.pendingLanes);if(0!==s){var a=i;for(a.pendingLanes|=2,a.entangledLanes|=2;s;){var c=1<<31-fe(s);a.entanglements[1]|=c,s&=~c}Tl(i),!(6&tu)&&(xu=$()+500,Cl(0,!1))}}break;case 13:null!==(a=_n(i,2))&&ju(a,0,2),Fu(),sd(i,2)}if(null===(i=dd(n))&&Gl(e,t,n,hd,r),i===o)break;o=i}null!==o&&n.stopPropagation()}else Gl(e,t,n,null,r)}}function dd(e){return pd(e=It(e))}var hd=null;function pd(e){if(hd=null,null!==(e=De(e))){var t=i(e);if(null===t)e=null;else{var r=t.tag;if(13===r){if(null!==(e=s(t)))return e;e=null}else if(3===r){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return hd=e,null}function yd(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ee()){case te:return 2;case re:return 8;case ne:case oe:return 32;case ie:return 268435456;default:return 32}default:return 32}}var gd=!1,md=null,bd=null,vd=null,wd=new Map,xd=new Map,Sd=[],Ed="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ad(e,t){switch(e){case"focusin":case"focusout":md=null;break;case"dragenter":case"dragleave":bd=null;break;case"mouseover":case"mouseout":vd=null;break;case"pointerover":case"pointerout":wd.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xd.delete(t.pointerId)}}function kd(e,t,r,n,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[o]},null!==t&&(null!==(t=Fe(t))&&ad(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Od(e){var t=De(e.target);if(null!==t){var r=i(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=s(r)))return e.blockedOn=t,void function(e,t){var r=R.p;try{return R.p=e,t()}finally{R.p=r}}(e.priority,function(){if(13===r.tag){var e=Nu();e=Oe(e);var t=_n(r,e);null!==t&&ju(t,0,e),sd(r,e)}})}else if(3===t&&r.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function Td(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=dd(e.nativeEvent);if(null!==r)return null!==(t=Fe(r))&&ad(t),e.blockedOn=r,!1;var n=new(r=e.nativeEvent).constructor(r.type,r);Ct=n,r.target.dispatchEvent(n),Ct=null,t.shift()}return!0}function Cd(e,t,r){Td(e)&&r.delete(t)}function Id(){gd=!1,null!==md&&Td(md)&&(md=null),null!==bd&&Td(bd)&&(bd=null),null!==vd&&Td(vd)&&(vd=null),wd.forEach(Cd),xd.forEach(Cd)}function _d(t,r){t.blockedOn===r&&(t.blockedOn=null,gd||(gd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Id)))}var Pd=null;function Rd(t){Pd!==t&&(Pd=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Pd===t&&(Pd=null);for(var e=0;e<t.length;e+=3){var r=t[e],n=t[e+1],o=t[e+2];if("function"!=typeof n){if(null===pd(n||r))continue;break}var i=Fe(r);null!==i&&(t.splice(e,3),e-=3,_s(i,{pending:!0,data:o,method:r.method,action:n},n,o))}}))}function Nd(e){function t(t){return _d(t,e)}null!==md&&_d(md,e),null!==bd&&_d(bd,e),null!==vd&&_d(vd,e),wd.forEach(t),xd.forEach(t);for(var r=0;r<Sd.length;r++){var n=Sd[r];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Sd.length&&null===(r=Sd[0]).blockedOn;)Od(r),null===r.blockedOn&&Sd.shift();if(null!=(r=(e.ownerDocument||e).$$reactFormReplay))for(n=0;n<r.length;n+=3){var o=r[n],i=r[n+1],s=o[Pe]||null;if("function"==typeof i)s||Rd(r);else if(s){var a=null;if(i&&i.hasAttribute("formAction")){if(o=i,s=i[Pe]||null)a=s.formAction;else if(null!==pd(o))continue}else a=s.action;"function"==typeof a?r[n+1]=a:(r.splice(n,3),n-=3),Rd(r)}}}function Bd(e){this._internalRoot=e}function jd(e){this._internalRoot=e}jd.prototype.render=Bd.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(n(409));od(t.current,Nu(),e,t,null,null)},jd.prototype.unmount=Bd.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;od(e.current,2,null,e,null,null),Fu(),t[Re]=null}},jd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ce();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Sd.length&&0!==t&&t<Sd[r].priority;r++);Sd.splice(r,0,e),0===r&&Od(e)}};var Md=t.version;if("19.1.1"!==Md)throw Error(n(527,Md,"19.1.1"));R.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(n(188));throw e=Object.keys(e).join(","),Error(n(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=i(e)))throw Error(n(188));return t!==e?null:e}for(var r=e,o=t;;){var s=r.return;if(null===s)break;var c=s.alternate;if(null===c){if(null!==(o=s.return)){r=o;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===r)return a(s),e;if(c===o)return a(s),t;c=c.sibling}throw Error(n(188))}if(r.return!==o.return)r=s,o=c;else{for(var u=!1,l=s.child;l;){if(l===r){u=!0,r=s,o=c;break}if(l===o){u=!0,o=s,r=c;break}l=l.sibling}if(!u){for(l=c.child;l;){if(l===r){u=!0,r=c,o=s;break}if(l===o){u=!0,o=c,r=s;break}l=l.sibling}if(!u)throw Error(n(189))}}if(r.alternate!==o)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?e:t}(t),e=null===(e=null!==e?c(e):null)?null:e.stateNode};var Ld={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.1.1"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Ud=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ud.isDisabled&&Ud.supportsFiber)try{ce=Ud.inject(Ld),ue=Ud}catch(e){}}return ol.createRoot=function(e,t){if(!o(e))throw Error(n(299));var r=!1,i="",s=ma,a=ba,c=va;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onUncaughtError&&(s=t.onUncaughtError),void 0!==t.onCaughtError&&(a=t.onCaughtError),void 0!==t.onRecoverableError&&(c=t.onRecoverableError),void 0!==t.unstable_transitionCallbacks&&t.unstable_transitionCallbacks),t=rd(e,1,!1,null,0,r,i,s,a,c,0,null),e[Re]=t.current,Kl(e),new Bd(t)},ol.hydrateRoot=function(e,t,r){if(!o(e))throw Error(n(299));var i=!1,s="",a=ma,c=ba,u=va,l=null;return null!=r&&(!0===r.unstable_strictMode&&(i=!0),void 0!==r.identifierPrefix&&(s=r.identifierPrefix),void 0!==r.onUncaughtError&&(a=r.onUncaughtError),void 0!==r.onCaughtError&&(c=r.onCaughtError),void 0!==r.onRecoverableError&&(u=r.onRecoverableError),void 0!==r.unstable_transitionCallbacks&&r.unstable_transitionCallbacks,void 0!==r.formState&&(l=r.formState)),(t=rd(e,1,!0,t,0,i,s,a,c,u,0,l)).context=nd(null),r=t.current,(s=oi(i=Oe(i=Nu()))).callback=null,ii(r,s,i),r=i,t.current.lanes=r,Ee(t,r),Tl(t),e[Re]=t.current,Kl(e),new jd(t)},ol.version="19.1.1",ol}var gl,ml,bl=(fl||(fl=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),nl.exports=yl()),nl.exports),vl={exports:{}},wl={};var xl=(ml||(ml=1,vl.exports=function(){if(gl)return wl;gl=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(t,r,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==r.key&&(o=""+r.key),"key"in r)for(var i in n={},r)"key"!==i&&(n[i]=r[i]);else n=r;return r=n.ref,{$$typeof:e,type:t,key:o,ref:void 0!==r?r:null,props:n}}return wl.Fragment=t,wl.jsx=r,wl.jsxs=r,wl}()),vl.exports);var Sl,El=function(e){var t,r,o,i,s=e.isOpen,a=e.onClose,c=void 0===a?function(){}:a,u=e.children,l=e.isSticky,f=void 0!==l&&l,d=e.appearance,h=e.isPersistent,p=Q.useRef(null),y=Q.useState(!1),g=y[0],m=y[1],b=function(e){void 0===e&&(e=460);var t=Q.useState(!1),r=t[0],n=t[1];return Q.useEffect(function(){var t=function(){return n(window.innerWidth<e)};return t(),window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}},[e]),r}(),v=function(e,t){void 0===t&&(t=300);var r=Q.useState({isOpening:!1,isClosing:!1}),o=r[0],i=r[1];return Q.useEffect(function(){if(e){i({isOpening:!0,isClosing:!1});var r=setTimeout(function(){i({isOpening:!1,isClosing:!1})},t);return function(){return clearTimeout(r)}}},[e,t]),n(n({},o),{handleClose:function(e){i({isOpening:!1,isClosing:!0});var r=setTimeout(function(){i({isOpening:!1,isClosing:!1}),e()},t);return function(){return clearTimeout(r)}}})}(s,250),x=v.isClosing,S=v.handleClose,E=function(e,t){void 0===t&&(t=[]);var r=Q.useState("auto"),n=r[0],o=r[1],i=Q.useState(!1),s=i[0],a=i[1],c=Q.useState(!1),u=c[0],l=c[1];return Q.useEffect(function(){var t=e.current;if(t){var r=!1,n=function(){r||t.offsetParent&&(o(t.offsetHeight),a(!0))},i=Array.from(t.getElementsByTagName("img")).filter(function(e){return!(e.complete&&e.naturalHeight>0)});if(0!==i.length){var s=i.length,c=function(){0==(s-=1)&&requestAnimationFrame(function(){return requestAnimationFrame(n)})};return i.forEach(function(e){e.addEventListener("load",c),e.addEventListener("error",c)}),function(){r=!0,i.forEach(function(e){e.removeEventListener("load",c),e.removeEventListener("error",c)})}}requestAnimationFrame(function(){return requestAnimationFrame(n)})}},w(w([],t,!0),[u],!1)),{height:n,isHeightReady:s,reset:function(){a(!1),o("auto"),l(function(e){return!e})}}}(p,[s,u]),A=E.height,k=E.isHeightReady,O=E.reset;return Q.useEffect(function(){if(s&&b){m(!1);var e=requestAnimationFrame(function(){m(!0)});return function(){return cancelAnimationFrame(e)}}},[s,b]),i=s,Q.useEffect(function(){return document.body.style.overflow=i?"hidden":"",function(){document.body.style.overflow=""}},[i]),Q.useEffect(function(){s||O()},[s]),s?xl.jsxs(xl.Fragment,{children:[!h&&xl.jsx("div",{className:"bluxcc:fixed bluxcc:inset-0 bluxcc:z-40 ".concat(x&&!f?"bluxcc:animate-fadeOut":"bluxcc:animate-fadeIn"),style:{backdropFilter:"blur(".concat(d.backdropBlur,")"),WebkitBackdropFilter:"blur(".concat(d.backdropBlur,")"),backgroundColor:d.backdropColor},onClick:f?function(){}:c}),xl.jsx("div",{className:"bluxcc:absolute bluxcc:inset-0 bluxcc:z-9999999 bluxcc:flex bluxcc:items-center bluxcc:justify-center ".concat(x&&!f&&"bluxcc:animate-fadeOut"),onClick:function(e){e.target!==e.currentTarget||f||S(c)},children:xl.jsx("div",{id:"bluxcc-modal",className:"bluxcc:box-border ".concat(b?"bluxcc:fixed bluxcc:bottom-0 bluxcc:left-0 bluxcc:w-full bluxcc:rounded-b-none!":"bluxcc:relative bluxcc:w-[360px]!"),style:{height:"number"==typeof A?"".concat(b?A+20:A,"px"):A,transition:k?"height 250ms ease-in-out, border-radius 250ms, opacity 250ms ease-out, outline 250ms ease-out, color 250ms ease-out".concat(b?", transform 250ms ease-out":""):"border-radius 250ms, opacity 250ms ease-out".concat(b?", transform 250ms ease-out":""),transform:b?x?"translateY(100%)":g?"translateY(0%)":"translateY(80%)":"",background:d.background,opacity:x&&!f?"0":"1",color:d.textColor,fontFamily:d.fontFamily,letterSpacing:"-0.04px",borderRadius:null!==(t=d.outlineRadius)&&void 0!==t?t:d.borderRadius,outline:"".concat(null!==(r=d.outlineWidth)&&void 0!==r?r:d.borderWidth," solid ").concat(null!==(o=d.outlineColor)&&void 0!==o?o:d.borderColor),overflow:"hidden",boxShadow:d.boxShadow},children:xl.jsx("div",{ref:p,className:"bluxcc:px-6 bluxcc:pb-4",style:{fontFamily:d.fontFamily,opacity:k?1:0,transition:"opacity 200ms ease-in-out"},children:u})})})]}):null},Al=function(){return function(e,t){return function(e,t,r){var n,o;void 0===r&&(r={});var i=(null===(n=yu[e])||void 0===n?void 0:n[t])||(null===(o=yu[e])||void 0===o?void 0:o.en)||"";return Nu(i,r)}(e,"en",t||{})}},kl=function(e){var t=e.fill,r=void 0===t?"#1C1B1F":t;return xl.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_3292_590",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:xl.jsx("rect",{width:"20",height:"20",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_3292_590)",children:xl.jsx("path",{d:"M9.1662 14.166H10.8329V9.16601H9.1662V14.166ZM9.99953 7.49935C10.2356 7.49935 10.4336 7.41949 10.5933 7.25976C10.753 7.10004 10.8329 6.90213 10.8329 6.66601C10.8329 6.4299 10.753 6.23199 10.5933 6.07226C10.4336 5.91254 10.2356 5.83268 9.99953 5.83268C9.76342 5.83268 9.5655 5.91254 9.40578 6.07226C9.24606 6.23199 9.1662 6.4299 9.1662 6.66601C9.1662 6.90213 9.24606 7.10004 9.40578 7.25976C9.5655 7.41949 9.76342 7.49935 9.99953 7.49935ZM9.99953 18.3327C8.84675 18.3327 7.76342 18.1139 6.74953 17.6764C5.73564 17.2389 4.8537 16.6452 4.1037 15.8952C3.3537 15.1452 2.75995 14.2632 2.32245 13.2493C1.88495 12.2355 1.6662 11.1521 1.6662 9.99935C1.6662 8.84657 1.88495 7.76324 2.32245 6.74935C2.75995 5.73546 3.3537 4.85352 4.1037 4.10352C4.8537 3.35352 5.73564 2.75977 6.74953 2.32227C7.76342 1.88477 8.84675 1.66602 9.99953 1.66602C11.1523 1.66602 12.2356 1.88477 13.2495 2.32227C14.2634 2.75977 15.1454 3.35352 15.8954 4.10352C16.6454 4.85352 17.2391 5.73546 17.6766 6.74935C18.1141 7.76324 18.3329 8.84657 18.3329 9.99935C18.3329 11.1521 18.1141 12.2355 17.6766 13.2493C17.2391 14.2632 16.6454 15.1452 15.8954 15.8952C15.1454 16.6452 14.2634 17.2389 13.2495 17.6764C12.2356 18.1139 11.1523 18.3327 9.99953 18.3327ZM9.99953 16.666C11.8606 16.666 13.437 16.0202 14.7287 14.7285C16.0204 13.4368 16.6662 11.8605 16.6662 9.99935C16.6662 8.13824 16.0204 6.56185 14.7287 5.27018C13.437 3.97852 11.8606 3.33268 9.99953 3.33268C8.13842 3.33268 6.56203 3.97852 5.27036 5.27018C3.9787 6.56185 3.33287 8.13824 3.33287 9.99935C3.33287 11.8605 3.9787 13.4368 5.27036 14.7285C6.56203 16.0202 8.13842 16.666 9.99953 16.666Z",fill:r})})]})},Ol=function(e){var t=e.fill,r=void 0===t?"#5F6367":t;return xl.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_117_204",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:xl.jsx("rect",{width:"20",height:"20",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_117_204)",children:xl.jsx("path",{d:"M6.67929 18.0448L5.49658 16.862L12.3587 9.99996L5.49658 3.13788L6.67929 1.95517L14.7241 9.99996L6.67929 18.0448Z",fill:r})})]})},Tl=function(e){var t=e.fill,r=void 0===t?"#5F6367":t;return xl.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_170_30135",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"25",children:xl.jsx("rect",{y:"0.5",width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_170_30135)",children:xl.jsx("path",{d:"M16 22.5L6 12.5L16 2.5L17.775 4.275L9.55 12.5L17.775 20.725L16 22.5Z",fill:r})})]})},Cl=function(e){var t=e.fill,r=void 0===t?"#5F6367":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2032_3674",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2032_3674)",children:xl.jsx("path",{d:"M5.26689 20L3.99994 18.7331L10.733 12L3.99994 5.26696L5.26689 4L11.9999 10.733L18.733 4L19.9999 5.26696L13.2669 12L19.9999 18.7331L18.733 20L11.9999 13.267L5.26689 20Z",fill:r})})]})},Il=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"bluxcc:animate-spin",children:[xl.jsx("mask",{id:"mask0_2054_770",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"25",height:"24",children:xl.jsx("rect",{x:"0.5",width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2054_770)",children:xl.jsx("path",{d:"M12.497 21.5C11.1965 21.5 9.96875 21.2508 8.81375 20.7525C7.65892 20.2542 6.65042 19.5739 5.78825 18.7118C4.92608 17.8496 4.24583 16.8411 3.7475 15.6863C3.24917 14.5313 3 13.3035 3 12.003C3 10.6867 3.24967 9.45358 3.749 8.30375C4.24833 7.15375 4.92817 6.14867 5.7885 5.2885C6.64867 4.42817 7.65733 3.74833 8.8145 3.249C9.97167 2.74967 11.2002 2.5 12.5 2.5V4C10.2833 4 8.39583 4.77917 6.8375 6.3375C5.27917 7.89583 4.5 9.78333 4.5 12C4.5 14.2167 5.27917 16.1042 6.8375 17.6625C8.39583 19.2208 10.2833 20 12.5 20C14.7167 20 16.6042 19.2208 18.1625 17.6625C19.7208 16.1042 20.5 14.2167 20.5 12H22C22 13.2998 21.7503 14.5283 21.251 15.6855C20.7517 16.8427 20.0718 17.8513 19.2115 18.7115C18.3513 19.5718 17.3462 20.2517 16.1962 20.751C15.0464 21.2503 13.8133 21.5 12.497 21.5Z",fill:r})})]})},_l=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_1027_16479",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_1027_16479)",children:xl.jsx("path",{d:"M19.5421 20.577L13.2613 14.296C12.7613 14.7088 12.1863 15.0319 11.5363 15.2653C10.8863 15.4986 10.2139 15.6153 9.51906 15.6153C7.80989 15.6153 6.36339 15.0235 5.17956 13.84C3.99573 12.6565 3.40381 11.2103 3.40381 9.50152C3.40381 7.79285 3.99556 6.34618 5.17906 5.16152C6.36256 3.97702 7.80873 3.38477 9.51756 3.38477C11.2262 3.38477 12.6729 3.97668 13.8576 5.16051C15.0421 6.34435 15.6343 7.79085 15.6343 9.50002C15.6343 10.2142 15.5145 10.8963 15.2748 11.5463C15.035 12.1963 14.7151 12.7616 14.3151 13.2423L20.5958 19.523L19.5421 20.577ZM9.51906 14.1155C10.8076 14.1155 11.8989 13.6683 12.7931 12.774C13.6874 11.8798 14.1346 10.7885 14.1346 9.50002C14.1346 8.21152 13.6874 7.12018 12.7931 6.22601C11.8989 5.33168 10.8076 4.88452 9.51906 4.88452C8.23056 4.88452 7.13923 5.33168 6.24506 6.22601C5.35073 7.12018 4.90356 8.21152 4.90356 9.50002C4.90356 10.7885 5.35073 11.8798 6.24506 12.774C7.13923 13.6683 8.23056 14.1155 9.51906 14.1155Z",fill:r})})]})},Pl=function(e){var t=e.fill,r=void 0===t?"#FFD60A":t;return xl.jsx("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl.jsx("path",{d:"M13.6344 23.0894L24.8394 11.8844L23.0832 10.1282L13.6344 19.5769L8.88442 14.8269L7.12817 16.5832L13.6344 23.0894ZM16.0028 31.8332C13.8128 31.8332 11.7543 31.4176 9.82734 30.5865C7.90039 29.7554 6.22428 28.6275 4.799 27.2028C3.37373 25.778 2.24525 24.1026 1.41359 22.1765C0.582198 20.2504 0.166504 18.1925 0.166504 16.0028C0.166504 13.8128 0.582059 11.7543 1.41317 9.82734C2.24428 7.90039 3.3722 6.22428 4.79692 4.799C6.22164 3.37373 7.89706 2.24525 9.82317 1.41359C11.7493 0.582198 13.8072 0.166504 15.9969 0.166504C18.1869 0.166504 20.2454 0.582059 22.1723 1.41317C24.0993 2.24428 25.7754 3.3722 27.2007 4.79692C28.6259 6.22164 29.7544 7.89706 30.5861 9.82317C31.4175 11.7493 31.8332 13.8072 31.8332 15.9969C31.8332 18.1869 31.4176 20.2454 30.5865 22.1723C29.7554 24.0993 28.6275 25.7754 27.2028 27.2007C25.778 28.6259 24.1026 29.7544 22.1765 30.5861C20.2504 31.4175 18.1925 31.8332 16.0028 31.8332Z",fill:r})})},Rl=function(e){var t=e.fill,r=void 0===t?"#666666":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2054_469",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2054_469)",children:xl.jsx("path",{d:"M20.3713 12.75H8.577V11.25H20.3713L18.552 9.43075L19.6057 8.34625L23.2595 12L19.6057 15.6538L18.552 14.5693L20.3713 12.75ZM15.202 8.86525V5H5V19H15.202V15.1348H16.702V20.5H3.5V3.5H16.702V8.86525H15.202Z",fill:r})})]})},Nl=function(e){var t=e.fill,r=void 0===t?"#4D4D4D":t;return xl.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_3052_13468",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:xl.jsx("rect",{width:"16",height:"16",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_3052_13468)",children:xl.jsx("path",{d:"M4.83333 11.666V1.66602H12.8333V11.666H4.83333ZM5.83333 10.666H11.8333V2.66602H5.83333V10.666ZM2.5 13.9993V4.20452H3.5V12.9993H10.2948V13.9993H2.5Z",fill:r})})]})},Bl=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_3063_3055",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"25",height:"24",children:xl.jsx("rect",{x:"0.5",width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_3063_3055)",children:xl.jsx("path",{d:"M7.75 17.5V2.5H19.75V17.5H7.75ZM9.25 16H18.25V4H9.25V16ZM4.25 21V6.30775H5.75V19.5H15.9423V21H4.25Z",fill:r})})]})},jl=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2054_838",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2054_838)",children:xl.jsx("path",{d:"M12 21.5C9.54899 21.5 7.42215 20.6913 5.61949 19.074C3.81682 17.4567 2.79365 15.432 2.54999 13H4.07499C4.31865 15.0167 5.19557 16.6875 6.70574 18.0125C8.21607 19.3375 9.98082 20 12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C10.4962 4 9.11249 4.38625 7.84899 5.15875C6.58549 5.93108 5.61149 6.99033 4.92699 8.3365H7.88449V9.8365H2.75774C3.26024 7.68267 4.37207 5.9215 6.09324 4.553C7.8144 3.18433 9.78332 2.5 12 2.5C13.3142 2.5 14.5492 2.74933 15.705 3.248C16.8608 3.74667 17.8662 4.42342 18.7212 5.27825C19.5762 6.13308 20.2531 7.13833 20.7517 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9983C21.5 13.3123 21.2506 14.5473 20.7517 15.7035C20.2531 16.8597 19.5762 17.8653 18.7212 18.7205C17.8662 19.5757 16.8608 20.2528 15.705 20.7518C14.5492 21.2506 13.3142 21.5 12 21.5ZM14.723 15.777L11.25 12.3025V7.3655H12.75V11.6962L15.7672 14.723L14.723 15.777Z",fill:r})})]})},Ml=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2054_817",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2054_817)",children:xl.jsx("path",{d:"M3.5 19.25V4.75L20.7115 12L3.5 19.25ZM5 17L16.85 12L5 7V10.6923L10.423 12L5 13.3077V17Z",fill:r})})]})},Ll=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2204_971",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:xl.jsx("rect",{width:"16",height:"16",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2204_971)",children:xl.jsx("path",{d:"M5.06372 11.8333L7.99955 8.89746L10.9354 11.8333H5.06372Z",fill:r})})]})},Ul=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_1816_18902",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_1816_18902)",children:xl.jsx("path",{d:"M11.9999 14.6537L7.59619 10.25H16.4037L11.9999 14.6537Z",fill:r})})]})},Dl=function(){return xl.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("rect",{x:"0.5",y:"0.5",width:"39",height:"39",rx:"19.5",fill:"transparent",stroke:"#00BD81"}),xl.jsx("mask",{id:"mask0_2212_3318",maskUnits:"userSpaceOnUse",x:"8",y:"8",width:"24",height:"24",children:xl.jsx("rect",{x:"8",y:"8",width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2212_3318)",children:xl.jsx("path",{d:"M19.25 23.6923H20.7595V19.1365L22.6095 20.9865L23.6538 19.9423L20.0095 16.298L16.3558 19.9423L17.4 20.9865L19.25 19.1365V23.6923ZM20.0017 29.5C18.6877 29.5 17.4527 29.2507 16.2965 28.752C15.1403 28.2533 14.1347 27.5766 13.2795 26.7218C12.4243 25.8669 11.7472 24.8617 11.2482 23.706C10.7494 22.5503 10.5 21.3156 10.5 20.0017C10.5 18.6877 10.7493 17.4527 11.248 16.2965C11.7467 15.1403 12.4234 14.1347 13.2783 13.2795C14.1331 12.4243 15.1383 11.7472 16.294 11.2482C17.4497 10.7494 18.6844 10.5 19.9983 10.5C21.3123 10.5 22.5473 10.7493 23.7035 11.248C24.8597 11.7467 25.8653 12.4234 26.7205 13.2783C27.5757 14.1331 28.2528 15.1383 28.7518 16.294C29.2506 17.4497 29.5 18.6844 29.5 19.9983C29.5 21.3123 29.2507 22.5473 28.752 23.7035C28.2533 24.8597 27.5766 25.8653 26.7218 26.7205C25.8669 27.5757 24.8617 28.2528 23.706 28.7518C22.5503 29.2506 21.3156 29.5 20.0017 29.5ZM20 28C22.2333 28 24.125 27.225 25.675 25.675C27.225 24.125 28 22.2333 28 20C28 17.7667 27.225 15.875 25.675 14.325C24.125 12.775 22.2333 12 20 12C17.7667 12 15.875 12.775 14.325 14.325C12.775 15.875 12 17.7667 12 20C12 22.2333 12.775 24.125 14.325 25.675C15.875 27.225 17.7667 28 20 28Z",fill:"#00BD81"})})]})},Fl=function(){return xl.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("rect",{x:"0.5",y:"0.5",width:"39",height:"39",rx:"19.5",fill:"transparent",stroke:"#00BD81"}),xl.jsx("mask",{id:"mask0_2494_9033",maskUnits:"userSpaceOnUse",x:"8",y:"8",width:"24",height:"24",children:xl.jsx("rect",{x:"8",y:"8",width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsxs("g",{mask:"url(#mask0_2494_9033)",children:[xl.jsx("path",{d:"M12.577 25.9728C12.0142 25.255 11.5587 24.4749 11.2105 23.6326C10.8625 22.7902 10.6321 21.9126 10.5193 20.9998H12.05C12.15 21.7165 12.3334 22.404 12.6 23.0623C12.8667 23.7206 13.2167 24.3331 13.65 24.8998L12.577 25.9728ZM10.5193 18.9998C10.6398 18.087 10.8722 17.2094 11.2165 16.3671C11.5607 15.5247 12.0206 14.7511 12.5963 14.0461L13.65 15.0998C13.2167 15.6665 12.8667 16.279 12.6 16.9373C12.3334 17.5956 12.15 18.2831 12.05 18.9998H10.5193ZM18.95 29.4498C18.0372 29.3433 17.1638 29.1154 16.3298 28.7661C15.4958 28.4167 14.718 27.9626 13.9963 27.4036L15.05 26.2998C15.6334 26.7331 16.25 27.0915 16.9 27.3748C17.55 27.6581 18.2334 27.8498 18.95 27.9498V29.4498ZM15.1 13.6806L13.9963 12.5961C14.7346 12.0306 15.525 11.5764 16.3673 11.2336C17.2096 10.8906 18.0872 10.6626 19 10.5498V12.0498C18.2834 12.1498 17.5959 12.3366 16.9375 12.6103C16.2792 12.8841 15.6667 13.2409 15.1 13.6806ZM20.95 29.4498V27.9498C21.677 27.8498 22.3729 27.6655 23.0375 27.3968C23.7022 27.1283 24.323 26.7691 24.9 26.3191L26.0038 27.4036C25.2655 27.9792 24.471 28.436 23.6203 28.7738C22.7696 29.1116 21.8795 29.337 20.95 29.4498ZM24.95 13.6998C24.3667 13.2665 23.7417 12.9081 23.075 12.6248C22.4084 12.3415 21.7167 12.1498 21 12.0498V10.5498C21.9129 10.6563 22.793 10.8826 23.6403 11.2288C24.4878 11.5748 25.2756 12.0306 26.0038 12.5961L24.95 13.6998ZM27.4038 25.9536L26.35 24.8998C26.7834 24.3331 27.1334 23.7206 27.4 23.0623C27.6667 22.404 27.85 21.7165 27.95 20.9998H29.4808C29.3603 21.9126 29.1279 22.7902 28.7835 23.6326C28.4394 24.4749 27.9795 25.2486 27.4038 25.9536ZM27.95 18.9998C27.85 18.2831 27.6667 17.5956 27.4 16.9373C27.1334 16.279 26.7834 15.6665 26.35 15.0998L27.423 14.0268C27.9859 14.7446 28.4414 15.5247 28.7895 16.3671C29.1375 17.2094 29.368 18.087 29.4808 18.9998H27.95Z",fill:"#00BD81"}),xl.jsx("circle",{cx:"20",cy:"20",r:"3",fill:"#00BD81"})]})]})},zl=function(){return xl.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("rect",{x:"0.5",y:"0.5",width:"39",height:"39",rx:"19.5",fill:"transparent",stroke:"#00BD81"}),xl.jsx("mask",{id:"mask0_2214_3828",maskUnits:"userSpaceOnUse",x:"8",y:"8",width:"24",height:"24",children:xl.jsx("rect",{x:"8",y:"8",width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2214_3828)",children:xl.jsx("path",{d:"M20.0095 23.6923L23.6538 20.048L22.6095 19.004L20.7595 20.854V16.298H19.25V20.854L17.4 19.004L16.3558 20.048L20.0095 23.6923ZM20.0017 29.5C18.6877 29.5 17.4527 29.2507 16.2965 28.752C15.1403 28.2533 14.1347 27.5766 13.2795 26.7218C12.4243 25.8669 11.7472 24.8617 11.2482 23.706C10.7494 22.5503 10.5 21.3156 10.5 20.0017C10.5 18.6877 10.7493 17.4527 11.248 16.2965C11.7467 15.1403 12.4234 14.1347 13.2783 13.2795C14.1331 12.4243 15.1383 11.7472 16.294 11.2482C17.4497 10.7494 18.6844 10.5 19.9983 10.5C21.3123 10.5 22.5473 10.7493 23.7035 11.248C24.8597 11.7467 25.8653 12.4234 26.7205 13.2783C27.5757 14.1331 28.2528 15.1383 28.7518 16.294C29.2506 17.4497 29.5 18.6844 29.5 19.9983C29.5 21.3123 29.2507 22.5473 28.752 23.7035C28.2533 24.8597 27.5766 25.8653 26.7218 26.7205C25.8669 27.5757 24.8617 28.2528 23.706 28.7518C22.5503 29.2506 21.3156 29.5 20.0017 29.5ZM20 28C22.2333 28 24.125 27.225 25.675 25.675C27.225 24.125 28 22.2333 28 20C28 17.7667 27.225 15.875 25.675 14.325C24.125 12.775 22.2333 12 20 12C17.7667 12 15.875 12.775 14.325 14.325C12.775 15.875 12 17.7667 12 20C12 22.2333 12.775 24.125 14.325 25.675C15.875 27.225 17.7667 28 20 28Z",fill:"#00BD81"})})]})},ql=function(){return xl.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2265_983",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2265_983)",children:xl.jsx("path",{d:"M8.00081 14.3337C7.13248 14.3337 6.31304 14.1672 5.54248 13.8343C4.77193 13.5014 4.09993 13.0482 3.52648 12.4747C2.95293 11.9012 2.4997 11.2292 2.16681 10.4587C1.83393 9.6881 1.66748 8.86866 1.66748 8.00033C1.66748 7.1251 1.83393 6.30394 2.16681 5.53683C2.4997 4.76972 2.95293 4.09944 3.52648 3.52599C4.09993 2.95244 4.77193 2.49921 5.54248 2.16633C6.31304 1.83344 7.13248 1.66699 8.00081 1.66699C8.87604 1.66699 9.6972 1.83344 10.4643 2.16633C11.2314 2.49921 11.9017 2.95244 12.4751 3.52599C13.0487 4.09944 13.5019 4.76972 13.8348 5.53683C14.1677 6.30394 14.3341 7.1251 14.3341 8.00033C14.3341 8.86866 14.1677 9.6881 13.8348 10.4587C13.5019 11.2292 13.0487 11.9012 12.4751 12.4747C11.9017 13.0482 11.2314 13.5014 10.4643 13.8343C9.6972 14.1672 8.87604 14.3337 8.00081 14.3337ZM8.00081 13.3195C8.34104 12.8683 8.62737 12.4132 8.85982 11.9542C9.09226 11.4952 9.28159 10.9934 9.42782 10.449H6.57381C6.72859 11.0106 6.92009 11.5208 7.14832 11.9798C7.37643 12.4388 7.66059 12.8854 8.00081 13.3195ZM6.70982 13.1362C6.45426 12.7695 6.22476 12.3527 6.02132 11.8857C5.81787 11.4185 5.65976 10.9397 5.54698 10.449H3.28548C3.63759 11.1413 4.10981 11.723 4.70215 12.194C5.29448 12.6649 5.9637 12.9789 6.70982 13.1362ZM9.29182 13.1362C10.0379 12.9789 10.7071 12.6649 11.2995 12.194C11.8918 11.723 12.364 11.1413 12.7161 10.449H10.4546C10.3204 10.9439 10.1516 11.4249 9.94815 11.892C9.74482 12.3591 9.52604 12.7738 9.29182 13.1362ZM2.86615 9.44899H5.34448C5.30259 9.20122 5.2722 8.95827 5.25331 8.72016C5.23454 8.48216 5.22515 8.24222 5.22515 8.00033C5.22515 7.75844 5.23454 7.51849 5.25331 7.28049C5.2722 7.04238 5.30259 6.79944 5.34448 6.55166H2.86615C2.80204 6.7781 2.75293 7.01355 2.71881 7.25799C2.68459 7.50244 2.66748 7.74988 2.66748 8.00033C2.66748 8.25077 2.68459 8.49822 2.71881 8.74266C2.75293 8.98711 2.80204 9.22255 2.86615 9.44899ZM6.34431 9.44899H9.65732C9.69909 9.20122 9.72943 8.96044 9.74831 8.72666C9.76709 8.49288 9.77648 8.25077 9.77648 8.00033C9.77648 7.74988 9.76709 7.50777 9.74831 7.27399C9.72943 7.04022 9.69909 6.79944 9.65732 6.55166H6.34431C6.30254 6.79944 6.2722 7.04022 6.25331 7.27399C6.23454 7.50777 6.22515 7.74988 6.22515 8.00033C6.22515 8.25077 6.23454 8.49288 6.25331 8.72666C6.2722 8.96044 6.30254 9.20122 6.34431 9.44899ZM10.6571 9.44899H13.1355C13.1996 9.22255 13.2487 8.98711 13.2828 8.74266C13.317 8.49822 13.3341 8.25077 13.3341 8.00033C13.3341 7.74988 13.317 7.50244 13.2828 7.25799C13.2487 7.01355 13.1996 6.7781 13.1355 6.55166H10.6571C10.699 6.79944 10.7294 7.04238 10.7483 7.28049C10.7671 7.51849 10.7765 7.75844 10.7765 8.00033C10.7765 8.24222 10.7671 8.48216 10.7483 8.72016C10.7294 8.95827 10.699 9.20122 10.6571 9.44899ZM10.4546 5.55166H12.7161C12.3598 4.85077 11.8908 4.2691 11.3091 3.80666C10.7275 3.34433 10.055 3.0281 9.29182 2.85799C9.54737 3.24599 9.7747 3.67038 9.97382 4.13116C10.173 4.59183 10.3333 5.06533 10.4546 5.55166ZM6.57381 5.55166H9.42782C9.27304 4.99433 9.07837 4.48083 8.84382 4.01116C8.60915 3.54149 8.32815 3.09816 8.00081 2.68116C7.67348 3.09816 7.39248 3.54149 7.15781 4.01116C6.92326 4.48083 6.72859 4.99433 6.57381 5.55166ZM3.28548 5.55166H5.54698C5.66831 5.06533 5.82859 4.59183 6.02781 4.13116C6.22693 3.67038 6.45426 3.24599 6.70982 2.85799C5.94226 3.0281 5.26876 3.34544 4.68931 3.80999C4.10976 4.27444 3.64181 4.85499 3.28548 5.55166Z",fill:"#666666"})})]})},Vl=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2324_772",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2324_772)",children:xl.jsx("path",{d:"M12 1.59619L21.5 7.25369V20.4999H2.5V7.25369L12 1.59619ZM12 12.6499L19.8 7.99994L12 3.34994L4.2 7.99994L12 12.6499ZM12 14.4037L4 9.62294V18.9999H20V9.62294L12 14.4037Z",fill:r})})]})},Hl=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2097_3575",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40",children:xl.jsx("rect",{width:"40",height:"40",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2097_3575)",children:xl.jsx("path",{d:"M20 2.66113L35.8334 12.0903V34.1674H4.16669V12.0903L20 2.66113ZM20 21.0841L33 13.3341L20 5.58405L7.00002 13.3341L20 21.0841ZM20 24.007L6.66669 16.0391V31.6674H33.3334V16.0391L20 24.007Z",fill:r})})]})},Kl=function(){return xl.jsxs("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("circle",{cx:"34",cy:"34",r:"34",fill:"#FFDEDE"}),xl.jsx("mask",{id:"mask0_2497_9140",maskUnits:"userSpaceOnUse",x:"14",y:"14",width:"40",height:"40",children:xl.jsx("rect",{x:"14",y:"14",width:"40",height:"40",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2497_9140)",children:xl.jsx("path",{d:"M33.9995 41.1662C34.2356 41.1662 34.4335 41.0863 34.5933 40.9266C34.753 40.7669 34.8328 40.569 34.8328 40.3328C34.8328 40.0967 34.753 39.8988 34.5933 39.7391C34.4335 39.5794 34.2356 39.4995 33.9995 39.4995C33.7634 39.4995 33.5655 39.5794 33.4058 39.7391C33.246 39.8988 33.1662 40.0967 33.1662 40.3328C33.1662 40.569 33.246 40.7669 33.4058 40.9266C33.5655 41.0863 33.7634 41.1662 33.9995 41.1662ZM33.4162 35.9995H34.5828V25.9995H33.4162V35.9995ZM34.0066 48.4995C32.0019 48.4995 30.1167 48.1191 28.3512 47.3583C26.5856 46.5974 25.0499 45.5648 23.7441 44.2603C22.438 42.9559 21.4041 41.4221 20.6424 39.6591C19.8805 37.8958 19.4995 36.0116 19.4995 34.0066C19.4995 32.0019 19.8799 30.1167 20.6408 28.3512C21.4016 26.5856 22.4342 25.0499 23.7387 23.7441C25.0431 22.438 26.5769 21.4041 28.3399 20.6424C30.1033 19.8805 31.9874 19.4995 33.9924 19.4995C35.9972 19.4995 37.8823 19.8799 39.6478 20.6408C41.4134 21.4016 42.9491 22.4342 44.2549 23.7387C45.561 25.0431 46.5949 26.5769 47.3566 28.3399C48.1185 30.1033 48.4995 31.9874 48.4995 33.9924C48.4995 35.9972 48.1191 37.8823 47.3583 39.6478C46.5974 41.4134 45.5648 42.9491 44.2603 44.2549C42.9559 45.561 41.4222 46.5949 39.6591 47.3566C37.8958 48.1185 36.0116 48.4995 34.0066 48.4995Z",fill:"#EC2929"})})]})},Wl=function(){return xl.jsxs("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("circle",{cx:"34",cy:"34",r:"34",fill:"#FFDEDE"}),xl.jsx("mask",{id:"mask0_3255_25187",maskUnits:"userSpaceOnUse",x:"14",y:"14",width:"40",height:"40",children:xl.jsx("rect",{x:"14",y:"14",width:"40",height:"40",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_3255_25187)",children:xl.jsx("path",{d:"M34.0013 49.8327C31.8305 49.8327 29.7819 49.4166 27.8555 48.5844C25.9291 47.7521 24.2491 46.6191 22.8155 45.1852C21.3816 43.7516 20.2485 42.0716 19.4163 40.1452C18.5841 38.2188 18.168 36.1702 18.168 33.9994C18.168 31.8113 18.5841 29.7584 19.4163 27.8406C20.2485 25.9228 21.3816 24.2471 22.8155 22.8135C24.2491 21.3796 25.9291 20.2466 27.8555 19.4144C29.7819 18.5821 31.8305 18.166 34.0013 18.166C36.1894 18.166 38.2423 18.5821 40.1601 19.4144C42.0778 20.2466 43.7535 21.3796 45.1871 22.8135C46.621 24.2471 47.7541 25.9228 48.5863 27.8406C49.4185 29.7584 49.8346 31.8113 49.8346 33.9994C49.8346 36.1702 49.4185 38.2188 48.5863 40.1452C47.7541 42.0716 46.621 43.7516 45.1871 45.1852C43.7535 46.6191 42.0778 47.7521 40.1601 48.5844C38.2423 49.4166 36.1894 49.8327 34.0013 49.8327ZM34.0013 47.2973C34.8519 46.1692 35.5677 45.0314 36.1488 43.8839C36.7299 42.7364 37.2033 41.4821 37.5688 40.121H30.4338C30.8208 41.5249 31.2995 42.8006 31.8701 43.9481C32.4403 45.0956 33.1508 46.212 34.0013 47.2973ZM30.7738 46.8389C30.1349 45.9223 29.5612 44.8802 29.0526 43.7127C28.5439 42.5449 28.1487 41.3477 27.8667 40.121H22.213C23.0932 41.8519 24.2738 43.306 25.7546 44.4835C27.2355 45.6607 28.9085 46.4459 30.7738 46.8389ZM37.2288 46.8389C39.0941 46.4459 40.7671 45.6607 42.248 44.4835C43.7288 43.306 44.9094 41.8519 45.7896 40.121H40.1359C39.8003 41.3582 39.3783 42.5607 38.8696 43.7285C38.3613 44.8963 37.8144 45.9331 37.2288 46.8389ZM21.1646 37.621H27.3605C27.2557 37.0016 27.1798 36.3942 27.1326 35.7989C27.0856 35.2039 27.0621 34.6041 27.0621 33.9994C27.0621 33.3946 27.0856 32.7948 27.1326 32.1998C27.1798 31.6045 27.2557 30.9971 27.3605 30.3777H21.1646C21.0044 30.9438 20.8816 31.5324 20.7963 32.1435C20.7107 32.7546 20.668 33.3732 20.668 33.9994C20.668 34.6255 20.7107 35.2441 20.7963 35.8552C20.8816 36.4663 21.0044 37.0549 21.1646 37.621ZM29.8601 37.621H38.1426C38.247 37.0016 38.3228 36.3996 38.3701 35.8152C38.417 35.2307 38.4405 34.6255 38.4405 33.9994C38.4405 33.3732 38.417 32.768 38.3701 32.1835C38.3228 31.5991 38.247 30.9971 38.1426 30.3777H29.8601C29.7556 30.9971 29.6798 31.5991 29.6326 32.1835C29.5856 32.768 29.5621 33.3732 29.5621 33.9994C29.5621 34.6255 29.5856 35.2307 29.6326 35.8152C29.6798 36.3996 29.7556 37.0016 29.8601 37.621ZM40.6421 37.621H46.838C46.9983 37.0549 47.121 36.4663 47.2063 35.8552C47.2919 35.2441 47.3346 34.6255 47.3346 33.9994C47.3346 33.3732 47.2919 32.7546 47.2063 32.1435C47.121 31.5324 46.9983 30.9438 46.838 30.3777H40.6421C40.7469 30.9971 40.8228 31.6045 40.8701 32.1998C40.917 32.7948 40.9405 33.3946 40.9405 33.9994C40.9405 34.6041 40.917 35.2039 40.8701 35.7989C40.8228 36.3942 40.7469 37.0016 40.6421 37.621ZM40.1359 27.8777H45.7896C44.8988 26.1255 43.7263 24.6713 42.2721 23.5152C40.818 22.3594 39.1369 21.5688 37.2288 21.1435C37.8677 22.1135 38.436 23.1745 38.9338 24.3264C39.4319 25.4781 39.8326 26.6619 40.1359 27.8777ZM30.4338 27.8777H37.5688C37.1819 26.4844 36.6952 25.2006 36.1088 24.0264C35.5221 22.8523 34.8196 21.7439 34.0013 20.7014C33.183 21.7439 32.4805 22.8523 31.8938 24.0264C31.3074 25.2006 30.8208 26.4844 30.4338 27.8777ZM22.213 27.8777H27.8667C28.1701 26.6619 28.5707 25.4781 29.0688 24.3264C29.5666 23.1745 30.1349 22.1135 30.7738 21.1435C28.8549 21.5688 27.1712 22.3621 25.7226 23.5235C24.2737 24.6846 23.1038 26.136 22.213 27.8777Z",fill:"#EC2929"})})]})},Gl=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_3052_2991",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_3052_2991)",children:xl.jsx("path",{d:"M12.05 19.75C9.88717 19.75 8.0465 18.9974 6.528 17.4923C5.00934 15.9871 4.25 14.1563 4.25 12V11.2192L2.4 13.0693L1.34625 12.0155L5 8.3615L8.65375 12.0155L7.6 13.0693L5.75 11.2192V12C5.75 13.7372 6.3615 15.2132 7.5845 16.428C8.80767 17.6427 10.2962 18.25 12.05 18.25C12.4642 18.25 12.8779 18.2048 13.2913 18.1145C13.7048 18.024 14.1083 17.8884 14.502 17.7078L15.627 18.8328C15.0642 19.1353 14.4831 19.3637 13.8838 19.5182C13.2843 19.6727 12.673 19.75 12.05 19.75ZM19 15.6385L15.3463 11.9845L16.4 10.9307L18.25 12.7808V12C18.25 10.2628 17.6385 8.78683 16.4155 7.572C15.1923 6.35733 13.7038 5.75 11.95 5.75C11.5358 5.75 11.1221 5.79517 10.7088 5.8855C10.2953 5.976 9.89167 6.11158 9.498 6.29225L8.373 5.16725C8.93584 4.86475 9.51692 4.63625 10.1163 4.48175C10.7158 4.32725 11.327 4.25 11.95 4.25C14.1128 4.25 15.9535 5.00258 17.472 6.50775C18.9907 8.01292 19.75 9.84367 19.75 12V12.7808L21.6 10.9307L22.6538 11.9845L19 15.6385Z",fill:r})})]})},Xl=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsx("svg",{width:"15",height:"12",viewBox:"0 0 15 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl.jsx("path",{d:"M7.87971 11.2048C6.42741 11.2048 5.19145 10.6994 4.17181 9.68874C3.15206 8.67806 2.64218 7.44875 2.64218 6.00082V5.47657L1.39995 6.7188L0.692383 6.01123L3.14579 3.55765L5.5992 6.01123L4.89163 6.7188L3.6494 5.47657V6.00082C3.6494 7.16729 4.06001 8.15839 4.88123 8.97412C5.70255 9.78974 6.70205 10.1976 7.87971 10.1976C8.15781 10.1976 8.43563 10.1672 8.71318 10.1066C8.99083 10.0458 9.26183 9.95476 9.52617 9.83345L10.2816 10.5889C9.90365 10.792 9.51347 10.9454 9.11103 11.0492C8.70848 11.1529 8.29804 11.2048 7.87971 11.2048ZM12.5465 8.44399L10.0931 5.99042L10.8006 5.28285L12.0429 6.52508V6.00082C12.0429 4.83436 11.6323 3.84326 10.811 3.02752C9.98971 2.2119 8.99022 1.80409 7.81256 1.80409C7.53446 1.80409 7.25663 1.83442 6.97909 1.89508C6.70143 1.95584 6.43044 2.04689 6.1661 2.1682L5.41069 1.41279C5.78861 1.20967 6.1788 1.05623 6.58124 0.95249C6.98379 0.848747 7.39423 0.796875 7.81256 0.796875C9.26485 0.796875 10.5008 1.30222 11.5205 2.3129C12.5402 3.32359 13.0501 4.55289 13.0501 6.00082V6.52508L14.2923 5.28285L14.9999 5.99042L12.5465 8.44399Z",fill:r})})},Zl=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_3052_13246",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_3052_13246)",children:xl.jsx("path",{d:"M3.5 11V3.5H11V11H3.5ZM5 9.5H9.5V5H5V9.5ZM3.5 20.5V13H11V20.5H3.5ZM5 19H9.5V14.5H5V19ZM13 11V3.5H20.5V11H13ZM14.5 9.5H19V5H14.5V9.5ZM18.625 20.5V18.625H20.5V20.5H18.625ZM13 14.875V13H14.875V14.875H13ZM14.875 16.75V14.875H16.75V16.75H14.875ZM13 18.625V16.75H14.875V18.625H13ZM14.875 20.5V18.625H16.75V20.5H14.875ZM16.75 18.625V16.75H18.625V18.625H16.75ZM16.75 14.875V13H18.625V14.875H16.75ZM18.625 16.75V14.875H20.5V16.75H18.625Z",fill:r})})]})},Ql=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_3052_12050",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_3052_12050)",children:xl.jsx("path",{d:"M20.5 8.029H19V5H5V19H19V15.971H20.5V20.5H3.5V3.5H20.5V8.029ZM11.5 16.5V7.5H21.5V16.5H11.5ZM16 13.5C16.4167 13.5 16.7708 13.3542 17.0625 13.0625C17.3542 12.7708 17.5 12.4167 17.5 12C17.5 11.5833 17.3542 11.2292 17.0625 10.9375C16.7708 10.6458 16.4167 10.5 16 10.5C15.5833 10.5 15.2292 10.6458 14.9375 10.9375C14.6458 11.2292 14.5 11.5833 14.5 12C14.5 12.4167 14.6458 12.7708 14.9375 13.0625C15.2292 13.3542 15.5833 13.5 16 13.5ZM20 15V9H13V15H20Z",fill:r})})]})},Yl=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_1909_18867",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:xl.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_1909_18867)",children:xl.jsx("path",{d:"M12 20.5C9.57317 20.5 7.54975 20.1573 5.92975 19.472C4.30992 18.7868 3.5 17.9308 3.5 16.9038V7C3.5 6.03467 4.3295 5.21 5.9885 4.526C7.6475 3.842 9.65133 3.5 12 3.5C14.3487 3.5 16.3525 3.842 18.0115 4.526C19.6705 5.21 20.5 6.03467 20.5 7V16.9038C20.5 17.9308 19.6901 18.7868 18.0703 19.472C16.4503 20.1573 14.4268 20.5 12 20.5ZM12 8.95775C13.4577 8.95775 14.9253 8.75167 16.403 8.3395C17.8805 7.92733 18.7366 7.48275 18.9712 7.00575C18.7429 6.51608 17.8958 6.05933 16.4298 5.6355C14.9638 5.21183 13.4872 5 12 5C10.5153 5 9.04383 5.20608 7.5855 5.61825C6.12717 6.03042 5.2685 6.48008 5.0095 6.96725C5.26217 7.46725 6.11442 7.924 7.56625 8.3375C9.01825 8.751 10.4962 8.95775 12 8.95775ZM12 13.9615C12.6937 13.9615 13.3687 13.9282 14.025 13.8615C14.6813 13.7948 15.3086 13.6974 15.9068 13.5693C16.5048 13.4411 17.0647 13.2821 17.5865 13.0922C18.1083 12.9026 18.5795 12.6878 19 12.448V8.9C18.5795 9.13967 18.1083 9.35442 17.5865 9.54425C17.0647 9.73392 16.5048 9.89283 15.9068 10.021C15.3086 10.1493 14.6813 10.2468 14.025 10.3135C13.3687 10.3802 12.6937 10.4135 12 10.4135C11.2937 10.4135 10.6055 10.3785 9.9355 10.3085C9.26567 10.2387 8.63333 10.1397 8.0385 10.0115C7.44367 9.88333 6.8895 9.726 6.376 9.5395C5.8625 9.35283 5.40383 9.13967 5 8.9V12.448C5.40383 12.6878 5.8625 12.901 6.376 13.0875C6.8895 13.274 7.44367 13.4313 8.0385 13.5595C8.63333 13.6878 9.26567 13.7869 9.9355 13.8567C10.6055 13.9266 11.2937 13.9615 12 13.9615ZM12 19C12.8115 19 13.6083 18.9465 14.3905 18.8395C15.1725 18.7323 15.884 18.5862 16.525 18.401C17.166 18.2157 17.7067 18.0006 18.147 17.7557C18.5875 17.5109 18.8718 17.2538 19 16.9845V13.948C18.5795 14.1878 18.1083 14.4026 17.5865 14.5922C17.0647 14.7821 16.5048 14.9411 15.9068 15.0693C15.3086 15.1974 14.6813 15.2948 14.025 15.3615C13.3687 15.4282 12.6937 15.4615 12 15.4615C11.2937 15.4615 10.6055 15.4266 9.9355 15.3567C9.26567 15.2869 8.63333 15.1878 8.0385 15.0595C7.44367 14.9313 6.8895 14.774 6.376 14.5875C5.8625 14.401 5.40383 14.1878 5 13.948V17C5.12817 17.2757 5.40992 17.5317 5.84525 17.7682C6.28042 18.0047 6.8185 18.2157 7.4595 18.401C8.10067 18.5862 8.81483 18.7323 9.602 18.8395C10.3892 18.9465 11.1885 19 12 19Z",fill:r})})]})},Jl=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_1793_24266",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"21",height:"20",children:xl.jsx("rect",{x:"0.5",width:"20",height:"20",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_1793_24266)",children:xl.jsx("path",{d:"M10.5019 12.9808C11.4462 12.9808 12.2482 12.6503 12.9079 11.9894C13.5677 11.3284 13.8975 10.5258 13.8975 9.58146C13.8975 8.63715 13.567 7.83514 12.9061 7.17542C12.2451 6.51569 11.4425 6.18583 10.4981 6.18583C9.55384 6.18583 8.75183 6.51632 8.09211 7.17729C7.43238 7.83826 7.10252 8.6409 7.10252 9.58521C7.10252 10.5295 7.43301 11.3315 8.09398 11.9913C8.75495 12.651 9.55759 12.9808 10.5019 12.9808ZM10.5 11.8333C9.87502 11.8333 9.34377 11.6146 8.90627 11.1771C8.46877 10.7396 8.25002 10.2083 8.25002 9.58333C8.25002 8.95833 8.46877 8.42708 8.90627 7.98958C9.34377 7.55208 9.87502 7.33333 10.5 7.33333C11.125 7.33333 11.6563 7.55208 12.0938 7.98958C12.5313 8.42708 12.75 8.95833 12.75 9.58333C12.75 10.2083 12.5313 10.7396 12.0938 11.1771C11.6563 11.6146 11.125 11.8333 10.5 11.8333ZM10.5011 15.4167C8.58481 15.4167 6.83877 14.8881 5.26294 13.8308C3.6871 12.7738 2.52683 11.3579 1.7821 9.58333C2.52683 7.80875 3.68669 6.39292 5.26169 5.33583C6.83683 4.27861 8.58259 3.75 10.499 3.75C12.4152 3.75 14.1613 4.27861 15.7371 5.33583C17.3129 6.39292 18.4732 7.80875 19.2179 9.58333C18.4732 11.3579 17.3134 12.7738 15.7384 13.8308C14.1632 14.8881 12.4175 15.4167 10.5011 15.4167ZM10.5 14.1667C12.0695 14.1667 13.5104 13.7535 14.8229 12.9271C16.1354 12.1007 17.1389 10.9861 17.8334 9.58333C17.1389 8.18056 16.1354 7.06597 14.8229 6.23958C13.5104 5.41319 12.0695 5 10.5 5C8.93058 5 7.48961 5.41319 6.1771 6.23958C4.8646 7.06597 3.86113 8.18056 3.16669 9.58333C3.86113 10.9861 4.8646 12.1007 6.1771 12.9271C7.48961 13.7535 8.93058 14.1667 10.5 14.1667Z",fill:r})})]})},$l=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsxs("svg",{width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_3104_19660",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"21",height:"20",children:xl.jsx("rect",{x:"0.5",width:"20",height:"20",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_3104_19660)",children:xl.jsx("path",{d:"M13.6442 10.8112L12.7084 9.87534C12.8334 9.1852 12.6365 8.56471 12.1177 8.01388C11.5991 7.46319 10.9627 7.25034 10.2084 7.37534L9.27252 6.43951C9.46058 6.35506 9.65343 6.29173 9.85106 6.24951C10.0487 6.20728 10.265 6.18617 10.5 6.18617C11.4456 6.18617 12.2482 6.51603 12.9079 7.17576C13.5677 7.83548 13.8975 8.63812 13.8975 9.58367C13.8975 9.81867 13.8764 10.0377 13.8342 10.2408C13.792 10.4437 13.7286 10.6338 13.6442 10.8112ZM16.2948 13.4041L15.375 12.542C15.9028 12.1392 16.3716 11.6983 16.7813 11.2191C17.191 10.7399 17.5417 10.1948 17.8334 9.58367C17.1389 8.18089 16.1424 7.06631 14.8438 6.23992C13.5452 5.41353 12.0972 5.00034 10.5 5.00034C10.0972 5.00034 9.70141 5.02812 9.31252 5.08367C8.92363 5.13923 8.54169 5.22256 8.16669 5.33367L7.19565 4.36263C7.72231 4.15319 8.26023 3.99881 8.8094 3.8995C9.35856 3.80006 9.92211 3.75034 10.5 3.75034C12.4529 3.75034 14.2141 4.28881 15.7836 5.36575C17.353 6.4427 18.4978 7.84867 19.2179 9.58367C18.9092 10.3283 18.5104 11.0233 18.0217 11.6687C17.5328 12.3139 16.9572 12.8924 16.2948 13.4041ZM16.9679 18.2247L13.5963 14.8785C13.1689 15.0367 12.6953 15.166 12.1754 15.2664C11.6557 15.3668 11.0972 15.417 10.5 15.417C8.54169 15.417 6.78051 14.8785 5.21648 13.8016C3.65231 12.7246 2.50752 11.3187 1.7821 9.58367C2.08974 8.84756 2.48717 8.16089 2.9744 7.52367C3.46162 6.88631 3.99794 6.33367 4.58335 5.86575L2.27565 3.53242L3.15398 2.6543L17.8461 17.3464L16.9679 18.2247ZM5.46169 6.74388C5.02141 7.0943 4.59322 7.51555 4.1771 8.00763C3.76099 8.49957 3.42419 9.02492 3.16669 9.58367C3.86113 10.9864 4.85766 12.101 6.15627 12.9274C7.45488 13.7538 8.9028 14.167 10.5 14.167C10.8793 14.167 11.257 14.1349 11.6331 14.0708C12.0091 14.0067 12.328 13.9405 12.5898 13.8722L11.5352 12.792C11.3931 12.8496 11.2286 12.8955 11.0417 12.9297C10.8547 12.964 10.6742 12.9812 10.5 12.9812C9.55447 12.9812 8.75183 12.6513 8.09211 11.9916C7.43238 11.3319 7.10252 10.5292 7.10252 9.58367C7.10252 9.41492 7.11968 9.23839 7.15398 9.05409C7.18815 8.86978 7.23405 8.70124 7.29169 8.54846L5.46169 6.74388Z",fill:r})})]})},ef=function(e){var t=e.fill,r=void 0===t?"#ffffff":t;return xl.jsxs("svg",{width:"42",height:"42",viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_3181_32834",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"42",height:"42",children:xl.jsx("rect",{x:"0.0644531",y:"0.330566",width:"41.3523",height:"41.3523",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_3181_32834)",children:xl.jsx("path",{d:"M12.1242 26.1761C13.5601 26.1761 14.7805 25.6735 15.7856 24.6684C16.7907 23.6633 17.2933 22.4429 17.2933 21.007C17.2933 19.5712 16.7907 18.3507 15.7856 17.3456C14.7805 16.3405 13.5601 15.838 12.1242 15.838C10.6884 15.838 9.4679 16.3405 8.46281 17.3456C7.45772 18.3507 6.95517 19.5712 6.95517 21.007C6.95517 22.4429 7.45772 23.6633 8.46281 24.6684C9.4679 25.6735 10.6884 26.1761 12.1242 26.1761ZM12.1242 31.3451C9.25252 31.3451 6.81159 30.34 4.80141 28.3298C2.79122 26.3197 1.78613 23.8787 1.78613 21.007C1.78613 18.1353 2.79122 15.6944 4.80141 13.6842C6.81159 11.674 9.25252 10.6689 12.1242 10.6689C14.4503 10.6689 16.482 11.3294 18.2194 12.6504C19.9567 13.9714 21.17 15.6083 21.8592 17.561H36.2895L39.6924 20.964L33.6619 27.856L29.3543 24.4531L25.9083 27.8991L22.4623 24.4531H21.8592C21.1413 26.5207 19.8921 28.1862 18.1117 29.4498C16.3312 30.7133 14.3354 31.3451 12.1242 31.3451Z",fill:r})})]})},tf=function(e){var t=e.fill,r=void 0===t?"#ffffff":t;return xl.jsxs("svg",{width:"42",height:"42",viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_396_7450",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"42",height:"42",children:xl.jsx("rect",{x:"0.870605",y:"0.552734",width:"40.7419",height:"40.7419",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_396_7450)",children:xl.jsx("path",{d:"M21.2414 37.8998C18.8931 37.8998 16.6863 37.4542 14.6209 36.563C12.5555 35.6718 10.7589 34.4623 9.23105 32.9344C7.70323 31.4066 6.4937 29.61 5.60247 27.5446C4.71124 25.4792 4.26562 23.2724 4.26562 20.924C4.26562 18.5757 4.71124 16.3689 5.60247 14.3035C6.4937 12.2381 7.70323 10.4415 9.23105 8.91366C10.7589 7.38584 12.5555 6.17632 14.6209 5.28509C16.6863 4.39386 18.8931 3.94824 21.2414 3.94824C23.5897 3.94824 25.7966 4.39386 27.862 5.28509C29.9274 6.17632 31.724 7.38584 33.2518 8.91366C34.7796 10.4415 35.9892 12.2381 36.8804 14.3035C37.7716 16.3689 38.2172 18.5757 38.2172 20.924C38.2172 23.2724 37.7716 25.4792 36.8804 27.5446C35.9892 29.61 34.7796 31.4066 33.2518 32.9344C31.724 34.4623 29.9274 35.6718 27.862 36.563C25.7966 37.4542 23.5897 37.8998 21.2414 37.8998ZM19.5438 34.3774V32.6798C18.5536 32.5383 17.5987 32.2695 16.6792 31.8734C15.7597 31.4773 14.9038 30.9964 14.1116 30.4305L12.9233 31.6612C13.857 32.3969 14.8826 32.9981 16.0001 33.4649C17.1177 33.9318 18.299 34.2359 19.5438 34.3774ZM22.939 34.3774C24.1839 34.2359 25.3651 33.9318 26.4827 33.4649C27.6003 32.9981 28.6259 32.3969 29.5596 31.6612L28.3713 30.4305C27.5791 30.9964 26.7232 31.4773 25.8037 31.8734C24.8842 32.2695 23.9293 32.5383 22.939 32.6798V34.3774ZM21.2414 29.4119C23.5897 29.4119 25.5915 28.5844 27.2466 26.9292C28.9018 25.2741 29.7293 23.2724 29.7293 20.924C29.7293 18.5757 28.9018 16.574 27.2466 14.9189C25.5915 13.2637 23.5897 12.4361 21.2414 12.4361C18.8931 12.4361 16.8914 13.2637 15.2362 14.9189C13.5811 16.574 12.7535 18.5757 12.7535 20.924C12.7535 23.2724 13.5811 25.2741 15.2362 26.9292C16.8914 28.5844 18.8931 29.4119 21.2414 29.4119ZM31.9786 29.2422C32.7142 28.3085 33.3155 27.2829 33.7823 26.1653C34.2491 25.0478 34.5533 23.8665 34.6948 22.6216H32.9972C32.8557 23.6119 32.5869 24.5668 32.1908 25.4863C31.7947 26.4058 31.3137 27.2617 30.7479 28.0539L31.9786 29.2422ZM10.5042 29.2422L11.735 28.0114C11.1691 27.2192 10.6881 26.3704 10.292 25.4651C9.89593 24.5597 9.62715 23.6119 9.48568 22.6216H7.7881C7.92957 23.8665 8.23372 25.0478 8.70055 26.1653C9.16739 27.2829 9.76861 28.3085 10.5042 29.2422ZM21.2414 27.7144L16.1487 20.924L21.2414 14.1337L26.3342 20.924L21.2414 27.7144ZM7.7881 19.2265H9.48568C9.62715 18.2362 9.89593 17.2884 10.292 16.383C10.6881 15.4776 11.1691 14.6289 11.735 13.8366L10.5042 12.6059C9.76861 13.5396 9.16739 14.5652 8.70055 15.6828C8.23372 16.8003 7.92957 17.9816 7.7881 19.2265ZM32.9972 19.2265H34.6948C34.5533 17.9816 34.2421 16.8003 33.7611 15.6828C33.2801 14.5652 32.6718 13.5396 31.9362 12.6059L30.7479 13.7942C31.3137 14.5864 31.7947 15.4423 32.1908 16.3618C32.5869 17.2813 32.8557 18.2362 32.9972 19.2265ZM14.154 11.4176C14.9462 10.8517 15.795 10.3708 16.7004 9.97465C17.6058 9.57855 18.5536 9.30977 19.5438 9.1683V7.47072C18.299 7.61219 17.1177 7.91634 16.0001 8.38317C14.8826 8.85001 13.857 9.45123 12.9233 10.1868L14.154 11.4176ZM28.3713 11.4176L29.5596 10.2293C28.6259 9.49367 27.6003 8.88537 26.4827 8.40439C25.3651 7.92341 24.1839 7.61219 22.939 7.47072V9.1683C23.9293 9.30977 24.8842 9.57855 25.8037 9.97465C26.7232 10.3708 27.5791 10.8517 28.3713 11.4176Z",fill:r})})]})},rf=function(e){var t=e.fill,r=void 0===t?"#ffffff":t;return xl.jsx("svg",{width:"29",height:"35",viewBox:"0 0 29 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl.jsx("path",{d:"M14.5964 19.3351C16.2782 19.3351 17.7135 18.7406 18.9024 17.5518C20.0912 16.3629 20.6857 14.9276 20.6857 13.2458C20.6857 11.564 20.0912 10.1286 18.9024 8.93976C17.7135 7.75089 16.2782 7.15646 14.5964 7.15646C12.9146 7.15646 11.4792 7.75089 10.2904 8.93976C9.1015 10.1286 8.50707 11.564 8.50707 13.2458C8.50707 14.9276 9.1015 16.3629 10.2904 17.5518C11.4792 18.7406 12.9146 19.3351 14.5964 19.3351ZM14.5964 34.9932C10.3629 33.9204 6.98475 31.6006 4.46204 28.034C1.93933 24.4675 0.677979 20.4659 0.677979 16.0294V5.41666L14.5964 0.197266L28.5148 5.41666V16.0294C28.5148 20.4659 27.2534 24.4675 24.7307 28.034C22.208 31.6006 18.8299 33.9204 14.5964 34.9932ZM14.5964 31.3397C16.3072 30.7887 17.8222 29.9261 19.1416 28.7517C20.4609 27.5774 21.6136 26.2508 22.5994 24.7719C21.3526 24.134 20.055 23.6483 18.7066 23.3148C17.3583 22.9814 15.9882 22.8147 14.5964 22.8147C13.2045 22.8147 11.8344 22.9814 10.4861 23.3148C9.13775 23.6483 7.84015 24.134 6.59329 24.7719C7.57918 26.2508 8.7318 27.5774 10.0511 28.7517C11.3705 29.9261 12.8856 30.7887 14.5964 31.3397Z",fill:r})})},nf=function(e){var t=e.fill,r=void 0===t?"#ffffff":t;return xl.jsxs("svg",{width:"40",height:"39",viewBox:"0 0 40 39",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_3181_32839",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"39",children:xl.jsx("rect",{x:"0.985352",y:"0.263672",width:"38.6622",height:"38.6622",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_3181_32839)",children:xl.jsx("path",{d:"M5.81836 34.0933V5.09668H34.815V8.31853H15.4839V30.8715H34.815V34.0933H5.81836ZM18.7058 27.6496V11.5404H36.4259V27.6496H18.7058ZM26.7604 22.0114C27.4585 22.0114 28.0357 21.7832 28.4921 21.3267C28.9486 20.8703 29.1768 20.2931 29.1768 19.595C29.1768 18.8969 28.9486 18.3197 28.4921 17.8633C28.0357 17.4068 27.4585 17.1786 26.7604 17.1786C26.0623 17.1786 25.4851 17.4068 25.0286 17.8633C24.5722 18.3197 24.344 18.8969 24.344 19.595C24.344 20.2931 24.5722 20.8703 25.0286 21.3267C25.4851 21.7832 26.0623 22.0114 26.7604 22.0114Z",fill:r})})]})},of=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl.jsx("path",{d:"M18.6502 23.875C18.6502 22.6 18.7939 21.6458 19.0814 21.0125C19.3689 20.3792 19.921 19.7292 20.7377 19.0625C21.371 18.5458 21.8564 18.0583 22.1939 17.6C22.5314 17.1417 22.7002 16.6167 22.7002 16.025C22.7002 15.3083 22.4606 14.7208 21.9814 14.2625C21.5023 13.8042 20.8335 13.575 19.9752 13.575C19.1169 13.575 18.4606 13.8271 18.0064 14.3312C17.5523 14.8354 17.2252 15.3542 17.0252 15.8875L14.5752 14.825C14.9585 13.7583 15.6148 12.8542 16.5439 12.1125C17.4731 11.3708 18.6169 11 19.9752 11C21.7335 11 23.0814 11.4813 24.0189 12.4438C24.9564 13.4062 25.4252 14.5833 25.4252 15.975C25.4252 16.7917 25.2356 17.5333 24.8564 18.2C24.4773 18.8667 23.896 19.5542 23.1127 20.2625C22.3127 20.9792 21.8273 21.5375 21.6564 21.9375C21.4856 22.3375 21.396 22.9833 21.3877 23.875H18.6502ZM19.9752 29.875C19.4585 29.875 19.0169 29.6917 18.6502 29.325C18.2835 28.9583 18.1002 28.5167 18.1002 28C18.1002 27.4833 18.2835 27.0417 18.6502 26.675C19.0169 26.3083 19.4585 26.125 19.9752 26.125C20.4919 26.125 20.9335 26.3083 21.3002 26.675C21.6669 27.0417 21.8502 27.4833 21.8502 28C21.8502 28.5167 21.6669 28.9583 21.3002 29.325C20.9335 29.6917 20.4919 29.875 19.9752 29.875Z",fill:r})})},sf=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return xl.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl.jsx("path",{d:"M7.46008 9.55039C7.46008 9.04039 7.51756 8.65871 7.63256 8.40539C7.74756 8.15207 7.9684 7.89207 8.29508 7.62539C8.5484 7.41871 8.74256 7.22371 8.87756 7.04039C9.01256 6.85707 9.08008 6.64707 9.08008 6.41039C9.08008 6.12371 8.98424 5.88871 8.79256 5.70539C8.60092 5.52207 8.3334 5.43039 7.99008 5.43039C7.64676 5.43039 7.38424 5.53123 7.20256 5.73287C7.02092 5.93455 6.89008 6.14207 6.81008 6.35539L5.83008 5.93039C5.9834 5.50371 6.24592 5.14207 6.61756 4.84539C6.98924 4.54871 7.44676 4.40039 7.99008 4.40039C8.6934 4.40039 9.23256 4.59291 9.60756 4.97791C9.98256 5.36287 10.1701 5.83371 10.1701 6.39039C10.1701 6.71707 10.0942 7.01371 9.94256 7.28039C9.79092 7.54707 9.5584 7.82207 9.24508 8.10539C8.92508 8.39207 8.73092 8.61539 8.66256 8.77539C8.59424 8.93539 8.5584 9.19371 8.55508 9.55039H7.46008ZM7.99008 11.9504C7.7834 11.9504 7.60676 11.8771 7.46008 11.7304C7.3134 11.5837 7.24008 11.4071 7.24008 11.2004C7.24008 10.9937 7.3134 10.8171 7.46008 10.6704C7.60676 10.5237 7.7834 10.4504 7.99008 10.4504C8.19676 10.4504 8.3734 10.5237 8.52008 10.6704C8.66676 10.8171 8.74008 10.9937 8.74008 11.2004C8.74008 11.4071 8.66676 11.5837 8.52008 11.7304C8.3734 11.8771 8.19676 11.9504 7.99008 11.9504Z",fill:r})})},af={error:{container:"bluxcc:bg-light-red-50 bluxcc:border bluxcc:border-alert-error",text:"bluxcc:text-alert-error",icon:xl.jsx(function(){return xl.jsxs("svg",{width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2175_4398",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"21",height:"20",children:xl.jsx("rect",{x:"0.5",width:"20",height:"20",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2175_4398)",children:xl.jsx("path",{d:"M9.87486 10.9054H11.1249V6.22605H9.87486V10.9054ZM10.4999 13.085C10.6906 13.085 10.8504 13.0205 10.9794 12.8915C11.1085 12.7624 11.173 12.6026 11.173 12.4119C11.173 12.2212 11.1085 12.0613 10.9794 11.9323C10.8504 11.8033 10.6906 11.7388 10.4999 11.7388C10.3092 11.7388 10.1493 11.8033 10.0203 11.9323C9.89125 12.0613 9.82673 12.2212 9.82673 12.4119C9.82673 12.6026 9.89125 12.7624 10.0203 12.8915C10.1493 13.0205 10.3092 13.085 10.4999 13.085ZM10.4999 18.4071L2.09277 10L10.4999 1.59293L18.9069 10L10.4999 18.4071Z",fill:"#EC2929"})})]})},{})},success:{container:"bluxcc:bg-white bluxcc:border bluxcc:border-alert-success",text:"bluxcc:text-alert-success",icon:xl.jsx(function(){return xl.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2175_4610",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:xl.jsx("rect",{width:"20",height:"20",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2175_4610)",children:xl.jsx("path",{d:"M8.81697 13.5448L14.4195 7.9423L13.5413 7.06418L8.81697 11.7886L6.44197 9.41355L5.56384 10.2917L8.81697 13.5448ZM10.0011 17.9167C8.90613 17.9167 7.8769 17.7089 6.91342 17.2933C5.94995 16.8778 5.1119 16.3138 4.39926 15.6015C3.68662 14.8891 3.12238 14.0514 2.70655 13.0883C2.29085 12.1253 2.08301 11.0963 2.08301 10.0015C2.08301 8.90647 2.29079 7.87723 2.70634 6.91376C3.1219 5.95029 3.68586 5.11223 4.39822 4.39959C5.11058 3.68695 5.94829 3.12272 6.91134 2.70689C7.8744 2.29119 8.90335 2.08334 9.99822 2.08334C11.0932 2.08334 12.1225 2.29112 13.0859 2.70668C14.0494 3.12223 14.8875 3.68619 15.6001 4.39855C16.3127 5.11091 16.877 5.94862 17.2928 6.91168C17.7085 7.87473 17.9163 8.90369 17.9163 9.99855C17.9163 11.0936 17.7086 12.1228 17.293 13.0863C16.8775 14.0497 16.3135 14.8878 15.6011 15.6004C14.8888 16.3131 14.0511 16.8773 13.088 17.2931C12.125 17.7088 11.096 17.9167 10.0011 17.9167Z",fill:"#00BD81"})})]})},{})},info:{container:"bluxcc:bg-light-blue-50 bluxcc:border bluxcc:border-alert-info",text:"bluxcc:text-alert-info",icon:xl.jsx(function(){return xl.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2175_4860",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:xl.jsx("rect",{width:"20",height:"20",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2175_4860)",children:xl.jsx("path",{d:"M10 13.5833C10.1181 13.5833 10.217 13.5434 10.2969 13.4635C10.3767 13.3837 10.4167 13.2847 10.4167 13.1667C10.4167 13.0486 10.3767 12.9497 10.2969 12.8698C10.217 12.7899 10.1181 12.75 10 12.75C9.88194 12.75 9.78299 12.7899 9.70312 12.8698C9.62326 12.9497 9.58333 13.0486 9.58333 13.1667C9.58333 13.2847 9.62326 13.3837 9.70312 13.4635C9.78299 13.5434 9.88194 13.5833 10 13.5833ZM9.70833 11H10.2917V6H9.70833V11ZM10.0035 17.25C9.00118 17.25 8.05861 17.0598 7.17583 16.6794C6.29306 16.299 5.52521 15.7826 4.87229 15.1304C4.21924 14.4782 3.70229 13.7113 3.32146 12.8298C2.94049 11.9481 2.75 11.006 2.75 10.0035C2.75 9.00118 2.94021 8.05861 3.32063 7.17583C3.70104 6.29306 4.21736 5.52521 4.86958 4.87229C5.52181 4.21924 6.28868 3.70229 7.17021 3.32146C8.05188 2.94049 8.99396 2.75 9.99646 2.75C10.9988 2.75 11.9414 2.94021 12.8242 3.32063C13.7069 3.70104 14.4748 4.21736 15.1277 4.86958C15.7808 5.52181 16.2977 6.28868 16.6785 7.17021C17.0595 8.05187 17.25 8.99396 17.25 9.99646C17.25 10.9988 17.0598 11.9414 16.6794 12.8242C16.299 13.7069 15.7826 14.4748 15.1304 15.1277C14.4782 15.7808 13.7113 16.2977 12.8298 16.6785C11.9481 17.0595 11.006 17.25 10.0035 17.25Z",fill:"#5093FF"})})]})},{})},warn:{container:"bluxcc:bg-white bluxcc:border bluxcc:border-alert-warning",text:"bluxcc:text-alert-warning",icon:xl.jsx(function(){return xl.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("mask",{id:"mask0_2175_4934",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:xl.jsx("rect",{width:"20",height:"20",fill:"#D9D9D9"})}),xl.jsx("g",{mask:"url(#mask0_2175_4934)",children:xl.jsx("path",{d:"M9.37486 10.9054H10.6249V6.22605H9.37486V10.9054ZM9.99986 13.085C10.1906 13.085 10.3504 13.0205 10.4794 12.8915C10.6085 12.7624 10.673 12.6026 10.673 12.4119C10.673 12.2212 10.6085 12.0613 10.4794 11.9323C10.3504 11.8033 10.1906 11.7388 9.99986 11.7388C9.80916 11.7388 9.6493 11.8033 9.52028 11.9323C9.39125 12.0613 9.32673 12.2212 9.32673 12.4119C9.32673 12.6026 9.39125 12.7624 9.52028 12.8915C9.6493 13.0205 9.80916 13.085 9.99986 13.085ZM9.99986 18.4071L1.59277 10L9.99986 1.59293L18.4069 10L9.99986 18.4071Z",fill:"#FA8F02"})})]})},{})},none:{container:"",text:"",icon:null}},cf=function(e){var t=e.type,r=e.message,n=e.className,o=void 0===n?"":n,i=af[t],s=i.container,a=i.text,c=i.icon,u=me(function(e){return e.config.appearance});return xl.jsxs("div",{style:{borderRadius:u.borderRadius},className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:px-3 bluxcc:h-10 bluxcc:max-w-[184px] ".concat(s," ").concat(a," ").concat(o),children:[c,xl.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:r})]})},uf=function(e){var t=e.icon,r=e.onInfo,n=e.onBack,o=e.title,i=void 0===o?" ":o,s=e.closeButton,a=void 0!==s&&s,c=e.onClose,u=e.isPersistent,l=me(function(e){return e.config}),f=me(function(e){return e.modal}),d=Al(),h=Tu(l.appearance.textColor,.7),p="none"!==f.alert.type,y=function(e){var t=e.onClick,r=e.children;return xl.jsx("button",{id:"bluxcc-button",onClick:t,className:"bluxcc:flex bluxcc:size-5 bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:r})};return xl.jsxs("header",{className:"bluxcc:flex bluxcc:h-16 bluxcc:w-full bluxcc:items-center bluxcc:justify-between",children:["info"===t?xl.jsx(y,{onClick:r,children:xl.jsx(kl,{fill:h})}):"back"===t?xl.jsx(y,{onClick:n,children:xl.jsx(Tl,{fill:h})}):xl.jsx("div",{className:"bluxcc:size-5"}),xl.jsx("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:p?xl.jsx(cf,{type:f.alert.type,message:f.alert.message}):xl.jsx("p",{className:"bluxcc:grow bluxcc:select-none bluxcc:text-center bluxcc:text-base bluxcc:font-medium",children:d(i)})}),!a||u?xl.jsx("div",{className:"bluxcc:size-5"}):xl.jsx(y,{onClick:c,children:xl.jsx(Cl,{fill:h})})]})},lf=function(){var e=me(function(e){return e.config.appearance});return xl.jsx("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:xl.jsx("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:e.borderWidth,borderTopColor:e.borderColor}})})},ff=function(e){var t,r=e.startIcon,n=e.onChange,o=e.onEnter,i=e.onSubmit,s=e.inputType,a=void 0===s?"text":s,c=me(function(e){return e}).config.appearance,u=Al(),l=Q.useState(!1),f=l[0],d=l[1],h=Q.useState(""),p=h[0],y=h[1],g=Q.useState(!1),m=g[0],b=g[1];return xl.jsxs("div",{className:"bluxcc:flex bluxcc:transition-colors bluxcc:duration-300 bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:py-2 bluxcc:pr-3 bluxcc:pl-2",style:{borderRadius:c.borderRadius,borderColor:f?c.accentColor:c.borderColor,backgroundColor:c.fieldBackground,borderWidth:c.borderWidth,color:c.textColor},onMouseEnter:function(e){f||(e.currentTarget.style.borderColor=c.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){f||(e.currentTarget.style.borderColor=c.borderColor)},children:[xl.jsx("span",{style:{background:c.background,borderRadius:c.borderRadius,borderColor:c.borderColor,borderWidth:c.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-all bluxcc:duration-300",children:r}),xl.jsxs("div",{style:{cursor:"text"},className:"bluxcc:ml-4 bluxcc:relative bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center",children:[xl.jsx("input",{id:"bluxcc-input",type:a,value:p,onChange:function(e){var t=e.target.value;y(t);var r=Mu(a,t);b(r),null==n||n(t)},onKeyDown:function(e){"Enter"===e.key&&m&&(null==o||o(p))},placeholder:u("email"),className:"bluxcc:mr-1 bluxcc:h-full bluxcc:w-full bluxcc:bg-transparent bluxcc:outline-hidden\n bluxcc:focus:outline-hidden bluxcc:text-base bluxcc:placeholder:text-base!",style:(t={color:c.textColor,font:c.fontFamily},t["--input-text-color"]=c.textColor,t),onFocus:function(){return d(!0)},onBlur:function(){d(!1),Mu("email",p)||b(!1)}}),xl.jsx("div",{className:"bluxcc:flex bluxcc:h-10 bluxcc:w-[100px] bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:xl.jsx("button",{id:"bluxcc-button",disabled:!m,onClick:function(){return null==i?void 0:i(p)},className:"bluxcc:absolute bluxcc:right-0 bluxcc:flex bluxcc:h-8 bluxcc:w-[68px]! bluxcc:items-center bluxcc:justify-center bluxcc:border bluxcc:!text-sm bluxcc:font-medium bluxcc:transition-[border-radius,background,border-color] bluxcc:duration-200",style:{background:c.fieldBackground,borderRadius:c.borderRadius,borderColor:m?c.accentColor:c.borderColor,color:m?c.accentColor:"#999999",borderWidth:c.borderWidth},children:u("submit")})})]})]})},df=function(e){var t=e.size,r=void 0===t?"medium":t,n=e.startIcon,o=e.endArrow,i=e.isRecent,s=void 0!==i&&i,a=e.label,c=e.onClick,u=me(function(e){return e}),l=Q.useState(!1),f=l[0],d=l[1],h=u.config.appearance,p=Al();return xl.jsxs("button",{type:"button",id:"bluxcc-button",onClick:c,className:"bluxcc:flex bluxcc:transition-colors bluxcc:duration-300\n ".concat("small"===r?"bluxcc:size-24 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:py-4":"bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:py-2 bluxcc:pr-3 bluxcc:pl-2","\n "),style:{borderRadius:h.borderRadius,borderColor:f?h.accentColor:h.borderColor,backgroundColor:h.fieldBackground,borderWidth:h.borderWidth,color:h.textColor},onMouseEnter:function(e){d(!0),f||(e.currentTarget.style.borderColor=h.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){d(!1),f||(e.currentTarget.style.borderColor=h.borderColor)},children:[xl.jsx("span",{style:{background:h.background,borderRadius:h.borderRadius,borderColor:h.borderColor,borderWidth:h.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-all bluxcc:duration-300",children:n}),xl.jsx("div",{className:"".concat("small"===r?"bluxcc:mt-0":"bluxcc:ml-4"," bluxcc:relative bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center"),children:xl.jsx("span",{className:"".concat("small"===r?"bluxcc:text-sm bluxcc:leading-4":"bluxcc:text-base"," bluxcc:font-medium bluxcc:select-none"),children:a})}),s&&xl.jsx("div",{className:"bluxcc:px-2 bluxcc:py-1 bluxcc:text-xs bluxcc:font-normal",style:{color:h.accentColor,borderRadius:h.borderRadius,backgroundColor:"".concat(Tu(h.accentColor,.15))},children:p("recent")}),o&&"medium"===r&&xl.jsx("span",{className:"bluxcc:ml-auto bluxcc:flex bluxcc:items-center",children:xl.jsx(Ol,{fill:"".concat(Tu(h.textColor,.7))})})]})},hf=function(e){var t=e.variant,r=void 0===t?"default":t,n=e.size,o=void 0===n?"medium":n,i=e.startIcon,s=e.endArrow,a=e.isRecent,c=void 0!==a&&a,u=e.label,l=e.onClick,f=e.onChange,d=e.onEnter,h=e.onSubmit,p=e.inputType,y=void 0===p?"text":p;return"input"===r?xl.jsx(ff,{onEnter:d,onSubmit:h,onChange:f,inputType:y,startIcon:i}):xl.jsx(df,{size:o,label:u,onClick:l,isRecent:c,endArrow:s,startIcon:i})},pf=function(){var e,t=Al(),r=Q.useState(!0),n=r[0],o=r[1],i=me(function(e){return e}),s=i.setRoute,a=i.logoutAction,c=i.setAlert,u=i.config.appearance,l=null===(e=i.user)||void 0===e?void 0:e.address,f=0!==i.balances.balances.length?i.balances.balances.find(function(e){return"native"===e.asset_type}).balance:"0";return xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center",children:[xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:mb-6 bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center",children:[xl.jsxs("div",{className:"bluxcc:text-center bluxcc:text-2xl bluxcc:h-8 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",style:{color:u.accentColor},children:[xl.jsx("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:xl.jsx("p",{className:"bluxcc:select-none",style:{verticalAlign:"middle",paddingTop:n?"0px":"8px"},children:f?n?"".concat(Cu(f)," XLM"):"******":t("loading")})}),xl.jsx("div",{className:"bluxcc:transition-all",children:n?xl.jsx("button",{id:"bluxcc-button",onClick:function(){return o(!1)},className:"bluxcc:bg-transparent",children:xl.jsx(Jl,{fill:u.accentColor})}):xl.jsx("button",{id:"bluxcc-button",onClick:function(){return o(!0)},className:"bluxcc:bg-transparent",children:xl.jsx($l,{fill:u.accentColor})})})]}),xl.jsx("button",{id:"bluxcc-button",className:"bluxcc:mt-4! bluxcc:leading-4 bluxcc:inline-flex bluxcc:bg-transparent bluxcc:text-sm bluxcc:select-none",onClick:function(){vu(l).then(function(){vu(l),c("info","Address Copied"),setTimeout(function(){c("none","")},1e3)}).catch(function(){})},style:{color:Tu(u.textColor,.7)},children:xl.jsxs("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",children:[l?Pu(l,5):"",xl.jsx(Nl,{fill:Tu(u.textColor,.7)})]})})]}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:space-x-3",children:[xl.jsx(hf,{size:"small",label:t("send"),startIcon:xl.jsx(Ml,{fill:u.textColor}),onClick:function(){s(se.SEND)}}),xl.jsx(hf,{size:"small",label:t("receive"),startIcon:xl.jsx(Zl,{fill:u.textColor}),onClick:function(){s(se.RECEIVE)}}),xl.jsx(hf,{size:"small",label:t("swap"),startIcon:xl.jsx(Gl,{fill:u.textColor}),onClick:function(){s(se.SWAP)}})]}),xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:w-full bluxcc:space-y-2",children:[xl.jsx(hf,{endArrow:!0,label:t("balances"),startIcon:xl.jsx(Ql,{fill:u.textColor}),onClick:function(){s(se.BALANCES)}}),xl.jsx(hf,{endArrow:!0,label:t("activity"),startIcon:xl.jsx(jl,{fill:u.textColor}),onClick:function(){s(se.ACTIVITY)}})]}),xl.jsx(lf,{}),xl.jsxs("button",{style:{color:Tu(u.textColor,.9),fontFamily:u.fontFamily},onClick:function(){a()},className:"bluxcc:flex bluxcc:h-12 bluxcc:font-medium bluxcc:text-base bluxcc:w-full bluxcc:bg-transparent bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",children:[xl.jsx(Rl,{fill:Tu(u.textColor,.9)}),t("logout")]})]})},yf={small:"bluxcc:h-8 bluxcc:!text-sm bluxcc:gap-1",medium:"bluxcc:h-10 bluxcc:!text-sm bluxcc:gap-1",large:"bluxcc:h-[52px] bluxcc:!text-base bluxcc:gap-1"},gf=function(e){var t=e.size,r=void 0===t?"large":t,o=e.disabled,i=void 0!==o&&o,s=e.variant,a=void 0===s?"outline":s,c=e.state,u=void 0===c?"enabled":c,l=e.children,f=e.startIcon,d=e.endIcon,h=e.onClick,p=e.style,y=e.className,g=e.type,m=me(function(e){return e.config.appearance}),b=n({borderRadius:m.borderRadius,pointerEvents:"disabled"===u?"none":void 0},p);return"outline"===a?Object.assign(b,{border:"1px solid ".concat(m.borderColor),color:m.accentColor,backgroundColor:m.fieldBackground,borderWidth:m.borderWidth}):"fill"===a?Object.assign(b,{backgroundColor:m.accentColor,fontWeight:"500",color:xu(m.accentColor)}):"text"===a?Object.assign(b,{color:m.accentColor,backgroundColor:"transparent"}):"tonal"===a&&Object.assign(b,{color:m.accentColor,backgroundColor:Tu(m.accentColor,.1)}),"selected"===u&&(b.boxShadow="0 0 0 2px ".concat(m.accentColor)),xl.jsxs("button",{type:g||"button",id:"bluxcc-button",onClick:h,disabled:"disabled"===u&&i,className:"".concat("bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:px-[10px] bluxcc:transition-all bluxcc:duration-300 bluxcc:w-full"," ").concat(yf[r]," ").concat(null!=y?y:""," bluxcc:transition-all bluxcc:duration-300"),style:b,children:[f&&xl.jsx("span",{children:f}),xl.jsx("span",{children:l}),d&&xl.jsx("span",{children:d})]})},mf=function(){return xl.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("g",{clipPath:"url(#clip0_238_2232)",children:xl.jsx("path",{d:"M41.06 12.5H38.94L17.5 63.18L17.565 63.205H23.285L27.5775 53.065C36.4925 56.07 46.155 56.02 55.04 52.9225L59.39 63.205H62.435L62.5 63.18L41.06 12.5ZM41.1025 53.3675C36.76 53.3675 32.445 52.665 28.3275 51.2925L41.3375 20.5325L54.2925 51.1525C50.05 52.6175 45.5925 53.3675 41.1025 53.3675Z",fill:"#0691B7"})}),xl.jsx("defs",{children:xl.jsx("clipPath",{id:"clip0_238_2232",children:xl.jsx("rect",{width:"45",height:"52.5",fill:"white",transform:"translate(17.5 12.5)"})})})]})},bf=function(e){var t=e.fill,r=void 0===t?"#221542":t;return xl.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("path",{d:"M24 32.6489C24 32.4316 24.177 32.2562 24.3941 32.2493C30.8491 32.0454 36.0454 26.8491 36.2494 20.3941C36.2562 20.177 36.4317 20 36.6489 20H55.6067C55.8239 20 56 20.176 56 20.3932V43.0339C56 43.2512 55.8239 43.4272 55.6067 43.4272H44.7877C44.5705 43.4272 44.3944 43.2511 44.3944 43.0339V33.7948C44.3944 33.3973 43.8568 33.2414 43.6304 33.5683C39.3932 39.6869 32.369 43.7288 24.3941 43.8579C24.1769 43.8615 24 43.6851 24 43.4679V32.6489Z",fill:r}),xl.jsx("path",{d:"M56 48.7019C56 48.4846 55.8239 48.3086 55.6067 48.3086H24.3933C24.1761 48.3086 24 48.4846 24 48.7019V59.5209C24 59.7381 24.1761 59.9141 24.3933 59.9141H55.6067C55.8239 59.9141 56 59.7381 56 59.5209V48.7019Z",fill:r})]})},vf=function(){return xl.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("path",{d:"M35.3965 22.0206C35.387 21.7877 35.6426 21.6421 35.85 21.7613C36.0391 21.8697 36.2214 21.9763 36.4108 22.0793C37.4561 22.6322 38.4411 23.2862 39.3506 24.0316C40.765 25.2248 41.9537 26.6489 42.863 28.2395C43.8201 29.8552 44.5524 31.5868 45.0408 33.3892C45.3763 34.6097 45.5118 35.8739 45.4423 37.1353C45.424 37.3038 45.4623 37.4733 45.5515 37.619C45.6404 37.7647 45.7755 37.8785 45.9366 37.9437C46.0983 38.0052 46.2759 38.0151 46.444 37.9716C46.6118 37.9281 46.7609 37.8335 46.8695 37.7018C47.9584 36.5756 49.2783 34.0312 49.7209 33.146C49.8035 32.9808 50.0122 32.9234 50.1628 33.0353C50.8695 33.5615 52.744 35.1839 54.3357 38.5648C54.8783 39.6532 55.2022 40.8313 55.4415 42.0155C55.6763 43.0827 55.7127 44.1643 55.6854 45.2552C55.5955 48.8495 54.0896 52.3164 51.5025 55.0283C49.2172 57.4236 46.2241 59.052 42.9112 59.6111C40.0647 60.1346 37.1246 59.885 34.415 58.8894C33.503 58.5235 32.6229 58.0866 31.7835 57.5829C30.5238 56.911 29.4366 55.9663 28.437 54.9636C26.8202 53.221 25.617 51.2313 24.9077 48.9541C24.5964 47.8221 24.4022 46.6628 24.328 45.4933C24.2327 43.5878 24.485 41.5751 25.1439 39.8321C26.1489 37.1738 27.8495 34.6081 30.1761 32.9007C32.3129 31.3427 34.0964 29.5211 34.9948 27.0774C35.3501 26.043 35.5137 24.9556 35.4779 23.8656C35.4779 23.2498 35.4213 22.6355 35.3965 22.0206Z",fill:"#1D1F20"}),xl.jsx("path",{d:"M34.5092 21.4775C34.4771 20.715 35.3603 20.2404 36.0555 20.6242C36.0946 20.6457 36.1328 20.6668 36.1703 20.6876C36.3258 20.7736 36.47 20.8534 36.6196 20.9318C37.7453 21.5043 38.8061 22.1815 39.7859 22.9531L39.7898 22.9562L39.7936 22.9594C41.3229 24.1993 42.6081 25.6787 43.5916 27.3311C44.6147 28.9918 45.3976 30.7715 45.92 32.6239C46.2872 33.9079 46.4354 35.2378 46.3591 36.5647L46.3582 36.5815L46.3563 36.5983C46.3533 36.6252 46.3597 36.6523 46.3745 36.6755C46.3878 36.6964 46.4071 36.7126 46.4292 36.7228C46.4532 36.7301 46.4787 36.7308 46.503 36.7247C46.5296 36.7181 46.554 36.7035 46.5722 36.6824L46.5896 36.662L46.6089 36.6429C47.1119 36.1428 47.7023 35.2873 48.2413 34.4054C48.7715 33.5378 49.2213 32.6969 49.4475 32.2622C49.7105 31.7564 50.4333 31.5228 50.9821 31.9154C51.7957 32.4976 53.8186 34.1967 55.5239 37.6749C56.1217 38.8299 56.4715 40.0632 56.7246 41.2659C56.9837 42.4016 57.0205 43.5377 56.9918 44.6456C56.8942 48.4003 55.258 52.0103 52.4616 54.8275C49.9898 57.3174 46.7462 59.0167 43.1488 59.6015C40.0664 60.1454 36.8829 59.8851 33.9491 58.8489L33.9391 58.8455L33.9292 58.8416C32.9525 58.4652 32.0099 58.0159 31.1106 57.4983C29.7188 56.7817 28.5375 55.7886 27.4844 54.7734L27.4756 54.7648L27.467 54.756C25.7243 52.9506 24.4206 50.8815 23.6522 48.5104L23.6488 48.5L23.6458 48.4897C23.3106 47.318 23.1015 46.118 23.0215 44.9078L23.0212 44.9034L23.021 44.8991C22.9183 42.9263 23.1884 40.8282 23.9103 38.9927C24.9876 36.2539 26.8221 33.5766 29.3717 31.7783L29.3726 31.7776L29.3735 31.777C31.5326 30.264 33.2623 28.5449 34.1303 26.2812C34.4711 25.3252 34.628 24.3203 34.5935 23.3132L34.5932 23.3027V23.2922C34.5932 22.9143 34.5711 22.557 34.5477 22.1796C34.5338 21.9555 34.5195 21.7243 34.5092 21.4775ZM35.9708 22.1106C35.9941 22.4944 36.0174 22.8972 36.0178 23.2817C36.0562 24.4434 35.8741 25.6021 35.48 26.7047L35.4777 26.7113L35.4752 26.7177C34.4776 29.3258 32.5064 31.2392 30.2323 32.8329C27.9527 34.4412 26.2572 36.8824 25.2485 39.4469C24.6032 41.0875 24.3492 43.0033 24.4438 44.831C24.5179 45.9488 24.7108 47.057 25.0197 48.1393C25.7228 50.3031 26.9127 52.1971 28.5193 53.8639C29.5346 54.8418 30.6026 55.7264 31.8152 56.3479L31.8312 56.3562L31.8467 56.3651C32.6822 56.847 33.5579 57.2652 34.4653 57.6156C37.1519 58.5624 40.0661 58.7993 42.8877 58.3005L42.8929 58.2997L42.8983 58.2988C46.1757 57.7671 49.1436 56.2177 51.4143 53.9304C53.9889 51.3368 55.4787 48.03 55.5675 44.6137C55.5953 43.547 55.5567 42.5267 55.3298 41.5356L55.3287 41.5301L55.3275 41.5247C55.0844 40.3687 54.7625 39.2559 54.237 38.2427L54.2336 38.2362L54.2304 38.2296C52.883 35.4791 51.3452 33.9558 50.5043 33.2654C50.2497 33.7399 49.8889 34.3902 49.4801 35.0589C48.9416 35.9398 48.2887 36.9055 47.6667 37.5296C47.4611 37.7595 47.1839 37.9252 46.8721 38.0029C46.5502 38.0831 46.2094 38.0649 45.8996 37.9514L45.8928 37.9489L45.8861 37.9463C45.5767 37.8261 45.3182 37.6163 45.1479 37.3487C44.9813 37.0869 44.9077 36.7831 44.9373 36.4803C45.0038 35.2958 44.8706 34.1086 44.5427 32.9626L44.5426 32.9614L44.5422 32.9603C44.0511 31.2185 43.3146 29.5452 42.3526 27.9842L42.3498 27.9799L42.3472 27.9754C41.4443 26.4573 40.2643 25.0983 38.8606 23.9595C37.9655 23.2549 36.9975 22.6356 35.9708 22.1106Z",fill:"#FABA0D"}),xl.jsx("path",{d:"M38.1541 40.1826C38.3555 40.2845 38.5266 40.3845 38.7097 40.4788C39.2759 40.7627 39.8094 41.0983 40.3022 41.4809C41.0683 42.0933 41.7122 42.8241 42.2047 43.6404C42.723 44.4695 43.1198 45.3584 43.3844 46.2834C43.566 46.9096 43.6394 47.5585 43.6018 48.2058C43.592 48.2923 43.6127 48.3793 43.6609 48.4541C43.7092 48.5289 43.7823 48.5873 43.8695 48.6208C43.9572 48.6525 44.0534 48.6575 44.1444 48.6351C44.2352 48.6127 44.3161 48.5642 44.3748 48.4967C45.0952 47.7907 45.5625 46.8778 45.9472 46.0075C47.0259 46.8063 47.8607 47.7933 48.419 48.9396C48.7129 49.4981 48.8884 50.1026 49.018 50.7105C49.1452 51.258 49.1649 51.8133 49.1501 52.3732C49.1014 54.2178 48.2857 55.9971 46.8845 57.3888C45.6466 58.618 44.0253 59.4538 42.2307 59.7409C40.689 60.0094 39.0963 59.8813 37.6287 59.3703C37.1346 59.1826 36.6579 58.9584 36.2033 58.7C35.521 58.355 34.932 57.8702 34.3906 57.3557C33.5148 56.4612 32.8631 55.4401 32.4789 54.2716C32.3103 53.6905 32.2051 53.0955 32.1649 52.4954C32.1132 51.5174 32.25 50.4844 32.6069 49.5898C33.1512 48.2256 34.0724 46.909 35.3326 46.0327C36.4901 45.2331 37.4561 44.2981 37.9427 43.044C38.1352 42.5132 38.2239 41.9552 38.2044 41.3958C38.2044 40.9908 38.1541 40.5871 38.1541 40.1826Z",fill:"#FABA0D"})]})},wf=function(e){var t=e.fill,r=void 0===t?"#B8BAC4":t;return xl.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsxs("g",{clipPath:"url(#clip0_54_32)",children:[xl.jsx("path",{d:"M39.898 61.6041C38.776 62.2821 37.324 62.3741 36.07 61.6801L32.782 59.8601C29.404 57.9961 28.194 53.7401 30.088 50.3761L33.282 44.6981L38.256 59.5521C38.556 60.4561 39.156 61.1621 39.896 61.6061L39.898 61.6041ZM50.746 32.0461L46.51 44.6961L39.898 32.9501L49.154 16.4981C49.614 15.6801 50.854 15.9381 50.95 16.8681L51.664 23.5781C51.972 26.4341 51.656 29.3221 50.744 32.0461H50.746Z",fill:r}),xl.jsx("path",{d:"M46.5099 44.6961L41.5399 59.5501C41.2379 60.4501 40.6399 61.1541 39.8999 61.6021C39.1579 61.1581 38.5539 60.4521 38.2579 59.5501L33.2839 44.6961L39.8979 32.9501L46.5099 44.6961Z",fill:"black"}),xl.jsx("path",{d:"M39.8979 32.9499L33.2799 44.6959L29.0459 32.0459C28.1339 29.3199 27.8179 26.4339 28.1259 23.5779L28.8399 16.8679C28.9399 15.9359 30.1759 15.6779 30.6339 16.4979L39.8979 32.9499ZM47.0099 59.8599L43.7239 61.6799C42.4639 62.3739 41.0179 62.2799 39.8979 61.6019C40.6399 61.1539 41.2379 60.4499 41.5379 59.5499L46.5079 44.6959L49.7019 50.3739C51.5959 53.7379 50.3859 57.9939 47.0099 59.8599Z",fill:r})]}),xl.jsx("defs",{children:xl.jsx("clipPath",{id:"clip0_54_32",children:xl.jsx("rect",{width:"24",height:"48",fill:"white",transform:"translate(28.0001 16)"})})})]})},xf=function(e){var t=e.fill,r=void 0===t?"#310CCC":t;return xl.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.1224 25.6667C34.9877 21.2577 30.9854 18 26.2222 18C20.5766 18 16 22.5766 16 28.2222C16 33.8678 20.5766 38.4444 26.2222 38.4444C30.9854 38.4444 34.9877 35.1868 36.1224 30.7778H44.963V39.2963H50.0741V30.7778H53.4814V39.2963H58.5926V30.7778H62V25.6667H36.1224ZM31.3333 28.2222C31.3333 31.045 29.045 33.3333 26.2222 33.3333C23.3995 33.3333 21.1111 31.045 21.1111 28.2222C21.1111 25.3995 23.3995 23.1111 26.2222 23.1111C29.045 23.1111 31.3333 25.3995 31.3333 28.2222Z",fill:r}),xl.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M41.8776 56.3333C43.0123 60.7423 47.0146 64 51.7778 64C57.4234 64 62 59.4233 62 53.7777C62 48.1321 57.4234 43.5555 51.7778 43.5555C47.0146 43.5555 43.0123 46.8132 41.8776 51.2222H33.037V42.7036H27.9259V51.2222H24.5186V42.7036H19.4075V51.2222H16V56.3333H41.8776ZM46.6667 53.7777C46.6667 50.955 48.955 48.6666 51.7778 48.6666C54.6005 48.6666 56.8889 50.955 56.8889 53.7777C56.8889 56.6005 54.6005 58.8888 51.7778 58.8888C48.955 58.8888 46.6667 56.6005 46.6667 53.7777Z",fill:r})]})},Sf=function(){return xl.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[xl.jsx("rect",{x:"7",y:"8",width:"66",height:"63.3555",fill:"url(#pattern0_453_8275)"}),xl.jsxs("defs",{children:[xl.jsx("pattern",{id:"pattern0_453_8275",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:xl.jsx("use",{xlinkHref:"#image0_453_8275",transform:"matrix(0.00277778 0 0 0.00289373 0 -0.0208706)"})}),xl.jsx("image",{id:"image0_453_8275",width:"360",height:"360",preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,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"})]})]})},Ef=function(e){var t=e.fill,r=void 0===t?"#C19CFC":t;return xl.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("rect",{width:"80",height:"80",fill:"#14142B"}),xl.jsx("path",{d:"M31.4709 25.298C32.4989 23.5176 33.6931 22.7759 34.9056 22.7037C37.3649 22.5412 42.8633 26.5906 41.1236 28.9951L44.3825 34.6802C46.4644 36.425 48.5728 37.7992 50.7331 38.7119C50.3293 40.4023 51.2694 41.0081 52.2177 41.6045C50.9529 39.3902 53.4296 38.1604 54.7645 40.3573C56.1435 42.2914 56.5128 44.2986 55.6869 45.862C54.4658 48.2032 51.1897 49.9382 49.7051 52.1168C52.7276 49.3783 56.7936 49.6856 58.4012 46.5034C59.4023 44.5328 56.8993 38.6941 55.7311 36.7234C53.9213 33.6954 51.6641 34.5719 51.4091 35.5484C49.0112 34.2374 46.8769 32.1586 44.6984 30.4227C45.7173 29.5283 46.2973 28.2356 45.1824 27.5394C42.8983 26.0936 40.2459 21.7728 36.8026 20.9318C36.4598 20.847 36.1106 20.8011 35.7638 20.8011C33.9691 20.8011 32.2139 22.0183 31.4709 25.298Z",fill:"#4E4B66"}),xl.jsx("path",{d:"M37.3473 76.875C40.0511 76.875 42.6867 76.5119 45.1848 75.8381C29.8061 79.9719 20.4061 62.3648 32.0948 49.9836C27.7906 48.8179 25.0244 44.4789 25.2962 39.2993C2.07278 56.3288 13.0876 76.875 37.3473 76.875ZM45.1893 75.8369C45.2134 75.83 45.2371 75.8244 45.2613 75.8175C45.2376 75.8238 45.213 75.8306 45.1893 75.8369Z",fill:r}),xl.jsx("path",{d:"M40.2192 20.5976C41.2212 21.2484 42.1605 22.1161 43.0301 22.9927C51.1726 21.2124 46.0253 13.3299 50.2589 10.2479C44.9099 12.1098 48.2739 20.8412 40.2192 20.5976Z",fill:r}),xl.jsx("path",{d:"M26.8951 26.9884L31.4711 25.2979C30.3556 16.0778 43.0391 12.3357 38.7527 3.125C38.5683 13.5557 25.8671 13.791 26.8951 26.9884Z",fill:r}),xl.jsx("path",{d:"M38.4804 47.0009C40.7549 45.9524 43.0213 44.5328 45.2963 45.2018C42.8014 43.5662 39.7365 44.3524 36.6443 44.5693C32.4899 44.8584 28.2741 44.4967 25.2961 39.2994C26.5614 45.8709 32.4198 49.7938 38.4804 47.0009Z",fill:r}),xl.jsx("path",{d:"M36.8114 13.5378C34.22 17.0091 30.8738 20.3717 31.4711 25.2978C32.358 21.3837 34.6862 20.4074 36.8028 20.9316C40.246 21.7726 42.8984 26.0934 45.1825 27.5392C46.2975 28.2354 45.7175 29.5281 44.6985 30.4225C46.877 32.1584 49.0113 34.2372 51.4092 35.5482C51.6642 34.5717 53.9215 33.6952 55.7311 36.7232C56.8994 38.6939 59.4025 44.5326 58.4013 46.5032C56.7937 49.6854 52.7277 49.3781 49.7051 52.1166C47.8608 48.7001 44.1722 47.8319 40.439 47.2809C41.9587 46.1148 43.5043 45.0662 45.2963 45.2017C43.0213 44.5326 40.755 45.9522 38.4804 47.0008C32.4198 49.7937 26.5614 45.8707 25.2962 39.2992C25.0244 44.4787 27.7906 48.8178 32.0948 49.9834C20.3866 62.3852 29.8376 80.03 45.2613 75.8175C58.4191 72.2194 68.125 59.8815 68.125 45.2017C68.125 32.1856 60.4915 21.0042 49.5827 16.1321C50.0835 19.0154 50.7158 21.7993 45.6651 25.6141C44.0753 24.2399 42.3011 21.9446 40.2191 20.5976C44.9184 20.7423 45.7265 17.8314 46.6576 15.0113C43.6573 14.0307 40.5251 13.5327 37.3768 13.5327C37.1884 13.5327 36.9999 13.5346 36.8114 13.5378ZM36.592 29.1214C37.1715 29.2386 37.7602 29.7267 38.296 30.2782C39.1656 31.1731 39.9915 31.3272 41.045 30.3869L44.3826 34.68L41.1237 28.9949C41.08 29.4471 40.7199 29.5552 40.281 29.5281C39.5171 29.4799 38.5533 28.9317 37.5421 28.9312C37.2284 28.9312 36.9102 28.9841 36.592 29.1214ZM52.2178 41.6043C52.7536 40.6734 53.4821 40.0676 54.7646 40.3571C54.272 39.5461 53.6237 39.2022 53.0655 39.2022C52.1108 39.2022 51.4197 40.2072 52.2178 41.6043Z",fill:r}),xl.jsx("path",{d:"M34.4399 16.6296C32.5865 19.1329 31.0581 21.8274 31.4711 25.2982C32.358 21.3841 34.6862 20.4077 36.8028 20.932C40.246 21.773 42.8984 26.0937 45.1825 27.5396C46.2975 28.2358 45.7175 29.5285 44.6985 30.4229C46.877 32.1588 49.0113 34.2376 51.4093 35.5486C51.6642 34.5722 53.9215 33.6956 55.7311 36.7236C56.8994 38.6942 59.4025 44.533 58.4013 46.5036C56.7938 49.6858 52.7277 49.3785 49.7051 52.117C47.8608 48.7006 44.1722 47.8324 40.439 47.2814C41.9587 46.1152 43.5043 45.0666 45.2963 45.2021C43.0213 44.533 40.755 45.9526 38.4805 47.0012C32.4198 49.7941 26.5614 45.8711 25.2962 39.2996C25.0244 44.4791 27.7906 48.8181 32.0948 49.9838C24.4708 58.056 25.8148 68.3512 31.9363 73.395C49.0996 76.8656 65.2613 63.3887 65.2613 45.2021C65.2613 33.9757 59.0073 24.2586 49.8813 19.5311C49.7143 21.3481 48.7482 23.2915 45.6651 25.6144C44.0753 24.2402 42.3011 21.945 40.2191 20.5979C43.3373 20.6884 44.7513 19.4412 45.6123 17.7592C42.9339 16.9055 40.134 16.4768 37.3318 16.4768C36.3666 16.4768 35.401 16.5274 34.4399 16.6296Z",fill:"#14142B"}),xl.jsx("path",{d:"M32.0948 49.9834C20.3866 62.3853 29.8376 80.03 45.2613 75.8175C27.6154 76.6125 29.3631 55.9857 40.5533 50.1193C44.5761 50.6797 48.7213 51.3942 50.7158 55.0814C53.7284 52.3523 57.7949 52.6503 59.4111 49.4681C60.0612 48.1941 59.2358 45.2926 58.2606 42.8694C58.6471 44.3616 58.796 45.7353 58.4013 46.5033C56.7937 49.6854 52.7277 49.3781 49.7051 52.1166C47.8608 48.7001 44.1722 47.8319 40.439 47.2809C41.9587 46.1148 43.5043 45.0663 45.2963 45.2017C43.0213 44.5326 40.755 45.9523 38.4804 47.0008C32.4198 49.7937 26.5614 45.8708 25.2962 39.2992C25.0244 44.4788 27.7906 48.8178 32.0948 49.9834Z",fill:"#262338"}),xl.jsx("path",{d:"M29.1416 26.4583L33.7175 25.6012C32.6021 16.3811 43.9749 14.1667 39.6486 5.625C39.6486 14.1667 27.6402 14.0533 29.1416 26.4583Z",fill:"#14142B"})]})},Af=function(e){var t=e.fill,r=void 0===t?"black":t;return xl.jsx("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl.jsx("path",{d:"M22.7898 38.3729C29.1931 21.8198 42.7306 18 42.7306 18C42.7306 18 38.3401 22.7294 35.2299 28.5503C32.12 34.3711 30.4735 44.9214 32.3029 47.832C41.267 46.0129 48.5848 35.8263 49.3165 26.9131C52.8484 29.4202 57.9147 33.2796 58.8296 44.7394C58.8296 44.7394 59.308 49.8328 56.2685 54.7441C53.2287 59.6554 46.7554 61.1106 46.7554 61.1106C46.7554 61.1106 40.3524 63.1116 33.4007 61.1106C26.7728 59.2032 17.2916 52.5875 22.7898 38.3729Z",fill:r})})},kf=function(e){var t=e.fill,r=void 0===t?"black":t;return xl.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsxs("g",{clipPath:"url(#clip0_44_35)",children:[xl.jsx("path",{d:"M27.8949 12.4346L25.2459 13.7842L12.4541 20.2997C12.4109 19.9698 12.3891 19.6374 12.389 19.3047C12.3907 17.9771 12.7393 16.673 13.4001 15.5216C14.0609 14.3702 15.0111 13.4113 16.1565 12.7401C17.3019 12.0689 18.6028 11.7086 19.9303 11.6948C21.2578 11.6811 22.5659 12.0144 23.725 12.6617L25.2412 11.8891L25.4674 11.7737C24.0784 10.7656 22.4378 10.1611 20.7267 10.0271C19.0157 9.8931 17.3009 10.2348 15.7719 11.0144C14.2429 11.794 12.9593 12.9812 12.0628 14.4448C11.1663 15.9083 10.692 17.5912 10.6922 19.3075C10.6922 19.5445 10.7012 19.7806 10.7192 20.0158C10.7444 20.3489 10.6705 20.6819 10.5069 20.9731C10.3432 21.2642 10.0971 21.5005 9.79954 21.6521L9 22.0598V23.9614L11.354 22.7616L12.1163 22.3726L12.8674 21.99L26.3526 15.119L27.8679 14.3473L31 12.751V10.8504L27.8949 12.4346Z",fill:r}),xl.jsx("path",{d:"M31 14.6539L13.6334 23.4963L12.1181 24.2698L9 25.8586V27.7584L12.0967 26.1807L14.7457 24.8311L27.5505 18.3063C27.5938 18.6384 27.6156 18.9729 27.6157 19.3078C27.6148 20.6369 27.2664 21.9427 26.6049 23.0955C25.9435 24.2484 24.992 25.2081 23.8449 25.8796C22.6978 26.551 21.3951 26.9107 20.066 26.9231C18.737 26.9354 17.4278 26.5999 16.2685 25.9499L16.1754 25.9992L14.5316 26.8369C15.9203 27.8451 17.5606 28.4497 19.2714 28.584C20.9822 28.7184 22.6968 28.3771 24.2258 27.5981C25.7548 26.819 27.0386 25.6324 27.9355 24.1693C28.8323 22.7063 29.3073 21.0238 29.3078 19.3078C29.3078 19.0686 29.2985 18.8294 29.2808 18.5929C29.2557 18.26 29.3295 17.9271 29.4929 17.636C29.6564 17.3448 29.9022 17.1085 30.1995 16.9566L31 16.5489V14.6539Z",fill:r})]}),xl.jsx("defs",{children:xl.jsx("clipPath",{id:"clip0_44_35",children:xl.jsx("rect",{width:"22",height:"18.6157",fill:"white",transform:"translate(9 10)"})})})]})},Of=function(e){var t=e.fill,r=void 0===t?"black":t;return xl.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl.jsx("path",{d:"M12.7847 3.8762L11.1792 4.69416L3.42667 8.64294C3.40045 8.443 3.38726 8.24156 3.38718 8.03991C3.38824 7.23531 3.59948 6.44495 3.99999 5.74711C4.40049 5.04928 4.97635 4.46818 5.67054 4.06138C6.36472 3.65458 7.15314 3.4362 7.9577 3.42786C8.76225 3.41952 9.55503 3.62152 10.2575 4.01385L11.1764 3.54563L11.3135 3.47568C10.4717 2.86469 9.47736 2.49834 8.44036 2.41713C7.40337 2.33591 6.36411 2.543 5.43745 3.01549C4.51079 3.48799 3.73281 4.20749 3.1895 5.09449C2.64619 5.98149 2.3587 7.00143 2.35881 8.0416C2.35881 8.18526 2.36426 8.32836 2.37517 8.47089C2.39044 8.67273 2.34567 8.87458 2.2465 9.05105C2.14733 9.22751 1.99818 9.3707 1.81782 9.4626L1.33325 9.70968V10.8622L2.75989 10.135L3.2219 9.89922L3.67713 9.66737L11.85 5.5031L12.7684 5.03545L14.6666 4.068V2.91608L12.7847 3.8762ZM14.6666 5.22104L4.1414 10.5801L3.22302 11.0489L1.33325 12.0118V13.1632L3.21005 12.207L4.81551 11.389L12.576 7.43462C12.6022 7.63588 12.6154 7.83863 12.6155 8.0416C12.615 8.84713 12.4038 9.63852 12.0029 10.3372C11.602 11.0359 11.0253 11.6176 10.3302 12.0245C9.63497 12.4314 8.84544 12.6494 8.03995 12.6569C7.23446 12.6644 6.44101 12.4611 5.7384 12.0671L5.68199 12.097L4.68577 12.6047C5.52738 13.2157 6.52152 13.5822 7.55835 13.6636C8.59519 13.745 9.63434 13.5382 10.561 13.066C11.4877 12.5938 12.2658 11.8747 12.8093 10.988C13.3528 10.1013 13.6407 9.08162 13.641 8.0416C13.641 7.89662 13.6354 7.75165 13.6247 7.60836C13.6094 7.40659 13.6541 7.20481 13.7532 7.02837C13.8523 6.85193 14.0012 6.70869 14.1814 6.61665L14.6666 6.36957V5.22104Z",fill:r})})},Tf=function(e){var t=e.fill,r=void 0===t?"black":t,n=e.background,o=void 0===n?"transparent":n;return xl.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("rect",{width:"40",height:"40",fill:o}),xl.jsx("path",{d:"M12.3719 15.1652C16.6511 10.9449 23.5889 10.9449 27.8682 15.1652L28.3831 15.6731C28.5971 15.8841 28.5971 16.2262 28.3831 16.4373L26.6214 18.1747C26.5144 18.2803 26.341 18.2803 26.234 18.1747L25.5253 17.4758C22.54 14.5316 17.7 14.5316 14.7147 17.4758L13.9557 18.2243C13.8488 18.3298 13.6753 18.3298 13.5683 18.2243L11.8066 16.4868C11.5926 16.2758 11.5926 15.9337 11.8066 15.7227L12.3719 15.1652ZM31.5116 18.7585L33.0795 20.3048C33.2935 20.5159 33.2935 20.858 33.0795 21.069L26.0096 28.0418C25.7956 28.2527 25.4487 28.2527 25.2347 28.0418L20.2169 23.093C20.1634 23.0402 20.0767 23.0402 20.0232 23.093L15.0055 28.0418C14.7915 28.2527 14.4446 28.2527 14.2306 28.0418L7.16047 21.0689C6.94651 20.8579 6.94651 20.5158 7.16047 20.3048L8.72842 18.7584C8.94238 18.5474 9.28928 18.5474 9.50323 18.7584L14.5212 23.7072C14.5746 23.76 14.6613 23.76 14.7148 23.7072L19.7325 18.7584C19.9464 18.5474 20.2934 18.5474 20.5073 18.7584L25.5252 23.7072C25.5787 23.76 25.6654 23.76 25.7189 23.7072L30.7367 18.7585C30.9507 18.5475 31.2976 18.5475 31.5116 18.7585Z",fill:r})]})},Cf=function(){return xl.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("path",{d:"M65.2273 65.8895H40.9771L65.2273 41.5859V65.8895Z",fill:"url(#paint0_linear_453_8276)"}),xl.jsx("path",{opacity:"0.14",d:"M65.227 65.3716L54.6021 54.6154L56.5146 52.8945L65.227 65.3716Z",fill:"url(#paint1_linear_453_8276)"}),xl.jsx("path",{d:"M65.2276 65.8596H14V14L65.2276 65.8596Z",fill:"url(#paint2_linear_453_8276)"}),xl.jsxs("defs",{children:[xl.jsxs("linearGradient",{id:"paint0_linear_453_8276",x1:"53.1021",y1:"41.4733",x2:"53.1021",y2:"65.9385",gradientUnits:"userSpaceOnUse",children:[xl.jsx("stop",{offset:"2.71717e-07",stopColor:"#FF4681"}),xl.jsx("stop",{offset:"1",stopColor:"#9B44F6"})]}),xl.jsxs("linearGradient",{id:"paint1_linear_453_8276",x1:"59.7273",y1:"54.2985",x2:"56.682",y2:"62.2417",gradientUnits:"userSpaceOnUse",children:[xl.jsx("stop",{offset:"9.43019e-07"}),xl.jsx("stop",{offset:"1"})]}),xl.jsxs("linearGradient",{id:"paint2_linear_453_8276",x1:"1.79599",y1:"27.5752",x2:"53.7337",y2:"78.8801",gradientUnits:"userSpaceOnUse",children:[xl.jsx("stop",{offset:"9.43019e-07",stopColor:"#FF4681"}),xl.jsx("stop",{offset:"0.7392",stopColor:"#9B44F6"})]})]})]})},If=function(e){var t=e.fill,r=void 0===t?"black":t;return xl.jsx("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl.jsx("path",{d:"M17 48.6421V60H34.6787V57.4811H19.5758V48.6421H17ZM61.4242 48.6421V57.4811H46.3213V59.9994H64V48.6421H61.4242ZM34.7044 31.3579V48.6415H46.3213V46.3701H37.2802V31.3579H34.7044ZM17 20V31.3579H19.5758V22.5183H34.6787V20H17ZM46.3213 20V22.5183H61.4242V31.3579H64V20H46.3213Z",fill:r})})},_f=function(e,t){switch(e){case"Rabet":return xl.jsx(wf,{fill:t?"#ffffff":"#B8BAC4"});case"Freighter":return t?xl.jsx(Sf,{}):xl.jsx(xf,{fill:"#310CCC"});case"Albedo":return xl.jsx(mf,{});case"LOBSTR":return xl.jsx(Af,{fill:t?"#ffffff":"#1a8da0"});case"xBull":return xl.jsx(Ef,{fill:t?"#FFFFFF":"#C19CFC"});case"Hana":return xl.jsx(bf,{fill:t?"#E6E0F7":"#221542"});case"Hot":return xl.jsx(vf,{});case"Wallet Connect":return xl.jsx(Tf,{fill:t?"#ffffff":"#0988f1"});case"Klever":return xl.jsx(Cf,{});case"Ledger":return xl.jsx(If,{fill:t?"#ffffff":"#000000"});default:return null}},Pf=function(){var e,t,r,n=Al(),o=me(function(e){return e}),i=o.user,s=o.waitingStatus,a=o.config.appearance;return xl.jsxs("div",{className:"bluxcc:mt-3 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[xl.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{borderColor:a.borderColor,borderWidth:a.borderWidth},children:_f(null!==(e=null==i?void 0:i.authValue)&&void 0!==e?e:"",Iu(a.background))}),xl.jsxs("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[xl.jsx("p",{className:"bluxcc:text-xl",children:"login"===s?n("waitingFor",{walletName:null!==(t=null==i?void 0:i.authValue)&&void 0!==t?t:"wallet"}):n("signingWith",{walletName:null!==(r=null==i?void 0:i.authValue)&&void 0!==r?r:"wallet"})}),xl.jsx("p",{className:"bluxcc:text-sm",children:n("login"===s?"acceptConnection":"signRequestInWallet")})]}),xl.jsx(lf,{}),xl.jsx(gf,{state:"disabled",variant:"outline",startIcon:xl.jsx(Il,{fill:a.accentColor}),children:n("login"===s?"connecting":"signing")})]})},Rf=function(e){var t=e.handleOpenAssets,r=e.asset,n=me(function(e){return e.config.appearance});return xl.jsxs("button",{id:"bluxcc-button",onClick:t,className:"bluxcc:flex bluxcc:bg-transparent bluxcc:items-center bluxcc:gap-1 bluxcc:p-1 bluxcc:max-h-12",style:{borderColor:n.borderColor,borderWidth:n.borderWidth,borderRadius:n.borderRadius,backgroundColor:n.fieldBackground},children:[xl.jsx("div",{style:{background:n.background,borderRadius:n.borderRadius,borderColor:n.borderColor,borderWidth:n.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-[border-radius] bluxcc:duration-300",children:"native"===r.assetType?xl.jsx(kf,{fill:xu(n.fieldBackground)}):xl.jsx(of,{fill:xu(n.fieldBackground)})}),xl.jsx("span",{children:r.assetCode}),xl.jsx(Ul,{fill:n.accentColor})]})},Nf=function(e,t,r,n,o,i,s,a,c,u){return d(void 0,void 0,void 0,function(){var l,f,d,p,y;return h(this,function(h){switch(h.label){case 0:l=Number(Number(e).toFixed(5)).toString(),f=Number((Number(t)/100*99.5).toFixed(5)).toString(),d=null,h.label=1;case 1:return h.trys.push([1,3,,4]),[4,a.loadAccount(s)];case 2:return d=h.sent(),[3,4];case 3:return h.sent(),[3,4];case 4:if(!d)throw new Error("Inactive account cannot send a transaction.");return p=new ae.TransactionBuilder(d,{fee:"70000",networkPassphrase:c}),u&&(p=p.addOperation(ae.Operation.changeTrust({limit:"999999999999",asset:gu(o)}))),y=w([],i.slice(1,i.length-1),!0).map(gu),p="from"===r?p.addOperation(ae.Operation.pathPaymentStrictSend({sendAsset:gu(n),sendAmount:l,destination:s,destAsset:gu(o),destMin:f,path:y})):p.addOperation(ae.Operation.pathPaymentStrictReceive({sendAsset:gu(n),sendMax:l,destination:s,destAsset:gu(o),destAmount:f,path:y})),[2,p.setTimeout(180).build().toXDR()]}})})},Bf=function(){var e=Al(),t=Q.useState("0"),r=t[0],o=t[1],i=Q.useState("0"),s=i[0],a=i[1],c=Q.useState(0),u=c[0],l=c[1],f=Q.useState(0),p=f[0],y=f[1],g=me(function(e){return e}),m=Q.useState(!1),b=m[0],v=m[1],x=Q.useState([]),S=x[0],E=x[1],A=Q.useState({field:"",message:""}),k=A[0],O=A[1],T=Q.useState(!1),C=T[0],I=T[1],_=Q.useState({rate:0,isInverted:!1}),P=_[0],R=_[1],N=Q.useState("from"),B=N[0],j=N[1],M=function(e){g.setSelectAsset(n(n({},g.selectAsset),{field:e})),g.setRoute(se.SELECT_ASSET)},L=function(e,t){"from"===t?a(e.target.value):o(e.target.value),j(t),I(!C)};Q.useEffect(function(){E([]),v(!1),O({field:"",message:""}),R({rate:0,isInverted:!1}),isNaN(Number(s))||""===s||Number(s)<0?O({field:"from",message:"Invalid value for FROM field."}):isNaN(Number(r))||""===r||Number(r)<0?O({field:"to",message:"Invalid value for TO field."}):g.selectAsset.swapFromAsset.assetCode!==g.selectAsset.swapToAsset.assetCode||g.selectAsset.swapFromAsset.assetIssuer!==g.selectAsset.swapToAsset.assetIssuer?isNaN(Number(g.selectAsset.swapFromAsset.assetBalance))?O({field:"from",message:"FROM asset has invalid balance."}):Number(s)>Number(g.selectAsset.swapFromAsset.assetBalance)?O({field:"from",message:"Insufficient balance."}):0===Number(s)&&0===Number(r)||(O({field:"",message:""}),d(void 0,void 0,void 0,function(){var e,t;return h(this,function(n){switch(n.label){case 0:if(v(!0),"from"!==B)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Hu([gu(g.selectAsset.swapFromAsset),s,[gu(g.selectAsset.swapToAsset)]],{})];case 2:return e=n.sent(),v(!1),0===e.response.records.length?O({field:"both",message:"Could not find path. Try again."}):(t=e.response.records[0],R({rate:Number(t.destination_amount)/Number(t.source_amount),isInverted:!1}),E(w(w([g.selectAsset.swapFromAsset],t.path.map(mu),!0),[g.selectAsset.swapToAsset],!1)),o(t.destination_amount)),[3,4];case 3:return n.sent(),v(!1),O({field:"both",message:"Could not find path. Try again."}),[3,4];case 4:return[3,8];case 5:return n.trys.push([5,7,,8]),[4,Vu([[gu(g.selectAsset.swapFromAsset)],gu(g.selectAsset.swapToAsset),r],{})];case 6:return e=n.sent(),v(!1),0===e.response.records.length?O({field:"both",message:"Could not find path. Try again."}):(t=e.response.records[0],R({rate:Number(t.destination_amount)/Number(t.source_amount),isInverted:!1}),E(w(w([g.selectAsset.swapFromAsset],t.path.map(mu),!0),[g.selectAsset.swapToAsset],!1)),a(t.source_amount)),[3,8];case 7:return n.sent(),v(!1),O({field:"both",message:"Could not find path. Try again."}),[3,8];case 8:return[2]}})})):O({field:"both",message:"FROM and TO assets are the same."})},[g.selectAsset,C]);var U=g.config.appearance,D="";0!==P.rate&&(D=P.isInverted?"1 ".concat(g.selectAsset.swapToAsset.assetCode," = ").concat((1/P.rate).toFixed(5)," ").concat(g.selectAsset.swapFromAsset.assetCode):"1 ".concat(g.selectAsset.swapFromAsset.assetCode," = ").concat(Cu(P.rate)," ").concat(g.selectAsset.swapToAsset.assetCode));var F="",z=""!==s&&"0"!==s&&Number(s)>=0&&!isNaN(Number(s)),q=""!==r&&"0"!==r&&Number(r)>=0&&!isNaN(Number(r));z&&q&&!b&&(F="".concat((Number(r)/100*99.5).toFixed(5)," ").concat(g.selectAsset.swapToAsset.assetCode));var V=[{label:"Rate",value:0!==P.rate&&q?xl.jsxs("span",{className:"bluxcc:flex bluxcc:gap-1.5 bluxcc:items-center",children:[D,xl.jsx("button",{id:"bluxcc-button",onClick:function(){y(function(e){return e+180}),R(n(n({},P),{isInverted:!P.isInverted}))},className:"bluxcc:transition-transform bluxcc:duration-300 bluxcc:bg-transparent",style:{transform:"rotate(".concat(p,"deg)")},children:xl.jsx(Xl,{fill:Tu(U.textColor,.7)})})]}):"—"},{label:"Path",value:(null==S?void 0:S.length)?S.map(function(e){return e.assetCode}).join(" > "):"—"},{label:"Minimum Received",value:q?F:"—"}];return xl.jsxs("form",{onSubmit:function(e){return d(void 0,void 0,void 0,function(){var t,n,o,i,a;return h(this,function(c){switch(c.label){case 0:if(e.preventDefault(),""!==k.message)return[2];c.label=1;case 1:return c.trys.push([1,3,,4]),t=function(e,t,r){var n=r.find(function(e){return"native"===e.asset_type});return"native"!==t.assetType&&(n=r.find(function(e){return e.asset_type===t.assetType&&e.asset_code===t.assetCode&&e.asset_issuer===t.assetIssuer})),!n||Number(n.balance)+Number(e)>=Number(n.limit)}(r,g.selectAsset.swapToAsset,g.balances.balances),[4,Nf(s,r,B,g.selectAsset.swapFromAsset,g.selectAsset.swapToAsset,S,null===(o=g.user)||void 0===o?void 0:o.address,null===(i=g.stellar)||void 0===i?void 0:i.servers.horizon,(null===(a=g.stellar)||void 0===a?void 0:a.activeNetwork)||"",t)];case 2:return n=c.sent(),setTimeout(function(){try{el(n)}catch(e){}},150),[3,4];case 3:return c.sent(),O({field:"both",message:"Failed to make transaction."}),[3,4];case 4:return[2]}})})},children:[xl.jsxs("div",{className:"bluxcc:relative bluxcc:w-full bluxcc:p-4",style:{backgroundColor:U.fieldBackground,borderColor:U.borderColor,borderRadius:U.borderRadius,borderWidth:U.borderWidth},children:[xl.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:text-sm bluxcc:select-none",children:[xl.jsx("span",{style:{color:Tu(U.textColor,.7)},children:"From"}),xl.jsxs("span",{children:[xl.jsx("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent bluxcc:border-none",style:{color:Tu(U.textColor,.7)},children:Cu(g.selectAsset.swapFromAsset.assetBalance)}),xl.jsxs("button",{id:"bluxcc-button",onClick:function(){j("from"),I(!C),a(g.selectAsset.swapFromAsset.assetBalance)},style:{color:U.accentColor},className:"bluxcc:mr-2 bluxcc:ml-1.5 bluxcc:inline-flex bluxcc:bg-transparent",children:[e("max")," ",xl.jsx(Ll,{fill:U.accentColor})]})]})]}),xl.jsxs("div",{className:"bluxcc:mt-2 bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[xl.jsx("input",{name:"from",type:"number",value:s,onChange:function(e){L(e,"from")},id:"bluxcc-input",className:"bluxcc:w-full bluxcc:bg-transparent bluxcc:text-xl bluxcc:font-medium bluxcc:outline-none",style:{color:"from"===k.field||"both"===k.field?"#ec2929":U.textColor}}),xl.jsx(Rf,{asset:g.selectAsset.swapFromAsset,handleOpenAssets:function(){M("swapFrom")}})]}),xl.jsx("div",{className:"bluxcc:mt-1 bluxcc:text-left bluxcc:text-xs",style:{color:Tu(U.textColor,.7)}}),xl.jsxs("button",{id:"bluxcc-button",className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:[xl.jsx("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:U.borderWidth,borderTopStyle:"solid",borderTopColor:U.borderColor}}),xl.jsx("div",{onClick:function(){var e=g.selectAsset.swapFromAsset,t=g.selectAsset.swapToAsset;l(function(e){return e+180}),g.setSelectAsset(n(n({},g.selectAsset),{swapFromAsset:t,swapToAsset:e}))},className:"bluxcc:z-20 bluxcc:p-2 bluxcc:transition-all bluxcc:duration-200",style:{backgroundColor:U.fieldBackground,borderColor:U.borderColor,borderRadius:U.borderRadius,borderWidth:U.borderWidth},children:xl.jsx("div",{className:"bluxcc:transition-transform bluxcc:duration-300",style:{transform:"rotate(".concat(u,"deg)")},children:xl.jsx(Gl,{fill:U.accentColor})})})]}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:text-sm bluxcc:select-none",style:{color:Tu(U.textColor,.7)},children:[xl.jsx("span",{children:"To"}),xl.jsx("span",{className:"bluxcc:mr-2",children:Cu(g.selectAsset.swapToAsset.assetBalance)})]}),xl.jsxs("div",{className:"bluxcc:mt-2 bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[xl.jsx("input",{name:"to",id:"bluxcc-input",type:"number",value:r,onChange:function(e){L(e,"to")},className:"bluxcc:w-full bluxcc:bg-transparent bluxcc:text-xl bluxcc:font-medium bluxcc:outline-none",style:{color:"to"===k.field||"both"===k.field?"#ec2929":U.textColor}}),xl.jsx(Rf,{asset:g.selectAsset.swapToAsset,handleOpenAssets:function(){M("swapTo")}})]}),xl.jsx("div",{className:"bluxcc:mt-1 bluxcc:text-left bluxcc:text-xs",style:{color:Tu(U.textColor,.7)}})]}),xl.jsx("div",{className:"bluxcc:h-3.5 bluxcc:my-[5px] bluxcc:mx-3 bluxcc:text-left bluxcc:text-xs bluxcc:text-alert-error",children:k.message}),xl.jsx("div",{style:{borderColor:U.borderColor,borderRadius:U.borderRadius,borderWidth:U.borderWidth},className:"bluxcc:w-full bluxcc:py-3 bluxcc:px-4",children:V.map(function(e,t,r){return xl.jsxs("div",{children:[xl.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:items-center bluxcc:text-xs bluxcc:font-medium",children:[xl.jsx("span",{style:{color:Tu(U.textColor,.8)},children:e.label}),xl.jsx("span",{style:{color:Tu(U.textColor,.7)},children:b?"LOADING...":e.value})]}),t!==r.length-1&&xl.jsx("div",{className:"bluxcc:my-2",style:{borderRadius:U.borderRadius,borderTop:"".concat(U.borderWidth," dashed ").concat(U.borderColor)}})]},e.label)})}),xl.jsx(lf,{}),xl.jsx(gf,{size:"large",state:"enabled",variant:"outline",type:"submit",disabled:""!==k.message,children:"Swap"})]})},jf=function(e){var t=e.button,r=e.onButtonClick,n=e.appearance;return xl.jsx("button",{onClick:r,id:"bluxcc-button",style:{borderRadius:n.borderRadius,color:n.textColor,borderColor:n.borderColor,background:n.background,borderWidth:n.borderWidth},className:"bluxcc:border bluxcc:!px-3 bluxcc:!py-1 bluxcc:!text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",children:t})},Mf=function(e){var t=e.label,r=e.autoFocus,n=e.type,o=void 0===n?"text":n,i=e.placeholder,s=void 0===i?"Input":i,a=e.error,c=e.iconRight,u=e.iconLeft,l=e.button,f=e.optionalField,d=void 0!==f&&f,h=e.onButtonClick,p=e.customLabel,y=e.value,g=e.className,m=e.onChange,b=me(function(e){return e.config.appearance}),v=Q.useState(!1),w=v[0],x=v[1],S=Al(),E=function(){return a?"#ec2929":w?b.accentColor:b.borderColor};return xl.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col",children:[t&&xl.jsxs("label",{style:{color:a?"#ec2929":b.textColor},className:"bluxcc:mb-2 bluxcc:ml-4 bluxcc:flex bluxcc:justify-between bluxcc:text-xs",children:[xl.jsxs("span",{children:[t," ",d&&xl.jsxs("span",{style:{color:Tu(b.textColor,.7)},className:"bluxcc:text-[10px]",children:["(",S("optional"),")"]})]}),xl.jsx("span",{children:p})]}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:px-4 bluxcc:py-2 bluxcc:transition-all bluxcc:duration-300 ".concat(g),onFocus:function(){return x(!0)},onBlur:function(){return x(!1)},onMouseEnter:function(e){w||a||(e.currentTarget.style.borderColor=b.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){w||(e.currentTarget.style.borderColor=a?"#ec2929":b.borderColor)},style:{"--tw-ring-color":E(),border:"".concat(b.borderWidth," solid ").concat(E()),borderRadius:b.borderRadius,backgroundColor:b.fieldBackground},children:[u&&xl.jsx("div",{className:"bluxcc:mr-2",children:u}),xl.jsx("input",{id:"bluxcc-input",autoComplete:"off",min:"number"===o?1:void 0,type:o,autoFocus:r,value:y,placeholder:s,className:"bluxcc:!mr-2 bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base bluxcc:font-medium",style:{color:b.textColor,width:l?"90%":"100%"},onChange:m}),l&&xl.jsx(jf,{button:l,onButtonClick:h,appearance:b}),c&&xl.jsx("div",{className:"bluxcc:ml-4",children:c})]}),!d&&xl.jsx("div",{className:"bluxcc:mt-1 bluxcc:text-xs bluxcc:ml-4 bluxcc:h-4",children:a?xl.jsx("p",{className:"bluxcc:text-alert-error",children:a}):""})]})},Lf=function(){var e=Al(),t=me(function(e){return e}),r=Q.useState({}),o=r[0],i=r[1],s=Q.useState({memo:"",amount:"",address:""}),a=s[0],c=s[1],u=function(e){return function(t){c(function(r){var o;return n(n({},r),((o={})[e]=t.target.value,o))}),i(function(t){var r;return n(n({},t),((r={})[e]="",r))})}};return xl.jsx(xl.Fragment,{children:xl.jsxs("div",{children:[xl.jsx("div",{className:"bluxcc:relative bluxcc:mb-1",children:xl.jsx(Mf,{autoFocus:!0,type:"number",label:e("amount"),placeholder:"0.00",value:a.amount,onChange:u("amount"),error:o.amount,customLabel:xl.jsxs("button",{id:"bluxcc-button",onClick:function(){var e=Number(t.selectAsset.sendAsset.assetBalance).toString();c(function(t){return n(n({},t),{amount:e})})},style:{color:t.config.appearance.accentColor},className:"bluxcc:mr-2 bluxcc:inline-flex bluxcc:bg-transparent",children:[e("max")," ",xl.jsx(Ll,{fill:t.config.appearance.accentColor})]}),onButtonClick:function(){t.setSelectAsset(n(n({},t.selectAsset),{field:"send"})),t.setRoute(se.SELECT_ASSET)},button:xl.jsxs("span",{className:"bluxcc:flex bluxcc:justify-between bluxcc:gap-1!",children:[xl.jsx("span",{className:"bluxcc:flex bluxcc:items-center",children:"native"===t.selectAsset.sendAsset.assetType?xl.jsx(Of,{fill:xu(t.config.appearance.background)}):xl.jsx(sf,{fill:xu(t.config.appearance.fieldBackground)})}),t.selectAsset.sendAsset.assetCode]})})}),xl.jsx("div",{className:"bluxcc:mb-1",children:xl.jsx(Mf,{label:e("to"),placeholder:e("enterAddress"),value:a.address,onChange:u("address"),error:o.address,button:e("paste"),onButtonClick:function(){return d(void 0,void 0,void 0,function(){var e;return h(this,function(t){switch(t.label){case 0:return[4,navigator.clipboard.readText()];case 1:return e=t.sent(),c(function(t){return n(n({},t),{address:e})}),[2]}})})}})}),xl.jsx("div",{children:xl.jsx(Mf,{optionalField:!0,label:e("memo"),placeholder:e("enterMemo"),value:a.memo,onChange:u("memo")})}),xl.jsx(lf,{}),xl.jsx(gf,{size:"large",variant:"outline",state:"enabled",onClick:function(){return d(void 0,void 0,void 0,function(){var r,n,o,s,c,u;return h(this,function(l){switch(l.label){case 0:if(r={},a.amount?Number(a.amount)>Number(t.selectAsset.sendAsset.assetBalance||"0")&&(r.amount=e("amountExceedsBalance")):r.amount=e("amountRequired"),a.address?ae.StrKey.isValidEd25519PublicKey(a.address)||(r.address=e("addressInvalid")):r.address=e("addressRequired"),i(r),0!==Object.keys(r).length)return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,(f=a.memo,p=a.amount,y=a.address,g=t.selectAsset.sendAsset,m=null===(s=t.user)||void 0===s?void 0:s.address,b=null===(c=t.stellar)||void 0===c?void 0:c.servers.horizon,v=(null===(u=t.stellar)||void 0===u?void 0:u.activeNetwork)||"",d(void 0,void 0,void 0,function(){var e,t,r,n;return h(this,function(o){switch(o.label){case 0:e=null,t=null,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,b.loadAccount(y)];case 2:return t=o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:return o.trys.push([4,6,,7]),[4,b.loadAccount(m)];case 5:return e=o.sent(),[3,7];case 6:return o.sent(),[3,7];case 7:if(!e)throw new Error("Inactive account cannot send a transaction.");if(!t&&"native"!==g.assetType)throw new Error("Cannot send non-native asset to an inactive account.");return r=new ae.TransactionBuilder(e,{fee:"50000",networkPassphrase:v}),t?(n=ae.Asset.native(),"native"!==g.assetType&&(n=new ae.Asset(g.assetCode,g.assetIssuer)),r=r.addOperation(ae.Operation.payment({amount:p,destination:y,asset:n}))):r=r.addOperation(ae.Operation.createAccount({startingBalance:p,destination:y})),f&&(r=r.addMemo(ae.Memo.text(f))),[2,r.setTimeout(180).build().toXDR()]}})}))];case 2:return n=l.sent(),setTimeout(function(){var e;el(n,{network:(null===(e=t.stellar)||void 0===e?void 0:e.activeNetwork)||""})},150),[3,4];case 3:return o=l.sent(),r.address=o.message,i(r),[3,4];case 4:return[2]}var f,p,y,g,m,b,v})})},children:e("sendButton")})]})})},Uf=function(e){var t=e.otp,r=e.setOtp,n=e.error,o=t.length,i=Q.useRef([]),s=me(function(e){return e.config.appearance});Q.useEffect(function(){n&&setTimeout(function(){var e;return null===(e=i.current[0])||void 0===e?void 0:e.focus()},1001)},[n]);var a=function(e){e.preventDefault();var t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,o);if(t){var n=w(w([],t.split(""),!0),Array(o-t.length).fill(""),!0);r(n),setTimeout(function(){var e;return null===(e=i.current[o-1])||void 0===e?void 0:e.focus()},0)}},c=function(e){return{borderRadius:s.borderRadius,color:s.accentColor,background:s.fieldBackground,"--tw-ring-color":n?"#FF6666":s.accentColor,borderColor:n?"#FF6666":e?s.accentColor:s.borderColor,borderWidth:s.borderWidth}};return xl.jsx("div",{className:"bluxcc:flex bluxcc:gap-1",children:t.map(function(e,n){return xl.jsx("input",{autoFocus:0===n,ref:function(e){i.current[n]=e},type:"text",inputMode:"numeric",maxLength:1,value:e,onChange:function(e){return function(e,n){var s,a=n.target.value.replace(/\D/g,"");if(a){var c=w([],t,!0);c[e]=a[0],r(c),e<o-1&&a&&(null===(s=i.current[e+1])||void 0===s||s.focus())}}(n,e)},onPaste:a,onKeyDown:function(e){return function(e,n){var o;if("Backspace"===n.key){var s=w([],t,!0);s[e]?(s[e]="",r(s)):e>0&&(null===(o=i.current[e-1])||void 0===o||o.focus(),s[e-1]="",r(s))}}(n,e)},className:"bluxcc:h-14 bluxcc:w-12 bluxcc:border bluxcc:text-center bluxcc:text-lg bluxcc:outline-hidden bluxcc:focus:ring-1",style:c(e)},n)})})},Df=function(){var e=Al(),t=me(function(e){return e.config.appearance}),r=me(function(e){return e.user}),n=null==r?void 0:r.authValue,o=Q.useState(Array(6).fill("")),i=o[0],s=o[1],a=Q.useState(!1),c=a[0],u=a[1];return Q.useEffect(function(){var e=i.join("");6===e.length&&function(e){d(void 0,void 0,void 0,function(){return h(this,function(t){switch(t.label){case 0:return u(!1),[4,new Promise(function(t){setTimeout(function(){t("123456"===e)},200)})];case 1:return t.sent()||(u(!0),setTimeout(function(){return s(Array(6).fill(""))},1e3)),[2]}})})}(e)},[i,n]),xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[xl.jsx("div",{style:{borderColor:t.borderColor,borderWidth:t.borderWidth},className:"bluxcc:mb-6 bluxcc:flex bluxcc:h-20 bluxcc:w-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:border-2",children:xl.jsx(Hl,{fill:t.textColor})}),xl.jsxs("div",{className:"bluxcc:flex-col bluxcc:space-y-1 bluxcc:text-center",children:[xl.jsx("p",{className:"bluxcc:text-xl bluxcc:font-medium",children:e("enterConfirmationCodeTitle")}),c?xl.jsx("p",{className:"bluxcc:flex bluxcc:h-10 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:text-alert-error",children:e("invalidCodeError")}):xl.jsx("p",{className:"bluxcc:h-10 bluxcc:text-sm",children:e("enterConfirmationCodeHelp")})]}),xl.jsx("div",{className:"bluxcc:mt-6 bluxcc:text-center",children:xl.jsx(Uf,{otp:i,setOtp:s,error:c})}),xl.jsx(lf,{}),xl.jsx(gf,{size:"medium",state:"enabled",variant:"text",onClick:function(){},style:{color:t.accentColor},children:e("resendCode")})]})},Ff=function(){var e,t,r=Al(),n=me(function(e){return e}),o=n.config,i=n.closeModal,s=n.waitingStatus,a=o.appearance,c=n.sendTransaction,u=null===(e=null==c?void 0:c.result)||void 0===e?void 0:e.hash,l=(null===(t=null==c?void 0:c.options)||void 0===t?void 0:t.network)||"",f=u?Su(l,o.explorer,"transactionUrl",u):null;Q.useEffect(function(){"login"===s&&setTimeout(function(){i()},1e3)},[]);return xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[xl.jsx("div",{style:{background:Tu(a.accentColor,.1)},className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-[68px] bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",children:xl.jsx(Pl,{fill:a.accentColor})}),xl.jsxs("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[xl.jsx("p",{className:"bluxcc:text-xl",children:r("login"===s?"connectionSuccessfulTitle":"transactionSuccessfulTitle")}),xl.jsx("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5",children:"login"===s?r("connectionSuccessfulMessage",{appName:bu(o.appName)}):r("transactionSuccessfulMessage")})]}),"sendTransaction"===s&&u&&"string"==typeof f&&xl.jsx(gf,{state:"enabled",variant:"outline",size:"small",className:"bluxcc:mt-4",onClick:function(){f&&window.open(f,"_blank","noopener,noreferrer")},children:r("seeInExplorer")}),xl.jsx(lf,{}),"login"===s?xl.jsx(gf,{state:"disabled",variant:"outline",children:r("loggingIn")}):xl.jsx(gf,{state:"enabled",variant:"fill",size:"large",onClick:function(){if(i(),"sendTransaction"===s){if(!c)return;var e=c.resolver,t=c.result;e&&t&&(e(t),setTimeout(function(){n.cleanUp("signMessage")},150))}else if("signMessage"===s){if(!n.signMessage)return;var r=n.signMessage;e=r.resolver,t=r.result;e&&t&&(e(t),setTimeout(function(){n.cleanUp("signMessage")},150))}},children:r("done")})]})},zf=function(e,t){return d(void 0,void 0,void 0,function(){var r,n;return h(this,function(o){switch(o.label){case 0:e.connectWallet(t.name),o.label=1;case 1:return o.trys.push([1,5,,6]),[4,t.connect()];case 2:return(r=o.sent())&&""!==r.trim()?[4,Ou(t)]:[3,4];case 3:n=o.sent(),e.connectWalletSuccessful(r,n),i=t.name,s=Eu(),a=w([i],s.filter(function(e){return e!==i}),!0),localStorage.setItem(rs,JSON.stringify(a)),setTimeout(function(){e.setRoute(se.SUCCESSFUL)},500),o.label=4;case 4:return[3,6];case 5:return o.sent(),e.setRoute(se.FAILED),[3,6];case 6:return[2]}var i,s,a})})},qf={},Vf=V(U),Hf={},Kf={};var Wf,Gf={},Xf={},Zf={};var Qf,Yf,Jf,$f,ed={};function td(){return Yf||(Yf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Vf;t.__exportStar((Wf||(Wf=1,Object.defineProperty(Zf,"__esModule",{value:!0}),Zf.ONE_THOUSAND=Zf.ONE_HUNDRED=void 0,Zf.ONE_HUNDRED=100,Zf.ONE_THOUSAND=1e3),Zf),e),t.__exportStar((Qf||(Qf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=5*e.ONE_MINUTE,e.TEN_MINUTES=10*e.ONE_MINUTE,e.THIRTY_MINUTES=30*e.ONE_MINUTE,e.SIXTY_MINUTES=60*e.ONE_MINUTE,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=3*e.ONE_HOUR,e.SIX_HOURS=6*e.ONE_HOUR,e.TWELVE_HOURS=12*e.ONE_HOUR,e.TWENTY_FOUR_HOURS=24*e.ONE_HOUR,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=3*e.ONE_DAY,e.FIVE_DAYS=5*e.ONE_DAY,e.SEVEN_DAYS=7*e.ONE_DAY,e.THIRTY_DAYS=30*e.ONE_DAY,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=2*e.ONE_WEEK,e.THREE_WEEKS=3*e.ONE_WEEK,e.FOUR_WEEKS=4*e.ONE_WEEK,e.ONE_YEAR=365*e.ONE_DAY}(ed)),ed),e)}(Xf)),Xf}function rd(){return $f||($f=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Vf;t.__exportStar((Sl||(Sl=1,Object.defineProperty(Kf,"__esModule",{value:!0}),Kf.delay=void 0,Kf.delay=function(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}),Kf),e),t.__exportStar(function(){if(Jf)return Gf;Jf=1,Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.fromMiliseconds=Gf.toMiliseconds=void 0;const e=td();return Gf.toMiliseconds=function(t){return t*e.ONE_THOUSAND},Gf.fromMiliseconds=function(t){return Math.floor(t/e.ONE_THOUSAND)},Gf}(),e)}(Hf)),Hf}var nd,od={};var id,sd,ad,cd={},ud={};function ld(){return sd||(sd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});Vf.__exportStar((id||(id=1,Object.defineProperty(ud,"__esModule",{value:!0}),ud.IWatch=void 0,ud.IWatch=class{}),ud),e)}(cd)),cd}var fd=(ad||(ad=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Vf;t.__exportStar(rd(),e),t.__exportStar(function(){if(nd)return od;nd=1,Object.defineProperty(od,"__esModule",{value:!0}),od.Watch=void 0;class e{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw new Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){const t=this.get(e);if(void 0!==t.elapsed)throw new Error(`Watch already stopped for label: ${e}`);const r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){const t=this.timestamps.get(e);if(void 0===t)throw new Error(`No timestamp found for label: ${e}`);return t}elapsed(e){const t=this.get(e);return t.elapsed||Date.now()-t.started}}return od.Watch=e,od.default=e,od}(),e),t.__exportStar(ld(),e),t.__exportStar(td(),e)}(qf)),qf);class dd{}class hd extends dd{constructor(e){super()}}const pd=fd.FIVE_SECONDS,yd="heartbeat_pulse";class gd extends hd{constructor(e){super(e),this.events=new _s.EventEmitter,this.interval=pd,this.interval=e?.interval||pd}static async init(e){const t=new gd(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),fd.toMiliseconds(this.interval))}pulse(){this.events.emit(yd)}}const md=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,bd=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,vd=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function wd(e,t){if(!("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t))return t;!function(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}(e)}function xd(e,t={}){if("string"!=typeof e)return e;if('"'===e[0]&&'"'===e[e.length-1]&&-1===e.indexOf("\\"))return e.slice(1,-1);const r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!vd.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(md.test(e)||bd.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,wd)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}function Sd(e,...t){try{return(r=e(...t))&&"function"==typeof r.then?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}var r}function Ed(e){if(function(e){const t=typeof e;return null===e||"object"!==t&&"function"!==t}(e))return String(e);if(function(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}(e)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return Ed(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const Ad="base64:";function kd(e){return"string"==typeof e?e:Ad+function(e){if(globalThis.Buffer)return Buffer.from(e).toString("base64");return globalThis.btoa(String.fromCodePoint(...e))}(e)}function Od(e){return"string"!=typeof e?e:e.startsWith(Ad)?function(e){if(globalThis.Buffer)return Buffer.from(e,"base64");return Uint8Array.from(globalThis.atob(e),e=>e.codePointAt(0))}(e.slice(7)):e}function Td(e){return e&&e.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function Cd(...e){return Td(e.join(":"))}function Id(e){return(e=Td(e))?e+":":""}const _d=()=>{const e=new Map;return{name:"memory",getInstance:()=>e,hasItem:t=>e.has(t),getItem:t=>e.get(t)??null,getItemRaw:t=>e.get(t)??null,setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys:()=>[...e.keys()],clear(){e.clear()},dispose(){e.clear()}}};function Pd(e={}){const t={mounts:{"":e.driver||_d()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=e=>{for(const r of t.mountpoints)if(e.startsWith(r))return{base:r,relativeKey:e.slice(r.length),driver:t.mounts[r]};return{base:"",relativeKey:e,driver:t.mounts[""]}},n=(e,r)=>t.mountpoints.filter(t=>t.startsWith(e)||r&&e.startsWith(t)).map(r=>({relativeBase:e.length>r.length?e.slice(r.length):void 0,mountpoint:r,driver:t.mounts[r]})),o=(e,r)=>{if(t.watching){r=Td(r);for(const n of t.watchListeners)n(e,r)}},i=async()=>{if(t.watching){for(const e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},s=(e,t,n)=>{const o=new Map,i=e=>{let t=o.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},o.set(e.base,t)),t};for(const n of e){const e="string"==typeof n,o=Td(e?n:n.key),s=e?void 0:n.value,a=e||!n.options?t:{...t,...n.options},c=r(o);i(c).items.push({key:o,value:s,relativeKey:c.relativeKey,options:a})}return Promise.all([...o.values()].map(e=>n(e))).then(e=>e.flat())},a={hasItem(e,t={}){e=Td(e);const{relativeKey:n,driver:o}=r(e);return Sd(o.hasItem,n,t)},getItem(e,t={}){e=Td(e);const{relativeKey:n,driver:o}=r(e);return Sd(o.getItem,n,t).then(e=>xd(e))},getItems:(e,t={})=>s(e,t,e=>e.driver.getItems?Sd(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:Cd(e.base,t.key),value:xd(t.value)}))):Promise.all(e.items.map(t=>Sd(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:xd(e)}))))),getItemRaw(e,t={}){e=Td(e);const{relativeKey:n,driver:o}=r(e);return o.getItemRaw?Sd(o.getItemRaw,n,t):Sd(o.getItem,n,t).then(e=>Od(e))},async setItem(e,t,n={}){if(void 0===t)return a.removeItem(e);e=Td(e);const{relativeKey:i,driver:s}=r(e);s.setItem&&(await Sd(s.setItem,i,Ed(t),n),s.watch||o("update",e))},async setItems(e,t){await s(e,t,async e=>{if(e.driver.setItems)return Sd(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:Ed(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>Sd(e.driver.setItem,t.relativeKey,Ed(t.value),t.options)))})},async setItemRaw(e,t,n={}){if(void 0===t)return a.removeItem(e,n);e=Td(e);const{relativeKey:i,driver:s}=r(e);if(s.setItemRaw)await Sd(s.setItemRaw,i,t,n);else{if(!s.setItem)return;await Sd(s.setItem,i,kd(t),n)}s.watch||o("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t}),e=Td(e);const{relativeKey:n,driver:i}=r(e);i.removeItem&&(await Sd(i.removeItem,n,t),(t.removeMeta||t.removeMata)&&await Sd(i.removeItem,n+"$",t),i.watch||o("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t}),e=Td(e);const{relativeKey:n,driver:o}=r(e),i=Object.create(null);if(o.getMeta&&Object.assign(i,await Sd(o.getMeta,n,t)),!t.nativeOnly){const e=await Sd(o.getItem,n+"$",t).then(e=>xd(e));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(i,e))}return i},setMeta(e,t,r={}){return this.setItem(e+"$",t,r)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){e=Id(e);const r=n(e,!0);let o=[];const i=[];let s=!0;for(const e of r){e.driver.flags?.maxDepth||(s=!1);const r=await Sd(e.driver.getKeys,e.relativeBase,t);for(const t of r){const r=e.mountpoint+Td(t);o.some(e=>r.startsWith(e))||i.push(r)}o=[e.mountpoint,...o.filter(t=>!t.startsWith(e.mountpoint))]}const a=void 0!==t.maxDepth&&!s;return i.filter(r=>(!a||function(e,t){if(void 0===t)return!0;let r=0,n=e.indexOf(":");for(;n>-1;)r++,n=e.indexOf(":",n+1);return r<=t}(r,t.maxDepth))&&function(e,t){return t?e.startsWith(t)&&"$"!==e[e.length-1]:"$"!==e[e.length-1]}(r,e))},async clear(e,t={}){e=Id(e),await Promise.all(n(e,!1).map(async e=>{if(e.driver.clear)return Sd(e.driver.clear,e.relativeBase,t);if(e.driver.removeItem){const r=await e.driver.getKeys(e.relativeBase||"",t);return Promise.all(r.map(r=>e.driver.removeItem(r,t)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(e=>Nd(e)))},watch:async e=>(await(async()=>{if(!t.watching){t.watching=!0;for(const e in t.mounts)t.unwatch[e]=await Rd(t.mounts[e],o,e)}})(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter(t=>t!==e),0===t.watchListeners.length&&await i()}),async unwatch(){t.watchListeners=[],await i()},mount(e,r){if((e=Id(e))&&t.mounts[e])throw new Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort((e,t)=>t.length-e.length)),t.mounts[e]=r,t.watching&&Promise.resolve(Rd(r,o,e)).then(r=>{t.unwatch[e]=r}).catch(console.error),a},async unmount(e,r=!0){(e=Id(e))&&t.mounts[e]&&(t.watching&&e in t.unwatch&&(t.unwatch[e]?.(),delete t.unwatch[e]),r&&await Nd(t.mounts[e]),t.mountpoints=t.mountpoints.filter(t=>t!==e),delete t.mounts[e])},getMount(e=""){e=Td(e)+":";const t=r(e);return{driver:t.driver,base:t.base}},getMounts(e="",t={}){e=Td(e);return n(e,t.parents).map(e=>({driver:e.driver,base:e.mountpoint}))},keys:(e,t={})=>a.getKeys(e,t),get:(e,t={})=>a.getItem(e,t),set:(e,t,r={})=>a.setItem(e,t,r),has:(e,t={})=>a.hasItem(e,t),del:(e,t={})=>a.removeItem(e,t),remove:(e,t={})=>a.removeItem(e,t)};return a}function Rd(e,t,r){return e.watch?e.watch((e,n)=>t(e,r+n)):()=>{}}async function Nd(e){"function"==typeof e.dispose&&await Sd(e.dispose)}function Bd(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function jd(e,t){let r;return(n,o)=>(()=>{if(r)return r;const n=indexedDB.open(e);return n.onupgradeneeded=()=>n.result.createObjectStore(t),r=Bd(n),r.then(e=>{e.onclose=()=>r=void 0},()=>{}),r})().then(e=>o(e.transaction(t,n).objectStore(t)))}let Md;function Ld(){return Md||(Md=jd("keyval-store","keyval")),Md}function Ud(e,t=Ld()){return t("readonly",t=>Bd(t.get(e)))}function Dd(e=Ld()){return e("readonly",e=>{if(e.getAllKeys)return Bd(e.getAllKeys());const t=[];return function(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},Bd(e.transaction)}(e,e=>t.push(e.key)).then(()=>t)})}function Fd(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return(e=>{const t=e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(t,(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t)})(e)}catch(t){return e}}function zd(e){return"string"==typeof e?e:(t=e,JSON.stringify(t,(e,t)=>"bigint"==typeof t?t.toString()+"n":t)||"");var t}var qd=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",r=e=>t+e;let n;return e.dbName&&e.storeName&&(n=jd(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await Ud(r(e),n)>"u"),getItem:async e=>await Ud(r(e),n)??null,setItem:(e,t)=>function(e,t,r=Ld()){return r("readwrite",r=>(r.put(t,e),Bd(r.transaction)))}(r(e),t,n),removeItem:e=>function(e,t=Ld()){return t("readwrite",t=>(t.delete(e),Bd(t.transaction)))}(r(e),n),getKeys:()=>Dd(n),clear:()=>function(e=Ld()){return e("readwrite",e=>(e.clear(),Bd(e.transaction)))}(n)}};class Vd{constructor(){this.indexedDb=Pd({driver:qd({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,zd(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var Hd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Kd={exports:{}};function Wd(e){var t;return[e[0],Fd(null!=(t=e[1])?t:"")]}!function(){let e;function t(){}e=t,e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){const e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Hd<"u"&&Hd.localStorage?Kd.exports=Hd.localStorage:typeof window<"u"&&window.localStorage?Kd.exports=window.localStorage:Kd.exports=new t}();class Gd{constructor(){this.localStorage=Kd.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Wd)}async getItem(e){const t=this.localStorage.getItem(e);if(null!==t)return Fd(t)}async setItem(e,t){this.localStorage.setItem(e,zd(t))}async removeItem(e){this.localStorage.removeItem(e)}}const Xd=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class Zd{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};const e=new Gd;this.storage=e;try{(async(e,t,r)=>{const n="wc_storage_version",o=await t.getItem(n);if(o&&o>=1)return void r(t);const i=await e.getKeys();if(!i.length)return void r(t);const s=[];for(;i.length;){const r=i.shift();if(!r)continue;const n=r.toLowerCase();if(n.includes("wc@")||n.includes("walletconnect")||n.includes("wc_")||n.includes("wallet_connect")){const n=await e.getItem(r);await t.setItem(r,n),s.push(r)}}await t.setItem(n,1),r(t),Xd(e,s)})(e,new Vd,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var Qd,Yd,Jd,$d;var eh=function(){if($d)return Jd;$d=1;const e=function(){if(Yd)return Qd;function e(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}return Yd=1,Qd=function(t,r,n){var o=n&&n.stringify||e;if("object"==typeof t&&null!==t){var i=r.length+1;if(1===i)return t;var s=new Array(i);s[0]=o(t);for(var a=1;a<i;a++)s[a]=o(r[a]);return s.join(" ")}if("string"!=typeof t)return t;var c=r.length;if(0===c)return t;for(var u="",l=0,f=-1,d=t&&t.length||0,h=0;h<d;){if(37===t.charCodeAt(h)&&h+1<d){switch(f=f>-1?f:0,t.charCodeAt(h+1)){case 100:case 102:if(l>=c)break;if(null==r[l])break;f<h&&(u+=t.slice(f,h)),u+=Number(r[l]),f=h+2,h++;break;case 105:if(l>=c)break;if(null==r[l])break;f<h&&(u+=t.slice(f,h)),u+=Math.floor(Number(r[l])),f=h+2,h++;break;case 79:case 111:case 106:if(l>=c)break;if(void 0===r[l])break;f<h&&(u+=t.slice(f,h));var p=typeof r[l];if("string"===p){u+="'"+r[l]+"'",f=h+2,h++;break}if("function"===p){u+=r[l].name||"<anonymous>",f=h+2,h++;break}u+=o(r[l]),f=h+2,h++;break;case 115:if(l>=c)break;f<h&&(u+=t.slice(f,h)),u+=String(r[l]),f=h+2,h++;break;case 37:f<h&&(u+=t.slice(f,h)),u+="%",f=h+2,h++,l--}++l}++h}return-1===f?t:(f<d&&(u+=t.slice(f)),u)},Qd}();Jd=n;const t=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},r={mapHttpRequest:u,mapHttpResponse:u,wrapRequestSerializer:l,wrapResponseSerializer:l,wrapErrorSerializer:l,req:u,res:u,err:function(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}};function n(e){(e=e||{}).browser=e.browser||{};const r=e.browser.transmit;if(r&&"function"!=typeof r.send)throw Error("pino: transmit option must have a send function");const u=e.browser.write||t;e.browser.write&&(e.browser.asObject=!0);const l=e.serializers||{},d=function(e,t){if(Array.isArray(e)){const t=e.filter(function(e){return"!stdSerializers.err"!==e});return t}return!0===e&&Object.keys(t)}(e.browser.serialize,l);let h=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(h=!1);"function"==typeof u&&(u.error=u.fatal=u.warn=u.info=u.debug=u.trace=u),!1===e.enabled&&(e.level="silent");const p=e.level||"info",y=Object.create(u);y.log||(y.log=f),Object.defineProperty(y,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(y,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,o(g,y,"error","log"),o(g,y,"fatal","error"),o(g,y,"warn","error"),o(g,y,"info","log"),o(g,y,"debug","log"),o(g,y,"trace","log")}});const g={transmit:r,serialize:d,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:c(e)};return y.levels=n.levels,y.level=p,y.setMaxListeners=y.getMaxListeners=y.emit=y.addListener=y.on=y.prependListener=y.once=y.prependOnceListener=y.removeListener=y.removeAllListeners=y.listeners=y.listenerCount=y.eventNames=y.write=y.flush=f,y.serializers=l,y._serialize=d,y._stdErrSerialize=h,y.child=function(t,n){if(!t)throw new Error("missing bindings for child Pino");n=n||{},d&&t.serializers&&(n.serializers=t.serializers);const o=n.serializers;if(d&&o){var c=Object.assign({},l,o),u=!0===e.browser.serialize?Object.keys(c):d;delete t.serializers,i([t],u,c,this._stdErrSerialize)}function f(e){this._childLevel=1+(0|e._childLevel),this.error=s(e,t,"error"),this.fatal=s(e,t,"fatal"),this.warn=s(e,t,"warn"),this.info=s(e,t,"info"),this.debug=s(e,t,"debug"),this.trace=s(e,t,"trace"),c&&(this.serializers=c,this._serialize=u),r&&(this._logEvent=a([].concat(e._logEvent.bindings,t)))}return f.prototype=this,new f(this)},r&&(y._logEvent=a()),y}function o(r,o,s,c){const u=Object.getPrototypeOf(o);o[s]=o.levelVal>o.levels.values[s]?f:u[s]?u[s]:t[s]||t[c]||f,function(r,o,s){if(!r.transmit&&o[s]===f)return;o[s]=(c=o[s],function(){const u=r.timestamp(),l=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===t?t:this;for(var d=0;d<l.length;d++)l[d]=arguments[d];if(r.serialize&&!r.asObject&&i(l,this._serialize,this.serializers,this._stdErrSerialize),r.asObject?c.call(f,function(t,r,o,s){t._serialize&&i(o,t._serialize,t.serializers,t._stdErrSerialize);const a=o.slice();let c=a[0];const u={};s&&(u.time=s),u.level=n.levels.values[r];let l=1+(0|t._childLevel);if(l<1&&(l=1),null!==c&&"object"==typeof c){for(;l--&&"object"==typeof a[0];)Object.assign(u,a.shift());c=a.length?e(a.shift(),a):void 0}else"string"==typeof c&&(c=e(a.shift(),a));return void 0!==c&&(u.msg=c),u}(this,s,l,u)):c.apply(f,l),r.transmit){const e=r.transmit.level||o.level,t=n.levels.values[e],c=n.levels.values[s];if(c<t)return;!function(e,t,r){const n=t.send,o=t.ts,s=t.methodLevel,c=t.methodValue,u=t.val,l=e._logEvent.bindings;i(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=o,e._logEvent.messages=r.filter(function(e){return-1===l.indexOf(e)}),e._logEvent.level.label=s,e._logEvent.level.value=c,n(s,e._logEvent,u),e._logEvent=a(l)}(this,{ts:u,methodLevel:s,methodValue:c,transmitLevel:e,transmitValue:n.levels.values[r.transmit.level||o.level],send:r.transmit.send,val:o.levelVal},l)}});var c}(r,o,s)}function i(e,t,r,o){for(const i in e)if(o&&e[i]instanceof Error)e[i]=n.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i]))for(const n in e[i])t&&t.indexOf(n)>-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function s(e,t,r){return function(){const n=new Array(1+arguments.length);n[0]=t;for(var o=1;o<n.length;o++)n[o]=arguments[o-1];return e[r].apply(this,n)}}function a(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function c(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?d:h}function u(){return{}}function l(e){return e}function f(){}function d(){return!1}function h(){return Date.now()}return n.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"}},n.stdSerializers=r,n.stdTimeFunctions=Object.assign({},{nullTime:d,epochTime:h,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),Jd}(),th=q(eh);const rh="info",nh="custom_context",oh=1024e3;class ih{constructor(e){this.nodeValue=e,this.sizeInBytes=(new TextEncoder).encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class sh{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const t=new ih(e);if(t.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const t=e.value;return e=e.next,{done:!1,value:t}}}}}class ah{constructor(e,t=oh){this.level=e??"error",this.levelValue=eh.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new sh(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===eh.levels.values.error?console.error(e):t===eh.levels.values.warn?console.warn(e):t===eh.levels.values.debug?console.debug(e):t===eh.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(zd({timestamp:(new Date).toISOString(),log:e}));const t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new sh(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push(zd({extraMetadata:e})),new Blob(t,{type:"application/json"})}}class ch{constructor(e,t=oh){this.baseChunkLogger=new ah(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const t=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=t,r.download=`walletconnect-logs-${(new Date).toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}}class uh{constructor(e,t=oh){this.baseChunkLogger=new ah(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var lh=Object.defineProperty,fh=Object.defineProperties,dh=Object.getOwnPropertyDescriptors,hh=Object.getOwnPropertySymbols,ph=Object.prototype.hasOwnProperty,yh=Object.prototype.propertyIsEnumerable,gh=(e,t,r)=>t in e?lh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mh=(e,t)=>{for(var r in t||(t={}))ph.call(t,r)&&gh(e,r,t[r]);if(hh)for(var r of hh(t))yh.call(t,r)&&gh(e,r,t[r]);return e},bh=(e,t)=>fh(e,dh(t));function vh(e){return bh(mh({},e),{level:e?.level||rh})}function wh(e,t=nh){let r="";return r=typeof e.bindings>"u"?function(e,t=nh){return e[t]||""}(e,t):e.bindings().context||"",r}function xh(e,t,r=nh){const n=function(e,t,r=nh){const n=wh(e,r);return n.trim()?`${n}/${t}`:t}(e,t,r);return function(e,t,r=nh){return e[r]=t,e}(e.child({context:n}),n,r)}function Sh(e){return typeof e.loggerOverride<"u"&&"string"!=typeof e.loggerOverride?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?function(e){var t,r;const n=new ch(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:th(bh(mh({},e.opts),{level:"trace",browser:bh(mh({},null==(r=e.opts)?void 0:r.browser),{write:e=>n.write(e)})})),chunkLoggerController:n}}(e):function(e){var t;const r=new uh(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:th(bh(mh({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}(e)}var Eh=Object.defineProperty,Ah=(e,t,r)=>((e,t,r)=>t in e?Eh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class kh extends dd{constructor(e){super(),this.opts=e,Ah(this,"protocol","wc"),Ah(this,"version",2)}}var Oh=Object.defineProperty,Th=(e,t,r)=>((e,t,r)=>t in e?Oh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Ch extends dd{constructor(e,t){super(),this.core=e,this.logger=t,Th(this,"records",new Map)}}class Ih{constructor(e,t){this.logger=e,this.core=t}}class _h extends dd{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Ph extends dd{constructor(e){super()}}class Rh{constructor(e,t,r,n){this.core=e,this.logger=t,this.name=r}}class Nh extends dd{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Bh extends dd{constructor(e,t){super(),this.core=e,this.logger=t}}class jh{constructor(e,t,r){this.core=e,this.logger=t,this.store=r}}class Mh{constructor(e,t){this.projectId=e,this.logger=t}}class Lh{constructor(e,t,r){this.core=e,this.logger=t,this.telemetryEnabled=r}}var Uh=Object.defineProperty,Dh=(e,t,r)=>((e,t,r)=>t in e?Uh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Fh{constructor(e){this.opts=e,Dh(this,"protocol","wc"),Dh(this,"version",2)}}class zh{constructor(e){this.client=e}}function qh(e,...t){if(!function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Vh(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const Hh="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Kh=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Wh(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),qh(e),e}class Gh{clone(){return this._cloneInto()}}function Xh(e=32){if(Hh&&"function"==typeof Hh.getRandomValues)return Hh.getRandomValues(new Uint8Array(e));if(Hh&&"function"==typeof Hh.randomBytes)return Hh.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}class Zh extends Gh{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Kh(this.buffer)}update(e){Vh(this);const{view:t,buffer:r,blockLen:n}=this,o=(e=Wh(e)).length;for(let i=0;i<o;){const s=Math.min(n-this.pos,o-i);if(s===n){const t=Kh(e);for(;n<=o-i;i+=n)this.process(t,i);continue}r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Vh(this),function(e,t){qh(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)})(r,n-8,BigInt(8*this.length),o),this.process(r,0);const s=Kh(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,u[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;return e.length=n,e.pos=s,e.finished=o,e.destroyed=i,n%t&&e.buffer.set(r),e}}const Qh=BigInt(2**32-1),Yh=BigInt(32);function Jh(e,t=!1){return t?{h:Number(e&Qh),l:Number(e>>Yh&Qh)}:{h:0|Number(e>>Yh&Qh),l:0|Number(e&Qh)}}const $h={fromBig:Jh,split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:i,l:s}=Jh(e[o],t);[r[o],n[o]]=[i,s]}return[r,n]},toBig:(e,t)=>BigInt(e>>>0)<<Yh|BigInt(t>>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:function(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,add5H:(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,add5L:(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0)},[ep,tp]=$h.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),rp=new Uint32Array(80),np=new Uint32Array(80);class op extends Zh{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:o,Cl:i,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:f,Gh:d,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,o,i,s,a,c,u,l,f,d,h,p,y]}set(e,t,r,n,o,i,s,a,c,u,l,f,d,h,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|i,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|f,this.Gh=0|d,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)rp[r]=e.getUint32(t),np[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|rp[e-15],r=0|np[e-15],n=$h.rotrSH(t,r,1)^$h.rotrSH(t,r,8)^$h.shrSH(t,r,7),o=$h.rotrSL(t,r,1)^$h.rotrSL(t,r,8)^$h.shrSL(t,r,7),i=0|rp[e-2],s=0|np[e-2],a=$h.rotrSH(i,s,19)^$h.rotrBH(i,s,61)^$h.shrSH(i,s,6),c=$h.rotrSL(i,s,19)^$h.rotrBL(i,s,61)^$h.shrSL(i,s,6),u=$h.add4L(o,c,np[e-7],np[e-16]),l=$h.add4H(u,n,a,rp[e-7],rp[e-16]);rp[e]=0|l,np[e]=0|u}let{Ah:r,Al:n,Bh:o,Bl:i,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:f,Fh:d,Fl:h,Gh:p,Gl:y,Hh:g,Hl:m}=this;for(let e=0;e<80;e++){const t=$h.rotrSH(l,f,14)^$h.rotrSH(l,f,18)^$h.rotrBH(l,f,41),b=$h.rotrSL(l,f,14)^$h.rotrSL(l,f,18)^$h.rotrBL(l,f,41),v=l&d^~l&p,w=f&h^~f&y,x=$h.add5L(m,b,w,tp[e],np[e]),S=$h.add5H(x,g,t,v,ep[e],rp[e]),E=0|x,A=$h.rotrSH(r,n,28)^$h.rotrBH(r,n,34)^$h.rotrBH(r,n,39),k=$h.rotrSL(r,n,28)^$h.rotrBL(r,n,34)^$h.rotrBL(r,n,39),O=r&o^r&s^o&s,T=n&i^n&a^i&a;g=0|p,m=0|y,p=0|d,y=0|h,d=0|l,h=0|f,({h:l,l:f}=$h.add(0|c,0|u,0|S,0|E)),c=0|s,u=0|a,s=0|o,a=0|i,o=0|r,i=0|n;const C=$h.add3L(E,k,T);r=$h.add3H(C,S,A,O),n=0|C}({h:r,l:n}=$h.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:i}=$h.add(0|this.Bh,0|this.Bl,0|o,0|i)),({h:s,l:a}=$h.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=$h.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:f}=$h.add(0|this.Eh,0|this.El,0|l,0|f)),({h:d,l:h}=$h.add(0|this.Fh,0|this.Fl,0|d,0|h)),({h:p,l:y}=$h.add(0|this.Gh,0|this.Gl,0|p,0|y)),({h:g,l:m}=$h.add(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(r,n,o,i,s,a,c,u,l,f,d,h,p,y,g,m)}roundClean(){rp.fill(0),np.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const ip=function(e){const t=t=>e().update(Wh(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}(()=>new op),sp=BigInt(0),ap=BigInt(1),cp=BigInt(2);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function up(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function lp(e){if(!up(e))throw new Error("Uint8Array expected")}function fp(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)}const dp=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function hp(e){lp(e);let t="";for(let r=0;r<e.length;r++)t+=dp[e[r]];return t}function pp(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?sp:BigInt("0x"+e)}const yp=48,gp=57,mp=65,bp=70,vp=97,wp=102;function xp(e){return e>=yp&&e<=gp?e-yp:e>=mp&&e<=bp?e-(mp-10):e>=vp&&e<=wp?e-(vp-10):void 0}function Sp(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,o=0;t<r;t++,o+=2){const r=xp(e.charCodeAt(o)),i=xp(e.charCodeAt(o+1));if(void 0===r||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}n[t]=16*r+i}return n}function Ep(e){return lp(e),pp(hp(Uint8Array.from(e).reverse()))}function Ap(e,t){return Sp(e.toString(16).padStart(2*t,"0"))}function kp(e,t){return Ap(e,t).reverse()}function Op(e,t,r){let n;if("string"==typeof t)try{n=Sp(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!up(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const o=n.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function Tp(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];lp(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}const Cp=e=>"bigint"==typeof e&&sp<=e;function Ip(e,t,r,n){if(!function(e,t,r){return Cp(e)&&Cp(t)&&Cp(r)&&t<=e&&e<r}(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}const _p=e=>(cp<<BigInt(e-1))-ap,Pp={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||up(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Rp(e,t,r={}){const n=(t,r,n)=>{const o=Pp[r];if("function"!=typeof o)throw new Error("invalid validator function");const i=e[t];if(!(n&&void 0===i||o(i,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+i)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}function Np(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(void 0!==o)return o;const i=e(r,...n);return t.set(r,i),i}}const Bp=BigInt(0),jp=BigInt(1),Mp=BigInt(2),Lp=BigInt(3),Up=BigInt(4),Dp=BigInt(5),Fp=BigInt(8);function zp(e,t){const r=e%t;return r>=Bp?r:t+r}function qp(e,t,r){if(t<Bp)throw new Error("invalid exponent, negatives unsupported");if(r<=Bp)throw new Error("invalid modulus");if(r===jp)return Bp;let n=jp;for(;t>Bp;)t&jp&&(n=n*e%r),e=e*e%r,t>>=jp;return n}function Vp(e,t,r){let n=e;for(;t-- >Bp;)n*=n,n%=r;return n}function Hp(e,t){if(e===Bp)throw new Error("invert: expected non-zero number");if(t<=Bp)throw new Error("invert: expected positive modulus, got "+t);let r=zp(e,t),n=t,o=Bp,i=jp;for(;r!==Bp;){const e=n%r,t=o-i*(n/r);n=r,r=e,o=i,i=t}if(n!==jp)throw new Error("invert: does not exist");return zp(o,t)}function Kp(e){if(e%Up===Lp){const t=(e+jp)/Up;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%Fp===Dp){const t=(e-Dp)/Fp;return function(e,r){const n=e.mul(r,Mp),o=e.pow(n,t),i=e.mul(r,o),s=e.mul(e.mul(i,Mp),o),a=e.mul(i,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),r))throw new Error("Cannot find square root");return a}}return function(e){const t=(e-jp)/Mp;let r,n,o;for(r=e-jp,n=0;r%Mp===Bp;r/=Mp,n++);for(o=Mp;o<e&&qp(o,t,e)!==e-jp;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===n){const t=(e+jp)/Up;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const i=(r+jp)/Mp;return function(e,s){if(e.pow(s,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let a=n,c=e.pow(e.mul(e.ONE,o),r),u=e.pow(s,i),l=e.pow(s,r);for(;!e.eql(l,e.ONE);){if(e.eql(l,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(l);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,jp<<BigInt(a-t-1));c=e.sqr(r),u=e.mul(u,r),l=e.mul(l,c),a=t}return u}}(e)}const Wp=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Gp(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Xp(e,t,r=!1,n={}){if(e<=Bp)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:i}=Gp(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:i,MASK:_p(o),ZERO:Bp,ONE:jp,create:t=>zp(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return Bp<=t&&t<e},is0:e=>e===Bp,isOdd:e=>(e&jp)===jp,neg:t=>zp(-t,e),eql:(e,t)=>e===t,sqr:t=>zp(t*t,e),add:(t,r)=>zp(t+r,e),sub:(t,r)=>zp(t-r,e),mul:(t,r)=>zp(t*r,e),pow:(e,t)=>function(e,t,r){if(r<Bp)throw new Error("invalid exponent, negatives unsupported");if(r===Bp)return e.ONE;if(r===jp)return t;let n=e.ONE,o=t;for(;r>Bp;)r&jp&&(n=e.mul(n,o)),o=e.sqr(o),r>>=jp;return n}(a,e,t),div:(t,r)=>zp(t*Hp(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Hp(t,e),sqrt:n.sqrt||(t=>(s||(s=Kp(e)),s(a,t))),invertBatch:e=>function(e,t){const r=new Array(t.length),n=t.reduce((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n)),e.ONE),o=e.inv(n);return t.reduceRight((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n)),o),r}(a,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?kp(e,i):Ap(e,i),fromBytes:e=>{if(e.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+e.length);return r?Ep(e):function(e){return pp(hp(e))}(e)}});return Object.freeze(a)}const Zp=BigInt(0),Qp=BigInt(1);function Yp(e,t){const r=t.negate();return e?r:t}function Jp(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function $p(e,t){Jp(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}const ey=new WeakMap,ty=new WeakMap;function ry(e){return ty.get(e)||1}function ny(e,t,r,n){if(function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})}(r,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,i=function(e){let t;for(t=0;e>sp;e>>=ap,t+=1);return t}(BigInt(r.length)),s=i>12?i-3:i>4?i-2:i?2:1,a=(1<<s)-1,c=new Array(a+1).fill(o);let u=o;for(let e=Math.floor((t.BITS-1)/s)*s;e>=0;e-=s){c.fill(o);for(let t=0;t<n.length;t++){const o=n[t],i=Number(o>>BigInt(e)&BigInt(a));c[i]=c[i].add(r[t])}let t=o;for(let e=c.length-1,r=o;e>0;e--)r=r.add(c[e]),t=t.add(r);if(u=u.add(t),0!==e)for(let e=0;e<s;e++)u=u.double()}return u}function oy(e){return function(e){const t=Wp.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});Rp(e,t)}(e.Fp),Rp(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Gp(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const iy=BigInt(0),sy=BigInt(1),ay=BigInt(2),cy=BigInt(8),uy={zip215:!0};function ly(e){const t=function(e){const t=oy(e);return Rp(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:r,n:n,prehash:o,hash:i,randomBytes:s,nByteLength:a,h:c}=t,u=ay<<BigInt(8*a)-sy,l=r.create,f=Xp(t.n,t.nBitLength),d=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(e*r.inv(t))}}catch{return{isValid:!1,value:iy}}}),h=t.adjustScalarBytes||(e=>e),p=t.domain||((e,t,r)=>{if(fp("phflag",r),t.length||r)throw new Error("Contexts/pre-hash are not supported");return e});function y(e,t){Ip("coordinate "+e,t,iy,u)}function g(e){if(!(e instanceof v))throw new Error("ExtendedPoint expected")}const m=Np((e,t)=>{const{ex:n,ey:o,ez:i}=e,s=e.is0();null==t&&(t=s?cy:r.inv(i));const a=l(n*t),c=l(o*t),u=l(i*t);if(s)return{x:iy,y:sy};if(u!==sy)throw new Error("invZ was invalid");return{x:a,y:c}}),b=Np(e=>{const{a:r,d:n}=t;if(e.is0())throw new Error("bad point: ZERO");const{ex:o,ey:i,ez:s,et:a}=e,c=l(o*o),u=l(i*i),f=l(s*s),d=l(f*f),h=l(c*r);if(l(f*l(h+u))!==l(d+l(n*l(c*u))))throw new Error("bad point: equation left != right (1)");if(l(o*i)!==l(s*a))throw new Error("bad point: equation left != right (2)");return!0});class v{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,y("x",e),y("y",t),y("z",r),y("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof v)throw new Error("extended point not allowed");const{x:t,y:r}=e||{};return y("x",t),y("y",r),new v(t,r,sy,l(t*r))}static normalizeZ(e){const t=r.invertBatch(e.map(e=>e.ez));return e.map((e,r)=>e.toAffine(t[r])).map(v.fromAffine)}static msm(e,t){return ny(v,f,e,t)}_setWindowSize(e){S.setWindowSize(this,e)}assertValidity(){b(this)}equals(e){g(e);const{ex:t,ey:r,ez:n}=this,{ex:o,ey:i,ez:s}=e,a=l(t*s),c=l(o*n),u=l(r*s),f=l(i*n);return a===c&&u===f}is0(){return this.equals(v.ZERO)}negate(){return new v(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:e}=t,{ex:r,ey:n,ez:o}=this,i=l(r*r),s=l(n*n),a=l(ay*l(o*o)),c=l(e*i),u=r+n,f=l(l(u*u)-i-s),d=c+s,h=d-a,p=c-s,y=l(f*h),g=l(d*p),m=l(f*p),b=l(h*d);return new v(y,g,b,m)}add(e){g(e);const{a:r,d:n}=t,{ex:o,ey:i,ez:s,et:a}=this,{ex:c,ey:u,ez:f,et:d}=e;if(r===BigInt(-1)){const e=l((i-o)*(u+c)),t=l((i+o)*(u-c)),r=l(t-e);if(r===iy)return this.double();const n=l(s*ay*d),h=l(a*ay*f),p=h+n,y=t+e,g=h-n,m=l(p*r),b=l(y*g),w=l(p*g),x=l(r*y);return new v(m,b,x,w)}const h=l(o*c),p=l(i*u),y=l(a*n*d),m=l(s*f),b=l((o+i)*(c+u)-h-p),w=m-y,x=m+y,S=l(p-r*h),E=l(b*w),A=l(x*S),k=l(b*S),O=l(w*x);return new v(E,A,O,k)}subtract(e){return this.add(e.negate())}wNAF(e){return S.wNAFCached(this,e,v.normalizeZ)}multiply(e){const t=e;Ip("scalar",t,sy,n);const{p:r,f:o}=this.wNAF(t);return v.normalizeZ([r,o])[0]}multiplyUnsafe(e,t=v.ZERO){const r=e;return Ip("scalar",r,iy,n),r===iy?x:this.is0()||r===sy?this:S.wNAFCachedUnsafe(this,r,v.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return S.unsafeLadder(this,n).is0()}toAffine(e){return m(this,e)}clearCofactor(){const{h:e}=t;return e===sy?this:this.multiplyUnsafe(e)}static fromHex(e,n=!1){const{d:o,a:i}=t,s=r.BYTES;e=Op("pointHex",e,s),fp("zip215",n);const a=e.slice(),c=e[s-1];a[s-1]=-129&c;const f=Ep(a),h=n?u:r.ORDER;Ip("pointHex.y",f,iy,h);const p=l(f*f),y=l(p-sy),g=l(o*p-i);let{isValid:m,value:b}=d(y,g);if(!m)throw new Error("Point.fromHex: invalid y coordinate");const w=(b&sy)===sy,x=!!(128&c);if(!n&&b===iy&&x)throw new Error("Point.fromHex: x=0 and x_0=1");return x!==w&&(b=l(-b)),v.fromAffine({x:b,y:f})}static fromPrivateKey(e){return k(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),n=kp(t,r.BYTES);return n[n.length-1]|=e&sy?128:0,n}toHex(){return hp(this.toRawBytes())}}v.BASE=new v(t.Gx,t.Gy,sy,l(t.Gx*t.Gy)),v.ZERO=new v(iy,sy,sy,iy);const{BASE:w,ZERO:x}=v,S=function(e,t){return{constTimeNegate:Yp,hasPrecomputes:e=>1!==ry(e),unsafeLadder(t,r,n=e.ZERO){let o=t;for(;r>Zp;)r&Qp&&(n=n.add(o)),o=o.double(),r>>=Qp;return n},precomputeWindow(e,r){const{windows:n,windowSize:o}=$p(r,t),i=[];let s=e,a=s;for(let e=0;e<n;e++){a=s,i.push(a);for(let e=1;e<o;e++)a=a.add(s),i.push(a);s=a.double()}return i},wNAF(r,n,o){const{windows:i,windowSize:s}=$p(r,t);let a=e.ZERO,c=e.BASE;const u=BigInt(2**r-1),l=2**r,f=BigInt(r);for(let e=0;e<i;e++){const t=e*s;let r=Number(o&u);o>>=f,r>s&&(r-=l,o+=Qp);const i=t,d=t+Math.abs(r)-1,h=e%2!=0,p=r<0;0===r?c=c.add(Yp(h,n[i])):a=a.add(Yp(p,n[d]))}return{p:a,f:c}},wNAFUnsafe(r,n,o,i=e.ZERO){const{windows:s,windowSize:a}=$p(r,t),c=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let e=0;e<s;e++){const t=e*a;if(o===Zp)break;let r=Number(o&c);if(o>>=l,r>a&&(r-=u,o+=Qp),0===r)continue;let s=n[t+Math.abs(r)-1];r<0&&(s=s.negate()),i=i.add(s)}return i},getPrecomputes(e,t,r){let n=ey.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&ey.set(t,r(n))),n},wNAFCached(e,t,r){const n=ry(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){const o=ry(e);return 1===o?this.unsafeLadder(e,t,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),t,n)},setWindowSize(e,r){Jp(r,t),ty.set(e,r),ey.delete(e)}}}(v,8*a);function E(e){return zp(e,n)}function A(e){return E(Ep(e))}function k(e){const t=r.BYTES;e=Op("private key",e,t);const n=Op("hashed private key",i(e),2*t),o=h(n.slice(0,t)),s=n.slice(t,2*t),a=A(o),c=w.multiply(a),u=c.toRawBytes();return{head:o,prefix:s,scalar:a,point:c,pointBytes:u}}function O(e=new Uint8Array,...t){const r=Tp(...t);return A(i(p(r,Op("context",e),!!o)))}const T=uy;return w._setWindowSize(8),{CURVE:t,getPublicKey:function(e){return k(e).pointBytes},sign:function(e,t,i={}){e=Op("message",e),o&&(e=o(e));const{prefix:s,scalar:a,pointBytes:c}=k(t),u=O(i.context,s,e),l=w.multiply(u).toRawBytes(),f=E(u+O(i.context,l,c,e)*a);return Ip("signature.s",f,iy,n),Op("result",Tp(l,kp(f,r.BYTES)),2*r.BYTES)},verify:function(e,t,n,i=T){const{context:s,zip215:a}=i,c=r.BYTES;e=Op("signature",e,2*c),t=Op("message",t),n=Op("publicKey",n,c),void 0!==a&&fp("zip215",a),o&&(t=o(t));const u=Ep(e.slice(c,2*c));let l,f,d;try{l=v.fromHex(n,a),f=v.fromHex(e.slice(0,c),a),d=w.multiplyUnsafe(u)}catch{return!1}if(!a&&l.isSmallOrder())return!1;const h=O(s,f.toRawBytes(),l.toRawBytes(),t);return f.add(l.multiplyUnsafe(h)).subtract(d).clearCofactor().equals(v.ZERO)},ExtendedPoint:v,utils:{getExtendedPublicKey:k,randomPrivateKey:()=>s(r.BYTES),precompute:(e=8,t=v.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}BigInt(0),BigInt(1);const fy=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),dy=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const hy=BigInt(1),py=BigInt(2);BigInt(3);const yy=BigInt(5),gy=BigInt(8);function my(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function by(e,t){const r=fy,n=zp(t*t*t,r),o=function(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=fy,s=e*e%i*e%i,a=Vp(s,py,i)*s%i,c=Vp(a,hy,i)*e%i,u=Vp(c,yy,i)*c%i,l=Vp(u,t,i)*u%i,f=Vp(l,r,i)*l%i,d=Vp(f,n,i)*f%i,h=Vp(d,o,i)*d%i,p=Vp(h,o,i)*d%i,y=Vp(p,t,i)*u%i;return{pow_p_5_8:Vp(y,py,i)*e%i,b2:s}}(e*zp(n*n*t,r)).pow_p_5_8;let i=zp(e*n*o,r);const s=zp(t*i*i,r),a=i,c=zp(i*dy,r),u=s===e,l=s===zp(-e,r),f=s===zp(-e*dy,r);return u&&(i=a),(l||f)&&(i=c),((e,t)=>(zp(e,t)&jp)===jp)(i,r)&&(i=zp(-i,r)),{isValid:u||l,value:i}}const vy=Xp(fy,void 0,!0),wy=ly({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:vy,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:gy,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ip,randomBytes:Xh,adjustScalarBytes:my,uvRatio:by}),xy=".",Sy="base64url",Ey="utf8",Ay="utf8",ky="did",Oy="key",Ty="base58btc";function Cy(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Iy(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Cy(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function _y(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));const r=Iy(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return Cy(r)}var Py=function(e,t){if(e.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 o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(255!==r[s])throw new TypeError(i+" is ambiguous");r[s]=o}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,o=0;e[t]===c;)n++,t++;for(var i=(e.length-t)*u+1>>>0,s=new Uint8Array(i);e[t];){var l=r[e.charCodeAt(t)];if(255===l)return;for(var f=0,d=i-1;(0!==l||f<o)&&-1!==d;d--,f++)l+=a*s[d]>>>0,s[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=f,t++}if(" "!==e[t]){for(var h=i-o;h!==i&&0===s[h];)h++;for(var p=new Uint8Array(n+(i-h)),y=n;h!==i;)p[y++]=s[h++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,i=t.length;o!==i&&0===t[o];)o++,r++;for(var s=(i-o)*l+1>>>0,u=new Uint8Array(s);o!==i;){for(var f=t[o],d=0,h=s-1;(0!==f||d<n)&&-1!==h;h--,d++)f+=256*u[h]>>>0,u[h]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");n=d,o++}for(var p=s-n;p!==s&&0===u[p];)p++;for(var y=c.repeat(r);p<s;++p)y+=e.charAt(u[p]);return y},decodeUnsafe:f,decode:function(e){var r=f(e);if(r)return r;throw new Error(`Non-${t} character`)}}},Ry=Py;const Ny=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class By{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class jy{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return Ly(this,e)}}class My{constructor(e){this.decoders=e}or(e){return Ly(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Ly=(e,t)=>new My({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Uy{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new By(e,t,r),this.decoder=new jy(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Dy=({name:e,prefix:t,encode:r,decode:n})=>new Uy(e,t,r,n),Fy=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=Ry(r,t);return Dy({prefix:e,name:t,encode:n,decode:e=>Ny(o(e))})},zy=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Dy({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let i="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,i+=t[o&a>>s];if(s&&(i+=t[o&a<<r-s]),n)for(;i.length*r&7;)i+="=";return i})(e,n,r),decode:t=>((e,t,r,n)=>{const o={};for(let e=0;e<t.length;++e)o[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const s=new Uint8Array(i*r/8|0);let a=0,c=0,u=0;for(let t=0;t<i;++t){const i=o[e[t]];if(void 0===i)throw new SyntaxError(`Non-${n} character`);c=c<<r|i,a+=r,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),qy=Dy({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var Vy=Object.freeze({__proto__:null,identity:qy});const Hy=zy({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ky=Object.freeze({__proto__:null,base2:Hy});const Wy=zy({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Gy=Object.freeze({__proto__:null,base8:Wy});const Xy=Fy({prefix:"9",name:"base10",alphabet:"0123456789"});var Zy=Object.freeze({__proto__:null,base10:Xy});const Qy=zy({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Yy=zy({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Jy=Object.freeze({__proto__:null,base16:Qy,base16upper:Yy});const $y=zy({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),eg=zy({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),tg=zy({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rg=zy({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ng=zy({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),og=zy({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ig=zy({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),sg=zy({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ag=zy({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var cg=Object.freeze({__proto__:null,base32:$y,base32upper:eg,base32pad:tg,base32padupper:rg,base32hex:ng,base32hexupper:og,base32hexpad:ig,base32hexpadupper:sg,base32z:ag});const ug=Fy({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),lg=Fy({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var fg=Object.freeze({__proto__:null,base36:ug,base36upper:lg});const dg=Fy({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),hg=Fy({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var pg=Object.freeze({__proto__:null,base58btc:dg,base58flickr:hg});const yg=zy({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),gg=zy({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),mg=zy({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),bg=zy({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var vg=Object.freeze({__proto__:null,base64:yg,base64pad:gg,base64url:mg,base64urlpad:bg});const wg=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),xg=wg.reduce((e,t,r)=>(e[r]=t,e),[]),Sg=wg.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);const Eg=Dy({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=xg[t],"")},decode:function(e){const t=[];for(const r of e){const e=Sg[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var Ag=Object.freeze({__proto__:null,base256emoji:Eg}),kg=function e(t,r,n){r=r||[];for(var o=n=n||0;t>=Cg;)r[n++]=255&t|Og,t/=128;for(;t&Tg;)r[n++]=255&t|Og,t>>>=7;return r[n]=0|t,e.bytes=n-o+1,r},Og=128,Tg=-128,Cg=Math.pow(2,31);var Ig=function e(t,r){var n,o=0,i=(r=r||0,0),s=r,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],o+=i<28?(n&Pg)<<i:(n&Pg)*Math.pow(2,i),i+=7}while(n>=_g);return e.bytes=s-r,o},_g=128,Pg=127;var Rg=Math.pow(2,7),Ng=Math.pow(2,14),Bg=Math.pow(2,21),jg=Math.pow(2,28),Mg=Math.pow(2,35),Lg=Math.pow(2,42),Ug=Math.pow(2,49),Dg=Math.pow(2,56),Fg=Math.pow(2,63),zg={encode:kg,decode:Ig,encodingLength:function(e){return e<Rg?1:e<Ng?2:e<Bg?3:e<jg?4:e<Mg?5:e<Lg?6:e<Ug?7:e<Dg?8:e<Fg?9:10}},qg=zg;const Vg=(e,t,r=0)=>(qg.encode(e,t,r),t),Hg=e=>qg.encodingLength(e),Kg=(e,t)=>{const r=t.byteLength,n=Hg(e),o=n+Hg(r),i=new Uint8Array(o+r);return Vg(e,i,0),Vg(r,i,n),i.set(t,o),new Wg(e,r,t,i)};class Wg{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const Gg=({name:e,code:t,encode:r})=>new Xg(e,t,r);class Xg{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Kg(this.code,t):t.then(e=>Kg(this.code,e))}throw Error("Unknown type, must be binary type")}}const Zg=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Qg=Gg({name:"sha2-256",code:18,encode:Zg("SHA-256")}),Yg=Gg({name:"sha2-512",code:19,encode:Zg("SHA-512")});Object.freeze({__proto__:null,sha256:Qg,sha512:Yg});const Jg=Ny,$g={code:0,name:"identity",encode:Jg,digest:e=>Kg(0,Jg(e))};Object.freeze({__proto__:null,identity:$g});new TextEncoder,new TextDecoder;const em={...Vy,...Ky,...Gy,...Zy,...Jy,...cg,...fg,...pg,...vg,...Ag};function tm(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const rm=tm("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>(new TextEncoder).encode(e.substring(1))),nm=tm("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{const t=Iy((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),om={utf8:rm,"utf-8":rm,hex:em.base16,latin1:nm,ascii:nm,binary:nm,...em};function im(e,t="utf8"){const r=om[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}function sm(e,t="utf8"){const r=om[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):Cy(globalThis.Buffer.from(e,"utf-8"))}function am(e){return Fd(im(sm(e,Sy),Ey))}function cm(e){return im(sm(zd(e),Ey),Sy)}function um(e){const t="z"+im(_y([sm("K36",Ty),e]),Ty);return[ky,Oy,t].join(":")}function lm(e){return im(e,Sy)}function fm(e){const t=e.split(xy),r=am(t[0]),n=am(t[1]),o=function(e){return sm(e,Sy)}(t[2]);return{header:r,payload:n,signature:o,data:sm(t.slice(0,2).join(xy),Ay)}}function dm(e=Xh(32)){const t=wy.getPublicKey(e);return{secretKey:_y([e,t]),publicKey:t}}async function hm(e,t,r,n,o=fd.fromMiliseconds(Date.now())){const i={alg:"EdDSA",typ:"JWT"},s={iss:um(n.publicKey),sub:e,aud:t,iat:o,exp:o+r},a=function(e){return sm([cm(e.header),cm(e.payload)].join(xy),Ay)}({header:i,payload:s});return function(e){return[cm(e.header),cm(e.payload),lm(e.signature)].join(xy)}({header:i,payload:s,signature:wy.sign(a,n.secretKey.slice(0,32))})}var pm=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},ym=function(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"},gm=function(e){this.version=e,this.type="node",this.name="node",this.os=process.platform},mm=function(e,t,r,n){this.name=e,this.version=t,this.os=r,this.bot=n,this.type="bot-device"},bm=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},vm=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},wm=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,xm=[["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",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],Sm=[["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 Em(e){return e?Am(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new vm:"undefined"!=typeof navigator?Am(navigator.userAgent):"undefined"!=typeof process&&process.version?new gm(process.version.slice(1)):null}function Am(e){var t=function(e){return""!==e&&xm.reduce(function(t,r){var n=r[0],o=r[1];if(t)return t;var i=o.exec(e);return!!i&&[n,i]},!1)}(e);if(!t)return null;var r=t[0],n=t[1];if("searchbot"===r)return new bm;var o=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);o?o.length<3&&(o=pm(pm([],o,!0),function(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}(3-o.length),!0)):o=[];var i=o.join("."),s=function(e){for(var t=0,r=Sm.length;t<r;t++){var n=Sm[t],o=n[0];if(n[1].exec(e))return o}return null}(e),a=wm.exec(e);return a&&a[1]?new mm(r,i,s,a[1]):new ym(r,i,s)}var km,Om={};function Tm(){if(km)return Om;function e(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function t(t){const r=e(t);if(!r)throw new Error(`${t} is not defined in Window`);return r}return km=1,Object.defineProperty(Om,"__esModule",{value:!0}),Om.getLocalStorage=Om.getLocalStorageOrThrow=Om.getCrypto=Om.getCryptoOrThrow=Om.getLocation=Om.getLocationOrThrow=Om.getNavigator=Om.getNavigatorOrThrow=Om.getDocument=Om.getDocumentOrThrow=Om.getFromWindowOrThrow=Om.getFromWindow=void 0,Om.getFromWindow=e,Om.getFromWindowOrThrow=t,Om.getDocumentOrThrow=function(){return t("document")},Om.getDocument=function(){return e("document")},Om.getNavigatorOrThrow=function(){return t("navigator")},Om.getNavigator=function(){return e("navigator")},Om.getLocationOrThrow=function(){return t("location")},Om.getLocation=function(){return e("location")},Om.getCryptoOrThrow=function(){return t("crypto")},Om.getCrypto=function(){return e("crypto")},Om.getLocalStorageOrThrow=function(){return t("localStorage")},Om.getLocalStorage=function(){return e("localStorage")},Om}var Cm,Im=Tm(),_m={};var Pm=function(){if(Cm)return _m;Cm=1,Object.defineProperty(_m,"__esModule",{value:!0}),_m.getWindowMetadata=void 0;const e=Tm();return _m.getWindowMetadata=function(){let t,r;try{t=e.getDocumentOrThrow(),r=e.getLocationOrThrow()}catch(e){return null}function n(...e){const r=t.getElementsByTagName("meta");for(let t=0;t<r.length;t++){const n=r[t],o=["itemprop","property","name"].map(e=>n.getAttribute(e)).filter(t=>!!t&&e.includes(t));if(o.length&&o){const e=n.getAttribute("content");if(e)return e}}return""}const o=function(){let e=n("name","og:site_name","og:title","twitter:title");return e||(e=t.title),e}(),i=n("description","og:description","twitter:description","keywords"),s=r.origin,a=function(){const e=t.getElementsByTagName("link"),n=[];for(let t=0;t<e.length;t++){const o=e[t],i=o.getAttribute("rel");if(i&&i.toLowerCase().indexOf("icon")>-1){const e=o.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let t=r.protocol+"//"+r.host;if(0===e.indexOf("/"))t+=e;else{const n=r.pathname.split("/");n.pop();t+=n.join("/")+"/"+e}n.push(t)}else if(0===e.indexOf("//")){const t=r.protocol+e;n.push(t)}else n.push(e)}}return n}();return{description:i,url:s,icons:a,name:o}},_m}();function Rm(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function Nm(e){return Rm(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Bm="2.36.0";let jm=({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,Mm=`viem@${Bm}`;class Lm extends Error{constructor(e,t={}){const r=t.cause instanceof Lm?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof Lm&&t.cause.docsPath||t.docsPath,o=jm?.({...t,docsPath:n});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...r?[`Details: ${r}`]:[],...Mm?[`Version: ${Mm}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=Bm}walk(e){return Um(this,e)}}function Um(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?Um(e.cause,t):t?null:e}class Dm extends Lm{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function Fm(e,{dir:t,size:r=32}={}){return"string"==typeof e?function(e,{dir:t,size:r=32}={}){if(null===r)return e;const n=e.replace("0x","");if(n.length>2*r)throw new Dm({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n["right"===t?"padEnd":"padStart"](2*r,"0")}`}(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new Dm({size:e.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let o=0;o<r;o++){const i="right"===t;n[i?o:r-o-1]=e[i?o:e.length-o-1]}return n}(e,{dir:t,size:r})}class zm extends Lm{constructor({max:e,min:t,signed:r,size:n,value:o}){super(`Number "${o}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class qm extends Lm{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function Vm(e,{size:t}){if(Nm(e)>t)throw new qm({givenSize:Nm(e),maxSize:t})}function Hm(e,t={}){const{signed:r}=t;t.size&&Vm(e,{size:t.size});const n=BigInt(e);if(!r)return n;const o=(e.length-2)/2;return n<=(1n<<8n*BigInt(o)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*o,"f")}`)-1n}const Km=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Wm(e,t={}){return"number"==typeof e||"bigint"==typeof e?Xm(e,t):"string"==typeof e?function(e,t={}){const r=Zm.encode(e);return Gm(r,t)}(e,t):"boolean"==typeof e?function(e,t={}){const r=`0x${Number(e)}`;if("number"==typeof t.size)return Vm(r,{size:t.size}),Fm(r,{size:t.size});return r}(e,t):Gm(e,t)}function Gm(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=Km[e[t]];const n=`0x${r}`;return"number"==typeof t.size?(Vm(n,{size:t.size}),Fm(n,{dir:"right",size:t.size})):n}function Xm(e,t={}){const{signed:r,size:n}=t,o=BigInt(e);let i;n?i=r?(1n<<8n*BigInt(n)-1n)-1n:2n**(8n*BigInt(n))-1n:"number"==typeof e&&(i=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof i&&r?-i-1n:0;if(i&&o>i||o<s){const t="bigint"==typeof e?"n":"";throw new zm({max:i?`${i}${t}`:void 0,min:`${s}${t}`,signed:r,size:n,value:`${e}${t}`})}const a=`0x${(r&&o<0?(1n<<BigInt(8*n))+BigInt(o):o).toString(16)}`;return n?Fm(a,{size:n}):a}const Zm=new TextEncoder;const Qm=new TextEncoder;function Ym(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const r=Xm(e,t);return eb(r)}(e,t):"boolean"==typeof e?function(e,t={}){const r=new Uint8Array(1);if(r[0]=Number(e),"number"==typeof t.size)return Vm(r,{size:t.size}),Fm(r,{size:t.size});return r}(e,t):Rm(e)?eb(e,t):tb(e,t)}const Jm={zero:48,nine:57,A:65,F:70,a:97,f:102};function $m(e){return e>=Jm.zero&&e<=Jm.nine?e-Jm.zero:e>=Jm.A&&e<=Jm.F?e-(Jm.A-10):e>=Jm.a&&e<=Jm.f?e-(Jm.a-10):void 0}function eb(e,t={}){let r=e;t.size&&(Vm(r,{size:t.size}),r=Fm(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const o=n.length/2,i=new Uint8Array(o);for(let e=0,t=0;e<o;e++){const r=$m(n.charCodeAt(t++)),o=$m(n.charCodeAt(t++));if(void 0===r||void 0===o)throw new Lm(`Invalid byte sequence ("${n[t-2]}${n[t-1]}" in "${n}").`);i[e]=16*r+o}return i}function tb(e,t={}){const r=Qm.encode(e);return"number"==typeof t.size?(Vm(r,{size:t.size}),Fm(r,{dir:"right",size:t.size})):r}const rb=BigInt(2**32-1),nb=BigInt(32);function ob(e,t=!1){return t?{h:Number(e&rb),l:Number(e>>nb&rb)}:{h:0|Number(e>>nb&rb),l:0|Number(e&rb)}}function ib(e,t=!1){const r=e.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){const{h:r,l:s}=ob(e[i],t);[n[i],o[i]]=[r,s]}return[n,o]}const sb="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function ab(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function cb(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function ub(e,...t){if(!ab(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function lb(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");cb(e.outputLen),cb(e.blockLen)}function fb(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function db(e,t){ub(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function hb(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function pb(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function yb(e,t){return e<<32-t|e>>>t}function gb(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const mb=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])()?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=gb(e[t]);return e},bb=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),vb=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function wb(e){if(ub(e),bb)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=vb[e[r]];return t}const xb=48,Sb=57,Eb=65,Ab=70,kb=97,Ob=102;function Tb(e){return e>=xb&&e<=Sb?e-xb:e>=Eb&&e<=Ab?e-(Eb-10):e>=kb&&e<=Ob?e-(kb-10):void 0}function Cb(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(bb)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,o=0;t<r;t++,o+=2){const r=Tb(e.charCodeAt(o)),i=Tb(e.charCodeAt(o+1));if(void 0===r||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}n[t]=16*r+i}return n}function Ib(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function _b(e){return"string"==typeof e&&(e=Ib(e)),ub(e),e}function Pb(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];ub(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}class Rb{}function Nb(e){const t=t=>e().update(_b(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Bb(e=32){if(sb&&"function"==typeof sb.getRandomValues)return sb.getRandomValues(new Uint8Array(e));if(sb&&"function"==typeof sb.randomBytes)return Uint8Array.from(sb.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const jb=BigInt(0),Mb=BigInt(1),Lb=BigInt(2),Ub=BigInt(7),Db=BigInt(256),Fb=BigInt(113),zb=[],qb=[],Vb=[];for(let e=0,t=Mb,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],zb.push(2*(5*n+r)),qb.push((e+1)*(e+2)/2%64);let o=jb;for(let e=0;e<7;e++)t=(t<<Mb^(t>>Ub)*Fb)%Db,t&Lb&&(o^=Mb<<(Mb<<BigInt(e))-Mb);Vb.push(o)}const Hb=ib(Vb,!0),Kb=Hb[0],Wb=Hb[1],Gb=(e,t,r)=>r>32?((e,t,r)=>t<<r-32|e>>>64-r)(e,t,r):((e,t,r)=>e<<r|t>>>32-r)(e,t,r),Xb=(e,t,r)=>r>32?((e,t,r)=>e<<r-32|t>>>64-r)(e,t,r):((e,t,r)=>t<<r|e>>>32-r)(e,t,r);class Zb extends Rb{constructor(e,t,r,n=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=o,cb(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}clone(){return this._cloneInto()}keccak(){mb(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,o=(t+2)%10,i=r[o],s=r[o+1],a=Gb(i,s,1)^r[n],c=Xb(i,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],o=e[3];for(let r=0;r<24;r++){const n=qb[r],i=Gb(t,o,n),s=Xb(t,o,n),a=zb[r];t=e[a],o=e[a+1],e[a]=i,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=Kb[n],e[1]^=Wb[n]}hb(r)}(this.state32,this.rounds),mb(this.state32),this.posOut=0,this.pos=0}update(e){fb(this),ub(e=_b(e));const{blockLen:t,state:r}=this,n=e.length;for(let o=0;o<n;){const i=Math.min(t-this.pos,n-o);for(let t=0;t<i;t++)r[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){fb(this,!1),ub(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,o=e.length;n<o;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return cb(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(db(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,hb(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:o,enableXOF:i}=this;return e||(e=new Zb(t,r,n,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}const Qb=(()=>{return e=1,t=136,r=32,Nb(()=>new Zb(t,e,r));var e,t,r})();function Yb(e,t){const r=t||"hex",n=Qb(Rm(e,{strict:!1})?Ym(e):e);return"bytes"===r?n:Wm(n)}class Jb extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const $b=new Jb(8192);function ev(e){return function(e,t){if($b.has(`${e}.${t}`))return $b.get(`${e}.${t}`);const r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=Yb(tb(r),"bytes"),o=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&o[e]&&(o[e]=o[e].toUpperCase()),(15&n[e>>1])>=8&&o[e+1]&&(o[e+1]=o[e+1].toUpperCase());const i=`0x${o.join("")}`;return $b.set(`${e}.${t}`,i),i}(`0x${Yb(`0x${e.substring(4)}`).substring(26)}`)}async function tv({hash:e,signature:t}){const r=Rm(e)?e:Wm(e),{secp256k1:n}=await Promise.resolve().then(function(){return hx}),o=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){const{r:e,s:r,v:o,yParity:i}=t,s=rv(Number(i??o));return new n.Signature(Hm(e),Hm(r)).addRecoveryBit(s)}const e=Rm(t)?t:Wm(t);if(65!==Nm(e))throw new Error("invalid signature length");const r=rv(function(e,t={}){return Number(Hm(e,t))}(`0x${e.slice(130)}`));return n.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(r)})();return`0x${o.recoverPublicKey(r.substring(2)).toHex(!1)}`}function rv(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw new Error("Invalid yParityOrV value")}function nv(e,t,r){return e&t^~e&r}function ov(e,t,r){return e&t^e&r^t&r}class iv extends Rb{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=pb(this.buffer)}update(e){fb(this),ub(e=_b(e));const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let i=0;i<o;){const s=Math.min(n-this.pos,o-i);if(s===n){const t=pb(e);for(;n<=o-i;i+=n)this.process(t,i);continue}r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){fb(this),db(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:i}=this;t[i++]=128,hb(this.buffer.subarray(i)),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,n-8,BigInt(8*this.length),o),this.process(r,0);const s=pb(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,u[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const sv=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),av=Uint32Array.from([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]),cv=new Uint32Array(64);class uv extends iv{constructor(e=32){super(64,e,8,!1),this.A=0|sv[0],this.B=0|sv[1],this.C=0|sv[2],this.D=0|sv[3],this.E=0|sv[4],this.F=0|sv[5],this.G=0|sv[6],this.H=0|sv[7]}get(){const{A:e,B:t,C:r,D:n,E:o,F:i,G:s,H:a}=this;return[e,t,r,n,o,i,s,a]}set(e,t,r,n,o,i,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)cv[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=cv[e-15],r=cv[e-2],n=yb(t,7)^yb(t,18)^t>>>3,o=yb(r,17)^yb(r,19)^r>>>10;cv[e]=o+cv[e-7]+n+cv[e-16]|0}let{A:r,B:n,C:o,D:i,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(yb(s,6)^yb(s,11)^yb(s,25))+nv(s,a,c)+av[e]+cv[e]|0,l=(yb(r,2)^yb(r,13)^yb(r,22))+ov(r,n,o)|0;u=c,c=a,a=s,s=i+t|0,i=o,o=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,i=i+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,o,i,s,a,c,u)}roundClean(){hb(cv)}destroy(){this.set(0,0,0,0,0,0,0,0),hb(this.buffer)}}const lv=Nb(()=>new uv);class fv extends Rb{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,lb(e);const r=_b(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,o=new Uint8Array(n);o.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),hb(o)}update(e){return fb(this),this.iHash.update(e),this}digestInto(e){fb(this),ub(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:o,blockLen:i,outputLen:s}=this;return e.finished=n,e.destroyed=o,e.blockLen=i,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const dv=(e,t,r)=>new fv(e,t).update(r).digest();dv.create=(e,t)=>new fv(e,t);const hv=BigInt(0),pv=BigInt(1);function yv(e,t=""){if("boolean"!=typeof e){throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e)}return e}function gv(e,t,r=""){const n=ab(e),o=e?.length,i=void 0!==t;if(!n||i&&o!==t){throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(i?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e))}return e}function mv(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function bv(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?hv:BigInt("0x"+e)}function vv(e){return bv(wb(e))}function wv(e){return ub(e),bv(wb(Uint8Array.from(e).reverse()))}function xv(e,t){return Cb(e.toString(16).padStart(2*t,"0"))}function Sv(e,t){return xv(e,t).reverse()}function Ev(e,t,r){let n;if("string"==typeof t)try{n=Cb(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!ab(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const o=n.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}const Av=e=>"bigint"==typeof e&&hv<=e;function kv(e,t,r){return Av(e)&&Av(t)&&Av(r)&&t<=e&&e<r}function Ov(e){let t;for(t=0;e>hv;e>>=pv,t+=1);return t}const Tv=e=>(pv<<BigInt(e))-pv;function Cv(e,t,r={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function n(t,r,n){const o=e[t];if(n&&void 0===o)return;const i=typeof o;if(i!==r||null===o)throw new Error(`param "${t}" is invalid: expected ${r}, got ${i}`)}Object.entries(t).forEach(([e,t])=>n(e,t,!1)),Object.entries(r).forEach(([e,t])=>n(e,t,!0))}function Iv(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(void 0!==o)return o;const i=e(r,...n);return t.set(r,i),i}}const _v=BigInt(0),Pv=BigInt(1),Rv=BigInt(2),Nv=BigInt(3),Bv=BigInt(4),jv=BigInt(5),Mv=BigInt(7),Lv=BigInt(8),Uv=BigInt(9),Dv=BigInt(16);function Fv(e,t){const r=e%t;return r>=_v?r:t+r}function zv(e,t,r){let n=e;for(;t-- >_v;)n*=n,n%=r;return n}function qv(e,t){if(e===_v)throw new Error("invert: expected non-zero number");if(t<=_v)throw new Error("invert: expected positive modulus, got "+t);let r=Fv(e,t),n=t,o=_v,i=Pv;for(;r!==_v;){const e=n%r,t=o-i*(n/r);n=r,r=e,o=i,i=t}if(n!==Pv)throw new Error("invert: does not exist");return Fv(o,t)}function Vv(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function Hv(e,t){const r=(e.ORDER+Pv)/Bv,n=e.pow(t,r);return Vv(e,n,t),n}function Kv(e,t){const r=(e.ORDER-jv)/Lv,n=e.mul(t,Rv),o=e.pow(n,r),i=e.mul(t,o),s=e.mul(e.mul(i,Rv),o),a=e.mul(i,e.sub(s,e.ONE));return Vv(e,a,t),a}function Wv(e){if(e<Nv)throw new Error("sqrt is not defined for small field");let t=e-Pv,r=0;for(;t%Rv===_v;)t/=Rv,r++;let n=Rv;const o=$v(e);for(;1===Yv(o,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return Hv;let i=o.pow(n,t);const s=(t+Pv)/Rv;return function(e,n){if(e.is0(n))return n;if(1!==Yv(e,n))throw new Error("Cannot find square root");let o=r,a=e.mul(e.ONE,i),c=e.pow(n,t),u=e.pow(n,s);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,r=e.sqr(c);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===o)throw new Error("Cannot find square root");const n=Pv<<BigInt(o-t-1),i=e.pow(a,n);o=t,a=e.sqr(i),c=e.mul(c,a),u=e.mul(u,i)}return u}}function Gv(e){return e%Bv===Nv?Hv:e%Lv===jv?Kv:e%Dv===Uv?function(e){const t=$v(e),r=Wv(e),n=r(t,t.neg(t.ONE)),o=r(t,n),i=r(t,t.neg(n)),s=(e+Mv)/Dv;return(e,t)=>{let r=e.pow(t,s),a=e.mul(r,n);const c=e.mul(r,o),u=e.mul(r,i),l=e.eql(e.sqr(a),t),f=e.eql(e.sqr(c),t);r=e.cmov(r,a,l),a=e.cmov(u,c,f);const d=e.eql(e.sqr(a),t),h=e.cmov(r,a,d);return Vv(e,h,t),h}}(e):Wv(e)}const Xv=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Zv(e){return Cv(e,Xv.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"})),e}function Qv(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((t,r,o)=>e.is0(r)?t:(n[o]=t,e.mul(t,r)),e.ONE),i=e.inv(o);return t.reduceRight((t,r,o)=>e.is0(r)?t:(n[o]=e.mul(t,n[o]),e.mul(t,r)),i),n}function Yv(e,t){const r=(e.ORDER-Pv)/Rv,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),s=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!s)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function Jv(e,t){void 0!==t&&cb(t);const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function $v(e,t,r=!1,n={}){if(e<=_v)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,i,s,a=!1;if("object"==typeof t&&null!=t){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(o=e.BITS),e.sqrt&&(i=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE),"boolean"==typeof e.modFromBytes&&(a=e.modFromBytes),s=e.allowedLengths}else"number"==typeof t&&(o=t),n.sqrt&&(i=n.sqrt);const{nBitLength:c,nByteLength:u}=Jv(e,o);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let l;const f=Object.freeze({ORDER:e,isLE:r,BITS:c,BYTES:u,MASK:Tv(c),ZERO:_v,ONE:Pv,allowedLengths:s,create:t=>Fv(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return _v<=t&&t<e},is0:e=>e===_v,isValidNot0:e=>!f.is0(e)&&f.isValid(e),isOdd:e=>(e&Pv)===Pv,neg:t=>Fv(-t,e),eql:(e,t)=>e===t,sqr:t=>Fv(t*t,e),add:(t,r)=>Fv(t+r,e),sub:(t,r)=>Fv(t-r,e),mul:(t,r)=>Fv(t*r,e),pow:(e,t)=>function(e,t,r){if(r<_v)throw new Error("invalid exponent, negatives unsupported");if(r===_v)return e.ONE;if(r===Pv)return t;let n=e.ONE,o=t;for(;r>_v;)r&Pv&&(n=e.mul(n,o)),o=e.sqr(o),r>>=Pv;return n}(f,e,t),div:(t,r)=>Fv(t*qv(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>qv(t,e),sqrt:i||(t=>(l||(l=Gv(e)),l(f,t))),toBytes:e=>r?Sv(e,u):xv(e,u),fromBytes:(t,n=!0)=>{if(s){if(!s.includes(t.length)||t.length>u)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+t.length);const e=new Uint8Array(u);e.set(t,r?0:e.length-t.length),t=e}if(t.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+t.length);let o=r?wv(t):vv(t);if(a&&(o=Fv(o,e)),!n&&!f.isValid(o))throw new Error("invalid field element: outside of range 0..ORDER");return o},invertBatch:e=>Qv(f,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(f)}function ew(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function tw(e){const t=ew(e);return t+Math.ceil(t/2)}function rw(e,t,r=!1){const n=e.length,o=ew(t),i=tw(t);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);const s=Fv(r?wv(e):vv(e),t-Pv)+Pv;return r?Sv(s,o):xv(s,o)}const nw=BigInt(0),ow=BigInt(1);function iw(e,t){const r=t.negate();return e?r:t}function sw(e,t){const r=Qv(e.Fp,t.map(e=>e.Z));return t.map((t,n)=>e.fromAffine(t.toAffine(r[n])))}function aw(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function cw(e,t){aw(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:Tv(e),maxNumber:r,shiftBy:BigInt(e)}}function uw(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:s}=r;let a=Number(e&o),c=e>>s;a>n&&(a-=i,c+=ow);const u=t*n;return{nextN:c,offset:u+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!=0,offsetF:u}}const lw=new WeakMap,fw=new WeakMap;function dw(e){return fw.get(e)||1}function hw(e){if(e!==nw)throw new Error("invalid wNAF")}class pw{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let n=e;for(;t>nw;)t&ow&&(r=r.add(n)),n=n.double(),t>>=ow;return r}precomputeWindow(e,t){const{windows:r,windowSize:n}=cw(t,this.bits),o=[];let i=e,s=i;for(let e=0;e<r;e++){s=i,o.push(s);for(let e=1;e<n;e++)s=s.add(i),o.push(s);i=s.double()}return o}wNAF(e,t,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE;const i=cw(e,this.bits);for(let e=0;e<i.windows;e++){const{nextN:s,offset:a,isZero:c,isNeg:u,isNegF:l,offsetF:f}=uw(r,e,i);r=s,c?o=o.add(iw(l,t[f])):n=n.add(iw(u,t[a]))}return hw(r),{p:n,f:o}}wNAFUnsafe(e,t,r,n=this.ZERO){const o=cw(e,this.bits);for(let e=0;e<o.windows&&r!==nw;e++){const{nextN:i,offset:s,isZero:a,isNeg:c}=uw(r,e,o);if(r=i,!a){const e=t[s];n=n.add(c?e.negate():e)}}return hw(r),n}getPrecomputes(e,t,r){let n=lw.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),lw.set(t,n))),n}cached(e,t,r){const n=dw(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)}unsafe(e,t,r,n){const o=dw(e);return 1===o?this._unsafeLadder(e,t,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),t,n)}createCache(e,t){aw(t,this.bits),fw.set(e,t),lw.delete(e)}hasCache(e){return 1!==dw(e)}}function yw(e,t,r,n){!function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})}(r,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}(n,t);const o=r.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,a=Ov(BigInt(o));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=Tv(c),l=new Array(Number(u)+1).fill(s);let f=s;for(let e=Math.floor((t.BITS-1)/c)*c;e>=0;e-=c){l.fill(s);for(let t=0;t<i;t++){const o=n[t],i=Number(o>>BigInt(e)&u);l[i]=l[i].add(r[t])}let t=s;for(let e=l.length-1,r=s;e>0;e--)r=r.add(l[e]),t=t.add(r);if(f=f.add(t),0!==e)for(let e=0;e<c;e++)f=f.double()}return f}function gw(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Zv(t),t}return $v(e,{isLE:r})}const mw=(e,t)=>(e+(e>=0?t:-t)/Aw)/t;function bw(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function vw(e,t){const r={};for(let n of Object.keys(t))r[n]=void 0===e[n]?t[n]:e[n];return yv(r.lowS,"lowS"),yv(r.prehash,"prehash"),void 0!==r.format&&bw(r.format),r}class ww extends Error{constructor(e=""){super(e)}}const xw={Err:ww,_tlv:{encode:(e,t)=>{const{Err:r}=xw;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const n=t.length/2,o=mv(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");const i=n>127?mv(o.length/2|128):"";return mv(e)+i+o+t},decode(e,t){const{Err:r}=xw;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const o=t[n++];let i=0;if(!!(128&o)){const e=127&o;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of s)i=i<<8|e;if(n+=e,i<128)throw new r("tlv.decode(long): not minimal encoding")}else i=o;const s=t.subarray(n,n+i);if(s.length!==i)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+i)}}},_int:{encode(e){const{Err:t}=xw;if(e<Sw)throw new t("integer: negative integers are not allowed");let r=mv(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=xw;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return vv(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=xw,o=Ev("signature",e),{v:i,l:s}=n.decode(48,o);if(s.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=n.decode(2,i),{v:u,l:l}=n.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(e){const{_tlv:t,_int:r}=xw,n=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,n)}},Sw=BigInt(0),Ew=BigInt(1),Aw=BigInt(2),kw=BigInt(3),Ow=BigInt(4);function Tw(e,t){const{BYTES:r}=e;let n;if("bigint"==typeof t)n=t;else{let o=Ev("private key",t);try{n=e.fromBytes(o)}catch(e){throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(n))throw new Error("invalid private key: out of range [1..N-1]");return n}function Cw(e,t={}){const r=function(e,t,r={},n){if(void 0===n&&(n="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>nw))throw new Error(`CURVE.${e} must be positive bigint`)}const o=gw(t.p,r.Fp,n),i=gw(t.n,r.Fn,n),s=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of s)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}}("weierstrass",e,t),{Fp:n,Fn:o}=r;let i=r.CURVE;const{h:s,n:a}=i;Cv(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=t;if(c&&(!n.is0(i.a)||"bigint"!=typeof c.beta||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const u=Pw(n,o);function l(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const f=t.toBytes||function(e,t,r){const{x:o,y:i}=t.toAffine(),s=n.toBytes(o);if(yv(r,"isCompressed"),r){l();return Pb(Iw(!n.isOdd(i)),s)}return Pb(Uint8Array.of(4),s,n.toBytes(i))},d=t.fromBytes||function(e){gv(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:r}=u,o=e.length,i=e[0],s=e.subarray(1);if(o!==t||2!==i&&3!==i){if(o===r&&4===i){const e=n.BYTES,t=n.fromBytes(s.subarray(0,e)),r=n.fromBytes(s.subarray(e,2*e));if(!p(t,r))throw new Error("bad point: is not on curve");return{x:t,y:r}}throw new Error(`bad point: got length ${o}, expected compressed=${t} or uncompressed=${r}`)}{const e=n.fromBytes(s);if(!n.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=h(e);let r;try{r=n.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}l();return!(1&~i)!==n.isOdd(r)&&(r=n.neg(r)),{x:e,y:r}}};function h(e){const t=n.sqr(e),r=n.mul(t,e);return n.add(n.add(r,n.mul(e,i.a)),i.b)}function p(e,t){const r=n.sqr(t),o=h(e);return n.eql(r,o)}if(!p(i.Gx,i.Gy))throw new Error("bad curve params: generator point");const y=n.mul(n.pow(i.a,kw),Ow),g=n.mul(n.sqr(i.b),BigInt(27));if(n.is0(n.add(y,g)))throw new Error("bad curve params: a or b");function m(e,t,r=!1){if(!n.isValid(t)||r&&n.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function b(e){if(!(e instanceof E))throw new Error("ProjectivePoint expected")}function v(e){if(!c||!c.basises)throw new Error("no endo");return function(e,t,r){const[[n,o],[i,s]]=t,a=mw(s*e,r),c=mw(-o*e,r);let u=e-a*n-c*i,l=-a*o-c*s;const f=u<Sw,d=l<Sw;f&&(u=-u),d&&(l=-l);const h=Tv(Math.ceil(Ov(r)/2))+Ew;if(u<Sw||u>=h||l<Sw||l>=h)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:l}}(e,c.basises,o.ORDER)}const w=Iv((e,t)=>{const{X:r,Y:o,Z:i}=e;if(n.eql(i,n.ONE))return{x:r,y:o};const s=e.is0();null==t&&(t=s?n.ONE:n.inv(i));const a=n.mul(r,t),c=n.mul(o,t),u=n.mul(i,t);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:a,y:c}}),x=Iv(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=e.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not field elements");if(!p(r,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function S(e,t,r,o,i){return r=new E(n.mul(r.X,e),r.Y,r.Z),t=iw(o,t),r=iw(i,r),t.add(r)}class E{constructor(e,t,r){this.X=m("x",e),this.Y=m("y",t,!0),this.Z=m("z",r),Object.freeze(this)}static CURVE(){return i}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof E)throw new Error("projective point not allowed");return n.is0(t)&&n.is0(r)?E.ZERO:new E(t,r,n.ONE)}static fromBytes(e){const t=E.fromAffine(d(gv(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return E.fromBytes(Ev("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return k.createCache(this,e),t||this.multiply(kw),this}assertValidity(){x(this)}hasEvenY(){const{y:e}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(e)}equals(e){b(e);const{X:t,Y:r,Z:o}=this,{X:i,Y:s,Z:a}=e,c=n.eql(n.mul(t,a),n.mul(i,o)),u=n.eql(n.mul(r,a),n.mul(s,o));return c&&u}negate(){return new E(this.X,n.neg(this.Y),this.Z)}double(){const{a:e,b:t}=i,r=n.mul(t,kw),{X:o,Y:s,Z:a}=this;let c=n.ZERO,u=n.ZERO,l=n.ZERO,f=n.mul(o,o),d=n.mul(s,s),h=n.mul(a,a),p=n.mul(o,s);return p=n.add(p,p),l=n.mul(o,a),l=n.add(l,l),c=n.mul(e,l),u=n.mul(r,h),u=n.add(c,u),c=n.sub(d,u),u=n.add(d,u),u=n.mul(c,u),c=n.mul(p,c),l=n.mul(r,l),h=n.mul(e,h),p=n.sub(f,h),p=n.mul(e,p),p=n.add(p,l),l=n.add(f,f),f=n.add(l,f),f=n.add(f,h),f=n.mul(f,p),u=n.add(u,f),h=n.mul(s,a),h=n.add(h,h),f=n.mul(h,p),c=n.sub(c,f),l=n.mul(h,d),l=n.add(l,l),l=n.add(l,l),new E(c,u,l)}add(e){b(e);const{X:t,Y:r,Z:o}=this,{X:s,Y:a,Z:c}=e;let u=n.ZERO,l=n.ZERO,f=n.ZERO;const d=i.a,h=n.mul(i.b,kw);let p=n.mul(t,s),y=n.mul(r,a),g=n.mul(o,c),m=n.add(t,r),v=n.add(s,a);m=n.mul(m,v),v=n.add(p,y),m=n.sub(m,v),v=n.add(t,o);let w=n.add(s,c);return v=n.mul(v,w),w=n.add(p,g),v=n.sub(v,w),w=n.add(r,o),u=n.add(a,c),w=n.mul(w,u),u=n.add(y,g),w=n.sub(w,u),f=n.mul(d,v),u=n.mul(h,g),f=n.add(u,f),u=n.sub(y,f),f=n.add(y,f),l=n.mul(u,f),y=n.add(p,p),y=n.add(y,p),g=n.mul(d,g),v=n.mul(h,v),y=n.add(y,g),g=n.sub(p,g),g=n.mul(d,g),v=n.add(v,g),p=n.mul(y,v),l=n.add(l,p),p=n.mul(w,v),u=n.mul(m,u),u=n.sub(u,p),p=n.mul(m,y),f=n.mul(w,f),f=n.add(f,p),new E(u,l,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(E.ZERO)}multiply(e){const{endo:r}=t;if(!o.isValidNot0(e))throw new Error("invalid scalar: out of range");let n,i;const s=e=>k.cached(this,e,e=>sw(E,e));if(r){const{k1neg:t,k1:o,k2neg:a,k2:c}=v(e),{p:u,f:l}=s(o),{p:f,f:d}=s(c);i=l.add(d),n=S(r.beta,u,f,t,a)}else{const{p:t,f:r}=s(e);n=t,i=r}return sw(E,[n,i])[0]}multiplyUnsafe(e){const{endo:r}=t,n=this;if(!o.isValid(e))throw new Error("invalid scalar: out of range");if(e===Sw||n.is0())return E.ZERO;if(e===Ew)return n;if(k.hasCache(this))return this.multiply(e);if(r){const{k1neg:t,k1:o,k2neg:i,k2:s}=v(e),{p1:a,p2:c}=function(e,t,r,n){let o=t,i=e.ZERO,s=e.ZERO;for(;r>nw||n>nw;)r&ow&&(i=i.add(o)),n&ow&&(s=s.add(o)),o=o.double(),r>>=ow,n>>=ow;return{p1:i,p2:s}}(E,n,o,s);return S(r.beta,a,c,t,i)}return k.unsafe(n,e)}multiplyAndAddUnsafe(e,t,r){const n=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(e){return w(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return s===Ew||(e?e(E,this):k.unsafe(this,a).is0())}clearCofactor(){const{clearCofactor:e}=t;return s===Ew?this:e?e(E,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(e=!0){return yv(e,"isCompressed"),this.assertValidity(),f(E,this,e)}toHex(e=!0){return wb(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return sw(E,e)}static msm(e,t){return yw(E,o,e,t)}static fromPrivateKey(e){return E.BASE.multiply(Tw(o,e))}}E.BASE=new E(i.Gx,i.Gy,n.ONE),E.ZERO=new E(n.ZERO,n.ONE,n.ZERO),E.Fp=n,E.Fn=o;const A=o.BITS,k=new pw(E,t.endo?Math.ceil(A/2):A);return E.BASE.precompute(8),E}function Iw(e){return Uint8Array.of(e?2:3)}function _w(e,t){Zv(e);const{A:r,B:n,Z:o}=t;if(!e.isValid(r)||!e.isValid(n)||!e.isValid(o))throw new Error("mapToCurveSimpleSWU: invalid opts");const i=function(e,t){const r=e.ORDER;let n=Sw;for(let e=r-Ew;e%Aw===Sw;e/=Aw)n+=Ew;const o=n,i=Aw<<o-Ew-Ew,s=i*Aw,a=(r-Ew)/s,c=(a-Ew)/Aw,u=s-Ew,l=i,f=e.pow(t,a),d=e.pow(t,(a+Ew)/Aw);let h=(t,r)=>{let n=f,i=e.pow(r,u),s=e.sqr(i);s=e.mul(s,r);let a=e.mul(t,s);a=e.pow(a,c),a=e.mul(a,i),i=e.mul(a,r),s=e.mul(a,t);let h=e.mul(s,i);a=e.pow(h,l);let p=e.eql(a,e.ONE);i=e.mul(s,d),a=e.mul(h,n),s=e.cmov(i,s,p),h=e.cmov(a,h,p);for(let t=o;t>Ew;t--){let r=t-Aw;r=Aw<<r-Ew;let o=e.pow(h,r);const a=e.eql(o,e.ONE);i=e.mul(s,n),n=e.mul(n,n),o=e.mul(h,n),s=e.cmov(i,s,a),h=e.cmov(o,h,a)}return{isValid:p,value:s}};if(e.ORDER%Ow===kw){const r=(e.ORDER-kw)/Ow,n=e.sqrt(e.neg(t));h=(t,o)=>{let i=e.sqr(o);const s=e.mul(t,o);i=e.mul(i,s);let a=e.pow(i,r);a=e.mul(a,s);const c=e.mul(a,n),u=e.mul(e.sqr(a),o),l=e.eql(u,t);return{isValid:l,value:e.cmov(c,a,l)}}}return h}(e,o);if(!e.isOdd)throw new Error("Field does not have .isOdd()");return t=>{let s,a,c,u,l,f,d,h;s=e.sqr(t),s=e.mul(s,o),a=e.sqr(s),a=e.add(a,s),c=e.add(a,e.ONE),c=e.mul(c,n),u=e.cmov(o,e.neg(a),!e.eql(a,e.ZERO)),u=e.mul(u,r),a=e.sqr(c),f=e.sqr(u),l=e.mul(f,r),a=e.add(a,l),a=e.mul(a,c),f=e.mul(f,u),l=e.mul(f,n),a=e.add(a,l),d=e.mul(s,c);const{isValid:p,value:y}=i(a,f);h=e.mul(s,t),h=e.mul(h,y),d=e.cmov(d,c,p),h=e.cmov(h,y,p);const g=e.isOdd(t)===e.isOdd(h);h=e.cmov(e.neg(h),h,g);const m=Qv(e,[u],!0)[0];return d=e.mul(d,m),{x:d,y:h}}}function Pw(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Rw(e,t,r={}){lb(t),Cv(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const n=r.randomBytes||Bb,o=r.hmac||((e,...r)=>dv(t,e,Pb(...r))),{Fp:i,Fn:s}=e,{ORDER:a,BITS:c}=s,{keygen:u,getPublicKey:l,getSharedSecret:f,utils:d,lengths:h}=function(e,t={}){const{Fn:r}=e,n=t.randomBytes||Bb,o=Object.assign(Pw(e.Fp,r),{seed:tw(r.ORDER)});function i(e){try{return!!Tw(r,e)}catch(e){return!1}}function s(e=n(o.seed)){return rw(gv(e,o.seed,"seed"),r.ORDER)}function a(t,n=!0){return e.BASE.multiply(Tw(r,t)).toBytes(n)}function c(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:n,publicKey:i,publicKeyUncompressed:s}=o;if(r.allowedLengths||n===i)return;const a=Ev("key",t).length;return a===i||a===s}const u={isValidSecretKey:i,isValidPublicKey:function(t,r){const{publicKey:n,publicKeyUncompressed:i}=o;try{const o=t.length;return!(!0===r&&o!==n||!1===r&&o!==i||!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:s,isValidPrivateKey:i,randomPrivateKey:s,normPrivateKeyToScalar:e=>Tw(r,e),precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)};return Object.freeze({getPublicKey:a,getSharedSecret:function(t,n,o=!0){if(!0===c(t))throw new Error("first arg must be private key");if(!1===c(n))throw new Error("second arg must be public key");const i=Tw(r,t);return e.fromHex(n).multiply(i).toBytes(o)},keygen:function(e){const t=s(e);return{secretKey:t,publicKey:a(t)}},Point:e,utils:u,lengths:o})}(e,r),p={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},y="compact";function g(e){return e>a>>Ew}function m(e,t){if(!s.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class b{constructor(e,t,r){this.r=m("r",e),this.s=m("s",t),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(e,t=y){let r;if(function(e,t){bw(t);const r=h.signature;gv(e,"compact"===t?r:"recovered"===t?r+1:void 0,`${t} signature`)}(e,t),"der"===t){const{r:t,s:r}=xw.toSig(gv(e));return new b(t,r)}"recovered"===t&&(r=e[0],t="compact",e=e.subarray(1));const n=s.BYTES,o=e.subarray(0,n),i=e.subarray(n,2*n);return new b(s.fromBytes(o),s.fromBytes(i),r)}static fromHex(e,t){return this.fromBytes(Cb(e),t)}addRecoveryBit(e){return new b(this.r,this.s,e)}recoverPublicKey(t){const r=i.ORDER,{r:n,s:o,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error("recovery id invalid");if(a*Aw<r&&c>1)throw new Error("recovery id is ambiguous for h>1 curve");const u=2===c||3===c?n+a:n;if(!i.isValid(u))throw new Error("recovery id 2 or 3 invalid");const l=i.toBytes(u),f=e.fromBytes(Pb(Iw(!(1&c)),l)),d=s.inv(u),h=w(Ev("msgHash",t)),p=s.create(-h*d),y=s.create(o*d),g=e.BASE.multiplyUnsafe(p).add(f.multiplyUnsafe(y));if(g.is0())throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return g(this.s)}toBytes(e=y){if(bw(e),"der"===e)return Cb(xw.hexFromSig(this));const t=s.toBytes(this.r),r=s.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return Pb(Uint8Array.of(this.recovery),t,r)}return Pb(t,r)}toHex(e){return wb(this.toBytes(e))}assertValidity(){}static fromCompact(e){return b.fromBytes(Ev("sig",e),"compact")}static fromDER(e){return b.fromBytes(Ev("sig",e),"der")}normalizeS(){return this.hasHighS()?new b(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return wb(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return wb(this.toBytes("compact"))}}const v=r.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=vv(e),r=8*e.length-c;return r>0?t>>BigInt(r):t},w=r.bits2int_modN||function(e){return s.create(v(e))},x=Tv(c);function S(e){return function(e,t,r,n){if(!kv(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}("num < 2^"+c,e,Sw,x),s.toBytes(e)}function E(e,r){return gv(e,void 0,"message"),r?gv(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:u,getPublicKey:l,getSharedSecret:f,utils:d,lengths:h,Point:e,sign:function(r,i,a={}){r=Ev("message",r);const{seed:c,k2sig:u}=function(t,r,o){if(["recovered","canonical"].some(e=>e in o))throw new Error("sign() legacy options not supported");const{lowS:i,prehash:a,extraEntropy:c}=vw(o,p);t=E(t,a);const u=w(t),l=Tw(s,r),f=[S(l),S(u)];if(null!=c&&!1!==c){const e=!0===c?n(h.secretKey):c;f.push(Ev("extraEntropy",e))}const d=Pb(...f),y=u;return{seed:d,k2sig:function(t){const r=v(t);if(!s.isValidNot0(r))return;const n=s.inv(r),o=e.BASE.multiply(r).toAffine(),a=s.create(o.x);if(a===Sw)return;const c=s.create(n*s.create(y+a*l));if(c===Sw)return;let u=(o.x===a?0:2)|Number(o.y&Ew),f=c;return i&&g(c)&&(f=s.neg(c),u^=1),new b(a,f,u)}}}(r,i,a),l=function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");const n=e=>new Uint8Array(e),o=e=>Uint8Array.of(e);let i=n(e),s=n(e),a=0;const c=()=>{i.fill(1),s.fill(0),a=0},u=(...e)=>r(s,i,...e),l=(e=n(0))=>{s=u(o(0),e),i=u(),0!==e.length&&(s=u(o(1),e),i=u())},f=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){i=u();const t=i.slice();r.push(t),e+=i.length}return Pb(...r)};return(e,t)=>{let r;for(c(),l(e);!(r=t(f()));)l();return c(),r}}(t.outputLen,s.BYTES,o);return l(c,u)},verify:function(t,r,n,o={}){const{lowS:i,prehash:a,format:c}=vw(o,p);if(n=Ev("publicKey",n),r=E(Ev("message",r),a),"strict"in o)throw new Error("options.strict was renamed to lowS");const u=void 0===c?function(e){let t;const r="string"==typeof e||ab(e),n=!r&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!r&&!n)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(n)t=new b(e.r,e.s);else if(r){try{t=b.fromBytes(Ev("sig",e),"der")}catch(e){if(!(e instanceof xw.Err))throw e}if(!t)try{t=b.fromBytes(Ev("sig",e),"compact")}catch(e){return!1}}return t||!1}(t):b.fromBytes(Ev("sig",t),c);if(!1===u)return!1;try{const t=e.fromBytes(n);if(i&&u.hasHighS())return!1;const{r:o,s:a}=u,c=w(r),l=s.inv(a),f=s.create(c*l),d=s.create(o*l),h=e.BASE.multiplyUnsafe(f).add(t.multiplyUnsafe(d));if(h.is0())return!1;return s.create(h.x)===o}catch(e){return!1}},recoverPublicKey:function(e,t,r={}){const{prehash:n}=vw(r,p);return t=E(t,n),b.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:b,hash:t})}function Nw(e){const{CURVE:t,curveOpts:r}=function(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp;let n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:r,Fn:$v(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}function Bw(e){const{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:o}=Nw(e);return function(e,t){const r=t.Point;return Object.assign({},t,{ProjectivePoint:r,CURVE:Object.assign({},e,Jv(r.Fn.ORDER,r.Fn.BITS))})}(e,Rw(Cw(t,r),n,o))}const jw=vv;function Mw(e,t){if(Uw(e),Uw(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function Lw(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function Uw(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function Dw(e){if(!ab(e)&&"string"!=typeof e)throw new Error("DST must be Uint8Array or string");return"string"==typeof e?Ib(e):e}function Fw(e,t,r){Cv(r,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:n,k:o,m:i,hash:s,expand:a,DST:c}=r;if("function"!=typeof(u=r.hash)||!Number.isSafeInteger(u.outputLen))throw new Error("expected valid hash");var u;ub(e),Uw(t);const l=n.toString(2).length,f=Math.ceil((l+o)/8),d=t*i*f;let h;if("xmd"===a)h=function(e,t,r,n){ub(e),Uw(r),(t=Dw(t)).length>255&&(t=n(Pb(Ib("H2C-OVERSIZE-DST-"),t)));const{outputLen:o,blockLen:i}=n,s=Math.ceil(r/o);if(r>65535||s>255)throw new Error("expand_message_xmd: invalid lenInBytes");const a=Pb(t,Mw(t.length,1)),c=Mw(0,i),u=Mw(r,2),l=new Array(s),f=n(Pb(c,e,u,Mw(0,1),a));l[0]=n(Pb(f,Mw(1,1),a));for(let e=1;e<=s;e++){const t=[Lw(f,l[e-1]),Mw(e+1,1),a];l[e]=n(Pb(...t))}return Pb(...l).slice(0,r)}(e,c,d,s);else if("xof"===a)h=function(e,t,r,n,o){if(ub(e),Uw(r),(t=Dw(t)).length>255){const e=Math.ceil(2*n/8);t=o.create({dkLen:e}).update(Ib("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(e).update(Mw(r,2)).update(t).update(Mw(t.length,1)).digest()}(e,c,d,o,s);else{if("_internal_pass"!==a)throw new Error('expand must be "xmd" or "xof"');h=e}const p=new Array(t);for(let e=0;e<t;e++){const t=new Array(i);for(let r=0;r<i;r++){const o=f*(r+e*i),s=h.subarray(o,o+f);t[r]=Fv(jw(s),n)}p[e]=t}return p}const zw=Ib("HashToScalar-");const qw={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Vw={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},Hw=BigInt(0),Kw=BigInt(1),Ww=BigInt(2);const Gw=$v(qw.p,{sqrt:function(e){const t=qw.p,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,f=zv(l,r,t)*l%t,d=zv(f,r,t)*l%t,h=zv(d,Ww,t)*u%t,p=zv(h,o,t)*h%t,y=zv(p,i,t)*p%t,g=zv(y,a,t)*y%t,m=zv(g,c,t)*g%t,b=zv(m,a,t)*y%t,v=zv(b,r,t)*l%t,w=zv(v,s,t)*p%t,x=zv(w,n,t)*u%t,S=zv(x,Ww,t);if(!Gw.eql(Gw.sqr(S),e))throw new Error("Cannot find square root");return S}}),Xw=function(e,t){const r=t=>Bw({...e,hash:t});return{...r(t),create:r}}({...qw,Fp:Gw,lowS:!0,endo:Vw},lv),Zw={};function Qw(e,...t){let r=Zw[e];if(void 0===r){const t=lv(Ib(e));r=Pb(t,t),Zw[e]=r}return lv(Pb(r,...t))}const Yw=e=>e.toBytes(!0).slice(1),Jw=(()=>Xw.Point)(),$w=e=>e%Ww===Hw;function ex(e){const{Fn:t,BASE:r}=Jw,n=Tw(t,e),o=r.multiply(n);return{scalar:$w(o.y)?n:t.neg(n),bytes:Yw(o)}}function tx(e){const t=Gw;if(!t.isValidNot0(e))throw new Error("invalid x: Fail if x ≥ p");const r=t.create(e*e),n=t.create(r*e+BigInt(7));let o=t.sqrt(n);$w(o)||(o=t.neg(o));const i=Jw.fromAffine({x:e,y:o});return i.assertValidity(),i}const rx=vv;function nx(...e){return Jw.Fn.create(rx(Qw("BIP0340/challenge",...e)))}function ox(e){return ex(e).bytes}function ix(e,t,r=Bb(32)){const{Fn:n}=Jw,o=Ev("message",e),{bytes:i,scalar:s}=ex(t),a=Ev("auxRand",r,32),c=n.toBytes(s^rx(Qw("BIP0340/aux",a))),u=Qw("BIP0340/nonce",c,i,o),{bytes:l,scalar:f}=ex(u),d=nx(l,i,o),h=new Uint8Array(64);if(h.set(l,0),h.set(n.toBytes(n.create(f+d*s)),32),!sx(h,o,i))throw new Error("sign: Invalid signature produced");return h}function sx(e,t,r){const{Fn:n,BASE:o}=Jw,i=Ev("signature",e,64),s=Ev("message",t),a=Ev("publicKey",r,32);try{const e=tx(rx(a)),t=rx(i.subarray(0,32));if(!kv(t,Kw,qw.p))return!1;const r=rx(i.subarray(32,64));if(!kv(r,Kw,qw.n))return!1;const c=nx(n.toBytes(t),Yw(e),s),u=o.multiplyUnsafe(r).add(e.multiplyUnsafe(n.neg(c))),{x:l,y:f}=u.toAffine();return!(u.is0()||!$w(f)||l!==t)}catch(e){return!1}}const ax=(()=>{const e=(e=Bb(48))=>rw(e,qw.n);return Xw.utils.randomSecretKey,{keygen:function(t){const r=e(t);return{secretKey:r,publicKey:ox(r)}},getPublicKey:ox,sign:ix,verify:sx,Point:Jw,utils:{randomSecretKey:e,randomPrivateKey:e,taggedHash:Qw,lift_x:tx,pointToBytes:Yw,numberToBytesBE:xv,bytesToNumberBE:vv,mod:Fv},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})(),cx=(()=>function(e,t){const r=t.map(e=>Array.from(e).reverse());return(t,n)=>{const[o,i,s,a]=r.map(r=>r.reduce((r,n)=>e.add(e.mul(r,t),n))),[c,u]=Qv(e,[i,a],!0);return t=e.mul(o,c),n=e.mul(n,e.mul(s,u)),{x:t,y:n}}}(Gw,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(e=>BigInt(e)))))(),ux=(()=>_w(Gw,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Gw.create(BigInt("-11"))}))(),lx=(()=>function(e,t,r){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");function n(r){return e.fromAffine(t(r))}function o(t){const r=t.clearCofactor();return r.equals(e.ZERO)?e.ZERO:(r.assertValidity(),r)}return{defaults:r,hashToCurve(e,t){const i=Fw(e,2,Object.assign({},r,t)),s=n(i[0]),a=n(i[1]);return o(s.add(a))},encodeToCurve(e,t){const i=r.encodeDST?{DST:r.encodeDST}:{};return o(n(Fw(e,1,Object.assign({},r,i,t))[0]))},mapToCurve(e){if(!Array.isArray(e))throw new Error("expected array of bigints");for(const t of e)if("bigint"!=typeof t)throw new Error("expected array of bigints");return o(n(e))},hashToScalar(t,n){const o=e.Fn.ORDER;return Fw(t,1,Object.assign({},r,{p:o,m:1,DST:zw},n))[0][0]}}}(Xw.Point,e=>{const{x:t,y:r}=ux(Gw.create(e[0]));return cx(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Gw.ORDER,m:1,k:128,expand:"xmd",hash:lv}))(),fx=(()=>lx.hashToCurve)(),dx=(()=>lx.encodeToCurve)();var hx=Object.freeze({__proto__:null,secp256k1:Xw,schnorr:ax,secp256k1_hasher:lx,hashToCurve:fx,encodeToCurve:dx});var px=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);for(let e=0;e<t.length;e++)t[e]=255;for(let r=0;r<e.length;r++){const n=e.charAt(r),o=n.charCodeAt(0);if(255!==t[o])throw new TypeError(n+" is ambiguous");t[o]=r}const r=e.length,n=e.charAt(0),o=Math.log(r)/Math.log(256),i=Math.log(256)/Math.log(r);function s(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;let i=0,s=0,a=0;for(;e[i]===n;)s++,i++;const c=(e.length-i)*o+1>>>0,u=new Uint8Array(c);for(;i<e.length;){const n=e.charCodeAt(i);if(n>255)return;let o=t[n];if(255===o)return;let s=0;for(let e=c-1;(0!==o||s<a)&&-1!==e;e--,s++)o+=r*u[e]>>>0,u[e]=o%256>>>0,o=o/256>>>0;if(0!==o)throw new Error("Non-zero carry");a=s,i++}let l=c-a;for(;l!==c&&0===u[l];)l++;const f=new Uint8Array(s+(c-l));let d=s;for(;l!==c;)f[d++]=u[l++];return f}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";let o=0,s=0,a=0;const c=t.length;for(;a!==c&&0===t[a];)a++,o++;const u=(c-a)*i+1>>>0,l=new Uint8Array(u);for(;a!==c;){let e=t[a],n=0;for(let t=u-1;(0!==e||n<s)&&-1!==t;t--,n++)e+=256*l[t]>>>0,l[t]=e%r>>>0,e=e/r>>>0;if(0!==e)throw new Error("Non-zero carry");s=n,a++}let f=u-s;for(;f!==u&&0===l[f];)f++;let d=n.repeat(o);for(;f<u;++f)d+=e.charAt(l[f]);return d},decodeUnsafe:s,decode:function(e){const t=s(e);if(t)return t;throw new Error("Non-base"+r+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");const yx=new TextEncoder;function gx(e,t,r){e.length>50?function(e,t,r){yx.encodeInto(e,t.subarray(r))}(e,t,r):function(e,t,r){const n=e.length;let o=r,i=0;for(;i<n;){let r=e.charCodeAt(i++);if(4294967168&r){if(4294965248&r){if(r>=55296&&r<=56319&&i<n){const t=e.charCodeAt(i);56320==(64512&t)&&(++i,r=((1023&r)<<10)+(1023&t)+65536)}4294901760&r?(t[o++]=r>>18&7|240,t[o++]=r>>12&63|128,t[o++]=r>>6&63|128):(t[o++]=r>>12&15|224,t[o++]=r>>6&63|128)}else t[o++]=r>>6&31|192;t[o++]=63&r|128}else t[o++]=r}}(e,t,r)}function mx(e,t,r){let n=t;const o=n+r,i=[];let s="";for(;n<o;){const t=e[n++];if(128&t)if(192==(224&t)){const r=63&e[n++];i.push((31&t)<<6|r)}else if(224==(240&t)){const r=63&e[n++],o=63&e[n++];i.push((31&t)<<12|r<<6|o)}else if(240==(248&t)){let r=(7&t)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++];r>65535&&(r-=65536,i.push(r>>>10&1023|55296),r=56320|1023&r),i.push(r)}else i.push(t);else i.push(t);i.length>=4096&&(s+=String.fromCharCode(...i),i.length=0)}return i.length>0&&(s+=String.fromCharCode(...i)),s}const bx=new TextDecoder;function vx(e,t,r){return r>200?function(e,t,r){const n=e.subarray(t,t+r);return bx.decode(n)}(e,t,r):mx(e,t,r)}class wx{constructor(e,t){this.type=e,this.data=t}}class xx extends Error{constructor(e){super(e);const t=Object.create(xx.prototype);Object.setPrototypeOf(this,t),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:xx.name})}}const Sx=4294967295;function Ex(e,t,r){const n=Math.floor(r/4294967296),o=r;e.setUint32(t,n),e.setUint32(t+4,o)}function Ax(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}const kx={type:-1,encode:function(e){if(e instanceof Date){return function({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=17179869183){if(0===t&&e<=4294967295){const t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}{const r=e/4294967296,n=4294967295&e,o=new Uint8Array(8),i=new DataView(o.buffer);return i.setUint32(0,t<<2|3&r),i.setUint32(4,n),o}}{const r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,t),Ex(n,4,e),r}}(function(e){const t=e.getTime(),r=Math.floor(t/1e3),n=1e6*(t-1e3*r),o=Math.floor(n/1e9);return{sec:r+o,nsec:n-1e9*o}}(e))}return null},decode:function(e){const t=function(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const e=t.getUint32(0);return{sec:4294967296*(3&e)+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:Ax(t,4),nsec:t.getUint32(0)};default:throw new xx(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}};class Ox{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(kx)}register({type:e,encode:t,decode:r}){if(e>=0)this.encoders[e]=t,this.decoders[e]=r;else{const n=-1-e;this.builtInEncoders[n]=t,this.builtInDecoders[n]=r}}tryToEncode(e,t){for(let r=0;r<this.builtInEncoders.length;r++){const n=this.builtInEncoders[r];if(null!=n){const o=n(e,t);if(null!=o){return new wx(-1-r,o)}}}for(let r=0;r<this.encoders.length;r++){const n=this.encoders[r];if(null!=n){const o=n(e,t);if(null!=o){return new wx(r,o)}}}return e instanceof wx?e:null}decode(e,t,r){const n=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return n?n(e,t,r):new wx(t,e)}}function Tx(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):function(e){return e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer}(e)?new Uint8Array(e):Uint8Array.from(e)}Ox.defaultCodec=new Ox;class Cx{constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??Ox.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??100,this.initialBufferSize=e?.initialBufferSize??2048,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new Cx({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered){return this.clone().encodeSharedRef(e)}try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered){return this.clone().encode(e)}try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw new Error(`Too deep objects in depth ${t}`);null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.useBigInt64&&"bigint"==typeof e?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){const t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)}resizeBuffer(e){const t=new ArrayBuffer(e),r=new Uint8Array(t),n=new DataView(t);r.set(this.bytes),this.view=n,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){!1===e?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error(`Too long string: ${e} bytes in UTF-8`);this.writeU8(219),this.writeU32(e)}}encodeString(e){const t=function(e){const t=e.length;let r=0,n=0;for(;n<t;){let o=e.charCodeAt(n++);if(4294967168&o)if(4294965248&o){if(o>=55296&&o<=56319&&n<t){const t=e.charCodeAt(n);56320==(64512&t)&&(++n,o=((1023&o)<<10)+(1023&t)+65536)}r+=4294901760&o?4:3}else r+=2;else r++}return r}(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),gx(e,this.bytes,this.pos),this.pos+=t}encodeObject(e,t){const r=this.extensionCodec.tryToEncode(e,this.context);if(null!=r)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`);this.encodeMap(e,t)}}encodeBinary(e){const t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error(`Too large binary: ${t}`);this.writeU8(198),this.writeU32(t)}const r=Tx(e);this.writeU8a(r)}encodeArray(e,t){const r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else{if(!(r<4294967296))throw new Error(`Too large array: ${r}`);this.writeU8(221),this.writeU32(r)}for(const r of e)this.doEncode(r,t+1)}countWithoutUndefined(e,t){let r=0;for(const n of t)void 0!==e[n]&&r++;return r}encodeMap(e,t){const r=Object.keys(e);this.sortKeys&&r.sort();const n=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(n<16)this.writeU8(128+n);else if(n<65536)this.writeU8(222),this.writeU16(n);else{if(!(n<4294967296))throw new Error(`Too large map object: ${n}`);this.writeU8(223),this.writeU32(n)}for(const n of r){const r=e[n];this.ignoreUndefined&&void 0===r||(this.encodeString(n),this.doEncode(r,t+1))}}encodeExtension(e){if("function"==typeof e.data){const t=e.data(this.pos+6),r=t.length;if(r>=4294967296)throw new Error(`Too large extension object: ${r}`);return this.writeU8(201),this.writeU32(r),this.writeI8(e.type),void this.writeU8a(t)}const t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error(`Too large extension object: ${t}`);this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),function(e,t,r){const n=r/4294967296,o=r;e.setUint32(t,n),e.setUint32(t+4,o)}(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),Ex(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function Ix(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}const _x="array",Px="map_key",Rx="map_value",Nx=e=>{if("string"==typeof e||"number"==typeof e)return e;throw new xx("The type of key must be string or number but "+typeof e)};class Bx{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const t=this.getUninitializedStateFromPool();t.type=_x,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){const t=this.getUninitializedStateFromPool();t.type=Px,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===_x){const t=e;t.size=0,t.array=void 0,t.position=0,t.type=void 0}if(e.type===Px||e.type===Rx){const t=e;t.size=0,t.map=void 0,t.readCount=0,t.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const jx=new DataView(new ArrayBuffer(0)),Mx=new Uint8Array(jx.buffer);try{jx.getInt8(0)}catch(SP){if(!(SP instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const Lx=new RangeError("Insufficient data"),Ux=new class{constructor(e=16,t=16){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let e=0;e<this.maxKeyLength;e++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,r){const n=this.caches[r-1];e:for(const o of n){const n=o.bytes;for(let o=0;o<r;o++)if(n[o]!==e[t+o])continue e;return o.str}return null}store(e,t){const r=this.caches[e.length-1],n={bytes:e,str:t};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=n:r.push(n)}decode(e,t,r){const n=this.find(e,t,r);if(null!=n)return this.hit++,n;this.miss++;const o=mx(e,t,r),i=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(i,o),o}};class Dx{constructor(e){this.totalPos=0,this.pos=0,this.view=jx,this.bytes=Mx,this.headByte=-1,this.stack=new Bx,this.entered=!1,this.extensionCodec=e?.extensionCodec??Ox.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??Sx,this.maxBinLength=e?.maxBinLength??Sx,this.maxArrayLength=e?.maxArrayLength??Sx,this.maxMapLength=e?.maxMapLength??Sx,this.maxExtLength=e?.maxExtLength??Sx,this.keyDecoder=void 0!==e?.keyDecoder?e.keyDecoder:Ux,this.mapKeyConverter=e?.mapKeyConverter??Nx}clone(){return new Dx({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(e){const t=Tx(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(-1!==this.headByte||this.hasRemaining(1)){const t=this.bytes.subarray(this.pos),r=Tx(e),n=new Uint8Array(t.length+r.length);n.set(t),n.set(r,t.length),this.setBuffer(n)}else this.setBuffer(e)}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:t,pos:r}=this;return new RangeError(`Extra ${t.byteLength-r} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered){return this.clone().decode(e)}try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){const t=this.clone();return void(yield*t.decodeMulti(e))}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered){return this.clone().decodeAsync(e)}try{this.entered=!0;let t,r=!1;for await(const n of e){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(n);try{t=this.doDecodeSync(),r=!0}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return t}const{headByte:n,pos:o,totalPos:i}=this;throw new RangeError(`Insufficient data in parsing ${Ix(n)} at ${i} (${o} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered){const r=this.clone();return void(yield*r.decodeMultiAsync(e,t))}try{this.entered=!0;let r=t,n=-1;for await(const o of e){if(t&&0===n)throw this.createExtraByteError(this.totalPos);this.appendBuffer(o),r&&(n=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),0!==--n;);}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const r=e-128;if(0!==r){this.pushMapState(r),this.complete();continue e}t={}}else if(e<160){const r=e-144;if(0!==r){this.pushArrayState(r),this.complete();continue e}t=[]}else{const r=e-160;t=this.decodeString(r,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===e){const e=this.lookU8();t=this.decodeString(e,1)}else if(218===e){const e=this.lookU16();t=this.decodeString(e,2)}else if(219===e){const e=this.lookU32();t=this.decodeString(e,4)}else if(220===e){const e=this.readU16();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(221===e){const e=this.readU32();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(222===e){const e=this.readU16();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(223===e){const e=this.readU32();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(196===e){const e=this.lookU8();t=this.decodeBinary(e,1)}else if(197===e){const e=this.lookU16();t=this.decodeBinary(e,2)}else if(198===e){const e=this.lookU32();t=this.decodeBinary(e,4)}else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e){const e=this.lookU8();t=this.decodeExtension(e,1)}else if(200===e){const e=this.lookU16();t=this.decodeExtension(e,2)}else{if(201!==e)throw new xx(`Unrecognized type byte: ${Ix(e)}`);{const e=this.lookU32();t=this.decodeExtension(e,4)}}this.complete();const r=this.stack;for(;r.length>0;){const e=r.top();if(e.type===_x){if(e.array[e.position]=t,e.position++,e.position!==e.size)continue e;t=e.array,r.release(e)}else{if(e.type===Px){if("__proto__"===t)throw new xx("The key __proto__ is not allowed");e.key=this.mapKeyConverter(t),e.type=Rx;continue e}if(e.map[e.key]=t,e.readCount++,e.readCount!==e.size){e.key=null,e.type=Px;continue e}t=e.map,r.release(e)}}return t}}readHeadByte(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new xx(`Unrecognized array type byte: ${Ix(e)}`)}}pushMapState(e){if(e>this.maxMapLength)throw new xx(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new xx(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){if(e>this.maxStrLength)throw new xx(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw Lx;const r=this.pos+t;let n;return n=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?this.keyDecoder.decode(this.bytes,r,e):vx(this.bytes,r,e),this.pos+=t+e,n}stateIsMapKey(){if(this.stack.length>0){return this.stack.top().type===Px}return!1}decodeBinary(e,t){if(e>this.maxBinLength)throw new xx(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw Lx;const r=this.pos+t,n=this.bytes.subarray(r,r+e);return this.pos+=t+e,n}decodeExtension(e,t){if(e>this.maxExtLength)throw new xx(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const r=this.view.getInt8(this.pos+t),n=this.decodeBinary(e,t+1);return this.extensionCodec.decode(n,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=(t=this.view,r=this.pos,4294967296*t.getUint32(r)+t.getUint32(r+4));var t,r;return this.pos+=8,e}readI64(){const e=Ax(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}}
36
36
  /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
37
- function Fx(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function zx(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function qx(e){if("function"!=typeof e)throw new Error("function expected");return!0}function Vx(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function Hx(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function Kx(e){if(!Array.isArray(e))throw new Error("array expected")}function Wx(e,t){if(!zx(!0,t))throw new Error(`${e}: array of strings expected`)}function Gx(e,t){if(!zx(!1,t))throw new Error(`${e}: array of numbers expected`)}function Xx(...e){const t=e=>e,r=(e,t)=>r=>e(t(r)),n=e.map(e=>e.encode).reduceRight(r,t),o=e.map(e=>e.decode).reduce(r,t);return{encode:n,decode:o}}function Zx(e){const t="string"==typeof e?e.split(""):e,r=t.length;Wx("alphabet",t);const n=new Map(t.map((e,t)=>[e,t]));return{encode:n=>(Kx(n),n.map(n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]})),decode:t=>(Kx(t),t.map(t=>{Vx("alphabet.decode",t);const r=n.get(t);if(void 0===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}function Qx(e=""){return Vx("join",e),{encode:t=>(Wx("join.decode",t),t.join(e)),decode:t=>(Vx("join.decode",t),t.split(e))}}function Yx(e,t="="){return Hx(e),Vx("padding",t),{encode(r){for(Wx("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){Wx("padding.decode",r);let n=r.length;if(n*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--){if((n-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return r.slice(0,n)}}}function Jx(e){return qx(e),{encode:e=>e,decode:t=>e(t)}}function $x(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(Kx(e),!e.length)return[];let n=0;const o=[],i=Array.from(e,e=>{if(Hx(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e}),s=i.length;for(;;){let e=0,a=!0;for(let o=n;o<s;o++){const s=i[o],c=t*e,u=c+s;if(!Number.isSafeInteger(u)||c/t!==e||u-s!==c)throw new Error("convertRadix: carry overflow");const l=u/r;e=u%r;const f=Math.floor(l);if(i[o]=f,!Number.isSafeInteger(f)||f*r+e!==u)throw new Error("convertRadix: carry overflow");a&&(f?a=!1:n=o)}if(o.push(e),a)break}for(let t=0;t<e.length-1&&0===e[t];t++)o.push(0);return o.reverse()}const eS=(e,t)=>0===t?e:eS(t,e%t),tS=(e,t)=>e+(t-eS(e,t)),rS=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function nS(e,t,r,n){if(Kx(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(tS(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${tS(t,r)}`);let o=0,i=0;const s=rS[t],a=rS[r]-1,c=[];for(const n of e){if(Hx(n),n>=s)throw new Error(`convertRadix2: invalid data word=${n} from=${t}`);if(o=o<<t|n,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=r;i-=r)c.push((o>>i-r&a)>>>0);const e=rS[i];if(void 0===e)throw new Error("invalid carry");o&=e-1}if(o=o<<r-i&a,!n&&i>=t)throw new Error("Excess padding");if(!n&&o>0)throw new Error(`Non-zero padding: ${o}`);return n&&i>0&&c.push(o>>>0),c}function oS(e,t=!1){if(Hx(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(tS(8,e)>32||tS(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!Fx(r))throw new Error("radix2.encode input should be Uint8Array");return nS(Array.from(r),8,e,!t)},decode:r=>(Gx("radix2.decode",r),Uint8Array.from(nS(r,e,8,t)))}}function iS(e){return qx(e),function(...t){try{return e.apply(null,t)}catch(e){}}}Xx(oS(4),Zx("0123456789ABCDEF"),Qx(""));const sS=Xx(oS(5),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Yx(5),Qx(""));Xx(oS(5),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Qx("")),Xx(oS(5),Zx("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Yx(5),Qx("")),Xx(oS(5),Zx("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Qx("")),Xx(oS(5),Zx("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Qx(""),Jx(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const aS=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)();aS||Xx(oS(6),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Yx(6),Qx("")),Xx(oS(6),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Qx("")),aS||Xx(oS(6),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Yx(6),Qx("")),Xx(oS(6),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Qx(""));const cS=e=>Xx(function(e){return Hx(e),{encode:t=>{if(!Fx(t))throw new Error("radix.encode input should be Uint8Array");return $x(Array.from(t),256,e)},decode:t=>(Gx("radix.decode",t),Uint8Array.from($x(t,e,256)))}}(58),Zx(e),Qx(""));cS("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),cS("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),cS("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const uS=Xx(Zx("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Qx("")),lS=[996825010,642813549,513874426,1027748829,705979059];function fS(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<lS.length;e++)1==(t>>e&1)&&(r^=lS[e]);return r}function dS(e,t,r=1){const n=e.length;let o=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);o=fS(o)^r>>5}o=fS(o);for(let t=0;t<n;t++)o=fS(o)^31&e.charCodeAt(t);for(let e of t)o=fS(o)^e;for(let e=0;e<6;e++)o=fS(o);return o^=r,uS.encode(nS([o%rS[30]],30,5,!1))}function hS(e){const t="bech32"===e?1:734539939,r=oS(5),n=r.decode,o=r.encode,i=iS(n);function s(e,r,n=90){Vx("bech32.encode prefix",e),Fx(r)&&(r=Array.from(r)),Gx("bech32.encode",r);const o=e.length;if(0===o)throw new TypeError(`Invalid prefix length ${o}`);const i=o+7+r.length;if(!1!==n&&i>n)throw new TypeError(`Length ${i} exceeds limit ${n}`);const s=e.toLowerCase(),a=dS(s,r,t);return`${s}1${uS.encode(r)}${a}`}function a(e,r=90){Vx("bech32.decode input",e);const n=e.length;if(n<8||!1!==r&&n>r)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${r})`);const o=e.toLowerCase();if(e!==o&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=o.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const s=o.slice(0,i),a=o.slice(i+1);if(a.length<6)throw new Error("Data must be at least 6 characters long");const c=uS.decode(a).slice(0,-6),u=dS(s,c,t);if(!a.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected "${u}"`);return{prefix:s,words:c}}return{encode:s,decode:a,encodeFromBytes:function(e,t){return s(e,o(t))},decodeToBytes:function(e){const{prefix:t,words:r}=a(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:iS(a),fromWords:n,fromWordsUnsafe:i,toWords:o}}hS("bech32"),hS("bech32m");function pS(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function yS(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?pS(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function gS(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));const r=yS(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return pS(r)}(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)()||Xx(oS(4),Zx("0123456789abcdef"),Qx(""),Jx(e=>{if("string"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));var mS=function(e,t){if(e.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 o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(255!==r[s])throw new TypeError(i+" is ambiguous");r[s]=o}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,o=0;e[t]===c;)n++,t++;for(var i=(e.length-t)*u+1>>>0,s=new Uint8Array(i);e[t];){var l=r[e.charCodeAt(t)];if(255===l)return;for(var f=0,d=i-1;(0!==l||f<o)&&-1!==d;d--,f++)l+=a*s[d]>>>0,s[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=f,t++}if(" "!==e[t]){for(var h=i-o;h!==i&&0===s[h];)h++;for(var p=new Uint8Array(n+(i-h)),y=n;h!==i;)p[y++]=s[h++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,i=t.length;o!==i&&0===t[o];)o++,r++;for(var s=(i-o)*l+1>>>0,u=new Uint8Array(s);o!==i;){for(var f=t[o],d=0,h=s-1;(0!==f||d<n)&&-1!==h;h--,d++)f+=256*u[h]>>>0,u[h]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");n=d,o++}for(var p=s-n;p!==s&&0===u[p];)p++;for(var y=c.repeat(r);p<s;++p)y+=e.charAt(u[p]);return y},decodeUnsafe:f,decode:function(e){var r=f(e);if(r)return r;throw new Error(`Non-${t} character`)}}},bS=mS;const vS=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class wS{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class xS{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return ES(this,e)}}class SS{constructor(e){this.decoders=e}or(e){return ES(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const ES=(e,t)=>new SS({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class AS{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new wS(e,t,r),this.decoder=new xS(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const kS=({name:e,prefix:t,encode:r,decode:n})=>new AS(e,t,r,n),OS=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=bS(r,t);return kS({prefix:e,name:t,encode:n,decode:e=>vS(o(e))})},TS=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>kS({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let i="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,i+=t[o&a>>s];if(s&&(i+=t[o&a<<r-s]),n)for(;i.length*r&7;)i+="=";return i})(e,n,r),decode:t=>((e,t,r,n)=>{const o={};for(let e=0;e<t.length;++e)o[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const s=new Uint8Array(i*r/8|0);let a=0,c=0,u=0;for(let t=0;t<i;++t){const i=o[e[t]];if(void 0===i)throw new SyntaxError(`Non-${n} character`);c=c<<r|i,a+=r,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),CS=kS({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var IS=Object.freeze({__proto__:null,identity:CS});const _S=TS({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var PS=Object.freeze({__proto__:null,base2:_S});const RS=TS({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var NS=Object.freeze({__proto__:null,base8:RS});const BS=OS({prefix:"9",name:"base10",alphabet:"0123456789"});var jS=Object.freeze({__proto__:null,base10:BS});const MS=TS({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),LS=TS({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var US=Object.freeze({__proto__:null,base16:MS,base16upper:LS});const DS=TS({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),FS=TS({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),zS=TS({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),qS=TS({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),VS=TS({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),HS=TS({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),KS=TS({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),WS=TS({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),GS=TS({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var XS=Object.freeze({__proto__:null,base32:DS,base32upper:FS,base32pad:zS,base32padupper:qS,base32hex:VS,base32hexupper:HS,base32hexpad:KS,base32hexpadupper:WS,base32z:GS});const ZS=OS({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),QS=OS({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var YS=Object.freeze({__proto__:null,base36:ZS,base36upper:QS});const JS=OS({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),$S=OS({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var eE=Object.freeze({__proto__:null,base58btc:JS,base58flickr:$S});const tE=TS({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),rE=TS({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),nE=TS({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),oE=TS({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var iE=Object.freeze({__proto__:null,base64:tE,base64pad:rE,base64url:nE,base64urlpad:oE});const sE=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),aE=sE.reduce((e,t,r)=>(e[r]=t,e),[]),cE=sE.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);const uE=kS({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=aE[t],"")},decode:function(e){const t=[];for(const r of e){const e=cE[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var lE=Object.freeze({__proto__:null,base256emoji:uE}),fE=function e(t,r,n){r=r||[];var o=n=n||0;for(;t>=pE;)r[n++]=255&t|dE,t/=128;for(;t&hE;)r[n++]=255&t|dE,t>>>=7;return r[n]=0|t,e.bytes=n-o+1,r},dE=128,hE=-128,pE=Math.pow(2,31);var yE=function e(t,r){var n,o=0,i=0,s=r=r||0,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],o+=i<28?(n&mE)<<i:(n&mE)*Math.pow(2,i),i+=7}while(n>=gE);return e.bytes=s-r,o},gE=128,mE=127;var bE=Math.pow(2,7),vE=Math.pow(2,14),wE=Math.pow(2,21),xE=Math.pow(2,28),SE=Math.pow(2,35),EE=Math.pow(2,42),AE=Math.pow(2,49),kE=Math.pow(2,56),OE=Math.pow(2,63),TE={encode:fE,decode:yE,encodingLength:function(e){return e<bE?1:e<vE?2:e<wE?3:e<xE?4:e<SE?5:e<EE?6:e<AE?7:e<kE?8:e<OE?9:10}};const CE=(e,t,r=0)=>(TE.encode(e,t,r),t),IE=e=>TE.encodingLength(e),_E=(e,t)=>{const r=t.byteLength,n=IE(e),o=n+IE(r),i=new Uint8Array(o+r);return CE(e,i,0),CE(r,i,n),i.set(t,o),new PE(e,r,t,i)};class PE{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const RE=({name:e,code:t,encode:r})=>new NE(e,t,r);class NE{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?_E(this.code,t):t.then(e=>_E(this.code,e))}throw Error("Unknown type, must be binary type")}}const BE=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));RE({name:"sha2-256",code:18,encode:BE("SHA-256")}),RE({name:"sha2-512",code:19,encode:BE("SHA-512")});new TextEncoder,new TextDecoder;const jE={...IS,...PS,...NS,...jS,...US,...XS,...YS,...eE,...iE,...lE};function ME(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const LE=ME("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>(new TextEncoder).encode(e.substring(1))),UE=ME("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{const t=yS((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),DE={utf8:LE,"utf-8":LE,hex:jE.base16,latin1:UE,ascii:UE,binary:UE,...jE};function FE(e,t="utf8"){const r=DE[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):pS(globalThis.Buffer.from(e,"utf-8"))}function zE(e,t="utf8"){const r=DE[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}const qE={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var VE,HE,KE,WE,GE,XE,ZE,QE;function YE(){if(HE)return VE;HE=1;function e(e){return(4294967296+e).toString(16).substring(1)}return VE={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,function(e){return(e<16?"0":"")+e.toString(16)}).join("")},debugPrint:function(t,r,n){let o="\n"+t+" = ";for(let i=0;i<r.length;i+=2){if(32===n)o+=e(r[i]).toUpperCase(),o+=" ",o+=e(r[i+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);o+=e(r[i+1]).toUpperCase(),o+=e(r[i]).toUpperCase()}i%6==4?o+="\n"+new Array(t.length+4).join(" "):i<r.length-2&&(o+=" ")}console.log(o)},testSpeed:function(e,t,r){let n=(new Date).getTime();const o=new Uint8Array(t);for(let e=0;e<t;e++)o[e]=e%256;const i=(new Date).getTime();console.log("Generated random input in "+(i-n)+"ms"),n=i;for(let i=0;i<r;i++){const r=e(o),i=(new Date).getTime(),s=i-n;n=i,console.log("Hashed in "+s+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(s/1e3)*100)/100+" MB PER SECOND")}}},VE}var JE=function(){if(QE)return ZE;QE=1;const e=function(){if(WE)return KE;WE=1;const e=YE();function t(e,t,r){const n=e[t]+e[r];let o=e[t+1]+e[r+1];n>=4294967296&&o++,e[t]=n,e[t+1]=o}function r(e,t,r,n){let o=e[t]+r;r<0&&(o+=4294967296);let i=e[t+1]+n;o>=4294967296&&i++,e[t]=o,e[t+1]=i}function n(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,n,o,i,s,u){const l=c[s],f=c[s+1],d=c[u],h=c[u+1];t(a,e,n),r(a,e,l,f);let p=a[i]^a[e],y=a[i+1]^a[e+1];a[i]=y,a[i+1]=p,t(a,o,i),p=a[n]^a[o],y=a[n+1]^a[o+1],a[n]=p>>>24^y<<8,a[n+1]=y>>>24^p<<8,t(a,e,n),r(a,e,d,h),p=a[i]^a[e],y=a[i+1]^a[e+1],a[i]=p>>>16^y<<16,a[i+1]=y>>>16^p<<16,t(a,o,i),p=a[n]^a[o],y=a[n+1]^a[o+1],a[n]=y>>>31^p<<1,a[n+1]=p>>>31^y<<1}const i=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(function(e){return 2*e})),a=new Uint32Array(32),c=new Uint32Array(32);function u(e,t){let r=0;for(r=0;r<16;r++)a[r]=e.h[r],a[r+16]=i[r];for(a[24]=a[24]^e.t,a[25]=a[25]^e.t/4294967296,t&&(a[28]=~a[28],a[29]=~a[29]),r=0;r<32;r++)c[r]=n(e.b,4*r);for(r=0;r<12;r++)o(0,8,16,24,s[16*r+0],s[16*r+1]),o(2,10,18,26,s[16*r+2],s[16*r+3]),o(4,12,20,28,s[16*r+4],s[16*r+5]),o(6,14,22,30,s[16*r+6],s[16*r+7]),o(0,10,20,30,s[16*r+8],s[16*r+9]),o(2,12,22,24,s[16*r+10],s[16*r+11]),o(4,14,16,26,s[16*r+12],s[16*r+13]),o(6,8,18,28,s[16*r+14],s[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^a[r]^a[r+16]}const l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function f(e,t,r,o){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(o&&16!==o.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const s={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};l.fill(0),l[0]=e,t&&(l[1]=t.length),l[2]=1,l[3]=1,r&&l.set(r,32),o&&l.set(o,48);for(let e=0;e<16;e++)s.h[e]=i[e]^n(l,4*e);return t&&(d(s,t),s.c=128),s}function d(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,u(e,!1),e.c=0),e.b[e.c++]=t[r]}function h(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;u(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function p(t,r,n,o,i){n=n||64,t=e.normalizeInput(t),o&&(o=e.normalizeInput(o)),i&&(i=e.normalizeInput(i));const s=f(n,r,o,i);return d(s,t),h(s)}return KE={blake2b:p,blake2bHex:function(t,r,n,o,i){const s=p(t,r,n,o,i);return e.toHex(s)},blake2bInit:f,blake2bUpdate:d,blake2bFinal:h},KE}(),t=function(){if(XE)return GE;XE=1;const e=YE();function t(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function r(e,t,r,o,i,a){s[e]=s[e]+s[t]+i,s[o]=n(s[o]^s[e],16),s[r]=s[r]+s[o],s[t]=n(s[t]^s[r],12),s[e]=s[e]+s[t]+a,s[o]=n(s[o]^s[e],8),s[r]=s[r]+s[o],s[t]=n(s[t]^s[r],7)}function n(e,t){return e>>>t^e<<32-t}const o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),s=new Uint32Array(16),a=new Uint32Array(16);function c(e,n){let c=0;for(c=0;c<8;c++)s[c]=e.h[c],s[c+8]=o[c];for(s[12]^=e.t,s[13]^=e.t/4294967296,n&&(s[14]=~s[14]),c=0;c<16;c++)a[c]=t(e.b,4*c);for(c=0;c<10;c++)r(0,4,8,12,a[i[16*c+0]],a[i[16*c+1]]),r(1,5,9,13,a[i[16*c+2]],a[i[16*c+3]]),r(2,6,10,14,a[i[16*c+4]],a[i[16*c+5]]),r(3,7,11,15,a[i[16*c+6]],a[i[16*c+7]]),r(0,5,10,15,a[i[16*c+8]],a[i[16*c+9]]),r(1,6,11,12,a[i[16*c+10]],a[i[16*c+11]]),r(2,7,8,13,a[i[16*c+12]],a[i[16*c+13]]),r(3,4,9,14,a[i[16*c+14]],a[i[16*c+15]]);for(c=0;c<8;c++)e.h[c]^=s[c]^s[c+8]}function u(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const n={h:new Uint32Array(o),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(l(n,t),n.c=64),n}function l(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,c(e,!1),e.c=0),e.b[e.c++]=t[r]}function f(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;c(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function d(t,r,n){n=n||32,t=e.normalizeInput(t);const o=u(n,r);return l(o,t),f(o)}return GE={blake2s:d,blake2sHex:function(t,r,n){const o=d(t,r,n);return e.toHex(o)},blake2sInit:u,blake2sUpdate:l,blake2sFinal:f},GE}();return ZE={blake2b:e.blake2b,blake2bHex:e.blake2bHex,blake2bInit:e.blake2bInit,blake2bUpdate:e.blake2bUpdate,blake2bFinal:e.blake2bFinal,blake2s:t.blake2s,blake2sHex:t.blake2sHex,blake2sInit:t.blake2sInit,blake2sUpdate:t.blake2sUpdate,blake2sFinal:t.blake2sFinal}}();function $E(e){const[t,r]=e.split(":");return{namespace:t,reference:r}}function eA(e,t){return e.includes(":")?[e]:t.chains||[]}var tA=Object.defineProperty,rA=Object.defineProperties,nA=Object.getOwnPropertyDescriptors,oA=Object.getOwnPropertySymbols,iA=Object.prototype.hasOwnProperty,sA=Object.prototype.propertyIsEnumerable,aA=(e,t,r)=>t in e?tA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cA=(e,t)=>{for(var r in t||(t={}))iA.call(t,r)&&aA(e,r,t[r]);if(oA)for(var r of oA(t))sA.call(t,r)&&aA(e,r,t[r]);return e},uA=(e,t,r)=>aA(e,"symbol"!=typeof t?t+"":t,r);const lA="react-native",fA="node",dA="browser",hA="unknown",pA="js";function yA(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function gA(){return!Im.getDocument()&&!!Im.getNavigator()&&"ReactNative"===navigator.product}function mA(){return!yA()&&!!Im.getNavigator()&&!!Im.getDocument()}function bA(){return gA()?lA:yA()?fA:mA()?dA:hA}function vA(){var e;try{return gA()&&typeof global<"u"&&typeof(null==global?void 0:global.Application)<"u"?null==(e=global.Application)?void 0:e.applicationId:void 0}catch{return}}function wA(e){var t,r;const n=xA();try{return null!=e&&e.url&&n.url&&new URL(e.url).host!==new URL(n.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${n.url}. This is probably unintended and can lead to issues.`),e.url=n.url),null!=(t=e?.icons)&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(e=>""!==e)),((e,t)=>rA(e,nA(t)))(cA(cA({},n),e),{url:e?.url||n.url,name:e?.name||n.name,description:e?.description||n.description,icons:null!=(r=e?.icons)&&r.length&&e.icons.length>0?e.icons:n.icons})}catch(t){return console.warn("Error populating app metadata",t),e||n}}function xA(){return Pm.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function SA(e,t,r){const n=function(){if(bA()===lA&&typeof global<"u"&&typeof(null==global?void 0:global.Platform)<"u"){const{OS:e,Version:t}=global.Platform;return[e,t].join("-")}const e=Em();if(null===e)return"unknown";const t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}(),o=function(){var e;const t=bA();return t===dA?[t,(null==(e=Im.getLocation())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),[pA,r].join("-"),n,o].join("/")}function EA({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:o,projectId:i,useOnCloseEvent:s,bundleId:a,packageName:c}){const u=r.split("?"),l={auth:o,ua:SA(e,t,n),projectId:i,useOnCloseEvent:s||void 0,packageName:c||void 0,bundleId:a||void 0},f=function(e,t){const r=new URLSearchParams(e);return Object.entries(t).sort(([e],[t])=>e.localeCompare(t)).forEach(([e,t])=>{null!=t&&r.set(e,String(t))}),r.toString()}(u[1]||"",l);return u[0]+"?"+f}function AA(e,t){return e.filter(e=>t.includes(e)).length===e.length}function kA(e){return Object.fromEntries(e.entries())}function OA(e){return new Map(Object.entries(e))}function TA(e=fd.FIVE_MINUTES,t){const r=fd.toMiliseconds(e||fd.FIVE_MINUTES);let n,o,i,s;return{resolve:e=>{i&&n&&(clearTimeout(i),n(e),s=Promise.resolve(e))},reject:e=>{i&&o&&(clearTimeout(i),o(e))},done:()=>new Promise((e,a)=>{if(s)return e(s);i=setTimeout(()=>{const e=new Error(t);s=Promise.reject(e),a(e)},r),n=e,o=a})}}function CA(e,t,r){return new Promise(async(n,o)=>{const i=setTimeout(()=>o(new Error(r)),t);try{n(await e)}catch(e){o(e)}clearTimeout(i)})}function IA(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function _A(e){const[t,r]=e.split(":"),n={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)n.topic=r;else{if("id"!==t||!Number.isInteger(Number(r)))throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);n.id=Number(r)}return n}function PA(e,t){return fd.fromMiliseconds((t||Date.now())+fd.toMiliseconds(e))}function RA(e){return Date.now()>=fd.toMiliseconds(e)}function NA(e,t){return`${e}${t?`:${t}`:""}`}function BA(e=[],t=[]){return[...new Set([...e,...t])]}async function jA({id:e,topic:t,wcDeepLink:r}){var n;try{if(!r)return;const o="string"==typeof r?JSON.parse(r):r,i=o?.href;if("string"!=typeof i)return;const s=function(e,t,r){const n=`requestId=${t}&sessionTopic=${r}`;e.endsWith("/")&&(e=e.slice(0,-1));let o=`${e}`;if(e.startsWith("https://t.me")){o=`${o}${e.includes("?")?"&startapp=":"?startapp="}${function(e,t=!1){const r=Buffer.from(e).toString("base64");return t?r.replace(/[=]/g,""):r}(n,!0)}`}else o=`${o}/wc?${n}`;return o}(i,e,t),a=bA();if(a===dA){if(null==(n=Im.getDocument())||!n.hasFocus())return void console.warn("Document does not have focus, skipping deeplink.");!function(e){let t="_self";!function(){try{return window.self!==window.top}catch{return!1}}()?(typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)||e.startsWith("https://")||e.startsWith("http://"))&&(t="_blank"):t="_top",window.open(e,t,"noreferrer noopener")}(s)}else a===lA&&typeof(null==global?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(e){console.error(e)}}function MA(e,t){if(!e.includes(t))return null;const r=e.split(/([&,?,=])/),n=r.indexOf(t);return r[n+2]}function LA(){return typeof crypto<"u"&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function UA(){return typeof process<"u"&&"true"===process.env.IS_VITEST}function DA(e){return Buffer.from(e,"base64").toString("utf-8")}class FA{constructor({limit:e}){uA(this,"limit"),uA(this,"set"),this.limit=e,this.set=new Set}add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){const e=this.set.values().next().value;e&&this.set.delete(e)}this.set.add(e)}}has(e){return this.set.has(e)}}const zA=BigInt(2**32-1),qA=BigInt(32);function VA(e,t=!1){return t?{h:Number(e&zA),l:Number(e>>qA&zA)}:{h:0|Number(e>>qA&zA),l:0|Number(e&zA)}}function HA(e,t=!1){const r=e.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){const{h:r,l:s}=VA(e[i],t);[n[i],o[i]]=[r,s]}return[n,o]}const KA=(e,t,r)=>e>>>r,WA=(e,t,r)=>e<<32-r|t>>>r,GA=(e,t,r)=>e>>>r|t<<32-r,XA=(e,t,r)=>e<<32-r|t>>>r,ZA=(e,t,r)=>e<<64-r|t>>>r-32,QA=(e,t,r)=>e>>>r-32|t<<64-r,YA=(e,t)=>t,JA=(e,t)=>e;function $A(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}}const ek=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),tk=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,rk=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),nk=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,ok=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),ik=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,sk="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function ak(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function ck(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function uk(e,...t){if(!ak(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function lk(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");ck(e.outputLen),ck(e.blockLen)}function fk(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function dk(e,t){uk(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function hk(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function pk(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function yk(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function gk(e,t){return e<<32-t|e>>>t}const mk=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function bk(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const vk=mk?e=>e:e=>bk(e);const wk=mk?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=bk(e[t]);return e},xk="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,Sk=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ek(e){if(uk(e),xk)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=Sk[e[r]];return t}const Ak=48,kk=57,Ok=65,Tk=70,Ck=97,Ik=102;function _k(e){return e>=Ak&&e<=kk?e-Ak:e>=Ok&&e<=Tk?e-(Ok-10):e>=Ck&&e<=Ik?e-(Ck-10):void 0}function Pk(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(xk)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,o=0;t<r;t++,o+=2){const r=_k(e.charCodeAt(o)),i=_k(e.charCodeAt(o+1));if(void 0===r||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}n[t]=16*r+i}return n}function Rk(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function Nk(e){return"string"==typeof e&&(e=Rk(e)),uk(e),e}function Bk(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];uk(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}class jk{}function Mk(e){const t=t=>e().update(Nk(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Lk(e=32){if(sk&&"function"==typeof sk.getRandomValues)return sk.getRandomValues(new Uint8Array(e));if(sk&&"function"==typeof sk.randomBytes)return Uint8Array.from(sk.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const Uk=BigInt(0),Dk=BigInt(1),Fk=BigInt(2),zk=BigInt(7),qk=BigInt(256),Vk=BigInt(113),Hk=[],Kk=[],Wk=[];for(let e=0,t=Dk,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Hk.push(2*(5*n+r)),Kk.push((e+1)*(e+2)/2%64);let o=Uk;for(let e=0;e<7;e++)t=(t<<Dk^(t>>zk)*Vk)%qk,t&Fk&&(o^=Dk<<(Dk<<BigInt(e))-Dk);Wk.push(o)}const Gk=HA(Wk,!0),Xk=Gk[0],Zk=Gk[1],Qk=(e,t,r)=>r>32?((e,t,r)=>t<<r-32|e>>>64-r)(e,t,r):((e,t,r)=>e<<r|t>>>32-r)(e,t,r),Yk=(e,t,r)=>r>32?((e,t,r)=>e<<r-32|t>>>64-r)(e,t,r):((e,t,r)=>t<<r|e>>>32-r)(e,t,r);class Jk extends jk{constructor(e,t,r,n=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=o,ck(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=hk(this.state)}clone(){return this._cloneInto()}keccak(){wk(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,o=(t+2)%10,i=r[o],s=r[o+1],a=Qk(i,s,1)^r[n],c=Yk(i,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],o=e[3];for(let r=0;r<24;r++){const n=Kk[r],i=Qk(t,o,n),s=Yk(t,o,n),a=Hk[r];t=e[a],o=e[a+1],e[a]=i,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=Xk[n],e[1]^=Zk[n]}pk(r)}(this.state32,this.rounds),wk(this.state32),this.posOut=0,this.pos=0}update(e){fk(this),uk(e=Nk(e));const{blockLen:t,state:r}=this,n=e.length;for(let o=0;o<n;){const i=Math.min(t-this.pos,n-o);for(let t=0;t<i;t++)r[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,!!(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){fk(this,!1),uk(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,o=e.length;n<o;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ck(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(dk(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,pk(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:o,enableXOF:i}=this;return e||(e=new Jk(t,r,n,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}const $k=((e,t,r)=>Mk(()=>new Jk(t,e,r)))(1,136,32);function eO(e,t,r){return e&t^~e&r}function tO(e,t,r){return e&t^e&r^t&r}class rO extends jk{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=yk(this.buffer)}update(e){fk(this),uk(e=Nk(e));const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let i=0;i<o;){const s=Math.min(n-this.pos,o-i);if(s===n){const t=yk(e);for(;n<=o-i;i+=n)this.process(t,i);continue}r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){fk(this),dk(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:i}=this;t[i++]=128,pk(this.buffer.subarray(i)),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)})(r,n-8,BigInt(8*this.length),o),this.process(r,0);const s=yk(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,u[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const nO=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),oO=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),iO=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),sO=Uint32Array.from([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]),aO=new Uint32Array(64);class cO extends rO{constructor(e=32){super(64,e,8,!1),this.A=0|nO[0],this.B=0|nO[1],this.C=0|nO[2],this.D=0|nO[3],this.E=0|nO[4],this.F=0|nO[5],this.G=0|nO[6],this.H=0|nO[7]}get(){const{A:e,B:t,C:r,D:n,E:o,F:i,G:s,H:a}=this;return[e,t,r,n,o,i,s,a]}set(e,t,r,n,o,i,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)aO[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=aO[e-15],r=aO[e-2],n=gk(t,7)^gk(t,18)^t>>>3,o=gk(r,17)^gk(r,19)^r>>>10;aO[e]=o+aO[e-7]+n+aO[e-16]|0}let{A:r,B:n,C:o,D:i,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(gk(s,6)^gk(s,11)^gk(s,25))+eO(s,a,c)+sO[e]+aO[e]|0,l=(gk(r,2)^gk(r,13)^gk(r,22))+tO(r,n,o)|0;u=c,c=a,a=s,s=i+t|0,i=o,o=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,i=i+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,o,i,s,a,c,u)}roundClean(){pk(aO)}destroy(){this.set(0,0,0,0,0,0,0,0),pk(this.buffer)}}const uO=HA(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),lO=uO[0],fO=uO[1],dO=new Uint32Array(80),hO=new Uint32Array(80);class pO extends rO{constructor(e=64){super(128,e,16,!1),this.Ah=0|iO[0],this.Al=0|iO[1],this.Bh=0|iO[2],this.Bl=0|iO[3],this.Ch=0|iO[4],this.Cl=0|iO[5],this.Dh=0|iO[6],this.Dl=0|iO[7],this.Eh=0|iO[8],this.El=0|iO[9],this.Fh=0|iO[10],this.Fl=0|iO[11],this.Gh=0|iO[12],this.Gl=0|iO[13],this.Hh=0|iO[14],this.Hl=0|iO[15]}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:o,Cl:i,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:f,Gh:d,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,o,i,s,a,c,u,l,f,d,h,p,y]}set(e,t,r,n,o,i,s,a,c,u,l,f,d,h,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|i,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|f,this.Gh=0|d,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)dO[r]=e.getUint32(t),hO[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|dO[e-15],r=0|hO[e-15],n=GA(t,r,1)^GA(t,r,8)^KA(t,0,7),o=XA(t,r,1)^XA(t,r,8)^WA(t,r,7),i=0|dO[e-2],s=0|hO[e-2],a=GA(i,s,19)^ZA(i,s,61)^KA(i,0,6),c=XA(i,s,19)^QA(i,s,61)^WA(i,s,6),u=rk(o,c,hO[e-7],hO[e-16]),l=nk(u,n,a,dO[e-7],dO[e-16]);dO[e]=0|l,hO[e]=0|u}let{Ah:r,Al:n,Bh:o,Bl:i,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:f,Fh:d,Fl:h,Gh:p,Gl:y,Hh:g,Hl:m}=this;for(let e=0;e<80;e++){const t=GA(l,f,14)^GA(l,f,18)^ZA(l,f,41),b=XA(l,f,14)^XA(l,f,18)^QA(l,f,41),v=l&d^~l&p,w=ok(m,b,f&h^~f&y,fO[e],hO[e]),x=ik(w,g,t,v,lO[e],dO[e]),S=0|w,E=GA(r,n,28)^ZA(r,n,34)^ZA(r,n,39),A=XA(r,n,28)^QA(r,n,34)^QA(r,n,39),k=r&o^r&s^o&s,O=n&i^n&a^i&a;g=0|p,m=0|y,p=0|d,y=0|h,d=0|l,h=0|f,({h:l,l:f}=$A(0|c,0|u,0|x,0|S)),c=0|s,u=0|a,s=0|o,a=0|i,o=0|r,i=0|n;const T=ek(S,A,O);r=tk(T,x,E,k),n=0|T}({h:r,l:n}=$A(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:i}=$A(0|this.Bh,0|this.Bl,0|o,0|i)),({h:s,l:a}=$A(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=$A(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:f}=$A(0|this.Eh,0|this.El,0|l,0|f)),({h:d,l:h}=$A(0|this.Fh,0|this.Fl,0|d,0|h)),({h:p,l:y}=$A(0|this.Gh,0|this.Gl,0|p,0|y)),({h:g,l:m}=$A(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(r,n,o,i,s,a,c,u,l,f,d,h,p,y,g,m)}roundClean(){pk(dO,hO)}destroy(){pk(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class yO extends pO{constructor(){super(48),this.Ah=0|oO[0],this.Al=0|oO[1],this.Bh=0|oO[2],this.Bl=0|oO[3],this.Ch=0|oO[4],this.Cl=0|oO[5],this.Dh=0|oO[6],this.Dl=0|oO[7],this.Eh=0|oO[8],this.El=0|oO[9],this.Fh=0|oO[10],this.Fl=0|oO[11],this.Gh=0|oO[12],this.Gl=0|oO[13],this.Hh=0|oO[14],this.Hl=0|oO[15]}}const gO=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class mO extends pO{constructor(){super(32),this.Ah=0|gO[0],this.Al=0|gO[1],this.Bh=0|gO[2],this.Bl=0|gO[3],this.Ch=0|gO[4],this.Cl=0|gO[5],this.Dh=0|gO[6],this.Dl=0|gO[7],this.Eh=0|gO[8],this.El=0|gO[9],this.Fh=0|gO[10],this.Fl=0|gO[11],this.Gh=0|gO[12],this.Gl=0|gO[13],this.Hh=0|gO[14],this.Hl=0|gO[15]}}const bO=Mk(()=>new cO),vO=Mk(()=>new pO),wO=Mk(()=>new yO),xO=Mk(()=>new mO),SO=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),EO=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),AO=new Uint32Array(32);function kO(e,t,r,n,o,i){const s=o[i],a=o[i+1];let c=AO[2*e],u=AO[2*e+1],l=AO[2*t],f=AO[2*t+1],d=AO[2*r],h=AO[2*r+1],p=AO[2*n],y=AO[2*n+1],g=ek(c,l,s);u=tk(g,u,f,a),c=0|g,({Dh:y,Dl:p}={Dh:y^u,Dl:p^c}),({Dh:y,Dl:p}={Dh:YA(0,p),Dl:JA(y)}),({h:h,l:d}=$A(h,d,y,p)),({Bh:f,Bl:l}={Bh:f^h,Bl:l^d}),({Bh:f,Bl:l}={Bh:GA(f,l,24),Bl:XA(f,l,24)}),AO[2*e]=c,AO[2*e+1]=u,AO[2*t]=l,AO[2*t+1]=f,AO[2*r]=d,AO[2*r+1]=h,AO[2*n]=p,AO[2*n+1]=y}function OO(e,t,r,n,o,i){const s=o[i],a=o[i+1];let c=AO[2*e],u=AO[2*e+1],l=AO[2*t],f=AO[2*t+1],d=AO[2*r],h=AO[2*r+1],p=AO[2*n],y=AO[2*n+1],g=ek(c,l,s);u=tk(g,u,f,a),c=0|g,({Dh:y,Dl:p}={Dh:y^u,Dl:p^c}),({Dh:y,Dl:p}={Dh:GA(y,p,16),Dl:XA(y,p,16)}),({h:h,l:d}=$A(h,d,y,p)),({Bh:f,Bl:l}={Bh:f^h,Bl:l^d}),({Bh:f,Bl:l}={Bh:ZA(f,l,63),Bl:QA(f,l,63)}),AO[2*e]=c,AO[2*e+1]=u,AO[2*t]=l,AO[2*t+1]=f,AO[2*r]=d,AO[2*r+1]=h,AO[2*n]=p,AO[2*n+1]=y}class TO extends jk{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,ck(e),ck(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=hk(this.buffer)}update(e){fk(this),uk(e=Nk(e));const{blockLen:t,buffer:r,buffer32:n}=this,o=e.length,i=e.byteOffset,s=e.buffer;for(let a=0;a<o;){this.pos===t&&(wk(n),this.compress(n,0,!1),wk(n),this.pos=0);const c=Math.min(t-this.pos,o-a),u=i+a;if(c===t&&!(u%4)&&a+c<o){const e=new Uint32Array(s,u,Math.floor((o-a)/4));wk(e);for(let r=0;a+t<o;r+=n.length,a+=t)this.length+=t,this.compress(e,r,!1);wk(e);continue}r.set(e.subarray(a,a+c),this.pos),this.pos+=c,this.length+=c,a+=c}return this}digestInto(e){fk(this),dk(e,this);const{pos:t,buffer32:r}=this;this.finished=!0,pk(this.buffer.subarray(t)),wk(r),this.compress(r,0,!0),wk(r);const n=hk(e);this.get().forEach((e,t)=>n[t]=vk(e))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){const{buffer:t,length:r,finished:n,destroyed:o,outputLen:i,pos:s}=this;return e||(e=new this.constructor({dkLen:i})),e.set(...this.get()),e.buffer.set(t),e.destroyed=o,e.finished=n,e.length=r,e.pos=s,e.outputLen=i,e}clone(){return this._cloneInto()}}class CO extends TO{constructor(e={}){const t=void 0===e.dkLen?64:e.dkLen;super(128,t),this.v0l=0|EO[0],this.v0h=0|EO[1],this.v1l=0|EO[2],this.v1h=0|EO[3],this.v2l=0|EO[4],this.v2h=0|EO[5],this.v3l=0|EO[6],this.v3h=0|EO[7],this.v4l=0|EO[8],this.v4h=0|EO[9],this.v5l=0|EO[10],this.v5h=0|EO[11],this.v6l=0|EO[12],this.v6h=0|EO[13],this.v7l=0|EO[14],this.v7h=0|EO[15],function(e,t={},r,n,o){if(ck(r),e<0||e>r)throw new Error("outputLen bigger than keyLen");const{key:i,salt:s,personalization:a}=t;if(void 0!==i&&(i.length<1||i.length>r))throw new Error("key length must be undefined or 1.."+r);if(void 0!==s&&s.length!==n)throw new Error("salt must be undefined or "+n);if(void 0!==a&&a.length!==o)throw new Error("personalization must be undefined or "+o)}(t,e,64,16,16);let{key:r,personalization:n,salt:o}=e,i=0;if(void 0!==r&&(r=Nk(r),i=r.length),this.v0l^=this.outputLen|i<<8|65536|1<<24,void 0!==o){o=Nk(o);const e=hk(o);this.v4l^=vk(e[0]),this.v4h^=vk(e[1]),this.v5l^=vk(e[2]),this.v5h^=vk(e[3])}if(void 0!==n){n=Nk(n);const e=hk(n);this.v6l^=vk(e[0]),this.v6h^=vk(e[1]),this.v7l^=vk(e[2]),this.v7h^=vk(e[3])}if(void 0!==r){const e=new Uint8Array(this.blockLen);e.set(r),this.update(e)}}get(){let{v0l:e,v0h:t,v1l:r,v1h:n,v2l:o,v2h:i,v3l:s,v3h:a,v4l:c,v4h:u,v5l:l,v5h:f,v6l:d,v6h:h,v7l:p,v7h:y}=this;return[e,t,r,n,o,i,s,a,c,u,l,f,d,h,p,y]}set(e,t,r,n,o,i,s,a,c,u,l,f,d,h,p,y){this.v0l=0|e,this.v0h=0|t,this.v1l=0|r,this.v1h=0|n,this.v2l=0|o,this.v2h=0|i,this.v3l=0|s,this.v3h=0|a,this.v4l=0|c,this.v4h=0|u,this.v5l=0|l,this.v5h=0|f,this.v6l=0|d,this.v6h=0|h,this.v7l=0|p,this.v7h=0|y}compress(e,t,r){this.get().forEach((e,t)=>AO[t]=e),AO.set(EO,16);let{h:n,l:o}=VA(BigInt(this.length));AO[24]=EO[8]^o,AO[25]=EO[9]^n,r&&(AO[28]=~AO[28],AO[29]=~AO[29]);let i=0;const s=SO;for(let r=0;r<12;r++)kO(0,4,8,12,e,t+2*s[i++]),OO(0,4,8,12,e,t+2*s[i++]),kO(1,5,9,13,e,t+2*s[i++]),OO(1,5,9,13,e,t+2*s[i++]),kO(2,6,10,14,e,t+2*s[i++]),OO(2,6,10,14,e,t+2*s[i++]),kO(3,7,11,15,e,t+2*s[i++]),OO(3,7,11,15,e,t+2*s[i++]),kO(0,5,10,15,e,t+2*s[i++]),OO(0,5,10,15,e,t+2*s[i++]),kO(1,6,11,12,e,t+2*s[i++]),OO(1,6,11,12,e,t+2*s[i++]),kO(2,7,8,13,e,t+2*s[i++]),OO(2,7,8,13,e,t+2*s[i++]),kO(3,4,9,14,e,t+2*s[i++]),OO(3,4,9,14,e,t+2*s[i++]);this.v0l^=AO[0]^AO[16],this.v0h^=AO[1]^AO[17],this.v1l^=AO[2]^AO[18],this.v1h^=AO[3]^AO[19],this.v2l^=AO[4]^AO[20],this.v2h^=AO[5]^AO[21],this.v3l^=AO[6]^AO[22],this.v3h^=AO[7]^AO[23],this.v4l^=AO[8]^AO[24],this.v4h^=AO[9]^AO[25],this.v5l^=AO[10]^AO[26],this.v5h^=AO[11]^AO[27],this.v6l^=AO[12]^AO[28],this.v6h^=AO[13]^AO[29],this.v7l^=AO[14]^AO[30],this.v7h^=AO[15]^AO[31],pk(AO)}destroy(){this.destroyed=!0,pk(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const IO=function(e){const t=(t,r)=>e(r).update(Nk(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new CO(e)),_O="https://rpc.walletconnect.org/v1";function PO(e){const t=`Ethereum Signed Message:\n${e.length}`,r=(new TextEncoder).encode(t+e);return"0x"+Buffer.from($k(r)).toString("hex")}async function RO(e,t,r,n,o,i){switch(r.t){case"eip191":return await async function(e,t,r){return(await async function({hash:e,signature:t}){return ev(await tv({hash:e,signature:t}))}({hash:PO(t),signature:r})).toLowerCase()===e.toLowerCase()}(e,t,r.s);case"eip1271":return await async function(e,t,r,n,o,i){const s=$E(n);if(!s.namespace||!s.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const s="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",c=r.substring(2),u=(c.length/2).toString(16).padStart(64,"0"),l=s+(t.startsWith("0x")?t:PO(t)).substring(2)+a+u+c,f=await fetch(`${i||_O}/?chainId=${n}&projectId=${o}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:NO(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:l},"latest"]})}),{result:d}=await f.json();return!!d&&d.slice(0,s.length).toLowerCase()===s.toLowerCase()}catch(e){return console.error("isValidEip1271Signature: ",e),!1}}(e,t,r.s,n,o,i);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function NO(){return Date.now()+Math.floor(1e3*Math.random())}function BO(e){const t=new Uint8Array(Buffer.from(e,"base64")),r=Array.from("TransactionData::").map(e=>e.charCodeAt(0)),n=new Uint8Array(r.length+t.length);n.set(r),n.set(t,r.length);const o=IO(n,{dkLen:32});return px.encode(o)}function jO(e){const t=new Uint8Array(bO(function(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if("object"==typeof e&&null!=e&&e.data)return new Uint8Array(Object.values(e.data));if("object"==typeof e&&e)return new Uint8Array(Object.values(e));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}(e)));return px.encode(t)}function MO(e){const t=function(e,t){return new Dx(t).decode(e)}(Buffer.from(e,"base64")).txn;if(!t)throw new Error("Invalid signed transaction: missing 'txn' field");const r=(s=t,new Cx(a).encodeSharedRef(s)),n=Buffer.from("TX"),o=Buffer.concat([n,Buffer.from(r)]),i=xO(o);var s,a;return sS.encode(i).replace(/=+$/,"")}function LO(e){const t=[];let r=BigInt(e);for(;r>=BigInt(128);)t.push(Number(r&BigInt(127)|BigInt(128))),r>>=BigInt(7);return t.push(Number(r)),Buffer.from(t)}function UO(e){const t=Buffer.from(e.signed.bodyBytes,"base64"),r=Buffer.from(e.signed.authInfoBytes,"base64"),n=Buffer.from(e.signature.signature,"base64"),o=[];o.push(Buffer.from([10])),o.push(LO(t.length)),o.push(t),o.push(Buffer.from([18])),o.push(LO(r.length)),o.push(r),o.push(Buffer.from([26])),o.push(LO(n.length)),o.push(n);const i=Buffer.concat(o),s=bO(i);return Buffer.from(s).toString("hex").toUpperCase()}var DO=Object.defineProperty,FO=Object.defineProperties,zO=Object.getOwnPropertyDescriptors,qO=Object.getOwnPropertySymbols,VO=Object.prototype.hasOwnProperty,HO=Object.prototype.propertyIsEnumerable,KO=(e,t,r)=>t in e?DO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const WO=e=>e?.split(":"),GO=e=>{const t=e&&WO(e);if(t)return t[2]+":"+t[3]},XO=e=>{const t=e&&WO(e);if(t)return t.pop()};async function ZO(e){const{cacao:t,projectId:r}=e,{s:n,p:o}=t,i=QO(o,o.iss),s=XO(o.iss);return await RO(s,i,n,GO(o.iss),r)}const QO=(e,t)=>{const r=`${e.domain} wants you to sign in with your Ethereum account:`,n=XO(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let o=e.statement||void 0;const i=`URI: ${e.aud||e.uri}`,s=`Version: ${e.version}`,a=`Chain ID: ${(e=>{const t=e&&WO(e);if(t)return e.includes("did:pkh:")?t[3]:t[1]})(t)}`,c=`Nonce: ${e.nonce}`,u=`Issued At: ${e.iat}`,l=e.exp?`Expiration Time: ${e.exp}`:void 0,f=e.nbf?`Not Before: ${e.nbf}`:void 0,d=e.requestId?`Request ID: ${e.requestId}`:void 0,h=e.resources?`Resources:${e.resources.map(e=>`\n- ${e}`).join("")}`:void 0,p=iT(e.resources);if(p){o=function(e="",t){YO(t);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;const n=[];let o=0;Object.keys(t.att).forEach(e=>{const r=Object.keys(t.att[e]).map(e=>({ability:e.split("/")[0],action:e.split("/")[1]}));r.sort((e,t)=>e.action.localeCompare(t.action));const i={};r.forEach(e=>{i[e.ability]||(i[e.ability]=[]),i[e.ability].push(e.action)});const s=Object.keys(i).map(t=>(o++,`(${o}) '${t}': '${i[t].join("', '")}' for '${e}'.`));n.push(s.join(", ").replace(".,","."))});const i=n.join(" "),s=`${r}${i}`;return`${e?e+" ":""}${s}`}(o,eT(p))}return[r,n,"",o,"",i,s,a,c,u,l,f,d,h].filter(e=>null!=e).join("\n")};function YO(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");const t=Object.keys(e.att);if(null==t||!t.length)throw new Error("No resources found in `att` property");t.forEach(t=>{const r=e.att[t];if(Array.isArray(r))throw new Error(`Resource must be an object: ${t}`);if("object"!=typeof r)throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${t}`);Object.keys(r).forEach(e=>{const t=r[e];if(!Array.isArray(t))throw new Error(`Ability limits ${e} must be an array of objects, found: ${t}`);if(!t.length)throw new Error(`Value of ${e} is empty array, must be an array with objects`);t.forEach(t=>{if("object"!=typeof t)throw new Error(`Ability limits (${e}) must be an array of objects, found: ${t}`)})})})}function JO(e,t,r={}){t=t?.sort((e,t)=>e.localeCompare(t));const n=t.map(t=>({[`${e}/${t}`]:[r]}));return Object.assign({},...n)}function $O(e){return YO(e),`urn:recap:${function(e){return Buffer.from(JSON.stringify(e)).toString("base64")}(e).replace(/=/g,"")}`}function eT(e){const t=function(e){return JSON.parse(Buffer.from(e,"base64").toString("utf-8"))}(e.replace("urn:recap:",""));return YO(t),t}function tT(e,t,r){const n=function(e,t,r,n={}){return r?.sort((e,t)=>e.localeCompare(t)),{att:{[e]:JO(t,r,n)}}}(e,t,r);return $O(n)}function rT(e,t){const r=function(e,t){YO(e),YO(t);const r=Object.keys(e.att).concat(Object.keys(t.att)).sort((e,t)=>e.localeCompare(t)),n={att:{}};return r.forEach(r=>{var o,i;Object.keys((null==(o=e.att)?void 0:o[r])||{}).concat(Object.keys((null==(i=t.att)?void 0:i[r])||{})).sort((e,t)=>e.localeCompare(t)).forEach(o=>{var i,s;n.att[r]=((e,t)=>FO(e,zO(t)))(((e,t)=>{for(var r in t||(t={}))VO.call(t,r)&&KO(e,r,t[r]);if(qO)for(var r of qO(t))HO.call(t,r)&&KO(e,r,t[r]);return e})({},n.att[r]),{[o]:(null==(i=e.att[r])?void 0:i[o])||(null==(s=t.att[r])?void 0:s[o])})})}),n}(eT(e),eT(t));return $O(r)}function nT(e){var t;const r=eT(e);YO(r);const n=null==(t=r.att)?void 0:t.eip155;return n?Object.keys(n).map(e=>e.split("/")[1]):[]}function oT(e){const t=eT(e);YO(t);const r=[];return Object.values(t.att).forEach(e=>{Object.values(e).forEach(e=>{var t;null!=(t=e?.[0])&&t.chains&&r.push(e[0].chains)})}),[...new Set(r.flat())]}function iT(e){if(!e)return;const t=e?.[e.length-1];return function(e){return e&&e.includes("urn:recap:")}(t)?t:void 0}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function sT(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function aT(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function cT(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function uT(e,...t){if(!sT(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function lT(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function fT(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function dT(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const hT=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function pT(e){if("string"==typeof e)e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!sT(e))throw new Error("Uint8Array expected, got "+typeof e);e=bT(e)}return e}function yT(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw new Error("invalid output length, expected "+e+", got: "+t.length);if(r&&!function(e){return e.byteOffset%4==0}(t))throw new Error("invalid output, must be aligned");return t}function gT(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}function mT(e,t,r){aT(r);const n=new Uint8Array(16),o=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}(n);return gT(o,0,BigInt(t),r),gT(o,8,BigInt(e),r),n}function bT(e){return Uint8Array.from(e)}const vT=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),wT=vT("expand 16-byte k"),xT=vT("expand 32-byte k"),ST=fT(wT),ET=fT(xT);function AT(e,t){return e<<t|e>>>32-t}function kT(e){return e.byteOffset%4==0}const OT=2**32-1,TT=new Uint32Array;const CT=(e,t)=>255&e[t++]|(255&e[t++])<<8;class IT{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,uT(e=pT(e),32);const t=CT(e,0),r=CT(e,2),n=CT(e,4),o=CT(e,6),i=CT(e,8),s=CT(e,10),a=CT(e,12),c=CT(e,14);this.r[0]=8191&t,this.r[1]=8191&(t>>>13|r<<3),this.r[2]=7939&(r>>>10|n<<6),this.r[3]=8191&(n>>>7|o<<9),this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,this.r[6]=8191&(i>>>14|s<<2),this.r[7]=8065&(s>>>11|a<<5),this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127;for(let t=0;t<8;t++)this.pad[t]=CT(e,16+2*t)}process(e,t,r=!1){const n=r?0:2048,{h:o,r:i}=this,s=i[0],a=i[1],c=i[2],u=i[3],l=i[4],f=i[5],d=i[6],h=i[7],p=i[8],y=i[9],g=CT(e,t+0),m=CT(e,t+2),b=CT(e,t+4),v=CT(e,t+6),w=CT(e,t+8),x=CT(e,t+10),S=CT(e,t+12),E=CT(e,t+14);let A=o[0]+(8191&g),k=o[1]+(8191&(g>>>13|m<<3)),O=o[2]+(8191&(m>>>10|b<<6)),T=o[3]+(8191&(b>>>7|v<<9)),C=o[4]+(8191&(v>>>4|w<<12)),I=o[5]+(w>>>1&8191),_=o[6]+(8191&(w>>>14|x<<2)),P=o[7]+(8191&(x>>>11|S<<5)),R=o[8]+(8191&(S>>>8|E<<8)),N=o[9]+(E>>>5|n),B=0,j=B+A*s+k*(5*y)+O*(5*p)+T*(5*h)+C*(5*d);B=j>>>13,j&=8191,j+=I*(5*f)+_*(5*l)+P*(5*u)+R*(5*c)+N*(5*a),B+=j>>>13,j&=8191;let M=B+A*a+k*s+O*(5*y)+T*(5*p)+C*(5*h);B=M>>>13,M&=8191,M+=I*(5*d)+_*(5*f)+P*(5*l)+R*(5*u)+N*(5*c),B+=M>>>13,M&=8191;let L=B+A*c+k*a+O*s+T*(5*y)+C*(5*p);B=L>>>13,L&=8191,L+=I*(5*h)+_*(5*d)+P*(5*f)+R*(5*l)+N*(5*u),B+=L>>>13,L&=8191;let U=B+A*u+k*c+O*a+T*s+C*(5*y);B=U>>>13,U&=8191,U+=I*(5*p)+_*(5*h)+P*(5*d)+R*(5*f)+N*(5*l),B+=U>>>13,U&=8191;let D=B+A*l+k*u+O*c+T*a+C*s;B=D>>>13,D&=8191,D+=I*(5*y)+_*(5*p)+P*(5*h)+R*(5*d)+N*(5*f),B+=D>>>13,D&=8191;let F=B+A*f+k*l+O*u+T*c+C*a;B=F>>>13,F&=8191,F+=I*s+_*(5*y)+P*(5*p)+R*(5*h)+N*(5*d),B+=F>>>13,F&=8191;let z=B+A*d+k*f+O*l+T*u+C*c;B=z>>>13,z&=8191,z+=I*a+_*s+P*(5*y)+R*(5*p)+N*(5*h),B+=z>>>13,z&=8191;let q=B+A*h+k*d+O*f+T*l+C*u;B=q>>>13,q&=8191,q+=I*c+_*a+P*s+R*(5*y)+N*(5*p),B+=q>>>13,q&=8191;let V=B+A*p+k*h+O*d+T*f+C*l;B=V>>>13,V&=8191,V+=I*u+_*c+P*a+R*s+N*(5*y),B+=V>>>13,V&=8191;let H=B+A*y+k*p+O*h+T*d+C*f;B=H>>>13,H&=8191,H+=I*l+_*u+P*c+R*a+N*s,B+=H>>>13,H&=8191,B=(B<<2)+B|0,B=B+j|0,j=8191&B,B>>>=13,M+=B,o[0]=j,o[1]=M,o[2]=L,o[3]=U,o[4]=D,o[5]=F,o[6]=z,o[7]=q,o[8]=V,o[9]=H}finalize(){const{h:e,pad:t}=this,r=new Uint16Array(10);let n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let o=(1^n)-1;for(let e=0;e<10;e++)r[e]&=o;o=~o;for(let t=0;t<10;t++)e[t]=e[t]&o|r[t];e[0]=65535&(e[0]|e[1]<<13),e[1]=65535&(e[1]>>>3|e[2]<<10),e[2]=65535&(e[2]>>>6|e[3]<<7),e[3]=65535&(e[3]>>>9|e[4]<<4),e[4]=65535&(e[4]>>>12|e[5]<<1|e[6]<<14),e[5]=65535&(e[6]>>>2|e[7]<<11),e[6]=65535&(e[7]>>>5|e[8]<<8),e[7]=65535&(e[8]>>>8|e[9]<<5);let i=e[0]+t[0];e[0]=65535&i;for(let r=1;r<8;r++)i=(e[r]+t[r]|0)+(i>>>16)|0,e[r]=65535&i;dT(r)}update(e){lT(this),uT(e=pT(e));const{buffer:t,blockLen:r}=this,n=e.length;for(let o=0;o<n;){const i=Math.min(r-this.pos,n-o);if(i!==r)t.set(e.subarray(o,o+i),this.pos),this.pos+=i,o+=i,this.pos===r&&(this.process(t,0,!1),this.pos=0);else for(;r<=n-o;o+=r)this.process(e,o)}return this}destroy(){dT(this.h,this.r,this.buffer,this.pad)}digestInto(e){lT(this),function(e,t){uT(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,h:r}=this;let{pos:n}=this;if(n){for(t[n++]=1;n<16;n++)t[n]=0;this.process(t,0,!0)}this.finalize();let o=0;for(let t=0;t<8;t++)e[o++]=r[t]>>>0,e[o++]=r[t]>>>8;return e}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}}const _T=function(e){const t=(t,r)=>e(r).update(pT(t)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new IT(e));const PT=function(e,t){const{allowShortKeys:r,extendNonceFn:n,counterLength:o,counterRight:i,rounds:s}=function(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw new Error("core must be a function");return cT(o),cT(s),aT(i),aT(r),(t,a,c,u,l=0)=>{uT(t),uT(a),uT(c);const f=c.length;if(void 0===u&&(u=new Uint8Array(f)),uT(u),cT(l),l<0||l>=OT)throw new Error("arx: counter overflow");if(u.length<f)throw new Error(`arx: output (${u.length}) is shorter than data (${f})`);const d=[];let h,p,y=t.length;if(32===y)d.push(h=bT(t)),p=ET;else{if(16!==y||!r)throw new Error(`arx: invalid 32-byte key, got length=${y}`);h=new Uint8Array(32),h.set(t),h.set(t,16),p=ST,d.push(h)}kT(a)||d.push(a=bT(a));const g=fT(h);if(n){if(24!==a.length)throw new Error("arx: extended nonce must be 24 bytes");n(p,g,fT(a.subarray(0,16)),g),a=a.subarray(16)}const m=16-o;if(m!==a.length)throw new Error(`arx: nonce must be ${m} or 16 bytes`);if(12!==m){const e=new Uint8Array(12);e.set(a,i?0:12-a.length),a=e,d.push(a)}const b=fT(a);return function(e,t,r,n,o,i,s,a){const c=o.length,u=new Uint8Array(64),l=fT(u),f=kT(o)&&kT(i),d=f?fT(o):TT,h=f?fT(i):TT;for(let p=0;p<c;s++){if(e(t,r,n,l,s,a),s>=OT)throw new Error("arx: counter overflow");const y=Math.min(64,c-p);if(f&&64===y){const e=p/4;if(p%4!=0)throw new Error("arx: invalid block position");for(let t,r=0;r<16;r++)t=e+r,h[t]=d[t]^l[r];p+=64;continue}for(let e,t=0;t<y;t++)e=p+t,i[e]=o[e]^u[t];p+=y}}(e,p,g,b,c,u,l,s),dT(...d),u}}(function(e,t,r,n,o,i=20){let s=e[0],a=e[1],c=e[2],u=e[3],l=t[0],f=t[1],d=t[2],h=t[3],p=t[4],y=t[5],g=t[6],m=t[7],b=o,v=r[0],w=r[1],x=r[2],S=s,E=a,A=c,k=u,O=l,T=f,C=d,I=h,_=p,P=y,R=g,N=m,B=b,j=v,M=w,L=x;for(let e=0;e<i;e+=2)S=S+O|0,B=AT(B^S,16),_=_+B|0,O=AT(O^_,12),S=S+O|0,B=AT(B^S,8),_=_+B|0,O=AT(O^_,7),E=E+T|0,j=AT(j^E,16),P=P+j|0,T=AT(T^P,12),E=E+T|0,j=AT(j^E,8),P=P+j|0,T=AT(T^P,7),A=A+C|0,M=AT(M^A,16),R=R+M|0,C=AT(C^R,12),A=A+C|0,M=AT(M^A,8),R=R+M|0,C=AT(C^R,7),k=k+I|0,L=AT(L^k,16),N=N+L|0,I=AT(I^N,12),k=k+I|0,L=AT(L^k,8),N=N+L|0,I=AT(I^N,7),S=S+T|0,L=AT(L^S,16),R=R+L|0,T=AT(T^R,12),S=S+T|0,L=AT(L^S,8),R=R+L|0,T=AT(T^R,7),E=E+C|0,B=AT(B^E,16),N=N+B|0,C=AT(C^N,12),E=E+C|0,B=AT(B^E,8),N=N+B|0,C=AT(C^N,7),A=A+I|0,j=AT(j^A,16),_=_+j|0,I=AT(I^_,12),A=A+I|0,j=AT(j^A,8),_=_+j|0,I=AT(I^_,7),k=k+O|0,M=AT(M^k,16),P=P+M|0,O=AT(O^P,12),k=k+O|0,M=AT(M^k,8),P=P+M|0,O=AT(O^P,7);let U=0;n[U++]=s+S|0,n[U++]=a+E|0,n[U++]=c+A|0,n[U++]=u+k|0,n[U++]=l+O|0,n[U++]=f+T|0,n[U++]=d+C|0,n[U++]=h+I|0,n[U++]=p+_|0,n[U++]=y+P|0,n[U++]=g+R|0,n[U++]=m+N|0,n[U++]=b+B|0,n[U++]=v+j|0,n[U++]=w+M|0,n[U++]=x+L|0},{counterRight:!1,counterLength:4,allowShortKeys:!1}),RT=new Uint8Array(16),NT=(e,t)=>{e.update(t);const r=t.length%16;r&&e.update(RT.subarray(r))},BT=new Uint8Array(32);function jT(e,t,r,n,o){const i=e(t,r,BT),s=_T.create(i);o&&NT(s,o),NT(s,n);const a=mT(n.length,o?o.length:0,!0);s.update(a);const c=s.digest();return dT(i,a),c}const MT=((e,t)=>{function r(r,...n){if(uT(r),!hT)throw new Error("Non little-endian hardware is not yet supported");if(void 0!==e.nonceLength){const t=n[0];if(!t)throw new Error("nonce / iv required");e.varSizeNonce?uT(t):uT(t,e.nonceLength)}const o=e.tagLength;o&&void 0!==n[1]&&uT(n[1]);const i=t(r,...n),s=(e,t)=>{if(void 0!==t){if(2!==e)throw new Error("cipher output not supported");uT(t)}};let a=!1;return{encrypt(e,t){if(a)throw new Error("cannot encrypt() twice with same key + nonce");return a=!0,uT(e),s(i.encrypt.length,t),i.encrypt(e,t)},decrypt(e,t){if(uT(e),o&&e.length<o)throw new Error("invalid ciphertext length: smaller than tagLength="+o);return s(i.decrypt.length,t),i.decrypt(e,t)}}}return Object.assign(r,e),r})({blockSize:64,nonceLength:12,tagLength:16},(e=>(t,r,n)=>({encrypt(o,i){const s=o.length;(i=yT(s+16,i,!1)).set(o);const a=i.subarray(0,-16);e(t,r,a,a,1);const c=jT(e,t,r,a,n);return i.set(c,s),dT(c),i},decrypt(o,i){i=yT(o.length-16,i,!1);const s=o.subarray(0,-16),a=o.subarray(-16),c=jT(e,t,r,s,n);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(a,c))throw new Error("invalid tag");return i.set(o.subarray(0,-16)),e(t,r,i,i,1),dT(c),i}}))(PT));class LT extends jk{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,lk(e);const r=Nk(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,o=new Uint8Array(n);o.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),pk(o)}update(e){return fk(this),this.iHash.update(e),this}digestInto(e){fk(this),uk(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:o,blockLen:i,outputLen:s}=this;return e.finished=n,e.destroyed=o,e.blockLen=i,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const UT=(e,t,r)=>new LT(e,t).update(r).digest();UT.create=(e,t)=>new LT(e,t);const DT=Uint8Array.from([0]),FT=Uint8Array.of();const zT=(e,t,r,n,o)=>function(e,t,r,n=32){lk(e),ck(n);const o=e.outputLen;if(n>255*o)throw new Error("Length should be <= 255*HashLen");const i=Math.ceil(n/o);void 0===r&&(r=FT);const s=new Uint8Array(i*o),a=UT.create(e,t),c=a._cloneInto(),u=new Uint8Array(a.outputLen);for(let e=0;e<i;e++)DT[0]=e+1,c.update(0===e?FT:u).update(r).update(DT).digestInto(u),s.set(u,o*e),a._cloneInto(c);return a.destroy(),c.destroy(),pk(u,DT),s.slice(0,n)}(e,function(e,t,r){return lk(e),void 0===r&&(r=new Uint8Array(e.outputLen)),UT(e,Nk(r),Nk(t))}(e,t,r),n,o),qT=bO,VT=BigInt(0),HT=BigInt(1);function KT(e,t=""){if("boolean"!=typeof e){throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e)}return e}function WT(e,t,r=""){const n=ak(e),o=e?.length,i=void 0!==t;if(!n||i&&o!==t){throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(i?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e))}return e}function GT(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function XT(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?VT:BigInt("0x"+e)}function ZT(e){return XT(Ek(e))}function QT(e){return uk(e),XT(Ek(Uint8Array.from(e).reverse()))}function YT(e,t){return Pk(e.toString(16).padStart(2*t,"0"))}function JT(e,t){return YT(e,t).reverse()}function $T(e,t,r){let n;if("string"==typeof t)try{n=Pk(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!ak(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const o=n.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}const eC=e=>"bigint"==typeof e&&VT<=e;function tC(e,t,r,n){if(!function(e,t,r){return eC(e)&&eC(t)&&eC(r)&&t<=e&&e<r}(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function rC(e){let t;for(t=0;e>VT;e>>=HT,t+=1);return t}const nC=e=>(HT<<BigInt(e))-HT;function oC(e,t,r={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function n(t,r,n){const o=e[t];if(n&&void 0===o)return;const i=typeof o;if(i!==r||null===o)throw new Error(`param "${t}" is invalid: expected ${r}, got ${i}`)}Object.entries(t).forEach(([e,t])=>n(e,t,!1)),Object.entries(r).forEach(([e,t])=>n(e,t,!0))}function iC(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(void 0!==o)return o;const i=e(r,...n);return t.set(r,i),i}}const sC=BigInt(0),aC=BigInt(1),cC=BigInt(2),uC=BigInt(3),lC=BigInt(4),fC=BigInt(5),dC=BigInt(7),hC=BigInt(8),pC=BigInt(9),yC=BigInt(16);function gC(e,t){const r=e%t;return r>=sC?r:t+r}function mC(e,t,r){let n=e;for(;t-- >sC;)n*=n,n%=r;return n}function bC(e,t){if(e===sC)throw new Error("invert: expected non-zero number");if(t<=sC)throw new Error("invert: expected positive modulus, got "+t);let r=gC(e,t),n=t,o=sC,i=aC;for(;r!==sC;){const e=n%r,t=o-i*(n/r);n=r,r=e,o=i,i=t}if(n!==aC)throw new Error("invert: does not exist");return gC(o,t)}function vC(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function wC(e,t){const r=(e.ORDER+aC)/lC,n=e.pow(t,r);return vC(e,n,t),n}function xC(e,t){const r=(e.ORDER-fC)/hC,n=e.mul(t,cC),o=e.pow(n,r),i=e.mul(t,o),s=e.mul(e.mul(i,cC),o),a=e.mul(i,e.sub(s,e.ONE));return vC(e,a,t),a}function SC(e){if(e<uC)throw new Error("sqrt is not defined for small field");let t=e-aC,r=0;for(;t%cC===sC;)t/=cC,r++;let n=cC;const o=CC(e);for(;1===OC(o,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return wC;let i=o.pow(n,t);const s=(t+aC)/cC;return function(e,n){if(e.is0(n))return n;if(1!==OC(e,n))throw new Error("Cannot find square root");let o=r,a=e.mul(e.ONE,i),c=e.pow(n,t),u=e.pow(n,s);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,r=e.sqr(c);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===o)throw new Error("Cannot find square root");const n=aC<<BigInt(o-t-1),i=e.pow(a,n);o=t,a=e.sqr(i),c=e.mul(c,a),u=e.mul(u,i)}return u}}function EC(e){return e%lC===uC?wC:e%hC===fC?xC:e%yC===pC?function(e){const t=CC(e),r=SC(e),n=r(t,t.neg(t.ONE)),o=r(t,n),i=r(t,t.neg(n)),s=(e+dC)/yC;return(e,t)=>{let r=e.pow(t,s),a=e.mul(r,n);const c=e.mul(r,o),u=e.mul(r,i),l=e.eql(e.sqr(a),t),f=e.eql(e.sqr(c),t);r=e.cmov(r,a,l),a=e.cmov(u,c,f);const d=e.eql(e.sqr(a),t),h=e.cmov(r,a,d);return vC(e,h,t),h}}(e):SC(e)}const AC=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function kC(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((t,r,o)=>e.is0(r)?t:(n[o]=t,e.mul(t,r)),e.ONE),i=e.inv(o);return t.reduceRight((t,r,o)=>e.is0(r)?t:(n[o]=e.mul(t,n[o]),e.mul(t,r)),i),n}function OC(e,t){const r=(e.ORDER-aC)/cC,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),s=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!s)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function TC(e,t){void 0!==t&&ck(t);const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function CC(e,t,r=!1,n={}){if(e<=sC)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,i,s,a=!1;if("object"==typeof t&&null!=t){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(o=e.BITS),e.sqrt&&(i=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE),"boolean"==typeof e.modFromBytes&&(a=e.modFromBytes),s=e.allowedLengths}else"number"==typeof t&&(o=t),n.sqrt&&(i=n.sqrt);const{nBitLength:c,nByteLength:u}=TC(e,o);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let l;const f=Object.freeze({ORDER:e,isLE:r,BITS:c,BYTES:u,MASK:nC(c),ZERO:sC,ONE:aC,allowedLengths:s,create:t=>gC(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return sC<=t&&t<e},is0:e=>e===sC,isValidNot0:e=>!f.is0(e)&&f.isValid(e),isOdd:e=>(e&aC)===aC,neg:t=>gC(-t,e),eql:(e,t)=>e===t,sqr:t=>gC(t*t,e),add:(t,r)=>gC(t+r,e),sub:(t,r)=>gC(t-r,e),mul:(t,r)=>gC(t*r,e),pow:(e,t)=>function(e,t,r){if(r<sC)throw new Error("invalid exponent, negatives unsupported");if(r===sC)return e.ONE;if(r===aC)return t;let n=e.ONE,o=t;for(;r>sC;)r&aC&&(n=e.mul(n,o)),o=e.sqr(o),r>>=aC;return n}(f,e,t),div:(t,r)=>gC(t*bC(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>bC(t,e),sqrt:i||(t=>(l||(l=EC(e)),l(f,t))),toBytes:e=>r?JT(e,u):YT(e,u),fromBytes:(t,n=!0)=>{if(s){if(!s.includes(t.length)||t.length>u)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+t.length);const e=new Uint8Array(u);e.set(t,r?0:e.length-t.length),t=e}if(t.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+t.length);let o=r?QT(t):ZT(t);if(a&&(o=gC(o,e)),!n&&!f.isValid(o))throw new Error("invalid field element: outside of range 0..ORDER");return o},invertBatch:e=>kC(f,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(f)}function IC(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function _C(e){const t=IC(e);return t+Math.ceil(t/2)}const PC=BigInt(0),RC=BigInt(1);function NC(e,t){const r=t.negate();return e?r:t}function BC(e,t){const r=kC(e.Fp,t.map(e=>e.Z));return t.map((t,n)=>e.fromAffine(t.toAffine(r[n])))}function jC(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function MC(e,t){jC(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:nC(e),maxNumber:r,shiftBy:BigInt(e)}}function LC(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:s}=r;let a=Number(e&o),c=e>>s;a>n&&(a-=i,c+=RC);const u=t*n;return{nextN:c,offset:u+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!=0,offsetF:u}}const UC=new WeakMap,DC=new WeakMap;function FC(e){return DC.get(e)||1}function zC(e){if(e!==PC)throw new Error("invalid wNAF")}class qC{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let n=e;for(;t>PC;)t&RC&&(r=r.add(n)),n=n.double(),t>>=RC;return r}precomputeWindow(e,t){const{windows:r,windowSize:n}=MC(t,this.bits),o=[];let i=e,s=i;for(let e=0;e<r;e++){s=i,o.push(s);for(let e=1;e<n;e++)s=s.add(i),o.push(s);i=s.double()}return o}wNAF(e,t,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE;const i=MC(e,this.bits);for(let e=0;e<i.windows;e++){const{nextN:s,offset:a,isZero:c,isNeg:u,isNegF:l,offsetF:f}=LC(r,e,i);r=s,c?o=o.add(NC(l,t[f])):n=n.add(NC(u,t[a]))}return zC(r),{p:n,f:o}}wNAFUnsafe(e,t,r,n=this.ZERO){const o=MC(e,this.bits);for(let e=0;e<o.windows&&r!==PC;e++){const{nextN:i,offset:s,isZero:a,isNeg:c}=LC(r,e,o);if(r=i,!a){const e=t[s];n=n.add(c?e.negate():e)}}return zC(r),n}getPrecomputes(e,t,r){let n=UC.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),UC.set(t,n))),n}cached(e,t,r){const n=FC(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)}unsafe(e,t,r,n){const o=FC(e);return 1===o?this._unsafeLadder(e,t,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),t,n)}createCache(e,t){jC(t,this.bits),DC.set(e,t),UC.delete(e)}hasCache(e){return 1!==FC(e)}}function VC(e,t,r,n){(function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})})(r,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}(n,t);const o=r.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,a=rC(BigInt(o));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=nC(c),l=new Array(Number(u)+1).fill(s);let f=s;for(let e=Math.floor((t.BITS-1)/c)*c;e>=0;e-=c){l.fill(s);for(let t=0;t<i;t++){const o=n[t],i=Number(o>>BigInt(e)&u);l[i]=l[i].add(r[t])}let t=s;for(let e=l.length-1,r=s;e>0;e--)r=r.add(l[e]),t=t.add(r);if(f=f.add(t),0!==e)for(let e=0;e<c;e++)f=f.double()}return f}function HC(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){const t=AC.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});oC(e,t)}(t),t}return CC(e,{isLE:r})}BigInt(0),BigInt(1),BigInt(2),BigInt(8),Rk("HashToScalar-");const KC=BigInt(0),WC=BigInt(1),GC=BigInt(2);function XC(e){const t=function(e){return oC(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})}(e),{P:r,type:n,adjustScalarBytes:o,powPminus2:i,randomBytes:s}=t,a="x25519"===n;if(!a&&"x448"!==n)throw new Error("invalid type");const c=s||Lk,u=a?255:448,l=a?32:56,f=BigInt(a?9:5),d=BigInt(a?121665:39081),h=a?GC**BigInt(254):GC**BigInt(447),p=a?BigInt(8)*GC**BigInt(251)-WC:BigInt(4)*GC**BigInt(445)-WC,y=h+p+WC,g=e=>gC(e,r),m=b(f);function b(e){return JT(g(e),l)}function v(e,t){const n=function(e,t){tC("u",e,KC,r),tC("scalar",t,h,y);const n=t,o=e;let s=WC,a=KC,c=e,l=WC,f=KC;for(let e=BigInt(u-1);e>=KC;e--){const t=n>>e&WC;f^=t,({x_2:s,x_3:c}=x(f,s,c)),({x_2:a,x_3:l}=x(f,a,l)),f=t;const r=s+a,i=g(r*r),u=s-a,h=g(u*u),p=i-h,y=c+l,m=g((c-l)*r),b=g(y*u),v=m+b,w=m-b;c=g(v*v),l=g(o*g(w*w)),s=g(i*h),a=g(p*(i+g(d*p)))}({x_2:s,x_3:c}=x(f,s,c)),({x_2:a,x_3:l}=x(f,a,l));const p=i(a);return g(s*p)}(function(e){const t=$T("u coordinate",e,l);return a&&(t[31]&=127),g(QT(t))}(t),function(e){return QT(o($T("scalar",e,l)))}(e));if(n===KC)throw new Error("invalid private or public key received");return b(n)}function w(e){return v(e,m)}function x(e,t,r){const n=g(e*(t-r));return{x_2:t=g(t-n),x_3:r=g(r+n)}}const S={secretKey:l,publicKey:l,seed:l},E=(e=c(l))=>(uk(e,S.seed),e);return{keygen:function(e){const t=E(e);return{secretKey:t,publicKey:w(t)}},getSharedSecret:(e,t)=>v(e,t),getPublicKey:e=>w(e),scalarMult:v,scalarMultBase:w,utils:{randomSecretKey:E,randomPrivateKey:E},GuBytes:m.slice(),lengths:S}}const ZC=BigInt(1),QC=BigInt(2),YC=BigInt(3),JC=BigInt(5),$C=BigInt(8),eI=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed");function tI(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const rI=CC({p:eI,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:$C,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")}.p,{isLE:!0}),nI=(()=>{const e=rI.ORDER;return XC({P:e,type:"x25519",powPminus2:t=>{const{pow_p_5_8:r,b2:n}=function(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=eI,s=e*e%i*e%i,a=mC(s,QC,i)*s%i,c=mC(a,ZC,i)*e%i,u=mC(c,JC,i)*c%i,l=mC(u,t,i)*u%i,f=mC(l,r,i)*l%i,d=mC(f,n,i)*f%i,h=mC(d,o,i)*d%i,p=mC(h,o,i)*d%i,y=mC(p,t,i)*u%i;return{pow_p_5_8:mC(y,QC,i)*e%i,b2:s}}(t);return gC(mC(r,YC,e)*n,e)},adjustScalarBytes:tI})})(),oI=(e,t)=>(e+(e>=0?t:-t)/fI)/t;function iI(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function sI(e,t){const r={};for(let n of Object.keys(t))r[n]=void 0===e[n]?t[n]:e[n];return KT(r.lowS,"lowS"),KT(r.prehash,"prehash"),void 0!==r.format&&iI(r.format),r}class aI extends Error{constructor(e=""){super(e)}}const cI={Err:aI,_tlv:{encode:(e,t)=>{const{Err:r}=cI;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const n=t.length/2,o=GT(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");const i=n>127?GT(o.length/2|128):"";return GT(e)+i+o+t},decode(e,t){const{Err:r}=cI;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const o=t[n++];let i=0;if(!!(128&o)){const e=127&o;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of s)i=i<<8|e;if(n+=e,i<128)throw new r("tlv.decode(long): not minimal encoding")}else i=o;const s=t.subarray(n,n+i);if(s.length!==i)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+i)}}},_int:{encode(e){const{Err:t}=cI;if(e<uI)throw new t("integer: negative integers are not allowed");let r=GT(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=cI;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return ZT(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=cI,o=$T("signature",e),{v:i,l:s}=n.decode(48,o);if(s.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=n.decode(2,i),{v:u,l:l}=n.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(e){const{_tlv:t,_int:r}=cI,n=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,n)}},uI=BigInt(0),lI=BigInt(1),fI=BigInt(2),dI=BigInt(3),hI=BigInt(4);function pI(e,t){const{BYTES:r}=e;let n;if("bigint"==typeof t)n=t;else{let o=$T("private key",t);try{n=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(n))throw new Error("invalid private key: out of range [1..N-1]");return n}function yI(e,t={}){const r=function(e,t,r={},n){if(void 0===n&&(n="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>PC))throw new Error(`CURVE.${e} must be positive bigint`)}const o=HC(t.p,r.Fp,n),i=HC(t.n,r.Fn,n),s=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of s)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}}("weierstrass",e,t),{Fp:n,Fn:o}=r;let i=r.CURVE;const{h:s,n:a}=i;oC(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=t;if(c&&(!n.is0(i.a)||"bigint"!=typeof c.beta||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const u=mI(n,o);function l(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const f=t.toBytes||function(e,t,r){const{x:o,y:i}=t.toAffine(),s=n.toBytes(o);if(KT(r,"isCompressed"),r){l();return Bk(gI(!n.isOdd(i)),s)}return Bk(Uint8Array.of(4),s,n.toBytes(i))},d=t.fromBytes||function(e){WT(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:r}=u,o=e.length,i=e[0],s=e.subarray(1);if(o!==t||2!==i&&3!==i){if(o===r&&4===i){const e=n.BYTES,t=n.fromBytes(s.subarray(0,e)),r=n.fromBytes(s.subarray(e,2*e));if(!p(t,r))throw new Error("bad point: is not on curve");return{x:t,y:r}}throw new Error(`bad point: got length ${o}, expected compressed=${t} or uncompressed=${r}`)}{const e=n.fromBytes(s);if(!n.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=h(e);let r;try{r=n.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}l();return!(1&~i)!==n.isOdd(r)&&(r=n.neg(r)),{x:e,y:r}}};function h(e){const t=n.sqr(e),r=n.mul(t,e);return n.add(n.add(r,n.mul(e,i.a)),i.b)}function p(e,t){const r=n.sqr(t),o=h(e);return n.eql(r,o)}if(!p(i.Gx,i.Gy))throw new Error("bad curve params: generator point");const y=n.mul(n.pow(i.a,dI),hI),g=n.mul(n.sqr(i.b),BigInt(27));if(n.is0(n.add(y,g)))throw new Error("bad curve params: a or b");function m(e,t,r=!1){if(!n.isValid(t)||r&&n.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function b(e){if(!(e instanceof E))throw new Error("ProjectivePoint expected")}function v(e){if(!c||!c.basises)throw new Error("no endo");return function(e,t,r){const[[n,o],[i,s]]=t,a=oI(s*e,r),c=oI(-o*e,r);let u=e-a*n-c*i,l=-a*o-c*s;const f=u<uI,d=l<uI;f&&(u=-u),d&&(l=-l);const h=nC(Math.ceil(rC(r)/2))+lI;if(u<uI||u>=h||l<uI||l>=h)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:l}}(e,c.basises,o.ORDER)}const w=iC((e,t)=>{const{X:r,Y:o,Z:i}=e;if(n.eql(i,n.ONE))return{x:r,y:o};const s=e.is0();null==t&&(t=s?n.ONE:n.inv(i));const a=n.mul(r,t),c=n.mul(o,t),u=n.mul(i,t);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:a,y:c}}),x=iC(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=e.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not field elements");if(!p(r,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function S(e,t,r,o,i){return r=new E(n.mul(r.X,e),r.Y,r.Z),t=NC(o,t),r=NC(i,r),t.add(r)}class E{constructor(e,t,r){this.X=m("x",e),this.Y=m("y",t,!0),this.Z=m("z",r),Object.freeze(this)}static CURVE(){return i}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof E)throw new Error("projective point not allowed");return n.is0(t)&&n.is0(r)?E.ZERO:new E(t,r,n.ONE)}static fromBytes(e){const t=E.fromAffine(d(WT(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return E.fromBytes($T("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return k.createCache(this,e),t||this.multiply(dI),this}assertValidity(){x(this)}hasEvenY(){const{y:e}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(e)}equals(e){b(e);const{X:t,Y:r,Z:o}=this,{X:i,Y:s,Z:a}=e,c=n.eql(n.mul(t,a),n.mul(i,o)),u=n.eql(n.mul(r,a),n.mul(s,o));return c&&u}negate(){return new E(this.X,n.neg(this.Y),this.Z)}double(){const{a:e,b:t}=i,r=n.mul(t,dI),{X:o,Y:s,Z:a}=this;let c=n.ZERO,u=n.ZERO,l=n.ZERO,f=n.mul(o,o),d=n.mul(s,s),h=n.mul(a,a),p=n.mul(o,s);return p=n.add(p,p),l=n.mul(o,a),l=n.add(l,l),c=n.mul(e,l),u=n.mul(r,h),u=n.add(c,u),c=n.sub(d,u),u=n.add(d,u),u=n.mul(c,u),c=n.mul(p,c),l=n.mul(r,l),h=n.mul(e,h),p=n.sub(f,h),p=n.mul(e,p),p=n.add(p,l),l=n.add(f,f),f=n.add(l,f),f=n.add(f,h),f=n.mul(f,p),u=n.add(u,f),h=n.mul(s,a),h=n.add(h,h),f=n.mul(h,p),c=n.sub(c,f),l=n.mul(h,d),l=n.add(l,l),l=n.add(l,l),new E(c,u,l)}add(e){b(e);const{X:t,Y:r,Z:o}=this,{X:s,Y:a,Z:c}=e;let u=n.ZERO,l=n.ZERO,f=n.ZERO;const d=i.a,h=n.mul(i.b,dI);let p=n.mul(t,s),y=n.mul(r,a),g=n.mul(o,c),m=n.add(t,r),v=n.add(s,a);m=n.mul(m,v),v=n.add(p,y),m=n.sub(m,v),v=n.add(t,o);let w=n.add(s,c);return v=n.mul(v,w),w=n.add(p,g),v=n.sub(v,w),w=n.add(r,o),u=n.add(a,c),w=n.mul(w,u),u=n.add(y,g),w=n.sub(w,u),f=n.mul(d,v),u=n.mul(h,g),f=n.add(u,f),u=n.sub(y,f),f=n.add(y,f),l=n.mul(u,f),y=n.add(p,p),y=n.add(y,p),g=n.mul(d,g),v=n.mul(h,v),y=n.add(y,g),g=n.sub(p,g),g=n.mul(d,g),v=n.add(v,g),p=n.mul(y,v),l=n.add(l,p),p=n.mul(w,v),u=n.mul(m,u),u=n.sub(u,p),p=n.mul(m,y),f=n.mul(w,f),f=n.add(f,p),new E(u,l,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(E.ZERO)}multiply(e){const{endo:r}=t;if(!o.isValidNot0(e))throw new Error("invalid scalar: out of range");let n,i;const s=e=>k.cached(this,e,e=>BC(E,e));if(r){const{k1neg:t,k1:o,k2neg:a,k2:c}=v(e),{p:u,f:l}=s(o),{p:f,f:d}=s(c);i=l.add(d),n=S(r.beta,u,f,t,a)}else{const{p:t,f:r}=s(e);n=t,i=r}return BC(E,[n,i])[0]}multiplyUnsafe(e){const{endo:r}=t,n=this;if(!o.isValid(e))throw new Error("invalid scalar: out of range");if(e===uI||n.is0())return E.ZERO;if(e===lI)return n;if(k.hasCache(this))return this.multiply(e);if(r){const{k1neg:t,k1:o,k2neg:i,k2:s}=v(e),{p1:a,p2:c}=function(e,t,r,n){let o=t,i=e.ZERO,s=e.ZERO;for(;r>PC||n>PC;)r&RC&&(i=i.add(o)),n&RC&&(s=s.add(o)),o=o.double(),r>>=RC,n>>=RC;return{p1:i,p2:s}}(E,n,o,s);return S(r.beta,a,c,t,i)}return k.unsafe(n,e)}multiplyAndAddUnsafe(e,t,r){const n=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(e){return w(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return s===lI||(e?e(E,this):k.unsafe(this,a).is0())}clearCofactor(){const{clearCofactor:e}=t;return s===lI?this:e?e(E,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(e=!0){return KT(e,"isCompressed"),this.assertValidity(),f(E,this,e)}toHex(e=!0){return Ek(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return BC(E,e)}static msm(e,t){return VC(E,o,e,t)}static fromPrivateKey(e){return E.BASE.multiply(pI(o,e))}}E.BASE=new E(i.Gx,i.Gy,n.ONE),E.ZERO=new E(n.ZERO,n.ONE,n.ZERO),E.Fp=n,E.Fn=o;const A=o.BITS,k=new qC(E,t.endo?Math.ceil(A/2):A);return E.BASE.precompute(8),E}function gI(e){return Uint8Array.of(e?2:3)}function mI(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function bI(e,t={}){const{Fn:r}=e,n=t.randomBytes||Lk,o=Object.assign(mI(e.Fp,r),{seed:_C(r.ORDER)});function i(e){try{return!!pI(r,e)}catch{return!1}}function s(e=n(o.seed)){return function(e,t,r=!1){const n=e.length,o=IC(t),i=_C(t);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);const s=gC(r?QT(e):ZT(e),t-aC)+aC;return r?JT(s,o):YT(s,o)}(WT(e,o.seed,"seed"),r.ORDER)}function a(t,n=!0){return e.BASE.multiply(pI(r,t)).toBytes(n)}function c(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:n,publicKey:i,publicKeyUncompressed:s}=o;if(r.allowedLengths||n===i)return;const a=$T("key",t).length;return a===i||a===s}return Object.freeze({getPublicKey:a,getSharedSecret:function(t,n,o=!0){if(!0===c(t))throw new Error("first arg must be private key");if(!1===c(n))throw new Error("second arg must be public key");const i=pI(r,t);return e.fromHex(n).multiply(i).toBytes(o)},keygen:function(e){const t=s(e);return{secretKey:t,publicKey:a(t)}},Point:e,utils:{isValidSecretKey:i,isValidPublicKey:function(t,r){const{publicKey:n,publicKeyUncompressed:i}=o;try{const o=t.length;return!(!0===r&&o!==n||!1===r&&o!==i)&&!!e.fromBytes(t)}catch{return!1}},randomSecretKey:s,isValidPrivateKey:i,randomPrivateKey:s,normPrivateKeyToScalar:e=>pI(r,e),precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)},lengths:o})}function vI(e,t,r={}){lk(t),oC(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const n=r.randomBytes||Lk,o=r.hmac||((e,...r)=>UT(t,e,Bk(...r))),{Fp:i,Fn:s}=e,{ORDER:a,BITS:c}=s,{keygen:u,getPublicKey:l,getSharedSecret:f,utils:d,lengths:h}=bI(e,r),p={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},y="compact";function g(e){return e>a>>lI}function m(e,t){if(!s.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class b{constructor(e,t,r){this.r=m("r",e),this.s=m("s",t),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(e,t=y){let r;if(function(e,t){iI(t);const r=h.signature;WT(e,"compact"===t?r:"recovered"===t?r+1:void 0,`${t} signature`)}(e,t),"der"===t){const{r:t,s:r}=cI.toSig(WT(e));return new b(t,r)}"recovered"===t&&(r=e[0],t="compact",e=e.subarray(1));const n=s.BYTES,o=e.subarray(0,n),i=e.subarray(n,2*n);return new b(s.fromBytes(o),s.fromBytes(i),r)}static fromHex(e,t){return this.fromBytes(Pk(e),t)}addRecoveryBit(e){return new b(this.r,this.s,e)}recoverPublicKey(t){const r=i.ORDER,{r:n,s:o,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error("recovery id invalid");if(a*fI<r&&c>1)throw new Error("recovery id is ambiguous for h>1 curve");const u=2===c||3===c?n+a:n;if(!i.isValid(u))throw new Error("recovery id 2 or 3 invalid");const l=i.toBytes(u),f=e.fromBytes(Bk(gI(!(1&c)),l)),d=s.inv(u),h=w($T("msgHash",t)),p=s.create(-h*d),y=s.create(o*d),g=e.BASE.multiplyUnsafe(p).add(f.multiplyUnsafe(y));if(g.is0())throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return g(this.s)}toBytes(e=y){if(iI(e),"der"===e)return Pk(cI.hexFromSig(this));const t=s.toBytes(this.r),r=s.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return Bk(Uint8Array.of(this.recovery),t,r)}return Bk(t,r)}toHex(e){return Ek(this.toBytes(e))}assertValidity(){}static fromCompact(e){return b.fromBytes($T("sig",e),"compact")}static fromDER(e){return b.fromBytes($T("sig",e),"der")}normalizeS(){return this.hasHighS()?new b(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Ek(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Ek(this.toBytes("compact"))}}const v=r.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=ZT(e),r=8*e.length-c;return r>0?t>>BigInt(r):t},w=r.bits2int_modN||function(e){return s.create(v(e))},x=nC(c);function S(e){return tC("num < 2^"+c,e,uI,x),s.toBytes(e)}function E(e,r){return WT(e,void 0,"message"),r?WT(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:u,getPublicKey:l,getSharedSecret:f,utils:d,lengths:h,Point:e,sign:function(r,i,a={}){r=$T("message",r);const{seed:c,k2sig:u}=function(t,r,o){if(["recovered","canonical"].some(e=>e in o))throw new Error("sign() legacy options not supported");const{lowS:i,prehash:a,extraEntropy:c}=sI(o,p);t=E(t,a);const u=w(t),l=pI(s,r),f=[S(l),S(u)];if(null!=c&&!1!==c){const e=!0===c?n(h.secretKey):c;f.push($T("extraEntropy",e))}const d=Bk(...f),y=u;return{seed:d,k2sig:function(t){const r=v(t);if(!s.isValidNot0(r))return;const n=s.inv(r),o=e.BASE.multiply(r).toAffine(),a=s.create(o.x);if(a===uI)return;const c=s.create(n*s.create(y+a*l));if(c===uI)return;let u=(o.x===a?0:2)|Number(o.y&lI),f=c;return i&&g(c)&&(f=s.neg(c),u^=1),new b(a,f,u)}}}(r,i,a);return function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");const n=e=>new Uint8Array(e),o=e=>Uint8Array.of(e);let i=n(e),s=n(e),a=0;const c=()=>{i.fill(1),s.fill(0),a=0},u=(...e)=>r(s,i,...e),l=(e=n(0))=>{s=u(o(0),e),i=u(),0!==e.length&&(s=u(o(1),e),i=u())},f=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){i=u();const t=i.slice();r.push(t),e+=i.length}return Bk(...r)};return(e,t)=>{let r;for(c(),l(e);!(r=t(f()));)l();return c(),r}}(t.outputLen,s.BYTES,o)(c,u)},verify:function(t,r,n,o={}){const{lowS:i,prehash:a,format:c}=sI(o,p);if(n=$T("publicKey",n),r=E($T("message",r),a),"strict"in o)throw new Error("options.strict was renamed to lowS");const u=void 0===c?function(e){let t;const r="string"==typeof e||ak(e),n=!r&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!r&&!n)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(n)t=new b(e.r,e.s);else if(r){try{t=b.fromBytes($T("sig",e),"der")}catch(e){if(!(e instanceof cI.Err))throw e}if(!t)try{t=b.fromBytes($T("sig",e),"compact")}catch{return!1}}return t||!1}(t):b.fromBytes($T("sig",t),c);if(!1===u)return!1;try{const t=e.fromBytes(n);if(i&&u.hasHighS())return!1;const{r:o,s:a}=u,c=w(r),l=s.inv(a),f=s.create(c*l),d=s.create(o*l),h=e.BASE.multiplyUnsafe(f).add(t.multiplyUnsafe(d));return!h.is0()&&s.create(h.x)===o}catch{return!1}},recoverPublicKey:function(e,t,r={}){const{prehash:n}=sI(r,p);return t=E(t,n),b.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:b,hash:t})}function wI(e){const{CURVE:t,curveOpts:r}=function(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp;let n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:r,Fn:CC(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}function xI(e){const{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:o}=wI(e);return function(e,t){const r=t.Point;return Object.assign({},t,{ProjectivePoint:r,CURVE:Object.assign({},e,TC(r.Fn.ORDER,r.Fn.BITS))})}(e,vI(yI(t,r),n,o))}function SI(e,t){const r=t=>xI({...e,hash:t});return{...r(t),create:r}}const EI={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},AI={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},kI={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},OI=CC(EI.p),TI=CC(AI.p),CI=CC(kI.p),II=SI({...EI,Fp:OI,lowS:!1},bO);SI({...AI,Fp:TI,lowS:!1},wO),SI({...kI,Fp:CI,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},vO);const _I=II,PI="base10",RI="base16",NI="base64pad",BI="base64url",jI="utf8";function MI(){return zE(Lk(32),RI)}function LI(e){return zE(qT(FE(e,RI)),RI)}function UI(e){return zE(qT(FE(e,jI)),RI)}function DI(e){return FE(`${e}`,PI)}function FI(e){return Number(zE(e,PI))}function zI(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function qI(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4;return t+"=".repeat(r)}function VI(e){if(2===FI(e.type))return zE(gS([e.type,e.sealed]),NI);if(1===FI(e.type)){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return zE(gS([e.type,e.senderPublicKey,e.iv,e.sealed]),NI)}return zE(gS([e.type,e.iv,e.sealed]),NI)}function HI(e){const t=FE((e.encoding||NI)===BI?qI(e.encoded):e.encoded,NI),r=t.slice(0,1);if(1===FI(r)){const e=33,n=e+12,o=t.slice(1,e),i=t.slice(e,n);return{type:r,sealed:t.slice(n),iv:i,senderPublicKey:o}}if(2===FI(r)){return{type:r,sealed:t.slice(1),iv:Lk(12)}}const n=t.slice(1,13);return{type:r,sealed:t.slice(13),iv:n}}function KI(e){const t=e?.type||0;if(1===t){if(typeof e?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function WI(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}function GI(e){return 2===e.type}function XI(e,t){const[r,n,o]=e.split("."),i=Buffer.from(qI(o),"base64");if(64!==i.length)throw new Error("Invalid signature length");const s=i.slice(0,32),a=i.slice(32,64),c=qT(`${r}.${n}`),u=function(e){const t=Buffer.from(e.x,"base64"),r=Buffer.from(e.y,"base64");return gS([new Uint8Array([4]),t,r])}(t);if(!_I.verify(gS([s,a]),c,u))throw new Error("Invalid signature");return fm(e).payload}function ZI(e){return e?.relay||{protocol:"irn"}}function QI(e){const t=qE[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}var YI=Object.defineProperty,JI=Object.defineProperties,$I=Object.getOwnPropertyDescriptors,e_=Object.getOwnPropertySymbols,t_=Object.prototype.hasOwnProperty,r_=Object.prototype.propertyIsEnumerable,n_=(e,t,r)=>t in e?YI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,o_=(e,t)=>{for(var r in t||(t={}))t_.call(t,r)&&n_(e,r,t[r]);if(e_)for(var r of e_(t))r_.call(t,r)&&n_(e,r,t[r]);return e};function i_(e,t="-"){const r={},n="relay"+t;return Object.keys(e).forEach(t=>{if(t.startsWith(n)){const o=t.replace(n,""),i=e[t];r[o]=i}}),r}function s_(e){if(!e.includes("wc:")){const t=DA(e);null!=t&&t.includes("wc:")&&(e=t)}const t=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,t),o=e.substring(t+1,r).split("@"),i=typeof r<"u"?e.substring(r):"",s=new URLSearchParams(i),a=Object.fromEntries(s.entries()),c="string"==typeof a.methods?a.methods.split(","):void 0;return{protocol:n,topic:a_(o[0]),version:parseInt(o[1],10),symKey:a.symKey,relay:i_(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function a_(e){return e.startsWith("//")?e.substring(2):e}function c_(e){const t=new URLSearchParams,r=o_(o_(((e,t)=>JI(e,$I(t)))(o_({},function(e,t="-"){const r={};return Object.keys(e).forEach(n=>{const o=n,i="relay"+t+o;e[o]&&(r[i]=e[o])}),r}(e.relay)),{symKey:e.symKey}),e.expiryTimestamp&&{expiryTimestamp:e.expiryTimestamp.toString()}),e.methods&&{methods:e.methods.join(",")});return Object.entries(r).sort(([e],[t])=>e.localeCompare(t)).forEach(([e,r])=>{void 0!==r&&t.append(e,String(r))}),`${e.protocol}:${e.topic}@${e.version}?${t}`}function u_(e,t,r){return`${e}?wc_ev=${r}&topic=${t}`}var l_=Object.defineProperty,f_=Object.defineProperties,d_=Object.getOwnPropertyDescriptors,h_=Object.getOwnPropertySymbols,p_=Object.prototype.hasOwnProperty,y_=Object.prototype.propertyIsEnumerable,g_=(e,t,r)=>t in e?l_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m_=(e,t)=>{for(var r in t||(t={}))p_.call(t,r)&&g_(e,r,t[r]);if(h_)for(var r of h_(t))y_.call(t,r)&&g_(e,r,t[r]);return e},b_=(e,t)=>f_(e,d_(t));function v_(e){const t=[];return e.forEach(e=>{const[r,n]=e.split(":");t.push(`${r}:${n}`)}),t}function w_(e){return e.includes(":")}function x_(e){return w_(e)?e.split(":")[0]:e}function S_(e){var t,r,n;const o={};if(!I_(e))return o;for(const[i,s]of Object.entries(e)){const e=w_(i)?[i]:s.chains,a=s.methods||[],c=s.events||[],u=x_(i);o[u]=b_(m_({},o[u]),{chains:BA(e,null==(t=o[u])?void 0:t.chains),methods:BA(a,null==(r=o[u])?void 0:r.methods),events:BA(c,null==(n=o[u])?void 0:n.events)})}return o}function E_(e,t){t=t.map(e=>e.replace("did:pkh:",""));const r=function(e){const t={};return e?.forEach(e=>{var r;const[n,o]=e.split(":");t[n]||(t[n]={accounts:[],chains:[],events:[],methods:[]}),t[n].accounts.push(e),null==(r=t[n].chains)||r.push(`${n}:${o}`)}),t}(t);for(const[t,n]of Object.entries(r))n.methods?n.methods=BA(n.methods,e):n.methods=e,n.events=["chainChanged","accountsChanged"];return r}const A_={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}},k_={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 O_(e,t){const{message:r,code:n}=k_[e];return{message:t?`${r} ${t}`:r,code:n}}function T_(e,t){const{message:r,code:n}=A_[e];return{message:t?`${r} ${t}`:r,code:n}}function C_(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function I_(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function __(e){return typeof e>"u"}function P_(e,t){return!(!t||!__(e))||"string"==typeof e&&!!e.trim().length}function R_(e,t){return!(!t||!__(e))||"number"==typeof e&&!isNaN(e)}function N_(e){return!(!P_(e,!1)||!e.includes(":"))&&2===e.split(":").length}function B_(e){let t=!0;return C_(e)?e.length&&(t=e.every(e=>P_(e,!1))):t=!1,t}function j_(e,t,r){let n=null;return Object.entries(e).forEach(([e,o])=>{if(n)return;const i=function(e,t,r){let n=null;return C_(t)&&t.length?t.forEach(e=>{n||N_(e)||(n=T_("UNSUPPORTED_CHAINS",`${r}, chain ${e} should be a string and conform to "namespace:chainId" format`))}):N_(e)||(n=T_("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}(e,eA(e,o),`${t} ${r}`);i&&(n=i)}),n}function M_(e,t){let r=null;return C_(e)?e.forEach(e=>{r||function(e){if(P_(e,!1)&&e.includes(":")){const t=e.split(":");if(3===t.length){const e=t[0]+":"+t[1];return!!t[2]&&N_(e)}}return!1}(e)||(r=T_("UNSUPPORTED_ACCOUNTS",`${t}, account ${e} should be a string and conform to "namespace:chainId:address" format`))}):r=T_("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function L_(e,t){let r=null;return Object.values(e).forEach(e=>{if(r)return;const n=function(e,t){let r=null;return B_(e?.methods)?B_(e?.events)||(r=T_("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=T_("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}(e,`${t}, namespace`);n&&(r=n)}),r}function U_(e,t){let r=null;if(e&&I_(e)){const n=L_(e,t);n&&(r=n);const o=function(e,t){let r=null;return Object.values(e).forEach(e=>{if(r)return;const n=M_(e?.accounts,`${t} namespace`);n&&(r=n)}),r}(e,t);o&&(r=o)}else r=O_("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function D_(e){return P_(e.protocol,!0)}function F_(e){return typeof e<"u"&&null!==typeof e}function z_(e,t){return!(!N_(t)||!function(e){const t=[];return Object.values(e).forEach(e=>{t.push(...v_(e.accounts))}),t}(e).includes(t))}function q_(e,t,r){return!!P_(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach(e=>{v_(e.accounts).includes(t)&&r.push(...e.methods)}),r}(e,t).includes(r)}function V_(e,t,r){return!!P_(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach(e=>{v_(e.accounts).includes(t)&&r.push(...e.events)}),r}(e,t).includes(r)}function H_(e,t,r){let n=null;const o=function(e){const t={};return Object.keys(e).forEach(r=>{var n;r.includes(":")?t[r]=e[r]:null==(n=e[r].chains)||n.forEach(n=>{t[n]={methods:e[r].methods,events:e[r].events}})}),t}(e),i=function(e){const t={};return Object.keys(e).forEach(r=>{if(r.includes(":"))t[r]=e[r];else{const n=v_(e[r].accounts);n?.forEach(n=>{t[n]={accounts:e[r].accounts.filter(e=>e.includes(`${n}:`)),methods:e[r].methods,events:e[r].events}})}}),t}(t),s=Object.keys(o),a=Object.keys(i),c=K_(Object.keys(e)),u=K_(Object.keys(t)),l=c.filter(e=>!u.includes(e));return l.length&&(n=O_("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${l.toString()}\n Received: ${Object.keys(t).toString()}`)),AA(s,a)||(n=O_("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${s.toString()}\n Approved: ${a.toString()}`)),Object.keys(t).forEach(e=>{if(!e.includes(":")||n)return;const o=v_(t[e].accounts);o.includes(e)||(n=O_("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e}\n Required: ${e}\n Approved: ${o.toString()}`))}),s.forEach(e=>{n||(AA(o[e].methods,i[e].methods)?AA(o[e].events,i[e].events)||(n=O_("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):n=O_("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))}),n}function K_(e){return[...new Set(e.map(e=>e.includes(":")?e.split(":")[0]:e))]}function W_(){const e=bA();return new Promise(t=>{switch(e){case dA:t(mA()&&navigator?.onLine);break;case lA:t(async function(){if(gA()&&typeof global<"u"&&null!=global&&global.NetInfo){const e=await(null==global?void 0:global.NetInfo.fetch());return e?.isConnected}return!0}());break;default:t(!0)}})}function G_(e){switch(bA()){case dA:!function(e){!gA()&&mA()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)))}(e);break;case lA:!function(e){gA()&&typeof global<"u"&&null!=global&&global.NetInfo&&global?.NetInfo.addEventListener(t=>e(t?.isConnected))}(e)}}const X_={};class Z_{static get(e){return X_[e]}static set(e,t){X_[e]=t}static delete(e){delete X_[e]}}function Q_({publicKey:e,signature:t,payload:r}){var n;const o=Y_(r.method),i=128|parseInt((null==(n=r.version)?void 0:n.toString())||"4"),s=function(e){const t=px.decode(e)[0];return 42===t?0:60===t?2:1}(r.address),a="00"===r.era?new Uint8Array([0]):Y_(r.era);if(1!==a.length&&2!==a.length)throw new Error("Invalid era length");const c=parseInt(r.nonce,16),u=new Uint8Array([255&c,c>>8&255]),l=BigInt(`0x${function(e){return e.startsWith("0x")?e.slice(2):e}(r.tip)}`),f=function(e){if(e<BigInt(1)<<BigInt(6))return new Uint8Array([Number(e<<BigInt(2))]);if(e<BigInt(1)<<BigInt(14)){const t=e<<BigInt(2)|BigInt(1);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255))])}if(e<BigInt(1)<<BigInt(30)){const t=e<<BigInt(2)|BigInt(2);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255)),Number(t>>BigInt(16)&BigInt(255)),Number(t>>BigInt(24)&BigInt(255))])}throw new Error("BigInt compact encoding not supported > 2^30")}(l),d=new Uint8Array([0,...e,s,...t,...a,...u,...f,...o]),h=function(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){const t=e<<2|1;return new Uint8Array([255&t,t>>8&255])}if(e<1<<30){const t=e<<2|2;return new Uint8Array([255&t,t>>8&255,t>>16&255,t>>24&255])}throw new Error("Compact encoding > 2^30 not supported")}(d.length+1);return new Uint8Array([...h,i,...d])}function Y_(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function J_(e){const t=Uint8Array.from(Buffer.from(e.signature,"hex")),r=function(e){const t=px.decode(e);if(t.length<33)throw new Error("Too short to contain a public key");return t.slice(1,33)}(e.transaction.address),n=Q_({publicKey:r,signature:t,payload:e.transaction});return function(e){const t=Y_(e),r=JE.blake2b(t,void 0,32);return"0x"+Buffer.from(r).toString("hex")}(Buffer.from(n).toString("hex"))}const $_="PARSE_ERROR",eP="INVALID_REQUEST",tP="METHOD_NOT_FOUND",rP="INVALID_PARAMS",nP="INTERNAL_ERROR",oP="SERVER_ERROR",iP=[-32700,-32600,-32601,-32602,-32603],sP={[$_]:{code:-32700,message:"Parse error"},[eP]:{code:-32600,message:"Invalid Request"},[tP]:{code:-32601,message:"Method not found"},[rP]:{code:-32602,message:"Invalid params"},[nP]:{code:-32603,message:"Internal error"},[oP]:{code:-32e3,message:"Server error"}},aP=oP;function cP(e){return Object.keys(sP).includes(e)?sP[e]:sP[aP]}var uP,lP={},fP={};var dP,hP,pP={};var yP=(hP||(hP=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Vf;t.__exportStar(function(){if(uP)return fP;function e(){return(null==z?void 0:z.crypto)||(null==z?void 0:z.msCrypto)||{}}function t(){const t=e();return t.subtle||t.webkitSubtle}return uP=1,Object.defineProperty(fP,"__esModule",{value:!0}),fP.isBrowserCryptoAvailable=fP.getSubtleCrypto=fP.getBrowerCrypto=void 0,fP.getBrowerCrypto=e,fP.getSubtleCrypto=t,fP.isBrowserCryptoAvailable=function(){return!!e()&&!!t()},fP}(),e),t.__exportStar(function(){if(dP)return pP;function e(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function t(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node}return dP=1,Object.defineProperty(pP,"__esModule",{value:!0}),pP.isBrowser=pP.isNode=pP.isReactNative=void 0,pP.isReactNative=e,pP.isNode=t,pP.isBrowser=function(){return!e()&&!t()},pP}(),e)}(lP)),lP);function gP(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function mP(e=6){return BigInt(gP(e))}function bP(e,t,r){return{id:r||gP(),jsonrpc:"2.0",method:e,params:t}}function vP(e,t){return{id:e,jsonrpc:"2.0",result:t}}function wP(e,t,r){return{id:e,jsonrpc:"2.0",error:xP(t,r)}}function xP(e,t){return void 0===e?cP(nP):("string"==typeof e&&(e=Object.assign(Object.assign({},cP(oP)),{message:e})),void 0!==t&&(e.data=t),function(e){return iP.includes(e)}(e.code)&&(e=function(e){const t=Object.values(sP).find(t=>t.code===e);return t||sP[aP]}(e.code)),e)}class SP{}class EP extends SP{constructor(){super()}}class AP extends EP{constructor(e){super()}}function kP(e,t){const r=function(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}function OP(e){return kP(e,"^wss?:")}function TP(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function CP(e){return TP(e)&&"method"in e}function IP(e){return TP(e)&&(_P(e)||PP(e))}function _P(e){return"result"in e}function PP(e){return"error"in e}class RP extends AP{constructor(e){super(e),this.events=new _s.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(bP(e.method,e.params||[],e.id||mP().toString()),t)}async requestStrict(e,t){return new Promise(async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,e=>{PP(e)?n(e.error):r(e.result)});try{await this.connection.send(e,t)}catch(e){n(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),IP(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",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(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}var NP,BP;const jP=e=>e.split("?")[0],MP=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:BP?NP:(BP=1,NP=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")});class LP{constructor(e){if(this.url=e,this.events=new _s.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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{typeof this.socket>"u"?t(new Error("Connection already closed")):(this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close())})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(zd(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!OP(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(new Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{const n=yP.isReactNative()?void 0:{rejectUnauthorized:(i=e,!new RegExp("wss?://localhost(:d{2,5})?").test(i))},o=new MP(e,[],n);var i;typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u"?o.onerror=e=>{const t=e;r(this.emitError(t.error))}:o.on("error",e=>{r(this.emitError(e))}),o.onopen=()=>{this.onOpen(o),t(o)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t="string"==typeof e.data?Fd(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),n=wP(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return function(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}(e,jP(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${jP(this.url)}`));return this.events.emit("register_error",t),t}}const UP="core",DP=`wc@2:${UP}:`,FP="error",zP={database:":memory:"},qP="client_ed25519_seed",VP=fd.ONE_DAY,HP=fd.SIX_HOURS,KP="wss://relay.walletconnect.org",WP="relayer_message",GP="relayer_message_ack",XP="relayer_connect",ZP="relayer_disconnect",QP="relayer_error",YP="relayer_connection_stalled",JP="relayer_publish",$P="payload",eR="connect",tR="disconnect",rR="error",nR="2.21.9",oR={link_mode:"link_mode",relay:"relay"},iR="inbound",sR="outbound",aR="WALLETCONNECT_LINK_MODE_APPS",cR="subscription_created",uR="subscription_deleted",lR="subscription_sync",fR="subscription_resubscribed",dR={wc_pairingDelete:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:fd.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:fd.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:fd.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:0},res:{ttl:fd.ONE_DAY,prompt:!1,tag:0}}},hR="pairing_create",pR="pairing_expire",yR="pairing_delete",gR="pairing_ping",mR="history_created",bR="history_updated",vR="history_deleted",wR="history_sync",xR="expirer_created",SR="expirer_deleted",ER="expirer_expired",AR="expirer_sync",kR="https://verify.walletconnect.org",OR=kR,TR=`${OR}/v3`,CR=["https://verify.walletconnect.com",kR],IR="pairing_started",_R="pairing_uri_validation_success",PR="pairing_uri_not_expired",RR="store_new_pairing",NR="subscribing_pairing_topic",BR="subscribe_pairing_topic_success",jR="existing_pairing",MR="pairing_not_expired",LR="emit_inactive_pairing",UR="emit_session_proposal",DR="no_internet_connection",FR="malformed_pairing_uri",zR="active_pairing_already_exists",qR="subscribe_pairing_topic_failure",VR="pairing_expired",HR="proposal_listener_not_found",KR="session_approve_started",WR="session_namespaces_validation_success",GR="subscribing_session_topic",XR="subscribe_session_topic_success",ZR="session_approve_publish_success",QR="store_session",YR="no_internet_connection",JR="proposal_expired",$R="subscribe_session_topic_failure",eN="session_approve_namespace_validation_failure",tN="proposal_not_found",rN="authenticated_session_approve_started",nN="create_authenticated_session_topic",oN="cacaos_verified",iN="store_authenticated_session",sN="subscribing_authenticated_session_topic",aN="subscribe_authenticated_session_topic_success",cN="publishing_authenticated_session_approve",uN="no_internet_connection",lN="invalid_cacao",fN="subscribe_authenticated_session_topic_failure",dN="authenticated_session_approve_publish_failure",hN="authenticated_session_pending_request_not_found";var pN=function(e,t){if(e.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 o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(255!==r[s])throw new TypeError(i+" is ambiguous");r[s]=o}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,o=0;e[t]===c;)n++,t++;for(var i=(e.length-t)*u+1>>>0,s=new Uint8Array(i);e[t];){var l=r[e.charCodeAt(t)];if(255===l)return;for(var f=0,d=i-1;(0!==l||f<o)&&-1!==d;d--,f++)l+=a*s[d]>>>0,s[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=f,t++}if(" "!==e[t]){for(var h=i-o;h!==i&&0===s[h];)h++;for(var p=new Uint8Array(n+(i-h)),y=n;h!==i;)p[y++]=s[h++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,i=t.length;o!==i&&0===t[o];)o++,r++;for(var s=(i-o)*l+1>>>0,u=new Uint8Array(s);o!==i;){for(var f=t[o],d=0,h=s-1;(0!==f||d<n)&&-1!==h;h--,d++)f+=256*u[h]>>>0,u[h]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");n=d,o++}for(var p=s-n;p!==s&&0===u[p];)p++;for(var y=c.repeat(r);p<s;++p)y+=e.charAt(u[p]);return y},decodeUnsafe:f,decode:function(e){var r=f(e);if(r)return r;throw new Error(`Non-${t} character`)}}},yN=pN;const gN=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class mN{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class bN{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return wN(this,e)}}class vN{constructor(e){this.decoders=e}or(e){return wN(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const wN=(e,t)=>new vN({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class xN{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new mN(e,t,r),this.decoder=new bN(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const SN=({name:e,prefix:t,encode:r,decode:n})=>new xN(e,t,r,n),EN=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=yN(r,t);return SN({prefix:e,name:t,encode:n,decode:e=>gN(o(e))})},AN=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>SN({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let i="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,i+=t[o&a>>s];if(s&&(i+=t[o&a<<r-s]),n)for(;i.length*r&7;)i+="=";return i})(e,n,r),decode:t=>((e,t,r,n)=>{const o={};for(let e=0;e<t.length;++e)o[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const s=new Uint8Array(i*r/8|0);let a=0,c=0,u=0;for(let t=0;t<i;++t){const i=o[e[t]];if(void 0===i)throw new SyntaxError(`Non-${n} character`);c=c<<r|i,a+=r,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),kN=SN({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var ON=Object.freeze({__proto__:null,identity:kN});const TN=AN({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var CN=Object.freeze({__proto__:null,base2:TN});const IN=AN({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var _N=Object.freeze({__proto__:null,base8:IN});const PN=EN({prefix:"9",name:"base10",alphabet:"0123456789"});var RN=Object.freeze({__proto__:null,base10:PN});const NN=AN({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),BN=AN({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var jN=Object.freeze({__proto__:null,base16:NN,base16upper:BN});const MN=AN({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),LN=AN({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),UN=AN({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),DN=AN({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),FN=AN({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),zN=AN({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),qN=AN({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),VN=AN({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),HN=AN({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var KN=Object.freeze({__proto__:null,base32:MN,base32upper:LN,base32pad:UN,base32padupper:DN,base32hex:FN,base32hexupper:zN,base32hexpad:qN,base32hexpadupper:VN,base32z:HN});const WN=EN({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),GN=EN({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var XN=Object.freeze({__proto__:null,base36:WN,base36upper:GN});const ZN=EN({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),QN=EN({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var YN=Object.freeze({__proto__:null,base58btc:ZN,base58flickr:QN});const JN=AN({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),$N=AN({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),eB=AN({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),tB=AN({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var rB=Object.freeze({__proto__:null,base64:JN,base64pad:$N,base64url:eB,base64urlpad:tB});const nB=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),oB=nB.reduce((e,t,r)=>(e[r]=t,e),[]),iB=nB.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);const sB=SN({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=oB[t],"")},decode:function(e){const t=[];for(const r of e){const e=iB[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var aB=Object.freeze({__proto__:null,base256emoji:sB}),cB=function e(t,r,n){r=r||[];for(var o=n=n||0;t>=fB;)r[n++]=255&t|uB,t/=128;for(;t&lB;)r[n++]=255&t|uB,t>>>=7;return r[n]=0|t,e.bytes=n-o+1,r},uB=128,lB=-128,fB=Math.pow(2,31);var dB=function e(t,r){var n,o=0,i=(r=r||0,0),s=r,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],o+=i<28?(n&pB)<<i:(n&pB)*Math.pow(2,i),i+=7}while(n>=hB);return e.bytes=s-r,o},hB=128,pB=127;var yB=Math.pow(2,7),gB=Math.pow(2,14),mB=Math.pow(2,21),bB=Math.pow(2,28),vB=Math.pow(2,35),wB=Math.pow(2,42),xB=Math.pow(2,49),SB=Math.pow(2,56),EB=Math.pow(2,63),AB={encode:cB,decode:dB,encodingLength:function(e){return e<yB?1:e<gB?2:e<mB?3:e<bB?4:e<vB?5:e<wB?6:e<xB?7:e<SB?8:e<EB?9:10}},kB=AB;const OB=(e,t,r=0)=>(kB.encode(e,t,r),t),TB=e=>kB.encodingLength(e),CB=(e,t)=>{const r=t.byteLength,n=TB(e),o=n+TB(r),i=new Uint8Array(o+r);return OB(e,i,0),OB(r,i,n),i.set(t,o),new IB(e,r,t,i)};class IB{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const _B=({name:e,code:t,encode:r})=>new PB(e,t,r);class PB{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?CB(this.code,t):t.then(e=>CB(this.code,e))}throw Error("Unknown type, must be binary type")}}const RB=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),NB=_B({name:"sha2-256",code:18,encode:RB("SHA-256")}),BB=_B({name:"sha2-512",code:19,encode:RB("SHA-512")});Object.freeze({__proto__:null,sha256:NB,sha512:BB});const jB=gN,MB={code:0,name:"identity",encode:jB,digest:e=>CB(0,jB(e))};Object.freeze({__proto__:null,identity:MB});new TextEncoder,new TextDecoder;const LB={...ON,...CN,..._N,...RN,...jN,...KN,...XN,...YN,...rB,...aB};function UB(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function DB(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const FB=DB("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>(new TextEncoder).encode(e.substring(1))),zB=DB("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{const t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?UB(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),qB={utf8:FB,"utf-8":FB,hex:LB.base16,latin1:zB,ascii:zB,binary:zB,...LB};var VB=Object.defineProperty,HB=(e,t,r)=>((e,t,r)=>t in e?VB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class KB{constructor(e,t){this.core=e,this.logger=t,HB(this,"keychain",new Map),HB(this,"name","keychain"),HB(this,"version","0.3"),HB(this,"initialized",!1),HB(this,"storagePrefix",DP),HB(this,"init",async()=>{if(!this.initialized){const e=await this.getKeyChain();typeof e<"u"&&(this.keychain=e),this.initialized=!0}}),HB(this,"has",e=>(this.isInitialized(),this.keychain.has(e))),HB(this,"set",async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()}),HB(this,"get",e=>{this.isInitialized();const t=this.keychain.get(e);if(typeof t>"u"){const{message:t}=O_("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}),HB(this,"del",async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()}),this.core=e,this.logger=xh(t,this.name)}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,kA(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?OA(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var WB=Object.defineProperty,GB=(e,t,r)=>((e,t,r)=>t in e?WB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class XB{constructor(e,t,r){this.core=e,this.logger=t,GB(this,"name","crypto"),GB(this,"keychain"),GB(this,"randomSessionIdentifier",MI()),GB(this,"initialized",!1),GB(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),GB(this,"hasKeys",e=>(this.isInitialized(),this.keychain.has(e))),GB(this,"getClientId",async()=>{this.isInitialized();return um(dm(await this.getClientSeed()).publicKey)}),GB(this,"generateKeyPair",()=>{this.isInitialized();const e=function(){const e=nI.utils.randomPrivateKey(),t=nI.getPublicKey(e);return{privateKey:zE(e,RI),publicKey:zE(t,RI)}}();return this.setPrivateKey(e.publicKey,e.privateKey)}),GB(this,"signJWT",async e=>{this.isInitialized();const t=dm(await this.getClientSeed()),r=this.randomSessionIdentifier,n=VP;return await hm(r,e,n,t)}),GB(this,"generateSharedKey",(e,t,r)=>{this.isInitialized();const n=function(e,t){const r=nI.getSharedSecret(FE(e,RI),FE(t,RI));return zE(zT(qT,r,void 0,void 0,32),RI)}(this.getPrivateKey(e),t);return this.setSymKey(n,r)}),GB(this,"setSymKey",async(e,t)=>{this.isInitialized();const r=t||LI(e);return await this.keychain.set(r,e),r}),GB(this,"deleteKeyPair",async e=>{this.isInitialized(),await this.keychain.del(e)}),GB(this,"deleteSymKey",async e=>{this.isInitialized(),await this.keychain.del(e)}),GB(this,"encode",async(e,t,r)=>{this.isInitialized();const n=KI(r),o=zd(t);if(GI(n))return function(e,t){const r=DI(2),n=Lk(12),o=VI({type:r,sealed:FE(e,jI),iv:n});return t===BI?zI(o):o}(o,r?.encoding);if(WI(n)){const t=n.senderPublicKey,r=n.receiverPublicKey;e=await this.generateSharedKey(t,r)}const i=this.getSymKey(e),{type:s,senderPublicKey:a}=n;return function(e){const t=DI(typeof e.type<"u"?e.type:0);if(1===FI(t)&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof e.senderPublicKey<"u"?FE(e.senderPublicKey,RI):void 0,n=typeof e.iv<"u"?FE(e.iv,RI):Lk(12),o=FE(e.symKey,RI),i=VI({type:t,sealed:MT(o,n).encrypt(FE(e.message,jI)),iv:n,senderPublicKey:r});return e.encoding===BI?zI(i):i}({type:s,symKey:i,message:o,senderPublicKey:a,encoding:r?.encoding})}),GB(this,"decode",async(e,t,r)=>{this.isInitialized();const n=function(e,t){const r=HI({encoded:e,encoding:t?.encoding});return KI({type:FI(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?zE(r.senderPublicKey,RI):void 0,receiverPublicKey:t?.receiverPublicKey})}(t,r);if(GI(n)){const e=function(e,t){const{sealed:r}=HI({encoded:e,encoding:t});return zE(r,jI)}(t,r?.encoding);return Fd(e)}if(WI(n)){const t=n.receiverPublicKey,r=n.senderPublicKey;e=await this.generateSharedKey(t,r)}try{const n=function(e){const t=FE(e.symKey,RI),{sealed:r,iv:n}=HI({encoded:e.encoded,encoding:e.encoding}),o=MT(t,n).decrypt(r);if(null===o)throw new Error("Failed to decrypt");return zE(o,jI)}({symKey:this.getSymKey(e),encoded:t,encoding:r?.encoding});return Fd(n)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}}),GB(this,"getPayloadType",(e,t=NI)=>FI(HI({encoded:e,encoding:t}).type)),GB(this,"getPayloadSenderPublicKey",(e,t=NI)=>{const r=HI({encoded:e,encoding:t});return r.senderPublicKey?zE(r.senderPublicKey,RI):void 0}),this.core=e,this.logger=xh(t,this.name),this.keychain=r||new KB(this.core,this.logger)}get context(){return wh(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(qP)}catch{e=MI(),await this.keychain.set(qP,e)}return function(e,t="utf8"){const r=qB[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):UB(globalThis.Buffer.from(e,"utf-8"))}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var ZB=Object.defineProperty,QB=Object.defineProperties,YB=Object.getOwnPropertyDescriptors,JB=Object.getOwnPropertySymbols,$B=Object.prototype.hasOwnProperty,ej=Object.prototype.propertyIsEnumerable,tj=(e,t,r)=>t in e?ZB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rj=(e,t,r)=>tj(e,"symbol"!=typeof t?t+"":t,r);class nj extends Ih{constructor(e,t){super(e,t),this.logger=e,this.core=t,rj(this,"messages",new Map),rj(this,"messagesWithoutClientAck",new Map),rj(this,"name","messages"),rj(this,"version","0.3"),rj(this,"initialized",!1),rj(this,"storagePrefix",DP),rj(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const e=await this.getRelayerMessages();typeof e<"u"&&(this.messages=e);const t=await this.getRelayerMessagesWithoutClientAck();typeof t<"u"&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}}),rj(this,"set",async(e,t,r)=>{this.isInitialized();const n=UI(t);let o=this.messages.get(e);if(typeof o>"u"&&(o={}),typeof o[n]<"u")return n;if(o[n]=t,this.messages.set(e,o),r===iR){const r=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,((e,t)=>QB(e,YB(t)))(((e,t)=>{for(var r in t||(t={}))$B.call(t,r)&&tj(e,r,t[r]);if(JB)for(var r of JB(t))ej.call(t,r)&&tj(e,r,t[r]);return e})({},r),{[n]:t}))}return await this.persist(),n}),rj(this,"get",e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t}),rj(this,"getWithoutAck",e=>{this.isInitialized();const t={};for(const r of e){const e=this.messagesWithoutClientAck.get(r)||{};t[r]=Object.values(e)}return t}),rj(this,"has",(e,t)=>{this.isInitialized();return typeof this.get(e)[UI(t)]<"u"}),rj(this,"ack",async(e,t)=>{this.isInitialized();const r=this.messagesWithoutClientAck.get(e);if(typeof r>"u")return;delete r[UI(t)],0===Object.keys(r).length?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,r),await this.persist()}),rj(this,"del",async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()}),this.logger=xh(e,this.name),this.core=t}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,kA(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,kA(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?OA(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?OA(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var oj=Object.defineProperty,ij=Object.defineProperties,sj=Object.getOwnPropertyDescriptors,aj=Object.getOwnPropertySymbols,cj=Object.prototype.hasOwnProperty,uj=Object.prototype.propertyIsEnumerable,lj=(e,t,r)=>t in e?oj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fj=(e,t)=>{for(var r in t||(t={}))cj.call(t,r)&&lj(e,r,t[r]);if(aj)for(var r of aj(t))uj.call(t,r)&&lj(e,r,t[r]);return e},dj=(e,t)=>ij(e,sj(t)),hj=(e,t,r)=>lj(e,"symbol"!=typeof t?t+"":t,r);class pj extends _h{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,hj(this,"events",new _s.EventEmitter),hj(this,"name","publisher"),hj(this,"queue",new Map),hj(this,"publishTimeout",fd.toMiliseconds(fd.ONE_MINUTE)),hj(this,"initialPublishTimeout",fd.toMiliseconds(15*fd.ONE_SECOND)),hj(this,"needsTransportRestart",!1),hj(this,"publish",async(e,t,r)=>{var n,o,i,s,a;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});const c=r?.ttl||HP,u=r?.prompt||!1,l=r?.tag||0,f=r?.id||mP().toString(),d=QI(ZI().protocol),h={id:f,method:r?.publishMethod||d.publish,params:fj({topic:e,message:t,ttl:c,prompt:u,tag:l,attestation:r?.attestation},r?.tvf)},p=`Failed to publish payload, please try again. id:${f} tag:${l}`;try{__(null==(n=h.params)?void 0:n.prompt)&&(null==(o=h.params)||delete o.prompt),__(null==(i=h.params)?void 0:i.tag)&&(null==(s=h.params)||delete s.tag);const a=new Promise(async e=>{const t=({id:r})=>{var n;(null==(n=h.id)?void 0:n.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(JP,t),e())};this.relayer.events.on(JP,t);const n=CA(new Promise((e,t)=>{this.rpcPublish(h,r).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${f} tag:${l}`);try{await n,this.events.removeListener(JP,t)}catch(e){this.queue.set(f,{request:h,opts:r,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,topic:e,message:t,opts:r}}),await CA(a,this.publishTimeout,p)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(a=r?.internal)&&a.throwOnFailedPublish)throw e}finally{this.queue.delete(f)}}),hj(this,"publishCustom",async e=>{var t,r,n,o,i;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:e});const{payload:s,opts:a={}}=e,{attestation:c,tvf:u,publishMethod:l,prompt:f,tag:d,ttl:h=fd.FIVE_MINUTES}=a,p=a.id||mP().toString(),y=QI(ZI().protocol),g=l||y.publish,m={id:p,method:g,params:fj(dj(fj({},s),{ttl:h,prompt:f,tag:d,attestation:c}),u)},b=`Failed to publish custom payload, please try again. id:${p} tag:${d}`;try{__(null==(t=m.params)?void 0:t.prompt)&&(null==(r=m.params)||delete r.prompt),__(null==(n=m.params)?void 0:n.tag)&&(null==(o=m.params)||delete o.tag);const e=new Promise(async e=>{const t=({id:r})=>{var n;(null==(n=m.id)?void 0:n.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(JP,t),e())};this.relayer.events.on(JP,t);const r=CA(new Promise((e,t)=>{this.rpcPublish(m,a).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${g} id:${p} tag:${d}`);try{await r,this.events.removeListener(JP,t)}catch(e){this.queue.set(p,{request:m,opts:a,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:p,payload:s,opts:a}}),await CA(e,this.publishTimeout,b)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(i=a?.internal)&&i.throwOnFailedPublish)throw e}finally{this.queue.delete(p)}}),hj(this,"on",(e,t)=>{this.events.on(e,t)}),hj(this,"once",(e,t)=>{this.events.once(e,t)}),hj(this,"off",(e,t)=>{this.events.off(e,t)}),hj(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.relayer=e,this.logger=xh(t,this.name),this.registerEventListeners()}get context(){return wh(this.logger)}async rpcPublish(e,t){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:e});const r=await this.relayer.request(e);return this.relayer.events.emit(JP,fj(fj({},e),t)),this.logger.debug("Successfully Published Payload"),r}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{var r;const n=e.attempt+1;this.queue.set(t,dj(fj({},e),{attempt:n})),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${null==(r=e.request.params)?void 0:r.tag}, attempt: ${n}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(yd,()=>{if(this.needsTransportRestart)return this.needsTransportRestart=!1,void this.relayer.events.emit(YP);this.checkQueue()}),this.relayer.on(GP,e=>{this.removeRequestFromQueue(e.id.toString())})}}var yj=Object.defineProperty,gj=(e,t,r)=>((e,t,r)=>t in e?yj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class mj{constructor(){gj(this,"map",new Map),gj(this,"set",(e,t)=>{const r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])}),gj(this,"get",e=>this.map.get(e)||[]),gj(this,"exists",(e,t)=>this.get(e).includes(t)),gj(this,"delete",(e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;const r=this.get(e);if(!this.exists(e,t))return;const n=r.filter(e=>e!==t);n.length?this.map.set(e,n):this.map.delete(e)}),gj(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}}var bj=Object.defineProperty,vj=Object.defineProperties,wj=Object.getOwnPropertyDescriptors,xj=Object.getOwnPropertySymbols,Sj=Object.prototype.hasOwnProperty,Ej=Object.prototype.propertyIsEnumerable,Aj=(e,t,r)=>t in e?bj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kj=(e,t)=>{for(var r in t||(t={}))Sj.call(t,r)&&Aj(e,r,t[r]);if(xj)for(var r of xj(t))Ej.call(t,r)&&Aj(e,r,t[r]);return e},Oj=(e,t)=>vj(e,wj(t)),Tj=(e,t,r)=>Aj(e,"symbol"!=typeof t?t+"":t,r);class Cj extends Nh{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,Tj(this,"subscriptions",new Map),Tj(this,"topicMap",new mj),Tj(this,"events",new _s.EventEmitter),Tj(this,"name","subscription"),Tj(this,"version","0.3"),Tj(this,"pending",new Map),Tj(this,"cached",[]),Tj(this,"initialized",!1),Tj(this,"storagePrefix",DP),Tj(this,"subscribeTimeout",fd.toMiliseconds(fd.ONE_MINUTE)),Tj(this,"initialSubscribeTimeout",fd.toMiliseconds(15*fd.ONE_SECOND)),Tj(this,"clientId"),Tj(this,"batchSubscribeTopicsLimit",500),Tj(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),Tj(this,"subscribe",async(e,t)=>{var r;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{const n=ZI(t),o={topic:e,relay:n,transportType:t?.transportType};null!=(r=t?.internal)&&r.skipSubscribe||this.pending.set(e,o);const i=await this.rpcSubscribe(e,n,t);return"string"==typeof i&&(this.onSubscribe(i,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),i}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}}),Tj(this,"unsubscribe",async(e,t)=>{this.isInitialized(),typeof t?.id<"u"?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)}),Tj(this,"isSubscribed",e=>new Promise(t=>{t(this.topicMap.topics.includes(e))})),Tj(this,"isKnownTopic",e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))})),Tj(this,"on",(e,t)=>{this.events.on(e,t)}),Tj(this,"once",(e,t)=>{this.events.once(e,t)}),Tj(this,"off",(e,t)=>{this.events.off(e,t)}),Tj(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),Tj(this,"start",async()=>{await this.onConnect()}),Tj(this,"stop",async()=>{await this.onDisconnect()}),Tj(this,"restart",async()=>{await this.restore(),await this.onRestart()}),Tj(this,"checkPending",async()=>{if(!(0!==this.pending.size||this.initialized&&this.relayer.connected))return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}),Tj(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(yd,async()=>{await this.checkPending()}),this.events.on(cR,async e=>{const t=cR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(uR,async e=>{const t=uR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}),this.relayer=e,this.logger=xh(t,this.name),this.clientId=""}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const r=this.topicMap.get(e);await Promise.all(r.map(async r=>await this.unsubscribeById(e,r,t)))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{const n=ZI(r);await this.restartToComplete({topic:e,id:t,relay:n}),await this.rpcUnsubscribe(e,t,n);const o=T_("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,r){var n,o;const i=await this.getSubscriptionId(e);if(null!=(n=r?.internal)&&n.skipSubscribe)return i;(!r||r?.transportType===oR.relay)&&await this.restartToComplete({topic:e,id:e,relay:t});const s={method:QI(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const a=null==(o=r?.internal)?void 0:o.throwOnFailedPublish;try{if(r?.transportType===oR.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(e=>this.logger.warn(e))},fd.toMiliseconds(fd.ONE_SECOND)),i;const t=new Promise(async t=>{const r=n=>{n.topic===e&&(this.events.removeListener(cR,r),t(n.id))};this.events.on(cR,r);try{const n=await CA(new Promise((e,t)=>{this.relayer.request(s).catch(e=>{this.logger.warn(e,e?.message),t(e)}).then(e)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(cR,r),t(n)}catch{}}),n=await CA(t,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!n&&a)throw new Error(`Subscribing to ${e} failed, please try again`);return n?i:null}catch(e){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(YP),a)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t={method:QI(e[0].relay.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{await await CA(new Promise(e=>{this.relayer.request(t).catch(e=>this.logger.warn(e)).then(e)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(YP)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t={method:QI(e[0].relay.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};let r;this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{r=await await CA(new Promise((e,r)=>{this.relayer.request(t).catch(e=>{this.logger.warn(e),r(e)}).then(e)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(YP)}return r}rpcUnsubscribe(e,t,r){const n={method:QI(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,Oj(kj({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,kj({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,kj({},t)),this.topicMap.set(t.topic,e),this.events.emit(cR,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:t}=O_("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(uR,Oj(kj({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(lR)}async onRestart(){if(this.cached.length){const e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<t;r++){const t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(fR)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size&&!e.every(e=>{var t;return e.topic===(null==(t=this.subscriptions.get(e.id))?void 0:t.topic)})){const{message:e}=O_("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async e=>Oj(kj({},e),{id:await this.getSubscriptionId(e.topic)})))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(await function(e){return new Promise(t=>setTimeout(t,e))}(fd.toMiliseconds(fd.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(t.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return UI(e+await this.getClientId())}}var Ij=Object.defineProperty,_j=Object.getOwnPropertySymbols,Pj=Object.prototype.hasOwnProperty,Rj=Object.prototype.propertyIsEnumerable,Nj=(e,t,r)=>t in e?Ij(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bj=(e,t)=>{for(var r in t||(t={}))Pj.call(t,r)&&Nj(e,r,t[r]);if(_j)for(var r of _j(t))Rj.call(t,r)&&Nj(e,r,t[r]);return e},jj=(e,t,r)=>Nj(e,"symbol"!=typeof t?t+"":t,r);class Mj extends Ph{constructor(e){super(e),jj(this,"protocol","wc"),jj(this,"version",2),jj(this,"core"),jj(this,"logger"),jj(this,"events",new _s.EventEmitter),jj(this,"provider"),jj(this,"messages"),jj(this,"subscriber"),jj(this,"publisher"),jj(this,"name","relayer"),jj(this,"transportExplicitlyClosed",!1),jj(this,"initialized",!1),jj(this,"connectionAttemptInProgress",!1),jj(this,"relayUrl"),jj(this,"projectId"),jj(this,"packageName"),jj(this,"bundleId"),jj(this,"hasExperiencedNetworkDisruption",!1),jj(this,"pingTimeout"),jj(this,"heartBeatTimeout",fd.toMiliseconds(fd.THIRTY_SECONDS+fd.FIVE_SECONDS)),jj(this,"reconnectTimeout"),jj(this,"connectPromise"),jj(this,"reconnectInProgress",!1),jj(this,"requestsInFlight",[]),jj(this,"connectTimeout",fd.toMiliseconds(15*fd.ONE_SECOND)),jj(this,"request",async e=>{var t,r;this.logger.debug("Publishing Request Payload");const n=e.id||mP().toString();await this.toEstablishConnection();try{this.logger.trace({id:n,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - publishing...");const o=`${n}:${(null==(r=e.params)?void 0:r.tag)||""}`;this.requestsInFlight.push(o);const i=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==o),i}catch(e){throw this.logger.debug(`Failed to Publish Request: ${n}`),e}}),jj(this,"resetPingTimeout",()=>{yA()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,r,n;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),null==(n=null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.terminate)||n.call(r)}catch(e){this.logger.warn(e,e?.message)}},this.heartBeatTimeout))}),jj(this,"onPayloadHandler",e=>{this.onProviderPayload(e),this.resetPingTimeout()}),jj(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected 🛜"),this.startPingTimeout(),this.events.emit(XP)}),jj(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected 🛑"),this.requestsInFlight=[],this.onProviderDisconnect()}),jj(this,"onProviderErrorHandler",e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit(QP,e),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),jj(this,"registerProviderListeners",()=>{this.provider.on($P,this.onPayloadHandler),this.provider.on(eR,this.onConnectHandler),this.provider.on(tR,this.onDisconnectHandler),this.provider.on(rR,this.onProviderErrorHandler)}),this.core=e.core,this.logger=typeof e.logger<"u"&&"string"!=typeof e.logger?xh(e.logger,this.name):th(vh({level:e.logger||"error"})),this.messages=new nj(this.logger,e.core),this.subscriber=new Cj(this,this.logger),this.publisher=new pj(this,this.logger),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||KP,gA()&&typeof global<"u"&&typeof(null==global?void 0:global.Platform)<"u"&&"android"===(null==global?void 0:global.Platform.OS)?this.packageName=vA():gA()&&typeof global<"u"&&typeof(null==global?void 0:global.Platform)<"u"&&"ios"===(null==global?void 0:global.Platform.OS)&&(this.bundleId=vA()),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e?.message))}get context(){return wh(this.logger)}get connected(){var e,t,r;return 1===(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)||!1}get connecting(){var e,t,r;return 0===(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)||void 0!==this.connectPromise||!1}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:oR.relay},sR)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){var r,n,o;this.isInitialized(),(null==t||!t.transportType||"relay"===t?.transportType)&&await this.toEstablishConnection();const i=typeof(null==(r=t?.internal)?void 0:r.throwOnFailedPublish)>"u"||(null==(n=t?.internal)?void 0:n.throwOnFailedPublish);let s,a=(null==(o=this.subscriber.topicMap.get(e))?void 0:o[0])||"";const c=t=>{t.topic===e&&(this.subscriber.off(cR,c),s())};return await Promise.all([new Promise(e=>{s=e,this.subscriber.on(cR,c)}),new Promise(async(r,n)=>{a=await this.subscriber.subscribe(e,Bj({internal:{throwOnFailedPublish:i}},t)).catch(e=>{i&&n(e)})||a,r()})]),a}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await CA(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(this.subscriber.hasAnyTopics){if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(t,r)=>{await this.connect(e).then(t).catch(r).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}else this.logger.info("Starting WS connection skipped because the client has no topics to work with.")}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await W_())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(0===e?.length)return void this.logger.trace("Batch message events is empty. Ignoring...");const t=e.sort((e,t)=>e.publishedAt-t.publishedAt);this.logger.debug(`Batch of ${t.length} message events sorted`);for(const e of t)try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,"Error while processing batch message event: "+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){const{topic:r}=e;if(!t.sessionExists){const e={topic:r,expiry:PA(fd.FIVE_MINUTES),relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,e)}this.events.emit(WP,e),await this.recordMessageEvent(e,iR)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let t=1;for(;t<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise(async(e,t)=>{const r=()=>{t(new Error("Connection interrupted while trying to connect"))};this.provider.once(tR,r),await CA(new Promise((e,t)=>{this.provider.connect().then(e).catch(t)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(e=>{t(e)}).finally(()=>{this.provider.off(tR,r),clearTimeout(this.reconnectTimeout)}),await new Promise(async(e,r)=>{const n=()=>{t(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(tR,n),await this.subscriber.start().then(e).catch(r).finally(()=>{this.provider.off(tR,n)})}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(e){await this.subscriber.stop();const t=e;this.logger.warn({},t.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(e=>setTimeout(e,fd.toMiliseconds(1*t))),t++}}startPingTimeout(){var e,t,r,n,o;if(yA())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(o=null==(n=null==(r=this.provider)?void 0:r.connection)?void 0:n.socket)||o.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new RP(new LP(EA({sdkVersion:nR,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){const{topic:r,message:n}=e;await this.messages.set(r,n,t)}async shouldIgnoreMessageEvent(e){const{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;const n=this.messages.has(t,r);return n&&this.logger.warn(`Ignoring duplicate message: ${r}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),CP(e)){if(!e.method.endsWith("_subscription"))return;const t=e.params,{topic:r,message:n,publishedAt:o,attestation:i}=t.data,s={topic:r,message:n,publishedAt:o,transportType:oR.relay,attestation:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(Bj({type:"event",event:t.id},s)),this.events.emit(t.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}else IP(e)&&this.events.emit(GP,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,iR),this.events.emit(WP,e))}async acknowledgePayload(e){const t=vP(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off($P,this.onPayloadHandler),this.provider.off(eR,this.onConnectHandler),this.provider.off(tR,this.onDisconnectHandler),this.provider.off(rR,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await W_();G_(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,e?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(yd,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&function(){var e;return!mA()||!Im.getDocument()||"visible"===(null==(e=Im.getDocument())?void 0:e.visibilityState)}())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(ZP),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},fd.toMiliseconds(.1)))))}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise)return void await this.connectPromise;await this.connect()}}}function Lj(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Uj(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Dj="[object Arguments]",Fj="[object Object]";function zj(){}function qj(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function Vj(e,t,r,n,o,i,s){const a=s(e,t,r,n,o,i);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Hj(e,t,i,s)}return Hj(e,t,i,s)}function Hj(e,t,r,n){if(Object.is(e,t))return!0;let o=Uj(e),i=Uj(t);if(o===Dj&&(o=Fj),i===Dj&&(i=Fj),o!==i)return!1;switch(o){case"[object String]":return e.toString()===t.toString();case"[object Number]":return function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}(e.valueOf(),t.valueOf());case"[object Boolean]":case"[object Date]":case"[object Symbol]":return Object.is(e.valueOf(),t.valueOf());case"[object RegExp]":return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}const s=(r=r??new Map).get(e),a=r.get(t);if(null!=s&&null!=a)return s===t;r.set(e,t),r.set(t,e);try{switch(o){case"[object Map]":if(e.size!==t.size)return!1;for(const[o,i]of e.entries())if(!t.has(o)||!Vj(i,t.get(o),o,e,t,r,n))return!1;return!0;case"[object Set]":{if(e.size!==t.size)return!1;const o=Array.from(e.values()),i=Array.from(t.values());for(let s=0;s<o.length;s++){const a=o[s],c=i.findIndex(o=>Vj(a,o,void 0,e,t,r,n));if(-1===c)return!1;i.splice(c,1)}return!0}case"[object Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":case"[object BigUint64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object BigInt64Array]":case"[object Float32Array]":case"[object Float64Array]":if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!Vj(e[o],t[o],o,e,t,r,n))return!1;return!0;case"[object ArrayBuffer]":return e.byteLength===t.byteLength&&Hj(new Uint8Array(e),new Uint8Array(t),r,n);case"[object DataView]":return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&Hj(new Uint8Array(e),new Uint8Array(t),r,n);case"[object Error]":return e.name===t.name&&e.message===t.message;case Fj:{if(!(Hj(e.constructor,t.constructor,r,n)||qj(e)&&qj(t)))return!1;const o=[...Object.keys(e),...Lj(e)],i=[...Object.keys(t),...Lj(t)];if(o.length!==i.length)return!1;for(let i=0;i<o.length;i++){const s=o[i],a=e[s];if(!Object.hasOwn(t,s))return!1;if(!Vj(a,t[s],s,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function Kj(e,t){return function(e,t,r){return Vj(e,t,void 0,void 0,void 0,void 0,r)}(e,t,zj)}var Wj=Object.defineProperty,Gj=Object.getOwnPropertySymbols,Xj=Object.prototype.hasOwnProperty,Zj=Object.prototype.propertyIsEnumerable,Qj=(e,t,r)=>t in e?Wj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yj=(e,t)=>{for(var r in t||(t={}))Xj.call(t,r)&&Qj(e,r,t[r]);if(Gj)for(var r of Gj(t))Zj.call(t,r)&&Qj(e,r,t[r]);return e},Jj=(e,t,r)=>Qj(e,"symbol"!=typeof t?t+"":t,r);class $j extends Rh{constructor(e,t,r,n=DP,o=void 0){super(e,t,r,n),this.core=e,this.logger=t,this.name=r,Jj(this,"map",new Map),Jj(this,"version","0.3"),Jj(this,"cached",[]),Jj(this,"initialized",!1),Jj(this,"getKey"),Jj(this,"storagePrefix",DP),Jj(this,"recentlyDeleted",[]),Jj(this,"recentlyDeletedLimit",200),Jj(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{this.getKey&&null!==e&&!__(e)?this.map.set(this.getKey(e),e):function(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}(e)?this.map.set(e.id,e):function(e){return e?.topic}(e)&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)}),Jj(this,"set",async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())}),Jj(this,"get",e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e))),Jj(this,"getAll",e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(r=>Kj(t[r],e[r]))):this.values)),Jj(this,"update",async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});const r=Yj(Yj({},this.getData(e)),t);this.map.set(e,r),await this.persist()}),Jj(this,"delete",async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())}),this.logger=xh(t,this.name),this.storagePrefix=n,this.getKey=o}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:t}=O_("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}const{message:t}=O_("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:e}=O_("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var eM=Object.defineProperty,tM=(e,t,r)=>((e,t,r)=>t in e?eM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class rM{constructor(e,t){this.core=e,this.logger=t,tM(this,"name","pairing"),tM(this,"version","0.3"),tM(this,"events",new Ps),tM(this,"pairings"),tM(this,"initialized",!1),tM(this,"storagePrefix",DP),tM(this,"ignoredPayloadTypes",[1]),tM(this,"registeredMethods",[]),tM(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),tM(this,"register",({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]}),tM(this,"create",async e=>{this.isInitialized();const t=MI(),r=await this.core.crypto.setSymKey(t),n=PA(fd.FIVE_MINUTES),o={protocol:"irn"},i={topic:r,expiry:n,relay:o,active:!1,methods:e?.methods},s=c_({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:o,expiryTimestamp:n,methods:e?.methods});return this.events.emit(hR,i),this.core.expirer.set(r,n),await this.pairings.set(r,i),await this.core.relayer.subscribe(r,{transportType:e?.transportType,internal:e?.internal}),{topic:r,uri:s}}),tM(this,"pair",async e=>{this.isInitialized();const t=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[IR]}});this.isValidPair(e,t);const{topic:r,symKey:n,relay:o,expiryTimestamp:i,methods:s}=s_(e.uri);let a;if(t.props.properties.topic=r,t.addTrace(_R),t.addTrace(PR),this.pairings.keys.includes(r)){if(a=this.pairings.get(r),t.addTrace(jR),a.active)throw t.setError(zR),new Error(`Pairing already exists: ${r}. Please try again with a new connection URI.`);t.addTrace(MR)}const c=i||PA(fd.FIVE_MINUTES),u={topic:r,relay:o,expiry:c,active:!1,methods:s};this.core.expirer.set(r,c),await this.pairings.set(r,u),t.addTrace(RR),e.activatePairing&&await this.activate({topic:r}),this.events.emit(hR,u),t.addTrace(LR),this.core.crypto.keychain.has(r)||await this.core.crypto.setSymKey(n,r),t.addTrace(NR);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{t.setError(DR)}try{await this.core.relayer.subscribe(r,{relay:o})}catch(e){throw t.setError(qR),e}return t.addTrace(BR),u}),tM(this,"activate",async({topic:e})=>{this.isInitialized();const t=PA(fd.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})}),tM(this,"ping",async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:t}=e;if(this.pairings.keys.includes(t)){const e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:n,reject:o}=TA();this.events.once(NA("pairing_ping",e),({error:e})=>{e?o(e):n()}),await r()}}),tM(this,"updateExpiry",async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})}),tM(this,"updateMetadata",async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})}),tM(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),tM(this,"disconnect",async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",T_("USER_DISCONNECTED")),await this.deletePairing(t))}),tM(this,"formatUriFromPairing",e=>{this.isInitialized();const{topic:t,relay:r,expiry:n,methods:o}=e,i=this.core.crypto.keychain.get(t);return c_({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:i,relay:r,expiryTimestamp:n,methods:o})}),tM(this,"sendRequest",async(e,t,r)=>{const n=bP(t,r),o=await this.core.crypto.encode(e,n),i=dR[t].req;return this.core.history.set(e,n),this.core.relayer.publish(e,o,i),n.id}),tM(this,"sendResult",async(e,t,r)=>{const n=vP(e,r),o=await this.core.crypto.encode(t,n),i=(await this.core.history.get(t,e)).request.method,s=dR[i].res;await this.core.relayer.publish(t,o,s),await this.core.history.resolve(n)}),tM(this,"sendError",async(e,t,r)=>{const n=wP(e,r),o=await this.core.crypto.encode(t,n),i=(await this.core.history.get(t,e)).request.method,s=dR[i]?dR[i].res:dR.unregistered_method.res;await this.core.relayer.publish(t,o,s),await this.core.history.resolve(n)}),tM(this,"deletePairing",async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,T_("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])}),tM(this,"cleanup",async()=>{const e=this.pairings.getAll().filter(e=>RA(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))}),tM(this,"onRelayEventRequest",async e=>{const{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return await this.onPairingPingRequest(t,r);case"wc_pairingDelete":return await this.onPairingDeleteRequest(t,r);default:return await this.onUnknownRpcMethodRequest(t,r)}}),tM(this,"onRelayEventResponse",async e=>{const{topic:t,payload:r}=e,n=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===n?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(n)}),tM(this,"onPairingPingRequest",async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit(gR,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),tM(this,"onPairingPingResponse",(e,t)=>{const{id:r}=t;setTimeout(()=>{_P(t)?this.events.emit(NA("pairing_ping",r),{}):PP(t)&&this.events.emit(NA("pairing_ping",r),{error:t.error})},500)}),tM(this,"onPairingDeleteRequest",async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(yR,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),tM(this,"onUnknownRpcMethodRequest",async(e,t)=>{const{id:r,method:n}=t;try{if(this.registeredMethods.includes(n))return;const t=T_("WC_METHOD_UNSUPPORTED",n);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),tM(this,"onUnknownRpcMethodResponse",e=>{this.registeredMethods.includes(e)||this.logger.error(T_("WC_METHOD_UNSUPPORTED",e))}),tM(this,"isValidPair",(e,t)=>{var r;if(!F_(e)){const{message:r}=O_("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(FR),new Error(r)}if(!function(e){function t(e){try{return typeof new URL(e)<"u"}catch{return!1}}try{if(P_(e,!1))return!!t(e)||t(DA(e))}catch{}return!1}(e.uri)){const{message:r}=O_("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(FR),new Error(r)}const n=s_(e?.uri);if(null==(r=n?.relay)||!r.protocol){const{message:e}=O_("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(FR),new Error(e)}if(null==n||!n.symKey){const{message:e}=O_("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(FR),new Error(e)}if(null!=n&&n.expiryTimestamp&&fd.toMiliseconds(n?.expiryTimestamp)<Date.now()){t.setError(VR);const{message:e}=O_("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(e)}}),tM(this,"isValidPing",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)}),tM(this,"isValidDisconnect",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)}),tM(this,"isValidPairingTopic",async e=>{if(!P_(e,!1)){const{message:t}=O_("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.pairings.keys.includes(e)){const{message:t}=O_("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(RA(this.pairings.get(e).expiry)){await this.deletePairing(e);const{message:t}=O_("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}),this.core=e,this.logger=xh(t,this.name),this.pairings=new $j(this.core,this.logger,this.name,this.storagePrefix)}get context(){return wh(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(WP,async e=>{const{topic:t,message:r,transportType:n}=e;if(this.pairings.keys.includes(t)&&n!==oR.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{const e=await this.core.crypto.decode(t,r);CP(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):IP(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,r)}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(ER,async e=>{const{topic:t}=_A(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(pR,{topic:t}))})}}var nM=Object.defineProperty,oM=(e,t,r)=>((e,t,r)=>t in e?nM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class iM extends Ch{constructor(e,t){super(e,t),this.core=e,this.logger=t,oM(this,"records",new Map),oM(this,"events",new _s.EventEmitter),oM(this,"name","history"),oM(this,"version","0.3"),oM(this,"cached",[]),oM(this,"initialized",!1),oM(this,"storagePrefix",DP),oM(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),oM(this,"set",(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;const n={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:PA(fd.THIRTY_DAYS)};this.records.set(n.id,n),this.persist(),this.events.emit(mR,n)}),oM(this,"resolve",async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;const t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=PP(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(bR,t))}),oM(this,"get",async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t))),oM(this,"delete",(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach(r=>{if(r.topic===e){if(typeof t<"u"&&r.id!==t)return;this.records.delete(r.id),this.events.emit(vR,r)}}),this.persist()}),oM(this,"exists",async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e)),oM(this,"on",(e,t)=>{this.events.on(e,t)}),oM(this,"once",(e,t)=>{this.events.once(e,t)}),oM(this,"off",(e,t)=>{this.events.off(e,t)}),oM(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=xh(t,this.name)}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const r={topic:t.topic,request:bP(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:t}=O_("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(wR)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:e}=O_("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(mR,e=>{const t=mR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(bR,e=>{const t=bR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(vR,e=>{const t=vR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(yd,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{fd.toMiliseconds(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(vR,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var sM=Object.defineProperty,aM=(e,t,r)=>((e,t,r)=>t in e?sM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class cM extends Bh{constructor(e,t){super(e,t),this.core=e,this.logger=t,aM(this,"expirations",new Map),aM(this,"events",new _s.EventEmitter),aM(this,"name","expirer"),aM(this,"version","0.3"),aM(this,"cached",[]),aM(this,"initialized",!1),aM(this,"storagePrefix",DP),aM(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),aM(this,"has",e=>{try{const t=this.formatTarget(e);return typeof this.getExpiration(t)<"u"}catch{return!1}}),aM(this,"set",(e,t)=>{this.isInitialized();const r=this.formatTarget(e),n={target:r,expiry:t};this.expirations.set(r,n),this.checkExpiry(r,n),this.events.emit(xR,{target:r,expiration:n})}),aM(this,"get",e=>{this.isInitialized();const t=this.formatTarget(e);return this.getExpiration(t)}),aM(this,"del",e=>{if(this.isInitialized(),this.has(e)){const t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(SR,{target:t,expiration:r})}}),aM(this,"on",(e,t)=>{this.events.on(e,t)}),aM(this,"once",(e,t)=>{this.events.once(e,t)}),aM(this,"off",(e,t)=>{this.events.off(e,t)}),aM(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=xh(t,this.name)}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return function(e){return IA("topic",e)}(e);if("number"==typeof e)return function(e){return IA("id",e)}(e);const{message:t}=O_("UNKNOWN_TYPE","Target type: "+typeof e);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(AR)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:e}=O_("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:t}=O_("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),new Error(t)}return t}checkExpiry(e,t){const{expiry:r}=t;fd.toMiliseconds(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(ER,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(yd,()=>this.checkExpirations()),this.events.on(xR,e=>{const t=xR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(ER,e=>{const t=ER;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(SR,e=>{const t=SR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var uM=Object.defineProperty,lM=(e,t,r)=>((e,t,r)=>t in e?uM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class fM extends jh{constructor(e,t,r){super(e,t,r),this.core=e,this.logger=t,this.store=r,lM(this,"name","verify-api"),lM(this,"abortController"),lM(this,"isDevEnv"),lM(this,"verifyUrlV3",TR),lM(this,"storagePrefix",DP),lM(this,"version",2),lM(this,"publicKey"),lM(this,"fetchPromise"),lM(this,"init",async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&fd.toMiliseconds(null==(e=this.publicKey)?void 0:e.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),lM(this,"register",async e=>{if(!mA()||this.isDevEnv)return;const t=window.location.origin,{id:r,decryptedId:n}=e,o=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${r}&decryptedId=${n}`;try{const e=Im.getDocument(),t=this.startAbortTimer(5*fd.ONE_SECOND),n=await new Promise((n,i)=>{const s=()=>{window.removeEventListener("message",c),e.body.removeChild(a),i("attestation aborted")};this.abortController.signal.addEventListener("abort",s);const a=e.createElement("iframe");a.src=o,a.style.display="none",a.addEventListener("error",s,{signal:this.abortController.signal});const c=o=>{if(o.data&&"string"==typeof o.data)try{const i=JSON.parse(o.data);if("verify_attestation"===i.type){if(fm(i.attestation).payload.id!==r)return;clearInterval(t),e.body.removeChild(a),this.abortController.signal.removeEventListener("abort",s),window.removeEventListener("message",c),n(null===i.attestation?"":i.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(a),window.addEventListener("message",c,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",n),n}catch(e){this.logger.warn(e)}return""}),lM(this,"resolve",async e=>{if(this.isDevEnv)return"";const{attestationId:t,hash:r,encryptedId:n}=e;if(""===t)return void this.logger.debug("resolve: attestationId is empty, skipping");if(t){if(fm(t).payload.id!==n)return;const e=await this.isValidJwtAttestation(t);if(e)return e.isVerified?e:void this.logger.warn("resolve: jwt attestation: origin url not verified")}if(!r)return;const o=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(r,o)}),lM(this,"fetchAttestation",async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);const r=this.startAbortTimer(5*fd.ONE_SECOND),n=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(r),200===n.status?await n.json():void 0}),lM(this,"getVerifyUrl",e=>{let t=e||OR;return CR.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${OR}`),t=OR),t}),lM(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const e=this.startAbortTimer(fd.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}}),lM(this,"persistPublicKey",async e=>{this.logger.debug("persisting public key to local storage",e),await this.store.setItem(this.storeKey,e),this.publicKey=e}),lM(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),lM(this,"isValidJwtAttestation",async e=>{const t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}const r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(e,r)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}}),lM(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),lM(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{const t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});const e=await this.fetchPromise;return this.fetchPromise=void 0,e}),lM(this,"validateAttestation",(e,t)=>{const r=XI(e,t.publicKey),n={hasExpired:fd.toMiliseconds(r.exp)<Date.now(),payload:r};if(n.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:n.payload.origin,isScam:n.payload.isScam,isVerified:n.payload.isVerified}}),this.logger=xh(t,this.name),this.abortController=new AbortController,this.isDevEnv=UA(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return wh(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),fd.toMiliseconds(e))}}var dM=Object.defineProperty,hM=(e,t,r)=>((e,t,r)=>t in e?dM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class pM extends Mh{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,hM(this,"context","echo"),hM(this,"registerDeviceToken",async e=>{const{clientId:t,token:r,notificationType:n,enableEncrypted:o=!1}=e,i=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:n,token:r,always_raw:o})})}),this.logger=xh(t,this.context)}}var yM=Object.defineProperty,gM=Object.getOwnPropertySymbols,mM=Object.prototype.hasOwnProperty,bM=Object.prototype.propertyIsEnumerable,vM=(e,t,r)=>t in e?yM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wM=(e,t)=>{for(var r in t||(t={}))mM.call(t,r)&&vM(e,r,t[r]);if(gM)for(var r of gM(t))bM.call(t,r)&&vM(e,r,t[r]);return e},xM=(e,t,r)=>vM(e,"symbol"!=typeof t?t+"":t,r);class SM extends Lh{constructor(e,t,r=!0){super(e,t,r),this.core=e,this.logger=t,xM(this,"context","event-client"),xM(this,"storagePrefix",DP),xM(this,"storageVersion",.1),xM(this,"events",new Map),xM(this,"shouldPersist",!1),xM(this,"init",async()=>{if(!UA())try{const e={eventId:LA(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:SA(this.core.relayer.protocol,this.core.relayer.version,nR)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}}),xM(this,"createEvent",e=>{const{event:t="ERROR",type:r="",properties:{topic:n,trace:o}}=e,i=LA(),s=this.core.projectId||"",a=Date.now(),c=wM({eventId:i,timestamp:a,props:{event:t,type:r,properties:{topic:n,trace:o}},bundleId:s,domain:this.getAppDomain()},this.setMethods(i));return this.telemetryEnabled&&(this.events.set(i,c),this.shouldPersist=!0),c}),xM(this,"getEvent",e=>{const{eventId:t,topic:r}=e;if(t)return this.events.get(t);const n=Array.from(this.events.values()).find(e=>e.props.properties.topic===r);return n?wM(wM({},n),this.setMethods(n.eventId)):void 0}),xM(this,"deleteEvent",e=>{const{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0}),xM(this,"setEventListeners",()=>{this.core.heartbeat.on(yd,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{fd.fromMiliseconds(Date.now())-fd.fromMiliseconds(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})}),xM(this,"setMethods",e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)})),xM(this,"addTrace",(e,t)=>{const r=this.events.get(e);r&&(r.props.properties.trace.push(t),this.events.set(e,r),this.shouldPersist=!0)}),xM(this,"setError",(e,t)=>{const r=this.events.get(e);r&&(r.props.type=t,r.timestamp=Date.now(),this.events.set(e,r),this.shouldPersist=!0)}),xM(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),xM(this,"restore",async()=>{try{const e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,wM(wM({},e),this.setMethods(e.eventId)))})}catch(e){this.logger.warn(e)}}),xM(this,"submit",async()=>{if(!this.telemetryEnabled||0===this.events.size)return;const e=[];for(const[t,r]of this.events)r.props.type&&e.push(r);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(const t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}}),xM(this,"sendEvent",async e=>{const t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${nR}${t}`,{method:"POST",body:JSON.stringify(e)})}),xM(this,"getAppDomain",()=>xA().url),this.logger=xh(t,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var EM=Object.defineProperty,AM=Object.getOwnPropertySymbols,kM=Object.prototype.hasOwnProperty,OM=Object.prototype.propertyIsEnumerable,TM=(e,t,r)=>t in e?EM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,CM=(e,t)=>{for(var r in t||(t={}))kM.call(t,r)&&TM(e,r,t[r]);if(AM)for(var r of AM(t))OM.call(t,r)&&TM(e,r,t[r]);return e},IM=(e,t,r)=>TM(e,"symbol"!=typeof t?t+"":t,r);class _M extends kh{constructor(e){var t;super(e),IM(this,"protocol","wc"),IM(this,"version",2),IM(this,"name",UP),IM(this,"relayUrl"),IM(this,"projectId"),IM(this,"customStoragePrefix"),IM(this,"events",new _s.EventEmitter),IM(this,"logger"),IM(this,"heartbeat"),IM(this,"relayer"),IM(this,"crypto"),IM(this,"storage"),IM(this,"history"),IM(this,"expirer"),IM(this,"pairing"),IM(this,"verify"),IM(this,"echoClient"),IM(this,"linkModeSupportedApps"),IM(this,"eventClient"),IM(this,"initialized",!1),IM(this,"logChunkController"),IM(this,"on",(e,t)=>this.events.on(e,t)),IM(this,"once",(e,t)=>this.events.once(e,t)),IM(this,"off",(e,t)=>this.events.off(e,t)),IM(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),IM(this,"dispatchEnvelope",({topic:e,message:t,sessionExists:r})=>{if(!e||!t)return;const n={topic:e,message:t,publishedAt:Date.now(),transportType:oR.link_mode};this.relayer.onLinkMessageEvent(n,{sessionExists:r})});const r=this.getGlobalCore(e?.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(e){console.warn("Failed to copy global core",e)}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||KP,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=vh({level:"string"==typeof e?.logger&&e.logger?e.logger:FP,name:UP}),{logger:o,chunkLoggerController:i}=Sh({opts:n,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=i,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=xh(o,this.name),this.heartbeat=new gd,this.crypto=new XB(this,this.logger,e?.keychain),this.history=new iM(this,this.logger),this.expirer=new cM(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new Zd(CM(CM({},zP),e?.storageOptions)),this.relayer=new Mj({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new rM(this,this.logger),this.verify=new fM(this,this.logger,this.storage),this.echoClient=new pM(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new SM(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(e){const t=new _M(e);await t.initialize();const r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return wh(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(aR,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(aR)||[],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}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;const t=`_walletConnectCore_${e}`,r=`${t}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[t]}catch(e){return void console.warn("Failed to get global WalletConnect core",e)}}setGlobalCore(e){var t;try{if(this.isGlobalCoreDisabled())return;const r=`_walletConnectCore_${(null==(t=e.opts)?void 0:t.customStoragePrefix)||""}`;globalThis[r]=e}catch(e){console.warn("Failed to set global WalletConnect core",e)}}isGlobalCoreDisabled(){try{return typeof process<"u"&&"true"===process.env.DISABLE_GLOBAL_CORE}catch{return!0}}}const PM=_M,RM="client",NM=`wc@2:${RM}:`,BM=RM,jM="error",MM="WALLETCONNECT_DEEPLINK_CHOICE",LM="Proposal expired",UM=fd.SEVEN_DAYS,DM={wc_sessionPropose:{req:{ttl:fd.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:1104},res:{ttl:fd.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:1106},res:{ttl:fd.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:fd.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:fd.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:1112},res:{ttl:fd.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:1114},res:{ttl:fd.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:fd.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:fd.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1119}}},FM={min:fd.FIVE_MINUTES,max:fd.SEVEN_DAYS},zM="IDLE",qM="ACTIVE",VM={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},HM=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],KM="wc@1.5:auth:",WM=`${KM}:PUB_KEY`;var GM=Object.defineProperty,XM=Object.defineProperties,ZM=Object.getOwnPropertyDescriptors,QM=Object.getOwnPropertySymbols,YM=Object.prototype.hasOwnProperty,JM=Object.prototype.propertyIsEnumerable,$M=(e,t,r)=>t in e?GM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eL=(e,t)=>{for(var r in t||(t={}))YM.call(t,r)&&$M(e,r,t[r]);if(QM)for(var r of QM(t))JM.call(t,r)&&$M(e,r,t[r]);return e},tL=(e,t)=>XM(e,ZM(t)),rL=(e,t,r)=>$M(e,"symbol"!=typeof t?t+"":t,r);class nL extends zh{constructor(e){super(e),rL(this,"name","engine"),rL(this,"events",new Ps),rL(this,"initialized",!1),rL(this,"requestQueue",{state:zM,queue:[]}),rL(this,"sessionRequestQueue",{state:zM,queue:[]}),rL(this,"emittedSessionRequests",new FA({limit:500})),rL(this,"requestQueueDelay",fd.ONE_SECOND),rL(this,"expectedPairingMethodMap",new Map),rL(this,"recentlyDeletedMap",new Map),rL(this,"recentlyDeletedLimit",200),rL(this,"relayMessageCache",[]),rL(this,"pendingSessions",new Map),rL(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(DM)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},fd.toMiliseconds(this.requestQueueDelay)))}),rL(this,"connect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const t=tL(eL({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t),t.optionalNamespaces=function(e,t){var r,n,o,i,s,a;const c=S_(e),u=S_(t),l={},f=Object.keys(c).concat(Object.keys(u));for(const e of f)l[e]={chains:BA(null==(r=c[e])?void 0:r.chains,null==(n=u[e])?void 0:n.chains),methods:BA(null==(o=c[e])?void 0:o.methods,null==(i=u[e])?void 0:i.methods),events:BA(null==(s=c[e])?void 0:s.events,null==(a=u[e])?void 0:a.events)};return l}(t.requiredNamespaces,t.optionalNamespaces),t.requiredNamespaces={};const{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:o,sessionProperties:i,scopedProperties:s,relays:a}=t;let c,u=r,l=!1;try{if(u){const e=this.client.core.pairing.pairings.get(u);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),l=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${u}) failed`),e}if(!u||!l){const{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});u=e,c=t}if(!u){const{message:e}=O_("NO_MATCHING_KEY",`connect() pairing topic: ${u}`);throw new Error(e)}const f=await this.client.core.crypto.generateKeyPair(),d=DM.wc_sessionPropose.req.ttl||fd.FIVE_MINUTES,h=PA(d),p=tL(eL(eL({requiredNamespaces:n,optionalNamespaces:o,relays:a??[{protocol:"irn"}],proposer:{publicKey:f,metadata:this.client.metadata},expiryTimestamp:h,pairingTopic:u},i&&{sessionProperties:i}),s&&{scopedProperties:s}),{id:gP()}),y=NA("session_connect",p.id),{reject:g,resolve:m,done:b}=TA(d,LM),v=({id:e})=>{e===p.id&&(this.client.events.off("proposal_expire",v),this.pendingSessions.delete(p.id),this.events.emit(y,{error:{message:LM,code:0}}))};return this.client.events.on("proposal_expire",v),this.events.once(y,({error:e,session:t})=>{this.client.events.off("proposal_expire",v),e?g(e):t&&m(t)}),await this.sendProposeSession({proposal:p,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:p.id}}}),await this.setProposal(p.id,p),{uri:c,approval:b}}),rL(this,"pair",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}}),rL(this,"approve",async e=>{var t,r,n;const o=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[KR]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw o.setError(YR),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),o.setError(tN),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(eN),e}const{id:i,relayProtocol:s,namespaces:a,sessionProperties:c,scopedProperties:u,sessionConfig:l}=e,f=this.client.proposal.get(i);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:d,proposer:h,requiredNamespaces:p,optionalNamespaces:y}=f;let g=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:d});g||(g=null==(n=this.client.core.eventClient)?void 0:n.createEvent({type:KR,properties:{topic:d,trace:[KR,WR]}}));const m=await this.client.core.crypto.generateKeyPair(),b=h.publicKey,v=await this.client.core.crypto.generateSharedKey(m,b),w=eL(eL(eL({relay:{protocol:s??"irn"},namespaces:a,controller:{publicKey:m,metadata:this.client.metadata},expiry:PA(UM)},c&&{sessionProperties:c}),u&&{scopedProperties:u}),l&&{sessionConfig:l}),x=oR.relay;g.addTrace(GR);try{await this.client.core.relayer.subscribe(v,{transportType:x,internal:{skipSubscribe:!0}})}catch(e){throw g.setError($R),e}g.addTrace(XR);const S=tL(eL({},w),{topic:v,requiredNamespaces:p,optionalNamespaces:y,pairingTopic:d,acknowledged:!1,self:w.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:m,transportType:oR.relay});await this.client.session.set(v,S),g.addTrace(QR);try{await this.sendApproveSession({sessionTopic:v,proposal:f,pairingProposalResponse:{relay:{protocol:s??"irn"},responderPublicKey:m},sessionSettleRequest:w,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:i}}}),g.addTrace(ZR)}catch(e){throw this.client.logger.error(e),this.client.session.delete(v,T_("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(v),e}return this.client.core.eventClient.deleteEvent({eventId:g.eventId}),await this.client.core.pairing.updateMetadata({topic:d,metadata:h.metadata}),await this.deleteProposal(i),await this.client.core.pairing.activate({topic:d}),await this.setExpiry(v,PA(UM)),{topic:v,acknowledged:()=>Promise.resolve(this.client.session.get(v))}}),rL(this,"reject",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}const{id:t,reason:r}=e;let n;try{n=this.client.proposal.get(t).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${t}) failed`),e}n&&await this.sendError({id:t,topic:n,error:r,rpcOpts:DM.wc_sessionPropose.reject}),await this.deleteProposal(t)}),rL(this,"update",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}const{topic:t,namespaces:r}=e,{done:n,resolve:o,reject:i}=TA(),s=gP(),a=mP().toString(),c=this.client.session.get(t).namespaces;return this.events.once(NA("session_update",s),({error:e})=>{e?i(e):o()}),await this.client.session.update(t,{namespaces:r}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:s,relayRpcId:a}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),i(e)}),{acknowledged:n}}),rL(this,"extend",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}const{topic:t}=e,r=gP(),{done:n,resolve:o,reject:i}=TA();return this.events.once(NA("session_extend",r),({error:e})=>{e?i(e):o()}),await this.setExpiry(t,PA(UM)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch(e=>{i(e)}),{acknowledged:n}}),rL(this,"request",async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}const{chainId:t,request:r,topic:n,expiry:o=DM.wc_sessionRequest.req.ttl}=e,i=this.client.session.get(n);i?.transportType===oR.relay&&await this.confirmOnlineStateOrThrow();const s=gP(),a=mP().toString(),{done:c,resolve:u,reject:l}=TA(o,"Request expired. Please try again.");this.events.once(NA("session_request",s),({error:e,result:t})=>{e?l(e):u(t)});const f="wc_sessionRequest",d=this.getAppLinkIfEnabled(i.peer.metadata,i.transportType);if(d)return await this.sendRequest({clientRpcId:s,relayRpcId:a,topic:n,method:f,params:{request:tL(eL({},r),{expiryTimestamp:PA(o)}),chainId:t},expiry:o,throwOnFailedPublish:!0,appLink:d}).catch(e=>l(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:s}),await c();const h={request:tL(eL({},r),{expiryTimestamp:PA(o)}),chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:s,relayRpcId:a,topic:n,method:f,params:h,expiry:o,throwOnFailedPublish:!0,tvf:this.getTVFParams(s,h)}).catch(e=>l(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:s}),e()}),new Promise(async e=>{var t;if(null==(t=i.sessionConfig)||!t.disableDeepLink){const e=await async function(e,t){let r="";try{if(mA()&&(r=localStorage.getItem(t),r))return r;r=await e.getItem(t)}catch(e){console.error(e)}return r}(this.client.core.storage,MM);await jA({id:s,topic:n,wcDeepLink:e})}e()}),c()]).then(e=>e[2])}),rL(this,"respond",async e=>{this.isInitialized(),await this.isValidRespond(e);const{topic:t,response:r}=e,{id:n}=r,o=this.client.session.get(t);o.transportType===oR.relay&&await this.confirmOnlineStateOrThrow();const i=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);_P(r)?await this.sendResult({id:n,topic:t,result:r.result,throwOnFailedPublish:!0,appLink:i}):PP(r)&&await this.sendError({id:n,topic:t,error:r.error,appLink:i}),this.cleanupAfterResponse(e)}),rL(this,"ping",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=gP(),r=mP().toString(),{done:n,resolve:o,reject:i}=TA();this.events.once(NA("session_ping",e),({error:e})=>{e?i(e):o()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:r}),n()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:t}))}),rL(this,"emit",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);const{topic:t,event:r,chainId:n}=e,o=mP().toString(),i=gP();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:n},throwOnFailedPublish:!0,relayRpcId:o,clientRpcId:i})}),rL(this,"disconnect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);const{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:T_("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else{if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:e}=O_("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw new Error(e)}await this.client.core.pairing.disconnect({topic:t})}}),rL(this,"find",e=>(this.isInitialized(),this.client.session.getAll().filter(t=>function(e,t){const{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),o=Object.keys(r);let i=!0;return!!AA(o,n)&&(n.forEach(t=>{const{accounts:n,methods:o,events:s}=e.namespaces[t],a=v_(n),c=r[t];AA(eA(t,c),a)&&AA(c.methods,o)&&AA(c.events,s)||(i=!1)}),i)}(t,e)))),rL(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),rL(this,"authenticate",async(e,t)=>{var r;this.isInitialized(),this.isValidAuthenticate(e);const n=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(r=this.client.metadata.redirect)?void 0:r.linkMode),o=n?oR.link_mode:oR.relay;o===oR.relay&&await this.confirmOnlineStateOrThrow();const{chains:i,statement:s="",uri:a,domain:c,nonce:u,type:l,exp:f,nbf:d,methods:h=[],expiry:p}=e,y=[...e.resources||[]],{topic:g,uri:m}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:g,uri:m}});const b=await this.client.core.crypto.generateKeyPair(),v=LI(b);if(await Promise.all([this.client.auth.authKeys.set(WM,{responseTopic:v,publicKey:b}),this.client.auth.pairingTopics.set(v,{topic:v,pairingTopic:g})]),await this.client.core.relayer.subscribe(v,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${g}`),h.length>0){const{namespace:e}=$E(i[0]);let t=tT(e,"request",h);iT(y)&&(t=rT(t,y.pop())),y.push(t)}const w=p&&p>DM.wc_sessionAuthenticate.req.ttl?p:DM.wc_sessionAuthenticate.req.ttl,x={authPayload:{type:l??"caip122",chains:i,statement:s,aud:a,domain:c,version:"1",nonce:u,iat:(new Date).toISOString(),exp:f,nbf:d,resources:y},requester:{publicKey:b,metadata:this.client.metadata},expiryTimestamp:PA(w)},S={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:i,methods:[...new Set(["personal_sign",...h])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:g,proposer:{publicKey:b,metadata:this.client.metadata},expiryTimestamp:PA(DM.wc_sessionPropose.req.ttl),id:gP()},{done:E,resolve:A,reject:k}=TA(w,"Request expired"),O=gP(),T=NA("session_connect",S.id),C=NA("session_request",O),I=async({error:e,session:t})=>{this.events.off(C,_),e?k(e):t&&A({session:t})},_=async e=>{var r,n,i;if(await this.deletePendingAuthRequest(O,{message:"fulfilled",code:0}),e.error){const t=T_("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off(T,I),k(e.error.message))}await this.deleteProposal(S.id),this.events.off(T,I);const{cacaos:s,responder:a}=e.result,c=[],u=[];for(const e of s){await ZO({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),k(T_("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:t}=e,r=iT(t.resources),n=[GO(t.iss)],o=XO(t.iss);if(r){const e=nT(r),t=oT(r);c.push(...e),n.push(...t)}for(const e of n)u.push(`${e}:${o}`)}const l=await this.client.core.crypto.generateSharedKey(b,a.publicKey);let f;c.length>0&&(f={topic:l,acknowledged:!0,self:{publicKey:b,metadata:this.client.metadata},peer:a,controller:a.publicKey,expiry:PA(UM),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:g,namespaces:E_([...new Set(c)],[...new Set(u)]),transportType:o},await this.client.core.relayer.subscribe(l,{transportType:o}),await this.client.session.set(l,f),g&&await this.client.core.pairing.updateMetadata({topic:g,metadata:a.metadata}),f=this.client.session.get(l)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(n=a.metadata.redirect)&&n.linkMode&&null!=(i=a.metadata.redirect)&&i.universal&&t&&(this.client.core.addLinkModeSupportedApp(a.metadata.redirect.universal),this.client.session.update(l,{transportType:oR.link_mode})),A({auths:s,session:f})};let P;this.events.once(T,I),this.events.once(C,_);try{if(n){const e=bP("wc_sessionAuthenticate",x,O);this.client.core.history.set(g,e);const r=await this.client.core.crypto.encode("",e,{type:2,encoding:BI});P=u_(t,g,r)}else await Promise.all([this.sendRequest({topic:g,method:"wc_sessionAuthenticate",params:x,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:O}),this.sendRequest({topic:g,method:"wc_sessionPropose",params:S,expiry:DM.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:S.id})])}catch(e){throw this.events.off(T,I),this.events.off(C,_),e}return await this.setProposal(S.id,S),await this.setAuthRequest(O,{request:tL(eL({},x),{verifyContext:{}}),pairingTopic:g,transportType:o}),{uri:P??m,response:E}}),rL(this,"approveSessionAuthenticate",async e=>{const{id:t,auths:r}=e,n=this.client.core.eventClient.createEvent({properties:{topic:t.toString(),trace:[rN]}});try{this.isInitialized()}catch(e){throw n.setError(uN),e}const o=this.getPendingAuthRequest(t);if(!o)throw n.setError(hN),new Error(`Could not find pending auth request with id ${t}`);const i=o.transportType||oR.relay;i===oR.relay&&await this.confirmOnlineStateOrThrow();const s=o.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=LI(s),u={type:1,receiverPublicKey:s,senderPublicKey:a},l=[],f=[];for(const e of r){if(!await ZO({cacao:e,projectId:this.client.core.projectId})){n.setError(lN);const e=T_("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:t,topic:c,error:e,encodeOpts:u}),new Error(e.message)}n.addTrace(oN);const{p:r}=e,o=iT(r.resources),i=[GO(r.iss)],s=XO(r.iss);if(o){const e=nT(o),t=oT(o);l.push(...e),i.push(...t)}for(const e of i)f.push(`${e}:${s}`)}const d=await this.client.core.crypto.generateSharedKey(a,s);let h;if(n.addTrace(nN),l?.length>0){h={topic:d,acknowledged:!0,self:{publicKey:a,metadata:this.client.metadata},peer:{publicKey:s,metadata:o.requester.metadata},controller:s,expiry:PA(UM),authentication:r,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:E_([...new Set(l)],[...new Set(f)]),transportType:i},n.addTrace(sN);try{await this.client.core.relayer.subscribe(d,{transportType:i})}catch(e){throw n.setError(fN),e}n.addTrace(aN),await this.client.session.set(d,h),n.addTrace(iN),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}n.addTrace(cN);try{await this.sendResult({topic:c,id:t,result:{cacaos:r,responder:{publicKey:a,metadata:this.client.metadata}},encodeOpts:u,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,i)})}catch(e){throw n.setError(dN),e}return await this.client.auth.requests.delete(t,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:n.eventId}),{session:h}}),rL(this,"rejectSessionAuthenticate",async e=>{this.isInitialized();const{id:t,reason:r}=e,n=this.getPendingAuthRequest(t);if(!n)throw new Error(`Could not find pending auth request with id ${t}`);n.transportType===oR.relay&&await this.confirmOnlineStateOrThrow();const o=n.requester.publicKey,i=await this.client.core.crypto.generateKeyPair(),s=LI(o),a={type:1,receiverPublicKey:o,senderPublicKey:i};await this.sendError({id:t,topic:s,error:r,encodeOpts:a,rpcOpts:DM.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(n.requester.metadata,n.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.deleteProposal(t)}),rL(this,"formatAuthMessage",e=>{this.isInitialized();const{request:t,iss:r}=e;return QO(t,r)}),rL(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{const e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)}),rL(this,"cleanupDuplicatePairings",async e=>{if(e.pairingTopic)try{const t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(r=>{var n,o;return(null==(n=r.peerMetadata)?void 0:n.url)&&(null==(o=r.peerMetadata)?void 0:o.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic});if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}}),rL(this,"deleteSession",async e=>{var t;const{topic:r,expirerHasDeleted:n=!1,emitEvent:o=!0,id:i=0}=e,{self:s}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,T_("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(s.publicKey)&&await this.client.core.crypto.deleteKeyPair(s.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(MM).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEach(e=>{e.topic===r&&this.deletePendingSessionRequest(e.id,T_("USER_DISCONNECTED"))}),r===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=zM),o&&this.client.events.emit("session_delete",{id:i,topic:r})}),rL(this,"deleteProposal",async(e,t)=>{if(t)try{const t=this.client.proposal.get(e),r=this.client.core.eventClient.getEvent({topic:t.pairingTopic});r?.setError(JR)}catch{}await Promise.all([this.client.proposal.delete(e,T_("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")}),rL(this,"deletePendingSessionRequest",async(e,t,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),r&&(this.sessionRequestQueue.state=zM,this.client.events.emit("session_request_expire",{id:e}))}),rL(this,"deletePendingAuthRequest",async(e,t,r=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])}),rL(this,"setExpiry",async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))}),rL(this,"setProposal",async(e,t)=>{this.client.core.expirer.set(e,PA(DM.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)}),rL(this,"setAuthRequest",async(e,t)=>{const{request:r,pairingTopic:n,transportType:o=oR.relay}=t;this.client.core.expirer.set(e,r.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:e,pairingTopic:n,verifyContext:r.verifyContext,transportType:o})}),rL(this,"setPendingSessionRequest",async e=>{const{id:t,topic:r,params:n,verifyContext:o}=e,i=n.request.expiryTimestamp||PA(DM.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,i),await this.client.pendingRequest.set(t,{id:t,topic:r,params:n,verifyContext:o})}),rL(this,"sendRequest",async e=>{const{topic:t,method:r,params:n,expiry:o,relayRpcId:i,clientRpcId:s,throwOnFailedPublish:a,appLink:c,tvf:u,publishOpts:l={}}=e,f=bP(r,n,s);let d;const h=!!c;try{const e=h?BI:NI;d=await this.client.core.crypto.encode(t,f,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t} failed`),e}let p;if(HM.includes(r)){const e=UI(JSON.stringify(f)),t=UI(d);p=await this.client.core.verify.register({id:t,decryptedId:e})}const y=eL(eL({},DM[r].req),l);if(y.attestation=p,o&&(y.ttl=o),i&&(y.id=i),this.client.core.history.set(t,f),h){const e=u_(c,t,d);await global.Linking.openURL(e,this.client.name)}else y.tvf=tL(eL({},u),{correlationId:f.id}),a?(y.internal=tL(eL({},y.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(t,d,y)):this.client.core.relayer.publish(t,d,y).catch(e=>this.client.logger.error(e));return f.id}),rL(this,"sendProposeSession",async e=>{const{proposal:t,publishOpts:r}=e,n=bP("wc_sessionPropose",t,t.id);this.client.core.history.set(t.pairingTopic,n);const o=await this.client.core.crypto.encode(t.pairingTopic,n,{encoding:NI}),i=UI(JSON.stringify(n)),s=UI(o),a=await this.client.core.verify.register({id:s,decryptedId:i});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:o},opts:tL(eL({},r),{publishMethod:"wc_proposeSession",attestation:a})})}),rL(this,"sendApproveSession",async e=>{const{sessionTopic:t,pairingProposalResponse:r,proposal:n,sessionSettleRequest:o,publishOpts:i}=e,s=vP(n.id,r),a=await this.client.core.crypto.encode(n.pairingTopic,s,{encoding:NI}),c=bP("wc_sessionSettle",o,i?.id),u=await this.client.core.crypto.encode(t,c,{encoding:NI});this.client.core.history.set(t,c),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:n.pairingTopic,sessionProposalResponse:a,sessionSettlementRequest:u},opts:tL(eL({},i),{publishMethod:"wc_approveSession"})})}),rL(this,"sendResult",async e=>{const{id:t,topic:r,result:n,throwOnFailedPublish:o,encodeOpts:i,appLink:s}=e,a=vP(t,n);let c;const u=s&&typeof(null==global?void 0:global.Linking)<"u";try{const e=u?BI:NI;c=await this.client.core.crypto.encode(r,a,tL(eL({},i||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${r} failed`),e}let l,f;try{l=await this.client.core.history.get(r,t);const e=l.request;try{f=this.getTVFParams(t,e.params,n)}catch(e){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${e?.message}`)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${r}, ${t}) failed`),e}if(u){const e=u_(s,r,c);await global.Linking.openURL(e,this.client.name)}else{const e=l.request.method,n=DM[e].res;n.tvf=tL(eL({},f),{correlationId:t}),o?(n.internal=tL(eL({},n.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,c,n)):this.client.core.relayer.publish(r,c,n).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(a)}),rL(this,"sendError",async e=>{const{id:t,topic:r,error:n,encodeOpts:o,rpcOpts:i,appLink:s}=e,a=wP(t,n);let c;const u=s&&typeof(null==global?void 0:global.Linking)<"u";try{const e=u?BI:NI;c=await this.client.core.crypto.encode(r,a,tL(eL({},o||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${r} failed`),e}let l;try{l=await this.client.core.history.get(r,t)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${r}, ${t}) failed`),e}if(u){const e=u_(s,r,c);await global.Linking.openURL(e,this.client.name)}else{const e=l.request.method,t=i||DM[e].res;this.client.core.relayer.publish(r,c,t)}await this.client.core.history.resolve(a)}),rL(this,"cleanup",async()=>{const e=[],t=[];this.client.session.getAll().forEach(t=>{let r=!1;RA(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{RA(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])}),rL(this,"onProviderMessageEvent",async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)}),rL(this,"onRelayEventRequest",async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()}),rL(this,"processRequestsQueue",async()=>{if(this.requestQueue.state!==qM){for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=qM;const e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=zM}else this.client.logger.info("Request queue already active, skipping...")}),rL(this,"processRequest",async e=>{const{topic:t,payload:r,attestation:n,transportType:o,encryptedId:i}=e,s=r.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:s}))switch(s){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:t,payload:r,attestation:n,encryptedId:i});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,r);case"wc_sessionPing":return await this.onSessionPingRequest(t,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:r,attestation:n,encryptedId:i,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(t,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:r,attestation:n,encryptedId:i,transportType:o});default:return this.client.logger.info(`Unsupported request method ${s}`)}}),rL(this,"onRelayEventResponse",async e=>{const{topic:t,payload:r,transportType:n}=e,o=(await this.client.core.history.get(t,r.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r,n);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${o}`)}}),rL(this,"onRelayEventUnknownPayload",e=>{const{topic:t}=e,{message:r}=O_("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw new Error(r)}),rL(this,"shouldIgnorePairingRequest",e=>{const{topic:t,requestMethod:r}=e,n=this.expectedPairingMethodMap.get(t);return!(!n||n.includes(r))&&!!(n.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),rL(this,"onSessionProposeRequest",async e=>{const{topic:t,payload:r,attestation:n,encryptedId:o}=e,{params:i,id:s}=r;try{const e=this.client.core.eventClient.getEvent({topic:t});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError(HR)),this.isValidConnect(eL({},r.params));const a=i.expiryTimestamp||PA(DM.wc_sessionPropose.req.ttl),c=eL({id:s,pairingTopic:t,expiryTimestamp:a,attestation:n,encryptedId:o},i);await this.setProposal(s,c);const u=await this.getVerifyContext({attestationId:n,hash:UI(JSON.stringify(r)),encryptedId:o,metadata:c.proposer.metadata});e?.addTrace(UR),this.client.events.emit("session_proposal",{id:s,params:c,verifyContext:u})}catch(e){await this.sendError({id:s,topic:t,error:e,rpcOpts:DM.wc_sessionPropose.autoReject}),this.client.logger.error(e)}}),rL(this,"onSessionProposeResponse",async(e,t,r)=>{const{id:n}=t;if(_P(t)){const{result:o}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const i=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:i});const s=i.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:s});const a=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});const c=await this.client.core.crypto.generateSharedKey(s,a);this.pendingSessions.set(n,{sessionTopic:c,pairingTopic:e,proposalId:n,publicKey:s});const u=await this.client.core.relayer.subscribe(c,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:u}),await this.client.core.pairing.activate({topic:e})}else if(PP(t)){await this.deleteProposal(n);const e=NA("session_connect",n);if(0===this.events.listenerCount(e))throw new Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}}),rL(this,"onSessionSettleRequest",async(e,t)=>{const{id:r,params:n}=t;try{this.isValidSessionSettleRequest(n);const{relay:r,controller:o,expiry:i,namespaces:s,sessionProperties:a,scopedProperties:c,sessionConfig:u}=t.params,l=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!l)return this.client.logger.error(`Pending session not found for topic ${e}`);const f=this.client.proposal.get(l.proposalId),d=tL(eL(eL(eL({topic:e,relay:r,expiry:i,namespaces:s,acknowledged:!0,pairingTopic:l.pairingTopic,requiredNamespaces:f.requiredNamespaces,optionalNamespaces:f.optionalNamespaces,controller:o.publicKey,self:{publicKey:l.publicKey,metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata}},a&&{sessionProperties:a}),c&&{scopedProperties:c}),u&&{sessionConfig:u}),{transportType:oR.relay});await this.client.session.set(d.topic,d),await this.setExpiry(d.topic,d.expiry),await this.client.core.pairing.updateMetadata({topic:l.pairingTopic,metadata:d.peer.metadata}),this.client.events.emit("session_connect",{session:d}),this.events.emit(NA("session_connect",l.proposalId),{session:d}),this.pendingSessions.delete(l.proposalId),this.deleteProposal(l.proposalId,!1),this.cleanupDuplicatePairings(d),await this.sendResult({id:t.id,topic:e,result:!0})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),rL(this,"onSessionSettleResponse",async(e,t)=>{const{id:r}=t;_P(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(NA("session_approve",r),{})):PP(t)&&(await this.client.session.delete(e,T_("USER_DISCONNECTED")),this.events.emit(NA("session_approve",r),{error:t.error}))}),rL(this,"onSessionUpdateRequest",async(e,t)=>{const{params:r,id:n}=t;try{const t=`${e}_session_update`,o=Z_.get(t);if(o&&this.isRequestOutOfSync(o,n))return this.client.logger.warn(`Discarding out of sync request - ${n}`),void this.sendError({id:n,topic:e,error:T_("INVALID_UPDATE_REQUEST")});this.isValidUpdate(eL({topic:e},r));try{Z_.set(t,n),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:n,topic:e,result:!0})}catch(e){throw Z_.delete(t),e}this.client.events.emit("session_update",{id:n,topic:e,params:r})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}}),rL(this,"isRequestOutOfSync",(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3)),rL(this,"onSessionUpdateResponse",(e,t)=>{const{id:r}=t,n=NA("session_update",r);if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners`);_P(t)?this.events.emit(NA("session_update",r),{}):PP(t)&&this.events.emit(NA("session_update",r),{error:t.error})}),rL(this,"onSessionExtendRequest",async(e,t)=>{const{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,PA(UM)),await this.sendResult({id:r,topic:e,result:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),rL(this,"onSessionExtendResponse",(e,t)=>{const{id:r}=t,n=NA("session_extend",r);if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners`);_P(t)?this.events.emit(NA("session_extend",r),{}):PP(t)&&this.events.emit(NA("session_extend",r),{error:t.error})}),rL(this,"onSessionPingRequest",async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),rL(this,"onSessionPingResponse",(e,t)=>{const{id:r}=t,n=NA("session_ping",r);setTimeout(()=>{if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners 2176`);_P(t)?this.events.emit(NA("session_ping",r),{}):PP(t)&&this.events.emit(NA("session_ping",r),{error:t.error})},500)}),rL(this,"onSessionDeleteRequest",async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise(t=>{this.client.core.relayer.once(JP,async()=>{t(await this.deleteSession({topic:e,id:r}))})}),this.sendResult({id:r,topic:e,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:T_("USER_DISCONNECTED")})]).catch(e=>this.client.logger.error(e))}catch(e){this.client.logger.error(e)}}),rL(this,"onSessionRequest",async e=>{var t,r,n;const{topic:o,payload:i,attestation:s,encryptedId:a,transportType:c}=e,{id:u,params:l}=i;try{await this.isValidRequest(eL({topic:o},l));const e=this.client.session.get(o),i={id:u,topic:o,params:l,verifyContext:await this.getVerifyContext({attestationId:s,hash:UI(JSON.stringify(bP("wc_sessionRequest",l,u))),encryptedId:a,metadata:e.peer.metadata,transportType:c})};await this.setPendingSessionRequest(i),c===oR.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(r=e.peer.metadata.redirect)?void 0:r.universal),null!=(n=this.client.signConfig)&&n.disableRequestQueue?this.emitSessionRequest(i):(this.addSessionRequestToSessionRequestQueue(i),this.processSessionRequestQueue())}catch(e){await this.sendError({id:u,topic:o,error:e}),this.client.logger.error(e)}}),rL(this,"onSessionRequestResponse",(e,t)=>{const{id:r}=t,n=NA("session_request",r);if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners`);_P(t)?this.events.emit(NA("session_request",r),{result:t.result}):PP(t)&&this.events.emit(NA("session_request",r),{error:t.error})}),rL(this,"onSessionEventRequest",async(e,t)=>{const{id:r,params:n}=t;try{const t=`${e}_session_event_${n.event.name}`,o=Z_.get(t);if(o&&this.isRequestOutOfSync(o,r))return void this.client.logger.info(`Discarding out of sync request - ${r}`);this.isValidEmit(eL({topic:e},n)),this.client.events.emit("session_event",{id:r,topic:e,params:n}),Z_.set(t,r)}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),rL(this,"onSessionAuthenticateResponse",(e,t)=>{const{id:r}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),_P(t)?this.events.emit(NA("session_request",r),{result:t.result}):PP(t)&&this.events.emit(NA("session_request",r),{error:t.error})}),rL(this,"onSessionAuthenticateRequest",async e=>{var t;const{topic:r,payload:n,attestation:o,encryptedId:i,transportType:s}=e;try{const{requester:e,authPayload:a,expiryTimestamp:c}=n.params,u=await this.getVerifyContext({attestationId:o,hash:UI(JSON.stringify(n)),encryptedId:i,metadata:e.metadata,transportType:s}),l={requester:e,pairingTopic:r,id:n.id,authPayload:a,verifyContext:u,expiryTimestamp:c};await this.setAuthRequest(n.id,{request:l,pairingTopic:r,transportType:s}),s===oR.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:n.params,id:n.id,verifyContext:u})}catch(e){this.client.logger.error(e);const t=n.params.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),i=this.getAppLinkIfEnabled(n.params.requester.metadata,s),a={type:1,receiverPublicKey:t,senderPublicKey:o};await this.sendError({id:n.id,topic:r,error:e,encodeOpts:a,rpcOpts:DM.wc_sessionAuthenticate.autoReject,appLink:i})}}),rL(this,"addSessionRequestToSessionRequestQueue",e=>{this.sessionRequestQueue.queue.push(e)}),rL(this,"cleanupAfterResponse",e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=zM,this.processSessionRequestQueue()},fd.toMiliseconds(this.requestQueueDelay))}),rL(this,"cleanupPendingSentRequestsForTopic",({topic:e,error:t})=>{const r=this.client.core.history.pending;r.length>0&&r.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{const r=NA("session_request",e.request.id);if(0===this.events.listenerCount(r))throw new Error(`emitting ${r} without any listeners`);this.events.emit(NA("session_request",e.request.id),{error:t})})}),rL(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===qM)return void this.client.logger.info("session request queue is already active.");const e=this.sessionRequestQueue.queue[0];if(e)try{this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}else this.client.logger.info("session request queue is empty.")}),rL(this,"emitSessionRequest",e=>{this.emittedSessionRequests.has(e.id)?this.client.logger.warn({id:e.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${e.id}`):(this.sessionRequestQueue.state=qM,this.emittedSessionRequests.add(e.id),this.client.events.emit("session_request",e))}),rL(this,"onPairingCreated",e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;const t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);t&&this.onSessionProposeRequest({topic:e.topic,payload:bP("wc_sessionPropose",tL(eL({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties}),t.id),attestation:t.attestation,encryptedId:t.encryptedId})}),rL(this,"isValidConnect",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw new Error(t)}const{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:n,sessionProperties:o,scopedProperties:i,relays:s}=e;if(__(t)||await this.isValidPairingTopic(t),!function(e,t){let r=!1;return t&&!e?r=!0:e&&C_(e)&&e.length&&e.forEach(e=>{r=D_(e)}),r}(s,!0)){const{message:e}=O_("MISSING_OR_INVALID",`connect() relays: ${s}`);throw new Error(e)}if(!__(r)&&0!==I_(r)){const e="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(e):this.client.logger.warn(e),this.validateNamespaces(r,"requiredNamespaces")}if(!__(n)&&0!==I_(n)&&this.validateNamespaces(n,"optionalNamespaces"),__(o)||this.validateSessionProps(o,"sessionProperties"),!__(i)){this.validateSessionProps(i,"scopedProperties");const e=Object.keys(r||{}).concat(Object.keys(n||{}));if(!Object.keys(i).every(t=>e.includes(t.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(i)}, required/optional namespaces: ${JSON.stringify(e)}`)}}),rL(this,"validateNamespaces",(e,t)=>{const r=function(e,t,r){let n=null;if(e&&I_(e)){const o=L_(e,t);o&&(n=o);const i=j_(e,t,r);i&&(n=i)}else n=O_("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}(e,"connect()",t);if(r)throw new Error(r.message)}),rL(this,"isValidApprove",async e=>{if(!F_(e))throw new Error(O_("MISSING_OR_INVALID",`approve() params: ${e}`).message);const{id:t,namespaces:r,relayProtocol:n,sessionProperties:o,scopedProperties:i}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);const s=this.client.proposal.get(t),a=U_(r,"approve()");if(a)throw new Error(a.message);const c=H_(s.requiredNamespaces,r,"approve()");if(c)throw new Error(c.message);if(!P_(n,!0)){const{message:e}=O_("MISSING_OR_INVALID",`approve() relayProtocol: ${n}`);throw new Error(e)}if(__(o)||this.validateSessionProps(o,"sessionProperties"),!__(i)){this.validateSessionProps(i,"scopedProperties");const e=new Set(Object.keys(r));if(!Object.keys(i).every(t=>e.has(t.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(i)}, approved namespaces: ${Array.from(e).join(", ")}`)}}),rL(this,"isValidReject",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`reject() params: ${e}`);throw new Error(t)}const{id:t,reason:r}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!function(e){return!!(e&&"object"==typeof e&&e.code&&R_(e.code,!1)&&e.message&&P_(e.message,!1))}(r)){const{message:e}=O_("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw new Error(e)}}),rL(this,"isValidSessionSettleRequest",e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw new Error(t)}const{relay:t,controller:r,namespaces:n,expiry:o}=e;if(!D_(t)){const{message:e}=O_("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(e)}const i=function(e,t){let r=null;return P_(e?.publicKey,!1)||(r=O_("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}(r,"onSessionSettleRequest()");if(i)throw new Error(i.message);const s=U_(n,"onSessionSettleRequest()");if(s)throw new Error(s.message);if(RA(o)){const{message:e}=O_("EXPIRED","onSessionSettleRequest()");throw new Error(e)}}),rL(this,"isValidUpdate",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`update() params: ${e}`);throw new Error(t)}const{topic:t,namespaces:r}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);const n=this.client.session.get(t),o=U_(r,"update()");if(o)throw new Error(o.message);const i=H_(n.requiredNamespaces,r,"update()");if(i)throw new Error(i.message)}),rL(this,"isValidExtend",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`extend() params: ${e}`);throw new Error(t)}const{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)}),rL(this,"isValidRequest",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`request() params: ${e}`);throw new Error(t)}const{topic:t,request:r,chainId:n,expiry:o}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);const{namespaces:i}=this.client.session.get(t);if(!z_(i,n)){const{message:e}=O_("MISSING_OR_INVALID",`request() chainId: ${n}`);throw new Error(e)}if(!function(e){return!(__(e)||!P_(e.method,!1))}(r)){const{message:e}=O_("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw new Error(e)}if(!q_(i,n,r.method)){const{message:e}=O_("MISSING_OR_INVALID",`request() method: ${r.method}`);throw new Error(e)}if(o&&!function(e,t){return R_(e,!1)&&e<=t.max&&e>=t.min}(o,FM)){const{message:e}=O_("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${FM.min} and ${FM.max}`);throw new Error(e)}}),rL(this,"isValidRespond",async e=>{var t;if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`respond() params: ${e}`);throw new Error(t)}const{topic:r,response:n}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(!function(e){return!(__(e)||__(e.result)&&__(e.error)||!R_(e.id,!1)||!P_(e.jsonrpc,!1))}(n)){const{message:e}=O_("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw new Error(e)}}),rL(this,"isValidPing",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),rL(this,"isValidEmit",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`emit() params: ${e}`);throw new Error(t)}const{topic:t,event:r,chainId:n}=e;await this.isValidSessionTopic(t);const{namespaces:o}=this.client.session.get(t);if(!z_(o,n)){const{message:e}=O_("MISSING_OR_INVALID",`emit() chainId: ${n}`);throw new Error(e)}if(!function(e){return!(__(e)||!P_(e.name,!1))}(r)){const{message:e}=O_("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}if(!V_(o,n,r.name)){const{message:e}=O_("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}}),rL(this,"isValidDisconnect",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),rL(this,"isValidAuthenticate",e=>{const{chains:t,uri:r,domain:n,nonce:o}=e;if(!Array.isArray(t)||0===t.length)throw new Error("chains is required and must be a non-empty array");if(!P_(r,!1))throw new Error("uri is required parameter");if(!P_(n,!1))throw new Error("domain is required parameter");if(!P_(o,!1))throw new Error("nonce is required parameter");if([...new Set(t.map(e=>$E(e).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:i}=$E(t[0]);if("eip155"!==i)throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),rL(this,"getVerifyContext",async e=>{const{attestationId:t,hash:r,encryptedId:n,metadata:o,transportType:i}=e,s={verified:{verifyUrl:o.verifyUrl||OR,validation:"UNKNOWN",origin:o.url||""}};try{if(i===oR.link_mode){const e=this.getAppLinkIfEnabled(o,i);return s.verified.validation=e&&new URL(e).origin===new URL(o.url).origin?"VALID":"INVALID",s}const e=await this.client.core.verify.resolve({attestationId:t,hash:r,encryptedId:n,verifyUrl:o.verifyUrl});e&&(s.verified.origin=e.origin,s.verified.isScam=e.isScam,s.verified.validation=e.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(s)}`),s}),rL(this,"validateSessionProps",(e,t)=>{Object.values(e).forEach((r,n)=>{if(null==r){const{message:o}=O_("MISSING_OR_INVALID",`${t} must contain an existing value for each key. Received: ${r} for key ${Object.keys(e)[n]}`);throw new Error(o)}})}),rL(this,"getPendingAuthRequest",e=>{const t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0}),rL(this,"addToRecentlyDeleted",(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0;const t=this.recentlyDeletedLimit/2;for(const r of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(r)}}}),rL(this,"checkRecentlyDeleted",e=>{const t=this.recentlyDeletedMap.get(e);if(t){const{message:r}=O_("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw new Error(r)}}),rL(this,"isLinkModeEnabled",(e,t)=>{var r,n,o,i,s,a,c,u,l;return!(!e||t!==oR.link_mode)&&(!0===(null==(n=null==(r=this.client.metadata)?void 0:r.redirect)?void 0:n.linkMode)&&void 0!==(null==(i=null==(o=this.client.metadata)?void 0:o.redirect)?void 0:i.universal)&&""!==(null==(a=null==(s=this.client.metadata)?void 0:s.redirect)?void 0:a.universal)&&void 0!==(null==(c=e?.redirect)?void 0:c.universal)&&""!==(null==(u=e?.redirect)?void 0:u.universal)&&!0===(null==(l=e?.redirect)?void 0:l.linkMode)&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&typeof(null==global?void 0:global.Linking)<"u")}),rL(this,"getAppLinkIfEnabled",(e,t)=>{var r;return this.isLinkModeEnabled(e,t)?null==(r=e?.redirect)?void 0:r.universal:void 0}),rL(this,"handleLinkModeMessage",({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;const t=MA(e,"topic")||"",r=decodeURIComponent(MA(e,"wc_ev")||""),n=this.client.session.keys.includes(t);n&&this.client.session.update(t,{transportType:oR.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:r,sessionExists:n})}),rL(this,"registerLinkModeListeners",async()=>{var e;if(UA()||gA()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){const e=null==global?void 0:global.Linking;if(typeof e<"u"){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);const t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}}),rL(this,"getTVFParams",(e,t,r)=>{var n,o,i;if(null==(n=t.request)||!n.method)return{};const s={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{const e=this.extractTxHashesFromResult(t.request,r);s.txHashes=e,s.contractAddresses=this.isValidContractData(t.request.params)?[null==(i=null==(o=t.request.params)?void 0:o[0])?void 0:i.to]:[]}catch(e){this.client.logger.warn("Error getting TVF params",e)}return s}),rL(this,"isValidContractData",e=>{var t;if(!e)return!1;try{const r=e?.data||(null==(t=e?.[0])?void 0:t.data);if(!r.startsWith("0x"))return!1;const n=r.slice(2);return!!/^[0-9a-fA-F]*$/.test(n)&&n.length%2==0}catch{}return!1}),rL(this,"extractTxHashesFromResult",(e,t)=>{var r;try{if(!t)return[];const n=e.method,o=VM[n];if("sui_signTransaction"===n)return[BO(t.transactionBytes)];if("near_signTransaction"===n)return[jO(t)];if("near_signTransactions"===n)return t.map(e=>jO(e));if("xrpl_signTransactionFor"===n||"xrpl_signTransaction"===n)return[null==(r=t.tx_json)?void 0:r.hash];if("polkadot_signTransaction"===n)return[J_({transaction:e.params.transactionPayload,signature:t.signature})];if("algo_signTxn"===n)return C_(t)?t.map(e=>MO(e)):[MO(t)];if("cosmos_signDirect"===n)return[UO(t)];if("wallet_sendCalls"===n)return function(e){var t,r;const n=[];try{if("string"==typeof e)return n.push(e),n;if("object"!=typeof e)return n;null!=e&&e.id&&n.push(e.id);const o=null==(r=null==(t=e?.capabilities)?void 0:t.caip345)?void 0:r.transactionHashes;o&&n.push(...o)}catch(e){console.warn("getWalletSendCallsHashes failed: ",e)}return n}(t);if("string"==typeof t)return[t];const i=t[o.key];if(C_(i))return"solana_signAllTransactions"===n?i.map(e=>function(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);const n=r[0];if(0===n)throw new Error("No signatures found");const o=1+64*n;if(r.length<o)throw new Error("Transaction data too short for claimed signature count");if(r.length<100)throw new Error("Transaction too short");const i=Buffer.from(e,"base64").slice(1,65);return px.encode(i)}(e)):i;if("string"==typeof i)return[i]}catch(e){this.client.logger.warn("Error extracting tx hashes from result",e)}return[]})}async processPendingMessageEvents(){try{const e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(const[e,r]of Object.entries(t))for(const t of r)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn("processPendingMessageEvents failed",e)}}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(WP,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){const{topic:t,message:r,attestation:n,transportType:o}=e,{publicKey:i}=this.client.auth.authKeys.keys.includes(WM)?this.client.auth.authKeys.get(WM):{responseTopic:void 0,publicKey:void 0};try{const e=await this.client.core.crypto.decode(t,r,{receiverPublicKey:i,encoding:o===oR.link_mode?BI:NI});CP(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:n,transportType:o,encryptedId:UI(r)})):IP(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:o}),this.client.core.history.delete(t,e.id)):await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:o}),await this.client.core.relayer.messages.ack(t,r)}catch(e){this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(ER,async e=>{const{topic:t,id:r}=_A(e.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,O_("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,O_("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))})}registerPairingEvents(){this.client.core.pairing.events.on(hR,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(yR,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!P_(e,!1)){const{message:t}=O_("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=O_("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(RA(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=O_("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!P_(e,!1)){const{message:t}=O_("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=O_("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(RA(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=O_("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=O_("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else{if(!this.client.core.pairing.pairings.keys.includes(e)){if(P_(e,!1)){const{message:t}=O_("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}{const{message:t}=O_("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}this.isValidPairingTopic(e)}}async isValidProposalId(e){if(!function(e){return"number"==typeof e}(e)){const{message:t}=O_("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=O_("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(RA(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=O_("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class oL extends $j{constructor(e,t){super(e,t,"proposal",NM),this.core=e,this.logger=t}}class iL extends $j{constructor(e,t){super(e,t,"session",NM),this.core=e,this.logger=t}}class sL extends $j{constructor(e,t){super(e,t,"request",NM,e=>e.id),this.core=e,this.logger=t}}class aL extends $j{constructor(e,t){super(e,t,"authKeys",KM,()=>WM),this.core=e,this.logger=t}}class cL extends $j{constructor(e,t){super(e,t,"pairingTopics",KM),this.core=e,this.logger=t}}class uL extends $j{constructor(e,t){super(e,t,"requests",KM,e=>e.id),this.core=e,this.logger=t}}var lL=Object.defineProperty,fL=(e,t,r)=>((e,t,r)=>t in e?lL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class dL{constructor(e,t){this.core=e,this.logger=t,fL(this,"authKeys"),fL(this,"pairingTopics"),fL(this,"requests"),this.authKeys=new aL(this.core,this.logger),this.pairingTopics=new cL(this.core,this.logger),this.requests=new uL(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var hL=Object.defineProperty,pL=(e,t,r)=>((e,t,r)=>t in e?hL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class yL extends Fh{constructor(e){super(e),pL(this,"protocol","wc"),pL(this,"version",2),pL(this,"name",BM),pL(this,"metadata"),pL(this,"core"),pL(this,"logger"),pL(this,"events",new _s.EventEmitter),pL(this,"engine"),pL(this,"session"),pL(this,"proposal"),pL(this,"pendingRequest"),pL(this,"auth"),pL(this,"signConfig"),pL(this,"on",(e,t)=>this.events.on(e,t)),pL(this,"once",(e,t)=>this.events.once(e,t)),pL(this,"off",(e,t)=>this.events.off(e,t)),pL(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),pL(this,"removeAllListeners",e=>this.events.removeAllListeners(e)),pL(this,"connect",async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"pair",async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"approve",async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"reject",async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"update",async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"extend",async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"request",async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"respond",async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"ping",async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"emit",async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"disconnect",async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"find",e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}}),pL(this,"authenticate",async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"formatAuthMessage",e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"approveSessionAuthenticate",async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"rejectSessionAuthenticate",async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),this.name=e?.name||BM,this.metadata=wA(e?.metadata),this.signConfig=e?.signConfig;const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:th(vh({level:e?.logger||jM}));this.core=e?.core||new PM(e),this.logger=xh(t,this.name),this.session=new iL(this.core,this.logger),this.proposal=new oL(this.core,this.logger),this.pendingRequest=new sL(this.core,this.logger),this.engine=new nL(this),this.auth=new dL(this.core,this.logger)}static async init(e){const t=new yL(e);return await t.initialize(),t}get context(){return wh(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var gL,mL,bL=!1,vL=function(e){return d(void 0,void 0,void 0,function(){return h(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.connect({optionalNamespaces:{stellar:{methods:["stellar_signXDR","stellar_signAndSubmitXDR","stellar_signMessage"],chains:[ns,os],events:[]}}})];case 1:return[2,t.sent()];case 2:return t.sent(),[2,null];case 3:return[2]}})})},wL=function(){var e=Al(),t=me(function(e){return e}),r=Q.useState(""),o=r[0],i=r[1],s=t.config,a=t.wallets,c=t.connectEmail,u=t.setShowAllWallets,l=s.appearance,f=s.loginMethods||[],p=f.includes("passkey"),y=Q.useMemo(function(){var e=w([],f,!0).filter(function(e){return"passkey"!==e});return w(w([],e,!0),p?["passkey"]:[],!0)},[f,p]),g=Q.useMemo(function(){return a.length>3?a.slice(2):[]},[a]),m=Q.useMemo(function(){return a.length<=3?a:t.showAllWallets?a.slice(2,a.length):a.slice(0,2)},[a,t.showAllWallets]);Q.useEffect(function(){t.walletConnect&&vL(t.walletConnect.client).then(function(e){t.setWalletConnectClient(t.walletConnect.client,e)}).catch(function(e){})},[]);var b=function(){c(o)},v=function(){return xl.jsxs("div",{className:"bluxcc:my-1 bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:[xl.jsx("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:z-10",style:{borderTop:"".concat(l.borderWidth," dashed ").concat(l.borderColor)}}),xl.jsx("span",{className:"bluxcc:z-20 bluxcc:w-auto bluxcc:px-2 bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",style:{background:l.background,color:l.borderColor},children:e("or")})]})};return xl.jsxs("div",{className:"bluxcc:w-full",children:[l.logo&&xl.jsx("div",{className:"bluxcc:my-6 bluxcc:flex bluxcc:max-h-20 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:xl.jsx("img",{src:l.logo,alt:s.appName,width:152,height:60,className:"bluxcc:max-h-[80px] bluxcc:max-w-[180px] bluxcc:select-none",loading:"eager",decoding:"async",draggable:"false",style:{contentVisibility:"auto"}})}),xl.jsx("div",{className:"",children:y.map(function(r,o){var s=y[o+1],a=y[o-1],c=y.includes("wallet"),f=c&&!t.showAllWallets&&"wallet"===r&&"email"===s||c&&"email"===r&&"wallet"!==a;return"wallet"===r?xl.jsx(Y.Fragment,{children:xl.jsxs("div",{className:"bluxcc:max-h-[324px] bluxcc:space-y-2 bluxcc:overflow-y-auto overflowStyle",children:[m.map(function(e){return xl.jsx(hf,n({},e,{label:e.name,startIcon:_f(e.name,Iu(l.background)),onClick:function(){return r=e,d(void 0,void 0,void 0,function(){return h(this,function(e){return r.name===oe.WalletConnect?t.setRoute(se.WALLET_CONNECT):zf(t,r),[2]})});var r}}),e.name)}),g.length>0&&!t.showAllWallets&&xl.jsx(hf,{endArrow:!0,label:e("allStellarWallets"),startIcon:xl.jsx(kf,{fill:xu(l.fieldBackground)}),onClick:function(){u(!0)}}),f&&v()]})},"wallet"):t.showAllWallets||"email"!==r?t.showAllWallets||"passkey"!==r?null:xl.jsx("button",{className:"bluxcc:mt-6! bluxcc:bg-transparent bluxcc:flex bluxcc:h-4 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:leading-7 bluxcc:font-medium",style:{color:l.accentColor,fontFamily:l.fontFamily},children:e("logInWithPasskey")},"passkey"):xl.jsx(Y.Fragment,{children:xl.jsxs(xl.Fragment,{children:[xl.jsx(hf,{inputType:"email",variant:"input",startIcon:xl.jsx(Vl,{fill:l.textColor}),onChange:function(e){return i(e)},onEnter:b,onSubmit:b}),f&&v()]})},"email")})}),xl.jsx("footer",{className:"bluxcc:w-full bluxcc:pt-[17px] bluxcc:text-center bluxcc:text-xs bluxcc:font-medium",children:xl.jsx("a",{"aria-label":"blux website",href:"https://blux.cc",target:"_blank",rel:"noreferrer",className:"bluxcc:no-underline",style:{color:l.textColor,font:l.fontFamily},children:e("poweredByBlux")})})]})},xL=Object.defineProperty,SL=Object.getOwnPropertySymbols,EL=Object.prototype.hasOwnProperty,AL=Object.prototype.propertyIsEnumerable,kL=(e,t,r)=>t in e?xL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OL=(e,t)=>{for(var r in t||(t={}))EL.call(t,r)&&kL(e,r,t[r]);if(SL)for(var r of SL(t))AL.call(t,r)&&kL(e,r,t[r]);return e},TL=(e,t)=>{var r={};for(var n in e)EL.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&SL)for(var n of SL(e))t.indexOf(n)<0&&AL.call(e,n)&&(r[n]=e[n]);return r};(e=>{const t=class t{constructor(e,r,n,i){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(n);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const r=this.getPenaltyScore();r<e&&(i=t,e=r),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(r,n){const o=e.QrSegment.makeSegments(r);return t.encodeSegments(o,n)}static encodeBinary(r,n){const o=e.QrSegment.makeBytes(r);return t.encodeSegments([o],n)}static encodeSegments(e,n,i=1,a=40,c=-1,u=!0){if(!(t.MIN_VERSION<=i&&i<=a&&a<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let l,f;for(l=i;;l++){const r=8*t.getNumDataCodewords(l,n),o=s.getTotalBits(e,l);if(o<=r){f=o;break}if(l>=a)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])u&&f<=8*t.getNumDataCodewords(l,e)&&(n=e);let d=[];for(const t of e){r(t.mode.modeBits,4,d),r(t.numChars,t.mode.numCharCountBits(l),d);for(const e of t.getData())d.push(e)}o(d.length==f);const h=8*t.getNumDataCodewords(l,n);o(d.length<=h),r(0,Math.min(4,h-d.length),d),r(0,(8-d.length%8)%8,d),o(d.length%8==0);for(let e=236;d.length<h;e^=253)r(e,8,d);let p=[];for(;8*p.length<d.length;)p.push(0);return d.forEach((e,t)=>p[t>>>3]|=e<<7-(7&t)),new t(l,n,p,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let r=0;r<t;r++)for(let n=0;n<t;n++)0==r&&0==n||0==r&&n==t-1||r==t-1&&0==n||this.drawAlignmentPattern(e[r],e[n]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let r=t;for(let e=0;e<10;e++)r=r<<1^1335*(r>>>9);const i=21522^(t<<10|r);o(i>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,n(i,e));this.setFunctionModule(8,7,n(i,6)),this.setFunctionModule(8,8,n(i,7)),this.setFunctionModule(7,8,n(i,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,n(i,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,n(i,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,n(i,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const r=n(t,e),o=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(o,i,r),this.setFunctionModule(i,o,r)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let n=-4;n<=4;n++){const o=Math.max(Math.abs(n),Math.abs(r)),i=e+n,s=t+r;0<=i&&i<this.size&&0<=s&&s<this.size&&this.setFunctionModule(i,s,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)this.setFunctionModule(e+n,t+r,1!=Math.max(Math.abs(n),Math.abs(r)))}setFunctionModule(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0}addEccAndInterleave(e){const r=this.version,n=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(r,n))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][r],s=t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][r],a=Math.floor(t.getNumRawDataModules(r)/8),c=i-a%i,u=Math.floor(a/i);let l=[];const f=t.reedSolomonComputeDivisor(s);for(let r=0,n=0;r<i;r++){let o=e.slice(n,n+u-s+(r<c?0:1));n+=o.length;const i=t.reedSolomonComputeRemainder(o,f);r<c&&o.push(0),l.push(o.concat(i))}let d=[];for(let e=0;e<l[0].length;e++)l.forEach((t,r)=>{(e!=u-s||r>=c)&&d.push(t[e])});return o(d.length==a),d}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let o=0;o<this.size;o++)for(let i=0;i<2;i++){const s=t-i,a=!(t+1&2)?this.size-1-o:o;!this.isFunction[a][s]&&r<8*e.length&&(this.modules[a][s]=n(e[r>>>3],7-(7&r)),r++)}}o(r==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let r=0;r<this.size;r++){let n;switch(e){case 0:n=(r+t)%2==0;break;case 1:n=t%2==0;break;case 2:n=r%3==0;break;case 3:n=(r+t)%3==0;break;case 4:n=(Math.floor(r/3)+Math.floor(t/2))%2==0;break;case 5:n=r*t%2+r*t%3==0;break;case 6:n=(r*t%2+r*t%3)%2==0;break;case 7:n=((r+t)%2+r*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][r]&&n&&(this.modules[t][r]=!this.modules[t][r])}}getPenaltyScore(){let e=0;for(let r=0;r<this.size;r++){let n=!1,o=0,i=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[r][s]==n?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),n||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),n=this.modules[r][s],o=1);e+=this.finderPenaltyTerminateAndCount(n,o,i)*t.PENALTY_N3}for(let r=0;r<this.size;r++){let n=!1,o=0,i=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][r]==n?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),n||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),n=this.modules[s][r],o=1);e+=this.finderPenaltyTerminateAndCount(n,o,i)*t.PENALTY_N3}for(let r=0;r<this.size-1;r++)for(let n=0;n<this.size-1;n++){const o=this.modules[r][n];o==this.modules[r][n+1]&&o==this.modules[r+1][n]&&o==this.modules[r+1][n+1]&&(e+=t.PENALTY_N2)}let r=0;for(const e of this.modules)r=e.reduce((e,t)=>e+(t?1:0),r);const n=this.size*this.size,i=Math.ceil(Math.abs(20*r-10*n)/n)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let r=[6];for(let n=this.size-7;r.length<e;n-=t)r.splice(1,0,n);return r}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return o(208<=r&&r<=29648),r}static getNumDataCodewords(e,r){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let r=[];for(let t=0;t<e-1;t++)r.push(0);r.push(1);let n=1;for(let o=0;o<e;o++){for(let e=0;e<r.length;e++)r[e]=t.reedSolomonMultiply(r[e],n),e+1<r.length&&(r[e]^=r[e+1]);n=t.reedSolomonMultiply(n,2)}return r}static reedSolomonComputeRemainder(e,r){let n=r.map(e=>0);for(const o of e){const e=o^n.shift();n.push(0),r.forEach((r,o)=>n[o]^=t.reedSolomonMultiply(r,e))}return n}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^285*(r>>>7),r^=(t>>>n&1)*e;return o(r>>>8==0),r}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const r=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(r&&e[0]>=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};function r(e,t,r){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let n=t-1;n>=0;n--)r.push(e>>>n&1)}function n(e,t){return!!(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;const i=class e{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let n=[];for(const e of t)r(e,8,n);return new e(e.Mode.BYTE,t.length,n)}static makeNumeric(t){if(!e.isNumeric(t))throw new RangeError("String contains non-numeric characters");let n=[];for(let e=0;e<t.length;){const o=Math.min(t.length-e,3);r(parseInt(t.substring(e,e+o),10),3*o+1,n),e+=o}return new e(e.Mode.NUMERIC,t.length,n)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let n,o=[];for(n=0;n+2<=t.length;n+=2){let i=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n));i+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n+1)),r(i,11,o)}return n<t.length&&r(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n)),6,o),new e(e.Mode.ALPHANUMERIC,t.length,o)}static makeSegments(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let n=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)r(t,8,n);else if(t<16384)r(2,2,n),r(t,14,n);else{if(!(t<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,n),r(t,21,n)}return new e(e.Mode.ECI,0,n)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let r=0;for(const n of e){const e=n.mode.numCharCountBits(t);if(n.numChars>=1<<e)return 1/0;r+=4+e+n.bitData.length}return r}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let r=0;r<e.length;r++)"%"!=e.charAt(r)?t.push(e.charCodeAt(r)):(t.push(parseInt(e.substring(r+1,r+3),16)),r+=2);return t}};i.NUMERIC_REGEX=/^[0-9]*$/,i.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,i.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let s=i;e.QrSegment=i})(gL||(gL={})),(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})((mL=gL||(gL={})).QrCode||(mL.QrCode={})),(e=>{(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||(e.QrSegment={}))})(gL||(gL={}));var CL=gL,IL={L:CL.QrCode.Ecc.LOW,M:CL.QrCode.Ecc.MEDIUM,Q:CL.QrCode.Ecc.QUARTILE,H:CL.QrCode.Ecc.HIGH},_L=128,PL="L",RL="#FFFFFF",NL="#000000",BL=!1,jL=1;
37
+ function Fx(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function zx(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function qx(e){if("function"!=typeof e)throw new Error("function expected");return!0}function Vx(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function Hx(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function Kx(e){if(!Array.isArray(e))throw new Error("array expected")}function Wx(e,t){if(!zx(!0,t))throw new Error(`${e}: array of strings expected`)}function Gx(e,t){if(!zx(!1,t))throw new Error(`${e}: array of numbers expected`)}function Xx(...e){const t=e=>e,r=(e,t)=>r=>e(t(r)),n=e.map(e=>e.encode).reduceRight(r,t),o=e.map(e=>e.decode).reduce(r,t);return{encode:n,decode:o}}function Zx(e){const t="string"==typeof e?e.split(""):e,r=t.length;Wx("alphabet",t);const n=new Map(t.map((e,t)=>[e,t]));return{encode:n=>(Kx(n),n.map(n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]})),decode:t=>(Kx(t),t.map(t=>{Vx("alphabet.decode",t);const r=n.get(t);if(void 0===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}function Qx(e=""){return Vx("join",e),{encode:t=>(Wx("join.decode",t),t.join(e)),decode:t=>(Vx("join.decode",t),t.split(e))}}function Yx(e,t="="){return Hx(e),Vx("padding",t),{encode(r){for(Wx("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){Wx("padding.decode",r);let n=r.length;if(n*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--){if((n-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return r.slice(0,n)}}}function Jx(e){return qx(e),{encode:e=>e,decode:t=>e(t)}}function $x(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(Kx(e),!e.length)return[];let n=0;const o=[],i=Array.from(e,e=>{if(Hx(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e}),s=i.length;for(;;){let e=0,a=!0;for(let o=n;o<s;o++){const s=i[o],c=t*e,u=c+s;if(!Number.isSafeInteger(u)||c/t!==e||u-s!==c)throw new Error("convertRadix: carry overflow");const l=u/r;e=u%r;const f=Math.floor(l);if(i[o]=f,!Number.isSafeInteger(f)||f*r+e!==u)throw new Error("convertRadix: carry overflow");a&&(f?a=!1:n=o)}if(o.push(e),a)break}for(let t=0;t<e.length-1&&0===e[t];t++)o.push(0);return o.reverse()}const eS=(e,t)=>0===t?e:eS(t,e%t),tS=(e,t)=>e+(t-eS(e,t)),rS=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function nS(e,t,r,n){if(Kx(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(tS(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${tS(t,r)}`);let o=0,i=0;const s=rS[t],a=rS[r]-1,c=[];for(const n of e){if(Hx(n),n>=s)throw new Error(`convertRadix2: invalid data word=${n} from=${t}`);if(o=o<<t|n,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=r;i-=r)c.push((o>>i-r&a)>>>0);const e=rS[i];if(void 0===e)throw new Error("invalid carry");o&=e-1}if(o=o<<r-i&a,!n&&i>=t)throw new Error("Excess padding");if(!n&&o>0)throw new Error(`Non-zero padding: ${o}`);return n&&i>0&&c.push(o>>>0),c}function oS(e,t=!1){if(Hx(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(tS(8,e)>32||tS(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!Fx(r))throw new Error("radix2.encode input should be Uint8Array");return nS(Array.from(r),8,e,!t)},decode:r=>(Gx("radix2.decode",r),Uint8Array.from(nS(r,e,8,t)))}}function iS(e){return qx(e),function(...t){try{return e.apply(null,t)}catch(e){}}}Xx(oS(4),Zx("0123456789ABCDEF"),Qx(""));const sS=Xx(oS(5),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Yx(5),Qx(""));Xx(oS(5),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Qx("")),Xx(oS(5),Zx("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Yx(5),Qx("")),Xx(oS(5),Zx("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Qx("")),Xx(oS(5),Zx("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Qx(""),Jx(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const aS=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)();aS||Xx(oS(6),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Yx(6),Qx("")),Xx(oS(6),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Qx("")),aS||Xx(oS(6),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Yx(6),Qx("")),Xx(oS(6),Zx("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Qx(""));const cS=e=>Xx(function(e){return Hx(e),{encode:t=>{if(!Fx(t))throw new Error("radix.encode input should be Uint8Array");return $x(Array.from(t),256,e)},decode:t=>(Gx("radix.decode",t),Uint8Array.from($x(t,e,256)))}}(58),Zx(e),Qx(""));cS("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),cS("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),cS("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const uS=Xx(Zx("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Qx("")),lS=[996825010,642813549,513874426,1027748829,705979059];function fS(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<lS.length;e++)1==(t>>e&1)&&(r^=lS[e]);return r}function dS(e,t,r=1){const n=e.length;let o=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);o=fS(o)^r>>5}o=fS(o);for(let t=0;t<n;t++)o=fS(o)^31&e.charCodeAt(t);for(let e of t)o=fS(o)^e;for(let e=0;e<6;e++)o=fS(o);return o^=r,uS.encode(nS([o%rS[30]],30,5,!1))}function hS(e){const t="bech32"===e?1:734539939,r=oS(5),n=r.decode,o=r.encode,i=iS(n);function s(e,r,n=90){Vx("bech32.encode prefix",e),Fx(r)&&(r=Array.from(r)),Gx("bech32.encode",r);const o=e.length;if(0===o)throw new TypeError(`Invalid prefix length ${o}`);const i=o+7+r.length;if(!1!==n&&i>n)throw new TypeError(`Length ${i} exceeds limit ${n}`);const s=e.toLowerCase(),a=dS(s,r,t);return`${s}1${uS.encode(r)}${a}`}function a(e,r=90){Vx("bech32.decode input",e);const n=e.length;if(n<8||!1!==r&&n>r)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${r})`);const o=e.toLowerCase();if(e!==o&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=o.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const s=o.slice(0,i),a=o.slice(i+1);if(a.length<6)throw new Error("Data must be at least 6 characters long");const c=uS.decode(a).slice(0,-6),u=dS(s,c,t);if(!a.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected "${u}"`);return{prefix:s,words:c}}return{encode:s,decode:a,encodeFromBytes:function(e,t){return s(e,o(t))},decodeToBytes:function(e){const{prefix:t,words:r}=a(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:iS(a),fromWords:n,fromWordsUnsafe:i,toWords:o}}hS("bech32"),hS("bech32m");function pS(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function yS(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?pS(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function gS(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));const r=yS(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return pS(r)}(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)()||Xx(oS(4),Zx("0123456789abcdef"),Qx(""),Jx(e=>{if("string"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));var mS=function(e,t){if(e.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 o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(255!==r[s])throw new TypeError(i+" is ambiguous");r[s]=o}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,o=0;e[t]===c;)n++,t++;for(var i=(e.length-t)*u+1>>>0,s=new Uint8Array(i);e[t];){var l=r[e.charCodeAt(t)];if(255===l)return;for(var f=0,d=i-1;(0!==l||f<o)&&-1!==d;d--,f++)l+=a*s[d]>>>0,s[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=f,t++}if(" "!==e[t]){for(var h=i-o;h!==i&&0===s[h];)h++;for(var p=new Uint8Array(n+(i-h)),y=n;h!==i;)p[y++]=s[h++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,i=t.length;o!==i&&0===t[o];)o++,r++;for(var s=(i-o)*l+1>>>0,u=new Uint8Array(s);o!==i;){for(var f=t[o],d=0,h=s-1;(0!==f||d<n)&&-1!==h;h--,d++)f+=256*u[h]>>>0,u[h]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");n=d,o++}for(var p=s-n;p!==s&&0===u[p];)p++;for(var y=c.repeat(r);p<s;++p)y+=e.charAt(u[p]);return y},decodeUnsafe:f,decode:function(e){var r=f(e);if(r)return r;throw new Error(`Non-${t} character`)}}},bS=mS;const vS=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class wS{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class xS{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return ES(this,e)}}class SS{constructor(e){this.decoders=e}or(e){return ES(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const ES=(e,t)=>new SS({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class AS{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new wS(e,t,r),this.decoder=new xS(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const kS=({name:e,prefix:t,encode:r,decode:n})=>new AS(e,t,r,n),OS=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=bS(r,t);return kS({prefix:e,name:t,encode:n,decode:e=>vS(o(e))})},TS=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>kS({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let i="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,i+=t[o&a>>s];if(s&&(i+=t[o&a<<r-s]),n)for(;i.length*r&7;)i+="=";return i})(e,n,r),decode:t=>((e,t,r,n)=>{const o={};for(let e=0;e<t.length;++e)o[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const s=new Uint8Array(i*r/8|0);let a=0,c=0,u=0;for(let t=0;t<i;++t){const i=o[e[t]];if(void 0===i)throw new SyntaxError(`Non-${n} character`);c=c<<r|i,a+=r,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),CS=kS({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var IS=Object.freeze({__proto__:null,identity:CS});const _S=TS({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var PS=Object.freeze({__proto__:null,base2:_S});const RS=TS({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var NS=Object.freeze({__proto__:null,base8:RS});const BS=OS({prefix:"9",name:"base10",alphabet:"0123456789"});var jS=Object.freeze({__proto__:null,base10:BS});const MS=TS({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),LS=TS({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var US=Object.freeze({__proto__:null,base16:MS,base16upper:LS});const DS=TS({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),FS=TS({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),zS=TS({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),qS=TS({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),VS=TS({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),HS=TS({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),KS=TS({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),WS=TS({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),GS=TS({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var XS=Object.freeze({__proto__:null,base32:DS,base32upper:FS,base32pad:zS,base32padupper:qS,base32hex:VS,base32hexupper:HS,base32hexpad:KS,base32hexpadupper:WS,base32z:GS});const ZS=OS({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),QS=OS({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var YS=Object.freeze({__proto__:null,base36:ZS,base36upper:QS});const JS=OS({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),$S=OS({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var eE=Object.freeze({__proto__:null,base58btc:JS,base58flickr:$S});const tE=TS({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),rE=TS({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),nE=TS({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),oE=TS({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var iE=Object.freeze({__proto__:null,base64:tE,base64pad:rE,base64url:nE,base64urlpad:oE});const sE=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),aE=sE.reduce((e,t,r)=>(e[r]=t,e),[]),cE=sE.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);const uE=kS({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=aE[t],"")},decode:function(e){const t=[];for(const r of e){const e=cE[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var lE=Object.freeze({__proto__:null,base256emoji:uE}),fE=function e(t,r,n){r=r||[];var o=n=n||0;for(;t>=pE;)r[n++]=255&t|dE,t/=128;for(;t&hE;)r[n++]=255&t|dE,t>>>=7;return r[n]=0|t,e.bytes=n-o+1,r},dE=128,hE=-128,pE=Math.pow(2,31);var yE=function e(t,r){var n,o=0,i=0,s=r=r||0,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],o+=i<28?(n&mE)<<i:(n&mE)*Math.pow(2,i),i+=7}while(n>=gE);return e.bytes=s-r,o},gE=128,mE=127;var bE=Math.pow(2,7),vE=Math.pow(2,14),wE=Math.pow(2,21),xE=Math.pow(2,28),SE=Math.pow(2,35),EE=Math.pow(2,42),AE=Math.pow(2,49),kE=Math.pow(2,56),OE=Math.pow(2,63),TE={encode:fE,decode:yE,encodingLength:function(e){return e<bE?1:e<vE?2:e<wE?3:e<xE?4:e<SE?5:e<EE?6:e<AE?7:e<kE?8:e<OE?9:10}};const CE=(e,t,r=0)=>(TE.encode(e,t,r),t),IE=e=>TE.encodingLength(e),_E=(e,t)=>{const r=t.byteLength,n=IE(e),o=n+IE(r),i=new Uint8Array(o+r);return CE(e,i,0),CE(r,i,n),i.set(t,o),new PE(e,r,t,i)};class PE{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const RE=({name:e,code:t,encode:r})=>new NE(e,t,r);class NE{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?_E(this.code,t):t.then(e=>_E(this.code,e))}throw Error("Unknown type, must be binary type")}}const BE=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));RE({name:"sha2-256",code:18,encode:BE("SHA-256")}),RE({name:"sha2-512",code:19,encode:BE("SHA-512")});new TextEncoder,new TextDecoder;const jE={...IS,...PS,...NS,...jS,...US,...XS,...YS,...eE,...iE,...lE};function ME(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const LE=ME("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>(new TextEncoder).encode(e.substring(1))),UE=ME("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{const t=yS((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),DE={utf8:LE,"utf-8":LE,hex:jE.base16,latin1:UE,ascii:UE,binary:UE,...jE};function FE(e,t="utf8"){const r=DE[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):pS(globalThis.Buffer.from(e,"utf-8"))}function zE(e,t="utf8"){const r=DE[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}const qE={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var VE,HE,KE,WE,GE,XE,ZE,QE;function YE(){if(HE)return VE;HE=1;function e(e){return(4294967296+e).toString(16).substring(1)}return VE={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,function(e){return(e<16?"0":"")+e.toString(16)}).join("")},debugPrint:function(t,r,n){let o="\n"+t+" = ";for(let i=0;i<r.length;i+=2){if(32===n)o+=e(r[i]).toUpperCase(),o+=" ",o+=e(r[i+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);o+=e(r[i+1]).toUpperCase(),o+=e(r[i]).toUpperCase()}i%6==4?o+="\n"+new Array(t.length+4).join(" "):i<r.length-2&&(o+=" ")}console.log(o)},testSpeed:function(e,t,r){let n=(new Date).getTime();const o=new Uint8Array(t);for(let e=0;e<t;e++)o[e]=e%256;const i=(new Date).getTime();console.log("Generated random input in "+(i-n)+"ms"),n=i;for(let i=0;i<r;i++){const r=e(o),i=(new Date).getTime(),s=i-n;n=i,console.log("Hashed in "+s+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(s/1e3)*100)/100+" MB PER SECOND")}}},VE}var JE=function(){if(QE)return ZE;QE=1;const e=function(){if(WE)return KE;WE=1;const e=YE();function t(e,t,r){const n=e[t]+e[r];let o=e[t+1]+e[r+1];n>=4294967296&&o++,e[t]=n,e[t+1]=o}function r(e,t,r,n){let o=e[t]+r;r<0&&(o+=4294967296);let i=e[t+1]+n;o>=4294967296&&i++,e[t]=o,e[t+1]=i}function n(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,n,o,i,s,u){const l=c[s],f=c[s+1],d=c[u],h=c[u+1];t(a,e,n),r(a,e,l,f);let p=a[i]^a[e],y=a[i+1]^a[e+1];a[i]=y,a[i+1]=p,t(a,o,i),p=a[n]^a[o],y=a[n+1]^a[o+1],a[n]=p>>>24^y<<8,a[n+1]=y>>>24^p<<8,t(a,e,n),r(a,e,d,h),p=a[i]^a[e],y=a[i+1]^a[e+1],a[i]=p>>>16^y<<16,a[i+1]=y>>>16^p<<16,t(a,o,i),p=a[n]^a[o],y=a[n+1]^a[o+1],a[n]=y>>>31^p<<1,a[n+1]=p>>>31^y<<1}const i=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(function(e){return 2*e})),a=new Uint32Array(32),c=new Uint32Array(32);function u(e,t){let r=0;for(r=0;r<16;r++)a[r]=e.h[r],a[r+16]=i[r];for(a[24]=a[24]^e.t,a[25]=a[25]^e.t/4294967296,t&&(a[28]=~a[28],a[29]=~a[29]),r=0;r<32;r++)c[r]=n(e.b,4*r);for(r=0;r<12;r++)o(0,8,16,24,s[16*r+0],s[16*r+1]),o(2,10,18,26,s[16*r+2],s[16*r+3]),o(4,12,20,28,s[16*r+4],s[16*r+5]),o(6,14,22,30,s[16*r+6],s[16*r+7]),o(0,10,20,30,s[16*r+8],s[16*r+9]),o(2,12,22,24,s[16*r+10],s[16*r+11]),o(4,14,16,26,s[16*r+12],s[16*r+13]),o(6,8,18,28,s[16*r+14],s[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^a[r]^a[r+16]}const l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function f(e,t,r,o){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(o&&16!==o.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const s={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};l.fill(0),l[0]=e,t&&(l[1]=t.length),l[2]=1,l[3]=1,r&&l.set(r,32),o&&l.set(o,48);for(let e=0;e<16;e++)s.h[e]=i[e]^n(l,4*e);return t&&(d(s,t),s.c=128),s}function d(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,u(e,!1),e.c=0),e.b[e.c++]=t[r]}function h(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;u(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function p(t,r,n,o,i){n=n||64,t=e.normalizeInput(t),o&&(o=e.normalizeInput(o)),i&&(i=e.normalizeInput(i));const s=f(n,r,o,i);return d(s,t),h(s)}return KE={blake2b:p,blake2bHex:function(t,r,n,o,i){const s=p(t,r,n,o,i);return e.toHex(s)},blake2bInit:f,blake2bUpdate:d,blake2bFinal:h},KE}(),t=function(){if(XE)return GE;XE=1;const e=YE();function t(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function r(e,t,r,o,i,a){s[e]=s[e]+s[t]+i,s[o]=n(s[o]^s[e],16),s[r]=s[r]+s[o],s[t]=n(s[t]^s[r],12),s[e]=s[e]+s[t]+a,s[o]=n(s[o]^s[e],8),s[r]=s[r]+s[o],s[t]=n(s[t]^s[r],7)}function n(e,t){return e>>>t^e<<32-t}const o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),s=new Uint32Array(16),a=new Uint32Array(16);function c(e,n){let c=0;for(c=0;c<8;c++)s[c]=e.h[c],s[c+8]=o[c];for(s[12]^=e.t,s[13]^=e.t/4294967296,n&&(s[14]=~s[14]),c=0;c<16;c++)a[c]=t(e.b,4*c);for(c=0;c<10;c++)r(0,4,8,12,a[i[16*c+0]],a[i[16*c+1]]),r(1,5,9,13,a[i[16*c+2]],a[i[16*c+3]]),r(2,6,10,14,a[i[16*c+4]],a[i[16*c+5]]),r(3,7,11,15,a[i[16*c+6]],a[i[16*c+7]]),r(0,5,10,15,a[i[16*c+8]],a[i[16*c+9]]),r(1,6,11,12,a[i[16*c+10]],a[i[16*c+11]]),r(2,7,8,13,a[i[16*c+12]],a[i[16*c+13]]),r(3,4,9,14,a[i[16*c+14]],a[i[16*c+15]]);for(c=0;c<8;c++)e.h[c]^=s[c]^s[c+8]}function u(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const n={h:new Uint32Array(o),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(l(n,t),n.c=64),n}function l(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,c(e,!1),e.c=0),e.b[e.c++]=t[r]}function f(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;c(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function d(t,r,n){n=n||32,t=e.normalizeInput(t);const o=u(n,r);return l(o,t),f(o)}return GE={blake2s:d,blake2sHex:function(t,r,n){const o=d(t,r,n);return e.toHex(o)},blake2sInit:u,blake2sUpdate:l,blake2sFinal:f},GE}();return ZE={blake2b:e.blake2b,blake2bHex:e.blake2bHex,blake2bInit:e.blake2bInit,blake2bUpdate:e.blake2bUpdate,blake2bFinal:e.blake2bFinal,blake2s:t.blake2s,blake2sHex:t.blake2sHex,blake2sInit:t.blake2sInit,blake2sUpdate:t.blake2sUpdate,blake2sFinal:t.blake2sFinal}}();function $E(e){const[t,r]=e.split(":");return{namespace:t,reference:r}}function eA(e,t){return e.includes(":")?[e]:t.chains||[]}var tA=Object.defineProperty,rA=Object.defineProperties,nA=Object.getOwnPropertyDescriptors,oA=Object.getOwnPropertySymbols,iA=Object.prototype.hasOwnProperty,sA=Object.prototype.propertyIsEnumerable,aA=(e,t,r)=>t in e?tA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cA=(e,t)=>{for(var r in t||(t={}))iA.call(t,r)&&aA(e,r,t[r]);if(oA)for(var r of oA(t))sA.call(t,r)&&aA(e,r,t[r]);return e},uA=(e,t,r)=>aA(e,"symbol"!=typeof t?t+"":t,r);const lA="react-native",fA="node",dA="browser",hA="unknown",pA="js";function yA(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function gA(){return!Im.getDocument()&&!!Im.getNavigator()&&"ReactNative"===navigator.product}function mA(){return!yA()&&!!Im.getNavigator()&&!!Im.getDocument()}function bA(){return gA()?lA:yA()?fA:mA()?dA:hA}function vA(){var e;try{return gA()&&typeof global<"u"&&typeof(null==global?void 0:global.Application)<"u"?null==(e=global.Application)?void 0:e.applicationId:void 0}catch{return}}function wA(e){var t,r;const n=xA();try{return null!=e&&e.url&&n.url&&new URL(e.url).host!==new URL(n.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${n.url}. This is probably unintended and can lead to issues.`),e.url=n.url),null!=(t=e?.icons)&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(e=>""!==e)),((e,t)=>rA(e,nA(t)))(cA(cA({},n),e),{url:e?.url||n.url,name:e?.name||n.name,description:e?.description||n.description,icons:null!=(r=e?.icons)&&r.length&&e.icons.length>0?e.icons:n.icons})}catch(t){return console.warn("Error populating app metadata",t),e||n}}function xA(){return Pm.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function SA(e,t,r){const n=function(){if(bA()===lA&&typeof global<"u"&&typeof(null==global?void 0:global.Platform)<"u"){const{OS:e,Version:t}=global.Platform;return[e,t].join("-")}const e=Em();if(null===e)return"unknown";const t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}(),o=function(){var e;const t=bA();return t===dA?[t,(null==(e=Im.getLocation())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),[pA,r].join("-"),n,o].join("/")}function EA({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:o,projectId:i,useOnCloseEvent:s,bundleId:a,packageName:c}){const u=r.split("?"),l={auth:o,ua:SA(e,t,n),projectId:i,useOnCloseEvent:s||void 0,packageName:c||void 0,bundleId:a||void 0},f=function(e,t){const r=new URLSearchParams(e);return Object.entries(t).sort(([e],[t])=>e.localeCompare(t)).forEach(([e,t])=>{null!=t&&r.set(e,String(t))}),r.toString()}(u[1]||"",l);return u[0]+"?"+f}function AA(e,t){return e.filter(e=>t.includes(e)).length===e.length}function kA(e){return Object.fromEntries(e.entries())}function OA(e){return new Map(Object.entries(e))}function TA(e=fd.FIVE_MINUTES,t){const r=fd.toMiliseconds(e||fd.FIVE_MINUTES);let n,o,i,s;return{resolve:e=>{i&&n&&(clearTimeout(i),n(e),s=Promise.resolve(e))},reject:e=>{i&&o&&(clearTimeout(i),o(e))},done:()=>new Promise((e,a)=>{if(s)return e(s);i=setTimeout(()=>{const e=new Error(t);s=Promise.reject(e),a(e)},r),n=e,o=a})}}function CA(e,t,r){return new Promise(async(n,o)=>{const i=setTimeout(()=>o(new Error(r)),t);try{n(await e)}catch(e){o(e)}clearTimeout(i)})}function IA(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function _A(e){const[t,r]=e.split(":"),n={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)n.topic=r;else{if("id"!==t||!Number.isInteger(Number(r)))throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);n.id=Number(r)}return n}function PA(e,t){return fd.fromMiliseconds((t||Date.now())+fd.toMiliseconds(e))}function RA(e){return Date.now()>=fd.toMiliseconds(e)}function NA(e,t){return`${e}${t?`:${t}`:""}`}function BA(e=[],t=[]){return[...new Set([...e,...t])]}async function jA({id:e,topic:t,wcDeepLink:r}){var n;try{if(!r)return;const o="string"==typeof r?JSON.parse(r):r,i=o?.href;if("string"!=typeof i)return;const s=function(e,t,r){const n=`requestId=${t}&sessionTopic=${r}`;e.endsWith("/")&&(e=e.slice(0,-1));let o=`${e}`;if(e.startsWith("https://t.me")){o=`${o}${e.includes("?")?"&startapp=":"?startapp="}${function(e,t=!1){const r=Buffer.from(e).toString("base64");return t?r.replace(/[=]/g,""):r}(n,!0)}`}else o=`${o}/wc?${n}`;return o}(i,e,t),a=bA();if(a===dA){if(null==(n=Im.getDocument())||!n.hasFocus())return void console.warn("Document does not have focus, skipping deeplink.");!function(e){let t="_self";!function(){try{return window.self!==window.top}catch{return!1}}()?(typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)||e.startsWith("https://")||e.startsWith("http://"))&&(t="_blank"):t="_top",window.open(e,t,"noreferrer noopener")}(s)}else a===lA&&typeof(null==global?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(e){console.error(e)}}function MA(e,t){if(!e.includes(t))return null;const r=e.split(/([&,?,=])/),n=r.indexOf(t);return r[n+2]}function LA(){return typeof crypto<"u"&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function UA(){return typeof process<"u"&&"true"===process.env.IS_VITEST}function DA(e){return Buffer.from(e,"base64").toString("utf-8")}class FA{constructor({limit:e}){uA(this,"limit"),uA(this,"set"),this.limit=e,this.set=new Set}add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){const e=this.set.values().next().value;e&&this.set.delete(e)}this.set.add(e)}}has(e){return this.set.has(e)}}const zA=BigInt(2**32-1),qA=BigInt(32);function VA(e,t=!1){return t?{h:Number(e&zA),l:Number(e>>qA&zA)}:{h:0|Number(e>>qA&zA),l:0|Number(e&zA)}}function HA(e,t=!1){const r=e.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){const{h:r,l:s}=VA(e[i],t);[n[i],o[i]]=[r,s]}return[n,o]}const KA=(e,t,r)=>e>>>r,WA=(e,t,r)=>e<<32-r|t>>>r,GA=(e,t,r)=>e>>>r|t<<32-r,XA=(e,t,r)=>e<<32-r|t>>>r,ZA=(e,t,r)=>e<<64-r|t>>>r-32,QA=(e,t,r)=>e>>>r-32|t<<64-r,YA=(e,t)=>t,JA=(e,t)=>e;function $A(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}}const ek=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),tk=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,rk=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),nk=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,ok=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),ik=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,sk="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function ak(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function ck(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function uk(e,...t){if(!ak(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function lk(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");ck(e.outputLen),ck(e.blockLen)}function fk(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function dk(e,t){uk(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function hk(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function pk(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function yk(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function gk(e,t){return e<<32-t|e>>>t}const mk=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function bk(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const vk=mk?e=>e:e=>bk(e);const wk=mk?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=bk(e[t]);return e},xk="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,Sk=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ek(e){if(uk(e),xk)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=Sk[e[r]];return t}const Ak=48,kk=57,Ok=65,Tk=70,Ck=97,Ik=102;function _k(e){return e>=Ak&&e<=kk?e-Ak:e>=Ok&&e<=Tk?e-(Ok-10):e>=Ck&&e<=Ik?e-(Ck-10):void 0}function Pk(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(xk)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,o=0;t<r;t++,o+=2){const r=_k(e.charCodeAt(o)),i=_k(e.charCodeAt(o+1));if(void 0===r||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}n[t]=16*r+i}return n}function Rk(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function Nk(e){return"string"==typeof e&&(e=Rk(e)),uk(e),e}function Bk(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];uk(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}class jk{}function Mk(e){const t=t=>e().update(Nk(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Lk(e=32){if(sk&&"function"==typeof sk.getRandomValues)return sk.getRandomValues(new Uint8Array(e));if(sk&&"function"==typeof sk.randomBytes)return Uint8Array.from(sk.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const Uk=BigInt(0),Dk=BigInt(1),Fk=BigInt(2),zk=BigInt(7),qk=BigInt(256),Vk=BigInt(113),Hk=[],Kk=[],Wk=[];for(let e=0,t=Dk,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Hk.push(2*(5*n+r)),Kk.push((e+1)*(e+2)/2%64);let o=Uk;for(let e=0;e<7;e++)t=(t<<Dk^(t>>zk)*Vk)%qk,t&Fk&&(o^=Dk<<(Dk<<BigInt(e))-Dk);Wk.push(o)}const Gk=HA(Wk,!0),Xk=Gk[0],Zk=Gk[1],Qk=(e,t,r)=>r>32?((e,t,r)=>t<<r-32|e>>>64-r)(e,t,r):((e,t,r)=>e<<r|t>>>32-r)(e,t,r),Yk=(e,t,r)=>r>32?((e,t,r)=>e<<r-32|t>>>64-r)(e,t,r):((e,t,r)=>t<<r|e>>>32-r)(e,t,r);class Jk extends jk{constructor(e,t,r,n=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=o,ck(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=hk(this.state)}clone(){return this._cloneInto()}keccak(){wk(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,o=(t+2)%10,i=r[o],s=r[o+1],a=Qk(i,s,1)^r[n],c=Yk(i,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],o=e[3];for(let r=0;r<24;r++){const n=Kk[r],i=Qk(t,o,n),s=Yk(t,o,n),a=Hk[r];t=e[a],o=e[a+1],e[a]=i,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=Xk[n],e[1]^=Zk[n]}pk(r)}(this.state32,this.rounds),wk(this.state32),this.posOut=0,this.pos=0}update(e){fk(this),uk(e=Nk(e));const{blockLen:t,state:r}=this,n=e.length;for(let o=0;o<n;){const i=Math.min(t-this.pos,n-o);for(let t=0;t<i;t++)r[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,!!(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){fk(this,!1),uk(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,o=e.length;n<o;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ck(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(dk(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,pk(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:o,enableXOF:i}=this;return e||(e=new Jk(t,r,n,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}const $k=((e,t,r)=>Mk(()=>new Jk(t,e,r)))(1,136,32);function eO(e,t,r){return e&t^~e&r}function tO(e,t,r){return e&t^e&r^t&r}class rO extends jk{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=yk(this.buffer)}update(e){fk(this),uk(e=Nk(e));const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let i=0;i<o;){const s=Math.min(n-this.pos,o-i);if(s===n){const t=yk(e);for(;n<=o-i;i+=n)this.process(t,i);continue}r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){fk(this),dk(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:i}=this;t[i++]=128,pk(this.buffer.subarray(i)),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)})(r,n-8,BigInt(8*this.length),o),this.process(r,0);const s=yk(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,u[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const nO=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),oO=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),iO=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),sO=Uint32Array.from([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]),aO=new Uint32Array(64);class cO extends rO{constructor(e=32){super(64,e,8,!1),this.A=0|nO[0],this.B=0|nO[1],this.C=0|nO[2],this.D=0|nO[3],this.E=0|nO[4],this.F=0|nO[5],this.G=0|nO[6],this.H=0|nO[7]}get(){const{A:e,B:t,C:r,D:n,E:o,F:i,G:s,H:a}=this;return[e,t,r,n,o,i,s,a]}set(e,t,r,n,o,i,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)aO[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=aO[e-15],r=aO[e-2],n=gk(t,7)^gk(t,18)^t>>>3,o=gk(r,17)^gk(r,19)^r>>>10;aO[e]=o+aO[e-7]+n+aO[e-16]|0}let{A:r,B:n,C:o,D:i,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(gk(s,6)^gk(s,11)^gk(s,25))+eO(s,a,c)+sO[e]+aO[e]|0,l=(gk(r,2)^gk(r,13)^gk(r,22))+tO(r,n,o)|0;u=c,c=a,a=s,s=i+t|0,i=o,o=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,i=i+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,o,i,s,a,c,u)}roundClean(){pk(aO)}destroy(){this.set(0,0,0,0,0,0,0,0),pk(this.buffer)}}const uO=HA(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),lO=uO[0],fO=uO[1],dO=new Uint32Array(80),hO=new Uint32Array(80);class pO extends rO{constructor(e=64){super(128,e,16,!1),this.Ah=0|iO[0],this.Al=0|iO[1],this.Bh=0|iO[2],this.Bl=0|iO[3],this.Ch=0|iO[4],this.Cl=0|iO[5],this.Dh=0|iO[6],this.Dl=0|iO[7],this.Eh=0|iO[8],this.El=0|iO[9],this.Fh=0|iO[10],this.Fl=0|iO[11],this.Gh=0|iO[12],this.Gl=0|iO[13],this.Hh=0|iO[14],this.Hl=0|iO[15]}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:o,Cl:i,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:f,Gh:d,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,o,i,s,a,c,u,l,f,d,h,p,y]}set(e,t,r,n,o,i,s,a,c,u,l,f,d,h,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|i,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|f,this.Gh=0|d,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)dO[r]=e.getUint32(t),hO[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|dO[e-15],r=0|hO[e-15],n=GA(t,r,1)^GA(t,r,8)^KA(t,0,7),o=XA(t,r,1)^XA(t,r,8)^WA(t,r,7),i=0|dO[e-2],s=0|hO[e-2],a=GA(i,s,19)^ZA(i,s,61)^KA(i,0,6),c=XA(i,s,19)^QA(i,s,61)^WA(i,s,6),u=rk(o,c,hO[e-7],hO[e-16]),l=nk(u,n,a,dO[e-7],dO[e-16]);dO[e]=0|l,hO[e]=0|u}let{Ah:r,Al:n,Bh:o,Bl:i,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:f,Fh:d,Fl:h,Gh:p,Gl:y,Hh:g,Hl:m}=this;for(let e=0;e<80;e++){const t=GA(l,f,14)^GA(l,f,18)^ZA(l,f,41),b=XA(l,f,14)^XA(l,f,18)^QA(l,f,41),v=l&d^~l&p,w=ok(m,b,f&h^~f&y,fO[e],hO[e]),x=ik(w,g,t,v,lO[e],dO[e]),S=0|w,E=GA(r,n,28)^ZA(r,n,34)^ZA(r,n,39),A=XA(r,n,28)^QA(r,n,34)^QA(r,n,39),k=r&o^r&s^o&s,O=n&i^n&a^i&a;g=0|p,m=0|y,p=0|d,y=0|h,d=0|l,h=0|f,({h:l,l:f}=$A(0|c,0|u,0|x,0|S)),c=0|s,u=0|a,s=0|o,a=0|i,o=0|r,i=0|n;const T=ek(S,A,O);r=tk(T,x,E,k),n=0|T}({h:r,l:n}=$A(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:i}=$A(0|this.Bh,0|this.Bl,0|o,0|i)),({h:s,l:a}=$A(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=$A(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:f}=$A(0|this.Eh,0|this.El,0|l,0|f)),({h:d,l:h}=$A(0|this.Fh,0|this.Fl,0|d,0|h)),({h:p,l:y}=$A(0|this.Gh,0|this.Gl,0|p,0|y)),({h:g,l:m}=$A(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(r,n,o,i,s,a,c,u,l,f,d,h,p,y,g,m)}roundClean(){pk(dO,hO)}destroy(){pk(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class yO extends pO{constructor(){super(48),this.Ah=0|oO[0],this.Al=0|oO[1],this.Bh=0|oO[2],this.Bl=0|oO[3],this.Ch=0|oO[4],this.Cl=0|oO[5],this.Dh=0|oO[6],this.Dl=0|oO[7],this.Eh=0|oO[8],this.El=0|oO[9],this.Fh=0|oO[10],this.Fl=0|oO[11],this.Gh=0|oO[12],this.Gl=0|oO[13],this.Hh=0|oO[14],this.Hl=0|oO[15]}}const gO=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class mO extends pO{constructor(){super(32),this.Ah=0|gO[0],this.Al=0|gO[1],this.Bh=0|gO[2],this.Bl=0|gO[3],this.Ch=0|gO[4],this.Cl=0|gO[5],this.Dh=0|gO[6],this.Dl=0|gO[7],this.Eh=0|gO[8],this.El=0|gO[9],this.Fh=0|gO[10],this.Fl=0|gO[11],this.Gh=0|gO[12],this.Gl=0|gO[13],this.Hh=0|gO[14],this.Hl=0|gO[15]}}const bO=Mk(()=>new cO),vO=Mk(()=>new pO),wO=Mk(()=>new yO),xO=Mk(()=>new mO),SO=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),EO=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),AO=new Uint32Array(32);function kO(e,t,r,n,o,i){const s=o[i],a=o[i+1];let c=AO[2*e],u=AO[2*e+1],l=AO[2*t],f=AO[2*t+1],d=AO[2*r],h=AO[2*r+1],p=AO[2*n],y=AO[2*n+1],g=ek(c,l,s);u=tk(g,u,f,a),c=0|g,({Dh:y,Dl:p}={Dh:y^u,Dl:p^c}),({Dh:y,Dl:p}={Dh:YA(0,p),Dl:JA(y)}),({h:h,l:d}=$A(h,d,y,p)),({Bh:f,Bl:l}={Bh:f^h,Bl:l^d}),({Bh:f,Bl:l}={Bh:GA(f,l,24),Bl:XA(f,l,24)}),AO[2*e]=c,AO[2*e+1]=u,AO[2*t]=l,AO[2*t+1]=f,AO[2*r]=d,AO[2*r+1]=h,AO[2*n]=p,AO[2*n+1]=y}function OO(e,t,r,n,o,i){const s=o[i],a=o[i+1];let c=AO[2*e],u=AO[2*e+1],l=AO[2*t],f=AO[2*t+1],d=AO[2*r],h=AO[2*r+1],p=AO[2*n],y=AO[2*n+1],g=ek(c,l,s);u=tk(g,u,f,a),c=0|g,({Dh:y,Dl:p}={Dh:y^u,Dl:p^c}),({Dh:y,Dl:p}={Dh:GA(y,p,16),Dl:XA(y,p,16)}),({h:h,l:d}=$A(h,d,y,p)),({Bh:f,Bl:l}={Bh:f^h,Bl:l^d}),({Bh:f,Bl:l}={Bh:ZA(f,l,63),Bl:QA(f,l,63)}),AO[2*e]=c,AO[2*e+1]=u,AO[2*t]=l,AO[2*t+1]=f,AO[2*r]=d,AO[2*r+1]=h,AO[2*n]=p,AO[2*n+1]=y}class TO extends jk{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,ck(e),ck(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=hk(this.buffer)}update(e){fk(this),uk(e=Nk(e));const{blockLen:t,buffer:r,buffer32:n}=this,o=e.length,i=e.byteOffset,s=e.buffer;for(let a=0;a<o;){this.pos===t&&(wk(n),this.compress(n,0,!1),wk(n),this.pos=0);const c=Math.min(t-this.pos,o-a),u=i+a;if(c===t&&!(u%4)&&a+c<o){const e=new Uint32Array(s,u,Math.floor((o-a)/4));wk(e);for(let r=0;a+t<o;r+=n.length,a+=t)this.length+=t,this.compress(e,r,!1);wk(e);continue}r.set(e.subarray(a,a+c),this.pos),this.pos+=c,this.length+=c,a+=c}return this}digestInto(e){fk(this),dk(e,this);const{pos:t,buffer32:r}=this;this.finished=!0,pk(this.buffer.subarray(t)),wk(r),this.compress(r,0,!0),wk(r);const n=hk(e);this.get().forEach((e,t)=>n[t]=vk(e))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){const{buffer:t,length:r,finished:n,destroyed:o,outputLen:i,pos:s}=this;return e||(e=new this.constructor({dkLen:i})),e.set(...this.get()),e.buffer.set(t),e.destroyed=o,e.finished=n,e.length=r,e.pos=s,e.outputLen=i,e}clone(){return this._cloneInto()}}class CO extends TO{constructor(e={}){const t=void 0===e.dkLen?64:e.dkLen;super(128,t),this.v0l=0|EO[0],this.v0h=0|EO[1],this.v1l=0|EO[2],this.v1h=0|EO[3],this.v2l=0|EO[4],this.v2h=0|EO[5],this.v3l=0|EO[6],this.v3h=0|EO[7],this.v4l=0|EO[8],this.v4h=0|EO[9],this.v5l=0|EO[10],this.v5h=0|EO[11],this.v6l=0|EO[12],this.v6h=0|EO[13],this.v7l=0|EO[14],this.v7h=0|EO[15],function(e,t={},r,n,o){if(ck(r),e<0||e>r)throw new Error("outputLen bigger than keyLen");const{key:i,salt:s,personalization:a}=t;if(void 0!==i&&(i.length<1||i.length>r))throw new Error("key length must be undefined or 1.."+r);if(void 0!==s&&s.length!==n)throw new Error("salt must be undefined or "+n);if(void 0!==a&&a.length!==o)throw new Error("personalization must be undefined or "+o)}(t,e,64,16,16);let{key:r,personalization:n,salt:o}=e,i=0;if(void 0!==r&&(r=Nk(r),i=r.length),this.v0l^=this.outputLen|i<<8|65536|1<<24,void 0!==o){o=Nk(o);const e=hk(o);this.v4l^=vk(e[0]),this.v4h^=vk(e[1]),this.v5l^=vk(e[2]),this.v5h^=vk(e[3])}if(void 0!==n){n=Nk(n);const e=hk(n);this.v6l^=vk(e[0]),this.v6h^=vk(e[1]),this.v7l^=vk(e[2]),this.v7h^=vk(e[3])}if(void 0!==r){const e=new Uint8Array(this.blockLen);e.set(r),this.update(e)}}get(){let{v0l:e,v0h:t,v1l:r,v1h:n,v2l:o,v2h:i,v3l:s,v3h:a,v4l:c,v4h:u,v5l:l,v5h:f,v6l:d,v6h:h,v7l:p,v7h:y}=this;return[e,t,r,n,o,i,s,a,c,u,l,f,d,h,p,y]}set(e,t,r,n,o,i,s,a,c,u,l,f,d,h,p,y){this.v0l=0|e,this.v0h=0|t,this.v1l=0|r,this.v1h=0|n,this.v2l=0|o,this.v2h=0|i,this.v3l=0|s,this.v3h=0|a,this.v4l=0|c,this.v4h=0|u,this.v5l=0|l,this.v5h=0|f,this.v6l=0|d,this.v6h=0|h,this.v7l=0|p,this.v7h=0|y}compress(e,t,r){this.get().forEach((e,t)=>AO[t]=e),AO.set(EO,16);let{h:n,l:o}=VA(BigInt(this.length));AO[24]=EO[8]^o,AO[25]=EO[9]^n,r&&(AO[28]=~AO[28],AO[29]=~AO[29]);let i=0;const s=SO;for(let r=0;r<12;r++)kO(0,4,8,12,e,t+2*s[i++]),OO(0,4,8,12,e,t+2*s[i++]),kO(1,5,9,13,e,t+2*s[i++]),OO(1,5,9,13,e,t+2*s[i++]),kO(2,6,10,14,e,t+2*s[i++]),OO(2,6,10,14,e,t+2*s[i++]),kO(3,7,11,15,e,t+2*s[i++]),OO(3,7,11,15,e,t+2*s[i++]),kO(0,5,10,15,e,t+2*s[i++]),OO(0,5,10,15,e,t+2*s[i++]),kO(1,6,11,12,e,t+2*s[i++]),OO(1,6,11,12,e,t+2*s[i++]),kO(2,7,8,13,e,t+2*s[i++]),OO(2,7,8,13,e,t+2*s[i++]),kO(3,4,9,14,e,t+2*s[i++]),OO(3,4,9,14,e,t+2*s[i++]);this.v0l^=AO[0]^AO[16],this.v0h^=AO[1]^AO[17],this.v1l^=AO[2]^AO[18],this.v1h^=AO[3]^AO[19],this.v2l^=AO[4]^AO[20],this.v2h^=AO[5]^AO[21],this.v3l^=AO[6]^AO[22],this.v3h^=AO[7]^AO[23],this.v4l^=AO[8]^AO[24],this.v4h^=AO[9]^AO[25],this.v5l^=AO[10]^AO[26],this.v5h^=AO[11]^AO[27],this.v6l^=AO[12]^AO[28],this.v6h^=AO[13]^AO[29],this.v7l^=AO[14]^AO[30],this.v7h^=AO[15]^AO[31],pk(AO)}destroy(){this.destroyed=!0,pk(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const IO=function(e){const t=(t,r)=>e(r).update(Nk(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new CO(e)),_O="https://rpc.walletconnect.org/v1";function PO(e){const t=`Ethereum Signed Message:\n${e.length}`,r=(new TextEncoder).encode(t+e);return"0x"+Buffer.from($k(r)).toString("hex")}async function RO(e,t,r,n,o,i){switch(r.t){case"eip191":return await async function(e,t,r){return(await async function({hash:e,signature:t}){return ev(await tv({hash:e,signature:t}))}({hash:PO(t),signature:r})).toLowerCase()===e.toLowerCase()}(e,t,r.s);case"eip1271":return await async function(e,t,r,n,o,i){const s=$E(n);if(!s.namespace||!s.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const s="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",c=r.substring(2),u=(c.length/2).toString(16).padStart(64,"0"),l=s+(t.startsWith("0x")?t:PO(t)).substring(2)+a+u+c,f=await fetch(`${i||_O}/?chainId=${n}&projectId=${o}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:NO(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:l},"latest"]})}),{result:d}=await f.json();return!!d&&d.slice(0,s.length).toLowerCase()===s.toLowerCase()}catch(e){return console.error("isValidEip1271Signature: ",e),!1}}(e,t,r.s,n,o,i);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function NO(){return Date.now()+Math.floor(1e3*Math.random())}function BO(e){const t=new Uint8Array(Buffer.from(e,"base64")),r=Array.from("TransactionData::").map(e=>e.charCodeAt(0)),n=new Uint8Array(r.length+t.length);n.set(r),n.set(t,r.length);const o=IO(n,{dkLen:32});return px.encode(o)}function jO(e){const t=new Uint8Array(bO(function(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if("object"==typeof e&&null!=e&&e.data)return new Uint8Array(Object.values(e.data));if("object"==typeof e&&e)return new Uint8Array(Object.values(e));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}(e)));return px.encode(t)}function MO(e){const t=function(e,t){return new Dx(t).decode(e)}(Buffer.from(e,"base64")).txn;if(!t)throw new Error("Invalid signed transaction: missing 'txn' field");const r=(s=t,new Cx(a).encodeSharedRef(s)),n=Buffer.from("TX"),o=Buffer.concat([n,Buffer.from(r)]),i=xO(o);var s,a;return sS.encode(i).replace(/=+$/,"")}function LO(e){const t=[];let r=BigInt(e);for(;r>=BigInt(128);)t.push(Number(r&BigInt(127)|BigInt(128))),r>>=BigInt(7);return t.push(Number(r)),Buffer.from(t)}function UO(e){const t=Buffer.from(e.signed.bodyBytes,"base64"),r=Buffer.from(e.signed.authInfoBytes,"base64"),n=Buffer.from(e.signature.signature,"base64"),o=[];o.push(Buffer.from([10])),o.push(LO(t.length)),o.push(t),o.push(Buffer.from([18])),o.push(LO(r.length)),o.push(r),o.push(Buffer.from([26])),o.push(LO(n.length)),o.push(n);const i=Buffer.concat(o),s=bO(i);return Buffer.from(s).toString("hex").toUpperCase()}var DO=Object.defineProperty,FO=Object.defineProperties,zO=Object.getOwnPropertyDescriptors,qO=Object.getOwnPropertySymbols,VO=Object.prototype.hasOwnProperty,HO=Object.prototype.propertyIsEnumerable,KO=(e,t,r)=>t in e?DO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const WO=e=>e?.split(":"),GO=e=>{const t=e&&WO(e);if(t)return t[2]+":"+t[3]},XO=e=>{const t=e&&WO(e);if(t)return t.pop()};async function ZO(e){const{cacao:t,projectId:r}=e,{s:n,p:o}=t,i=QO(o,o.iss),s=XO(o.iss);return await RO(s,i,n,GO(o.iss),r)}const QO=(e,t)=>{const r=`${e.domain} wants you to sign in with your Ethereum account:`,n=XO(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let o=e.statement||void 0;const i=`URI: ${e.aud||e.uri}`,s=`Version: ${e.version}`,a=`Chain ID: ${(e=>{const t=e&&WO(e);if(t)return e.includes("did:pkh:")?t[3]:t[1]})(t)}`,c=`Nonce: ${e.nonce}`,u=`Issued At: ${e.iat}`,l=e.exp?`Expiration Time: ${e.exp}`:void 0,f=e.nbf?`Not Before: ${e.nbf}`:void 0,d=e.requestId?`Request ID: ${e.requestId}`:void 0,h=e.resources?`Resources:${e.resources.map(e=>`\n- ${e}`).join("")}`:void 0,p=iT(e.resources);if(p){o=function(e="",t){YO(t);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;const n=[];let o=0;Object.keys(t.att).forEach(e=>{const r=Object.keys(t.att[e]).map(e=>({ability:e.split("/")[0],action:e.split("/")[1]}));r.sort((e,t)=>e.action.localeCompare(t.action));const i={};r.forEach(e=>{i[e.ability]||(i[e.ability]=[]),i[e.ability].push(e.action)});const s=Object.keys(i).map(t=>(o++,`(${o}) '${t}': '${i[t].join("', '")}' for '${e}'.`));n.push(s.join(", ").replace(".,","."))});const i=n.join(" "),s=`${r}${i}`;return`${e?e+" ":""}${s}`}(o,eT(p))}return[r,n,"",o,"",i,s,a,c,u,l,f,d,h].filter(e=>null!=e).join("\n")};function YO(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");const t=Object.keys(e.att);if(null==t||!t.length)throw new Error("No resources found in `att` property");t.forEach(t=>{const r=e.att[t];if(Array.isArray(r))throw new Error(`Resource must be an object: ${t}`);if("object"!=typeof r)throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${t}`);Object.keys(r).forEach(e=>{const t=r[e];if(!Array.isArray(t))throw new Error(`Ability limits ${e} must be an array of objects, found: ${t}`);if(!t.length)throw new Error(`Value of ${e} is empty array, must be an array with objects`);t.forEach(t=>{if("object"!=typeof t)throw new Error(`Ability limits (${e}) must be an array of objects, found: ${t}`)})})})}function JO(e,t,r={}){t=t?.sort((e,t)=>e.localeCompare(t));const n=t.map(t=>({[`${e}/${t}`]:[r]}));return Object.assign({},...n)}function $O(e){return YO(e),`urn:recap:${function(e){return Buffer.from(JSON.stringify(e)).toString("base64")}(e).replace(/=/g,"")}`}function eT(e){const t=function(e){return JSON.parse(Buffer.from(e,"base64").toString("utf-8"))}(e.replace("urn:recap:",""));return YO(t),t}function tT(e,t,r){const n=function(e,t,r,n={}){return r?.sort((e,t)=>e.localeCompare(t)),{att:{[e]:JO(t,r,n)}}}(e,t,r);return $O(n)}function rT(e,t){const r=function(e,t){YO(e),YO(t);const r=Object.keys(e.att).concat(Object.keys(t.att)).sort((e,t)=>e.localeCompare(t)),n={att:{}};return r.forEach(r=>{var o,i;Object.keys((null==(o=e.att)?void 0:o[r])||{}).concat(Object.keys((null==(i=t.att)?void 0:i[r])||{})).sort((e,t)=>e.localeCompare(t)).forEach(o=>{var i,s;n.att[r]=((e,t)=>FO(e,zO(t)))(((e,t)=>{for(var r in t||(t={}))VO.call(t,r)&&KO(e,r,t[r]);if(qO)for(var r of qO(t))HO.call(t,r)&&KO(e,r,t[r]);return e})({},n.att[r]),{[o]:(null==(i=e.att[r])?void 0:i[o])||(null==(s=t.att[r])?void 0:s[o])})})}),n}(eT(e),eT(t));return $O(r)}function nT(e){var t;const r=eT(e);YO(r);const n=null==(t=r.att)?void 0:t.eip155;return n?Object.keys(n).map(e=>e.split("/")[1]):[]}function oT(e){const t=eT(e);YO(t);const r=[];return Object.values(t.att).forEach(e=>{Object.values(e).forEach(e=>{var t;null!=(t=e?.[0])&&t.chains&&r.push(e[0].chains)})}),[...new Set(r.flat())]}function iT(e){if(!e)return;const t=e?.[e.length-1];return function(e){return e&&e.includes("urn:recap:")}(t)?t:void 0}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function sT(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function aT(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function cT(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function uT(e,...t){if(!sT(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function lT(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function fT(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function dT(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const hT=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function pT(e){if("string"==typeof e)e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!sT(e))throw new Error("Uint8Array expected, got "+typeof e);e=bT(e)}return e}function yT(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw new Error("invalid output length, expected "+e+", got: "+t.length);if(r&&!function(e){return e.byteOffset%4==0}(t))throw new Error("invalid output, must be aligned");return t}function gT(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}function mT(e,t,r){aT(r);const n=new Uint8Array(16),o=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}(n);return gT(o,0,BigInt(t),r),gT(o,8,BigInt(e),r),n}function bT(e){return Uint8Array.from(e)}const vT=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),wT=vT("expand 16-byte k"),xT=vT("expand 32-byte k"),ST=fT(wT),ET=fT(xT);function AT(e,t){return e<<t|e>>>32-t}function kT(e){return e.byteOffset%4==0}const OT=2**32-1,TT=new Uint32Array;const CT=(e,t)=>255&e[t++]|(255&e[t++])<<8;class IT{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,uT(e=pT(e),32);const t=CT(e,0),r=CT(e,2),n=CT(e,4),o=CT(e,6),i=CT(e,8),s=CT(e,10),a=CT(e,12),c=CT(e,14);this.r[0]=8191&t,this.r[1]=8191&(t>>>13|r<<3),this.r[2]=7939&(r>>>10|n<<6),this.r[3]=8191&(n>>>7|o<<9),this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,this.r[6]=8191&(i>>>14|s<<2),this.r[7]=8065&(s>>>11|a<<5),this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127;for(let t=0;t<8;t++)this.pad[t]=CT(e,16+2*t)}process(e,t,r=!1){const n=r?0:2048,{h:o,r:i}=this,s=i[0],a=i[1],c=i[2],u=i[3],l=i[4],f=i[5],d=i[6],h=i[7],p=i[8],y=i[9],g=CT(e,t+0),m=CT(e,t+2),b=CT(e,t+4),v=CT(e,t+6),w=CT(e,t+8),x=CT(e,t+10),S=CT(e,t+12),E=CT(e,t+14);let A=o[0]+(8191&g),k=o[1]+(8191&(g>>>13|m<<3)),O=o[2]+(8191&(m>>>10|b<<6)),T=o[3]+(8191&(b>>>7|v<<9)),C=o[4]+(8191&(v>>>4|w<<12)),I=o[5]+(w>>>1&8191),_=o[6]+(8191&(w>>>14|x<<2)),P=o[7]+(8191&(x>>>11|S<<5)),R=o[8]+(8191&(S>>>8|E<<8)),N=o[9]+(E>>>5|n),B=0,j=B+A*s+k*(5*y)+O*(5*p)+T*(5*h)+C*(5*d);B=j>>>13,j&=8191,j+=I*(5*f)+_*(5*l)+P*(5*u)+R*(5*c)+N*(5*a),B+=j>>>13,j&=8191;let M=B+A*a+k*s+O*(5*y)+T*(5*p)+C*(5*h);B=M>>>13,M&=8191,M+=I*(5*d)+_*(5*f)+P*(5*l)+R*(5*u)+N*(5*c),B+=M>>>13,M&=8191;let L=B+A*c+k*a+O*s+T*(5*y)+C*(5*p);B=L>>>13,L&=8191,L+=I*(5*h)+_*(5*d)+P*(5*f)+R*(5*l)+N*(5*u),B+=L>>>13,L&=8191;let U=B+A*u+k*c+O*a+T*s+C*(5*y);B=U>>>13,U&=8191,U+=I*(5*p)+_*(5*h)+P*(5*d)+R*(5*f)+N*(5*l),B+=U>>>13,U&=8191;let D=B+A*l+k*u+O*c+T*a+C*s;B=D>>>13,D&=8191,D+=I*(5*y)+_*(5*p)+P*(5*h)+R*(5*d)+N*(5*f),B+=D>>>13,D&=8191;let F=B+A*f+k*l+O*u+T*c+C*a;B=F>>>13,F&=8191,F+=I*s+_*(5*y)+P*(5*p)+R*(5*h)+N*(5*d),B+=F>>>13,F&=8191;let z=B+A*d+k*f+O*l+T*u+C*c;B=z>>>13,z&=8191,z+=I*a+_*s+P*(5*y)+R*(5*p)+N*(5*h),B+=z>>>13,z&=8191;let q=B+A*h+k*d+O*f+T*l+C*u;B=q>>>13,q&=8191,q+=I*c+_*a+P*s+R*(5*y)+N*(5*p),B+=q>>>13,q&=8191;let V=B+A*p+k*h+O*d+T*f+C*l;B=V>>>13,V&=8191,V+=I*u+_*c+P*a+R*s+N*(5*y),B+=V>>>13,V&=8191;let H=B+A*y+k*p+O*h+T*d+C*f;B=H>>>13,H&=8191,H+=I*l+_*u+P*c+R*a+N*s,B+=H>>>13,H&=8191,B=(B<<2)+B|0,B=B+j|0,j=8191&B,B>>>=13,M+=B,o[0]=j,o[1]=M,o[2]=L,o[3]=U,o[4]=D,o[5]=F,o[6]=z,o[7]=q,o[8]=V,o[9]=H}finalize(){const{h:e,pad:t}=this,r=new Uint16Array(10);let n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let o=(1^n)-1;for(let e=0;e<10;e++)r[e]&=o;o=~o;for(let t=0;t<10;t++)e[t]=e[t]&o|r[t];e[0]=65535&(e[0]|e[1]<<13),e[1]=65535&(e[1]>>>3|e[2]<<10),e[2]=65535&(e[2]>>>6|e[3]<<7),e[3]=65535&(e[3]>>>9|e[4]<<4),e[4]=65535&(e[4]>>>12|e[5]<<1|e[6]<<14),e[5]=65535&(e[6]>>>2|e[7]<<11),e[6]=65535&(e[7]>>>5|e[8]<<8),e[7]=65535&(e[8]>>>8|e[9]<<5);let i=e[0]+t[0];e[0]=65535&i;for(let r=1;r<8;r++)i=(e[r]+t[r]|0)+(i>>>16)|0,e[r]=65535&i;dT(r)}update(e){lT(this),uT(e=pT(e));const{buffer:t,blockLen:r}=this,n=e.length;for(let o=0;o<n;){const i=Math.min(r-this.pos,n-o);if(i!==r)t.set(e.subarray(o,o+i),this.pos),this.pos+=i,o+=i,this.pos===r&&(this.process(t,0,!1),this.pos=0);else for(;r<=n-o;o+=r)this.process(e,o)}return this}destroy(){dT(this.h,this.r,this.buffer,this.pad)}digestInto(e){lT(this),function(e,t){uT(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,h:r}=this;let{pos:n}=this;if(n){for(t[n++]=1;n<16;n++)t[n]=0;this.process(t,0,!0)}this.finalize();let o=0;for(let t=0;t<8;t++)e[o++]=r[t]>>>0,e[o++]=r[t]>>>8;return e}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}}const _T=function(e){const t=(t,r)=>e(r).update(pT(t)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new IT(e));const PT=function(e,t){const{allowShortKeys:r,extendNonceFn:n,counterLength:o,counterRight:i,rounds:s}=function(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw new Error("core must be a function");return cT(o),cT(s),aT(i),aT(r),(t,a,c,u,l=0)=>{uT(t),uT(a),uT(c);const f=c.length;if(void 0===u&&(u=new Uint8Array(f)),uT(u),cT(l),l<0||l>=OT)throw new Error("arx: counter overflow");if(u.length<f)throw new Error(`arx: output (${u.length}) is shorter than data (${f})`);const d=[];let h,p,y=t.length;if(32===y)d.push(h=bT(t)),p=ET;else{if(16!==y||!r)throw new Error(`arx: invalid 32-byte key, got length=${y}`);h=new Uint8Array(32),h.set(t),h.set(t,16),p=ST,d.push(h)}kT(a)||d.push(a=bT(a));const g=fT(h);if(n){if(24!==a.length)throw new Error("arx: extended nonce must be 24 bytes");n(p,g,fT(a.subarray(0,16)),g),a=a.subarray(16)}const m=16-o;if(m!==a.length)throw new Error(`arx: nonce must be ${m} or 16 bytes`);if(12!==m){const e=new Uint8Array(12);e.set(a,i?0:12-a.length),a=e,d.push(a)}const b=fT(a);return function(e,t,r,n,o,i,s,a){const c=o.length,u=new Uint8Array(64),l=fT(u),f=kT(o)&&kT(i),d=f?fT(o):TT,h=f?fT(i):TT;for(let p=0;p<c;s++){if(e(t,r,n,l,s,a),s>=OT)throw new Error("arx: counter overflow");const y=Math.min(64,c-p);if(f&&64===y){const e=p/4;if(p%4!=0)throw new Error("arx: invalid block position");for(let t,r=0;r<16;r++)t=e+r,h[t]=d[t]^l[r];p+=64;continue}for(let e,t=0;t<y;t++)e=p+t,i[e]=o[e]^u[t];p+=y}}(e,p,g,b,c,u,l,s),dT(...d),u}}(function(e,t,r,n,o,i=20){let s=e[0],a=e[1],c=e[2],u=e[3],l=t[0],f=t[1],d=t[2],h=t[3],p=t[4],y=t[5],g=t[6],m=t[7],b=o,v=r[0],w=r[1],x=r[2],S=s,E=a,A=c,k=u,O=l,T=f,C=d,I=h,_=p,P=y,R=g,N=m,B=b,j=v,M=w,L=x;for(let e=0;e<i;e+=2)S=S+O|0,B=AT(B^S,16),_=_+B|0,O=AT(O^_,12),S=S+O|0,B=AT(B^S,8),_=_+B|0,O=AT(O^_,7),E=E+T|0,j=AT(j^E,16),P=P+j|0,T=AT(T^P,12),E=E+T|0,j=AT(j^E,8),P=P+j|0,T=AT(T^P,7),A=A+C|0,M=AT(M^A,16),R=R+M|0,C=AT(C^R,12),A=A+C|0,M=AT(M^A,8),R=R+M|0,C=AT(C^R,7),k=k+I|0,L=AT(L^k,16),N=N+L|0,I=AT(I^N,12),k=k+I|0,L=AT(L^k,8),N=N+L|0,I=AT(I^N,7),S=S+T|0,L=AT(L^S,16),R=R+L|0,T=AT(T^R,12),S=S+T|0,L=AT(L^S,8),R=R+L|0,T=AT(T^R,7),E=E+C|0,B=AT(B^E,16),N=N+B|0,C=AT(C^N,12),E=E+C|0,B=AT(B^E,8),N=N+B|0,C=AT(C^N,7),A=A+I|0,j=AT(j^A,16),_=_+j|0,I=AT(I^_,12),A=A+I|0,j=AT(j^A,8),_=_+j|0,I=AT(I^_,7),k=k+O|0,M=AT(M^k,16),P=P+M|0,O=AT(O^P,12),k=k+O|0,M=AT(M^k,8),P=P+M|0,O=AT(O^P,7);let U=0;n[U++]=s+S|0,n[U++]=a+E|0,n[U++]=c+A|0,n[U++]=u+k|0,n[U++]=l+O|0,n[U++]=f+T|0,n[U++]=d+C|0,n[U++]=h+I|0,n[U++]=p+_|0,n[U++]=y+P|0,n[U++]=g+R|0,n[U++]=m+N|0,n[U++]=b+B|0,n[U++]=v+j|0,n[U++]=w+M|0,n[U++]=x+L|0},{counterRight:!1,counterLength:4,allowShortKeys:!1}),RT=new Uint8Array(16),NT=(e,t)=>{e.update(t);const r=t.length%16;r&&e.update(RT.subarray(r))},BT=new Uint8Array(32);function jT(e,t,r,n,o){const i=e(t,r,BT),s=_T.create(i);o&&NT(s,o),NT(s,n);const a=mT(n.length,o?o.length:0,!0);s.update(a);const c=s.digest();return dT(i,a),c}const MT=((e,t)=>{function r(r,...n){if(uT(r),!hT)throw new Error("Non little-endian hardware is not yet supported");if(void 0!==e.nonceLength){const t=n[0];if(!t)throw new Error("nonce / iv required");e.varSizeNonce?uT(t):uT(t,e.nonceLength)}const o=e.tagLength;o&&void 0!==n[1]&&uT(n[1]);const i=t(r,...n),s=(e,t)=>{if(void 0!==t){if(2!==e)throw new Error("cipher output not supported");uT(t)}};let a=!1;return{encrypt(e,t){if(a)throw new Error("cannot encrypt() twice with same key + nonce");return a=!0,uT(e),s(i.encrypt.length,t),i.encrypt(e,t)},decrypt(e,t){if(uT(e),o&&e.length<o)throw new Error("invalid ciphertext length: smaller than tagLength="+o);return s(i.decrypt.length,t),i.decrypt(e,t)}}}return Object.assign(r,e),r})({blockSize:64,nonceLength:12,tagLength:16},(e=>(t,r,n)=>({encrypt(o,i){const s=o.length;(i=yT(s+16,i,!1)).set(o);const a=i.subarray(0,-16);e(t,r,a,a,1);const c=jT(e,t,r,a,n);return i.set(c,s),dT(c),i},decrypt(o,i){i=yT(o.length-16,i,!1);const s=o.subarray(0,-16),a=o.subarray(-16),c=jT(e,t,r,s,n);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(a,c))throw new Error("invalid tag");return i.set(o.subarray(0,-16)),e(t,r,i,i,1),dT(c),i}}))(PT));class LT extends jk{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,lk(e);const r=Nk(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,o=new Uint8Array(n);o.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),pk(o)}update(e){return fk(this),this.iHash.update(e),this}digestInto(e){fk(this),uk(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:o,blockLen:i,outputLen:s}=this;return e.finished=n,e.destroyed=o,e.blockLen=i,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const UT=(e,t,r)=>new LT(e,t).update(r).digest();UT.create=(e,t)=>new LT(e,t);const DT=Uint8Array.from([0]),FT=Uint8Array.of();const zT=(e,t,r,n,o)=>function(e,t,r,n=32){lk(e),ck(n);const o=e.outputLen;if(n>255*o)throw new Error("Length should be <= 255*HashLen");const i=Math.ceil(n/o);void 0===r&&(r=FT);const s=new Uint8Array(i*o),a=UT.create(e,t),c=a._cloneInto(),u=new Uint8Array(a.outputLen);for(let e=0;e<i;e++)DT[0]=e+1,c.update(0===e?FT:u).update(r).update(DT).digestInto(u),s.set(u,o*e),a._cloneInto(c);return a.destroy(),c.destroy(),pk(u,DT),s.slice(0,n)}(e,function(e,t,r){return lk(e),void 0===r&&(r=new Uint8Array(e.outputLen)),UT(e,Nk(r),Nk(t))}(e,t,r),n,o),qT=bO,VT=BigInt(0),HT=BigInt(1);function KT(e,t=""){if("boolean"!=typeof e){throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e)}return e}function WT(e,t,r=""){const n=ak(e),o=e?.length,i=void 0!==t;if(!n||i&&o!==t){throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(i?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e))}return e}function GT(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function XT(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?VT:BigInt("0x"+e)}function ZT(e){return XT(Ek(e))}function QT(e){return uk(e),XT(Ek(Uint8Array.from(e).reverse()))}function YT(e,t){return Pk(e.toString(16).padStart(2*t,"0"))}function JT(e,t){return YT(e,t).reverse()}function $T(e,t,r){let n;if("string"==typeof t)try{n=Pk(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!ak(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const o=n.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}const eC=e=>"bigint"==typeof e&&VT<=e;function tC(e,t,r,n){if(!function(e,t,r){return eC(e)&&eC(t)&&eC(r)&&t<=e&&e<r}(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function rC(e){let t;for(t=0;e>VT;e>>=HT,t+=1);return t}const nC=e=>(HT<<BigInt(e))-HT;function oC(e,t,r={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function n(t,r,n){const o=e[t];if(n&&void 0===o)return;const i=typeof o;if(i!==r||null===o)throw new Error(`param "${t}" is invalid: expected ${r}, got ${i}`)}Object.entries(t).forEach(([e,t])=>n(e,t,!1)),Object.entries(r).forEach(([e,t])=>n(e,t,!0))}function iC(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(void 0!==o)return o;const i=e(r,...n);return t.set(r,i),i}}const sC=BigInt(0),aC=BigInt(1),cC=BigInt(2),uC=BigInt(3),lC=BigInt(4),fC=BigInt(5),dC=BigInt(7),hC=BigInt(8),pC=BigInt(9),yC=BigInt(16);function gC(e,t){const r=e%t;return r>=sC?r:t+r}function mC(e,t,r){let n=e;for(;t-- >sC;)n*=n,n%=r;return n}function bC(e,t){if(e===sC)throw new Error("invert: expected non-zero number");if(t<=sC)throw new Error("invert: expected positive modulus, got "+t);let r=gC(e,t),n=t,o=sC,i=aC;for(;r!==sC;){const e=n%r,t=o-i*(n/r);n=r,r=e,o=i,i=t}if(n!==aC)throw new Error("invert: does not exist");return gC(o,t)}function vC(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function wC(e,t){const r=(e.ORDER+aC)/lC,n=e.pow(t,r);return vC(e,n,t),n}function xC(e,t){const r=(e.ORDER-fC)/hC,n=e.mul(t,cC),o=e.pow(n,r),i=e.mul(t,o),s=e.mul(e.mul(i,cC),o),a=e.mul(i,e.sub(s,e.ONE));return vC(e,a,t),a}function SC(e){if(e<uC)throw new Error("sqrt is not defined for small field");let t=e-aC,r=0;for(;t%cC===sC;)t/=cC,r++;let n=cC;const o=CC(e);for(;1===OC(o,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return wC;let i=o.pow(n,t);const s=(t+aC)/cC;return function(e,n){if(e.is0(n))return n;if(1!==OC(e,n))throw new Error("Cannot find square root");let o=r,a=e.mul(e.ONE,i),c=e.pow(n,t),u=e.pow(n,s);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,r=e.sqr(c);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===o)throw new Error("Cannot find square root");const n=aC<<BigInt(o-t-1),i=e.pow(a,n);o=t,a=e.sqr(i),c=e.mul(c,a),u=e.mul(u,i)}return u}}function EC(e){return e%lC===uC?wC:e%hC===fC?xC:e%yC===pC?function(e){const t=CC(e),r=SC(e),n=r(t,t.neg(t.ONE)),o=r(t,n),i=r(t,t.neg(n)),s=(e+dC)/yC;return(e,t)=>{let r=e.pow(t,s),a=e.mul(r,n);const c=e.mul(r,o),u=e.mul(r,i),l=e.eql(e.sqr(a),t),f=e.eql(e.sqr(c),t);r=e.cmov(r,a,l),a=e.cmov(u,c,f);const d=e.eql(e.sqr(a),t),h=e.cmov(r,a,d);return vC(e,h,t),h}}(e):SC(e)}const AC=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function kC(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((t,r,o)=>e.is0(r)?t:(n[o]=t,e.mul(t,r)),e.ONE),i=e.inv(o);return t.reduceRight((t,r,o)=>e.is0(r)?t:(n[o]=e.mul(t,n[o]),e.mul(t,r)),i),n}function OC(e,t){const r=(e.ORDER-aC)/cC,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),s=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!s)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function TC(e,t){void 0!==t&&ck(t);const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function CC(e,t,r=!1,n={}){if(e<=sC)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,i,s,a=!1;if("object"==typeof t&&null!=t){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(o=e.BITS),e.sqrt&&(i=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE),"boolean"==typeof e.modFromBytes&&(a=e.modFromBytes),s=e.allowedLengths}else"number"==typeof t&&(o=t),n.sqrt&&(i=n.sqrt);const{nBitLength:c,nByteLength:u}=TC(e,o);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let l;const f=Object.freeze({ORDER:e,isLE:r,BITS:c,BYTES:u,MASK:nC(c),ZERO:sC,ONE:aC,allowedLengths:s,create:t=>gC(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return sC<=t&&t<e},is0:e=>e===sC,isValidNot0:e=>!f.is0(e)&&f.isValid(e),isOdd:e=>(e&aC)===aC,neg:t=>gC(-t,e),eql:(e,t)=>e===t,sqr:t=>gC(t*t,e),add:(t,r)=>gC(t+r,e),sub:(t,r)=>gC(t-r,e),mul:(t,r)=>gC(t*r,e),pow:(e,t)=>function(e,t,r){if(r<sC)throw new Error("invalid exponent, negatives unsupported");if(r===sC)return e.ONE;if(r===aC)return t;let n=e.ONE,o=t;for(;r>sC;)r&aC&&(n=e.mul(n,o)),o=e.sqr(o),r>>=aC;return n}(f,e,t),div:(t,r)=>gC(t*bC(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>bC(t,e),sqrt:i||(t=>(l||(l=EC(e)),l(f,t))),toBytes:e=>r?JT(e,u):YT(e,u),fromBytes:(t,n=!0)=>{if(s){if(!s.includes(t.length)||t.length>u)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+t.length);const e=new Uint8Array(u);e.set(t,r?0:e.length-t.length),t=e}if(t.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+t.length);let o=r?QT(t):ZT(t);if(a&&(o=gC(o,e)),!n&&!f.isValid(o))throw new Error("invalid field element: outside of range 0..ORDER");return o},invertBatch:e=>kC(f,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(f)}function IC(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function _C(e){const t=IC(e);return t+Math.ceil(t/2)}const PC=BigInt(0),RC=BigInt(1);function NC(e,t){const r=t.negate();return e?r:t}function BC(e,t){const r=kC(e.Fp,t.map(e=>e.Z));return t.map((t,n)=>e.fromAffine(t.toAffine(r[n])))}function jC(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function MC(e,t){jC(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:nC(e),maxNumber:r,shiftBy:BigInt(e)}}function LC(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:s}=r;let a=Number(e&o),c=e>>s;a>n&&(a-=i,c+=RC);const u=t*n;return{nextN:c,offset:u+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!=0,offsetF:u}}const UC=new WeakMap,DC=new WeakMap;function FC(e){return DC.get(e)||1}function zC(e){if(e!==PC)throw new Error("invalid wNAF")}class qC{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let n=e;for(;t>PC;)t&RC&&(r=r.add(n)),n=n.double(),t>>=RC;return r}precomputeWindow(e,t){const{windows:r,windowSize:n}=MC(t,this.bits),o=[];let i=e,s=i;for(let e=0;e<r;e++){s=i,o.push(s);for(let e=1;e<n;e++)s=s.add(i),o.push(s);i=s.double()}return o}wNAF(e,t,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE;const i=MC(e,this.bits);for(let e=0;e<i.windows;e++){const{nextN:s,offset:a,isZero:c,isNeg:u,isNegF:l,offsetF:f}=LC(r,e,i);r=s,c?o=o.add(NC(l,t[f])):n=n.add(NC(u,t[a]))}return zC(r),{p:n,f:o}}wNAFUnsafe(e,t,r,n=this.ZERO){const o=MC(e,this.bits);for(let e=0;e<o.windows&&r!==PC;e++){const{nextN:i,offset:s,isZero:a,isNeg:c}=LC(r,e,o);if(r=i,!a){const e=t[s];n=n.add(c?e.negate():e)}}return zC(r),n}getPrecomputes(e,t,r){let n=UC.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),UC.set(t,n))),n}cached(e,t,r){const n=FC(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)}unsafe(e,t,r,n){const o=FC(e);return 1===o?this._unsafeLadder(e,t,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),t,n)}createCache(e,t){jC(t,this.bits),DC.set(e,t),UC.delete(e)}hasCache(e){return 1!==FC(e)}}function VC(e,t,r,n){(function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})})(r,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}(n,t);const o=r.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,a=rC(BigInt(o));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=nC(c),l=new Array(Number(u)+1).fill(s);let f=s;for(let e=Math.floor((t.BITS-1)/c)*c;e>=0;e-=c){l.fill(s);for(let t=0;t<i;t++){const o=n[t],i=Number(o>>BigInt(e)&u);l[i]=l[i].add(r[t])}let t=s;for(let e=l.length-1,r=s;e>0;e--)r=r.add(l[e]),t=t.add(r);if(f=f.add(t),0!==e)for(let e=0;e<c;e++)f=f.double()}return f}function HC(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){const t=AC.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});oC(e,t)}(t),t}return CC(e,{isLE:r})}BigInt(0),BigInt(1),BigInt(2),BigInt(8),Rk("HashToScalar-");const KC=BigInt(0),WC=BigInt(1),GC=BigInt(2);function XC(e){const t=function(e){return oC(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})}(e),{P:r,type:n,adjustScalarBytes:o,powPminus2:i,randomBytes:s}=t,a="x25519"===n;if(!a&&"x448"!==n)throw new Error("invalid type");const c=s||Lk,u=a?255:448,l=a?32:56,f=BigInt(a?9:5),d=BigInt(a?121665:39081),h=a?GC**BigInt(254):GC**BigInt(447),p=a?BigInt(8)*GC**BigInt(251)-WC:BigInt(4)*GC**BigInt(445)-WC,y=h+p+WC,g=e=>gC(e,r),m=b(f);function b(e){return JT(g(e),l)}function v(e,t){const n=function(e,t){tC("u",e,KC,r),tC("scalar",t,h,y);const n=t,o=e;let s=WC,a=KC,c=e,l=WC,f=KC;for(let e=BigInt(u-1);e>=KC;e--){const t=n>>e&WC;f^=t,({x_2:s,x_3:c}=x(f,s,c)),({x_2:a,x_3:l}=x(f,a,l)),f=t;const r=s+a,i=g(r*r),u=s-a,h=g(u*u),p=i-h,y=c+l,m=g((c-l)*r),b=g(y*u),v=m+b,w=m-b;c=g(v*v),l=g(o*g(w*w)),s=g(i*h),a=g(p*(i+g(d*p)))}({x_2:s,x_3:c}=x(f,s,c)),({x_2:a,x_3:l}=x(f,a,l));const p=i(a);return g(s*p)}(function(e){const t=$T("u coordinate",e,l);return a&&(t[31]&=127),g(QT(t))}(t),function(e){return QT(o($T("scalar",e,l)))}(e));if(n===KC)throw new Error("invalid private or public key received");return b(n)}function w(e){return v(e,m)}function x(e,t,r){const n=g(e*(t-r));return{x_2:t=g(t-n),x_3:r=g(r+n)}}const S={secretKey:l,publicKey:l,seed:l},E=(e=c(l))=>(uk(e,S.seed),e);return{keygen:function(e){const t=E(e);return{secretKey:t,publicKey:w(t)}},getSharedSecret:(e,t)=>v(e,t),getPublicKey:e=>w(e),scalarMult:v,scalarMultBase:w,utils:{randomSecretKey:E,randomPrivateKey:E},GuBytes:m.slice(),lengths:S}}const ZC=BigInt(1),QC=BigInt(2),YC=BigInt(3),JC=BigInt(5),$C=BigInt(8),eI=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed");function tI(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const rI=CC({p:eI,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:$C,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")}.p,{isLE:!0}),nI=(()=>{const e=rI.ORDER;return XC({P:e,type:"x25519",powPminus2:t=>{const{pow_p_5_8:r,b2:n}=function(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=eI,s=e*e%i*e%i,a=mC(s,QC,i)*s%i,c=mC(a,ZC,i)*e%i,u=mC(c,JC,i)*c%i,l=mC(u,t,i)*u%i,f=mC(l,r,i)*l%i,d=mC(f,n,i)*f%i,h=mC(d,o,i)*d%i,p=mC(h,o,i)*d%i,y=mC(p,t,i)*u%i;return{pow_p_5_8:mC(y,QC,i)*e%i,b2:s}}(t);return gC(mC(r,YC,e)*n,e)},adjustScalarBytes:tI})})(),oI=(e,t)=>(e+(e>=0?t:-t)/fI)/t;function iI(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function sI(e,t){const r={};for(let n of Object.keys(t))r[n]=void 0===e[n]?t[n]:e[n];return KT(r.lowS,"lowS"),KT(r.prehash,"prehash"),void 0!==r.format&&iI(r.format),r}class aI extends Error{constructor(e=""){super(e)}}const cI={Err:aI,_tlv:{encode:(e,t)=>{const{Err:r}=cI;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const n=t.length/2,o=GT(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");const i=n>127?GT(o.length/2|128):"";return GT(e)+i+o+t},decode(e,t){const{Err:r}=cI;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const o=t[n++];let i=0;if(!!(128&o)){const e=127&o;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of s)i=i<<8|e;if(n+=e,i<128)throw new r("tlv.decode(long): not minimal encoding")}else i=o;const s=t.subarray(n,n+i);if(s.length!==i)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+i)}}},_int:{encode(e){const{Err:t}=cI;if(e<uI)throw new t("integer: negative integers are not allowed");let r=GT(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=cI;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return ZT(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=cI,o=$T("signature",e),{v:i,l:s}=n.decode(48,o);if(s.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=n.decode(2,i),{v:u,l:l}=n.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(e){const{_tlv:t,_int:r}=cI,n=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,n)}},uI=BigInt(0),lI=BigInt(1),fI=BigInt(2),dI=BigInt(3),hI=BigInt(4);function pI(e,t){const{BYTES:r}=e;let n;if("bigint"==typeof t)n=t;else{let o=$T("private key",t);try{n=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(n))throw new Error("invalid private key: out of range [1..N-1]");return n}function yI(e,t={}){const r=function(e,t,r={},n){if(void 0===n&&(n="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>PC))throw new Error(`CURVE.${e} must be positive bigint`)}const o=HC(t.p,r.Fp,n),i=HC(t.n,r.Fn,n),s=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of s)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}}("weierstrass",e,t),{Fp:n,Fn:o}=r;let i=r.CURVE;const{h:s,n:a}=i;oC(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=t;if(c&&(!n.is0(i.a)||"bigint"!=typeof c.beta||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const u=mI(n,o);function l(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const f=t.toBytes||function(e,t,r){const{x:o,y:i}=t.toAffine(),s=n.toBytes(o);if(KT(r,"isCompressed"),r){l();return Bk(gI(!n.isOdd(i)),s)}return Bk(Uint8Array.of(4),s,n.toBytes(i))},d=t.fromBytes||function(e){WT(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:r}=u,o=e.length,i=e[0],s=e.subarray(1);if(o!==t||2!==i&&3!==i){if(o===r&&4===i){const e=n.BYTES,t=n.fromBytes(s.subarray(0,e)),r=n.fromBytes(s.subarray(e,2*e));if(!p(t,r))throw new Error("bad point: is not on curve");return{x:t,y:r}}throw new Error(`bad point: got length ${o}, expected compressed=${t} or uncompressed=${r}`)}{const e=n.fromBytes(s);if(!n.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=h(e);let r;try{r=n.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}l();return!(1&~i)!==n.isOdd(r)&&(r=n.neg(r)),{x:e,y:r}}};function h(e){const t=n.sqr(e),r=n.mul(t,e);return n.add(n.add(r,n.mul(e,i.a)),i.b)}function p(e,t){const r=n.sqr(t),o=h(e);return n.eql(r,o)}if(!p(i.Gx,i.Gy))throw new Error("bad curve params: generator point");const y=n.mul(n.pow(i.a,dI),hI),g=n.mul(n.sqr(i.b),BigInt(27));if(n.is0(n.add(y,g)))throw new Error("bad curve params: a or b");function m(e,t,r=!1){if(!n.isValid(t)||r&&n.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function b(e){if(!(e instanceof E))throw new Error("ProjectivePoint expected")}function v(e){if(!c||!c.basises)throw new Error("no endo");return function(e,t,r){const[[n,o],[i,s]]=t,a=oI(s*e,r),c=oI(-o*e,r);let u=e-a*n-c*i,l=-a*o-c*s;const f=u<uI,d=l<uI;f&&(u=-u),d&&(l=-l);const h=nC(Math.ceil(rC(r)/2))+lI;if(u<uI||u>=h||l<uI||l>=h)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:l}}(e,c.basises,o.ORDER)}const w=iC((e,t)=>{const{X:r,Y:o,Z:i}=e;if(n.eql(i,n.ONE))return{x:r,y:o};const s=e.is0();null==t&&(t=s?n.ONE:n.inv(i));const a=n.mul(r,t),c=n.mul(o,t),u=n.mul(i,t);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:a,y:c}}),x=iC(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=e.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not field elements");if(!p(r,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function S(e,t,r,o,i){return r=new E(n.mul(r.X,e),r.Y,r.Z),t=NC(o,t),r=NC(i,r),t.add(r)}class E{constructor(e,t,r){this.X=m("x",e),this.Y=m("y",t,!0),this.Z=m("z",r),Object.freeze(this)}static CURVE(){return i}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof E)throw new Error("projective point not allowed");return n.is0(t)&&n.is0(r)?E.ZERO:new E(t,r,n.ONE)}static fromBytes(e){const t=E.fromAffine(d(WT(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return E.fromBytes($T("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return k.createCache(this,e),t||this.multiply(dI),this}assertValidity(){x(this)}hasEvenY(){const{y:e}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(e)}equals(e){b(e);const{X:t,Y:r,Z:o}=this,{X:i,Y:s,Z:a}=e,c=n.eql(n.mul(t,a),n.mul(i,o)),u=n.eql(n.mul(r,a),n.mul(s,o));return c&&u}negate(){return new E(this.X,n.neg(this.Y),this.Z)}double(){const{a:e,b:t}=i,r=n.mul(t,dI),{X:o,Y:s,Z:a}=this;let c=n.ZERO,u=n.ZERO,l=n.ZERO,f=n.mul(o,o),d=n.mul(s,s),h=n.mul(a,a),p=n.mul(o,s);return p=n.add(p,p),l=n.mul(o,a),l=n.add(l,l),c=n.mul(e,l),u=n.mul(r,h),u=n.add(c,u),c=n.sub(d,u),u=n.add(d,u),u=n.mul(c,u),c=n.mul(p,c),l=n.mul(r,l),h=n.mul(e,h),p=n.sub(f,h),p=n.mul(e,p),p=n.add(p,l),l=n.add(f,f),f=n.add(l,f),f=n.add(f,h),f=n.mul(f,p),u=n.add(u,f),h=n.mul(s,a),h=n.add(h,h),f=n.mul(h,p),c=n.sub(c,f),l=n.mul(h,d),l=n.add(l,l),l=n.add(l,l),new E(c,u,l)}add(e){b(e);const{X:t,Y:r,Z:o}=this,{X:s,Y:a,Z:c}=e;let u=n.ZERO,l=n.ZERO,f=n.ZERO;const d=i.a,h=n.mul(i.b,dI);let p=n.mul(t,s),y=n.mul(r,a),g=n.mul(o,c),m=n.add(t,r),v=n.add(s,a);m=n.mul(m,v),v=n.add(p,y),m=n.sub(m,v),v=n.add(t,o);let w=n.add(s,c);return v=n.mul(v,w),w=n.add(p,g),v=n.sub(v,w),w=n.add(r,o),u=n.add(a,c),w=n.mul(w,u),u=n.add(y,g),w=n.sub(w,u),f=n.mul(d,v),u=n.mul(h,g),f=n.add(u,f),u=n.sub(y,f),f=n.add(y,f),l=n.mul(u,f),y=n.add(p,p),y=n.add(y,p),g=n.mul(d,g),v=n.mul(h,v),y=n.add(y,g),g=n.sub(p,g),g=n.mul(d,g),v=n.add(v,g),p=n.mul(y,v),l=n.add(l,p),p=n.mul(w,v),u=n.mul(m,u),u=n.sub(u,p),p=n.mul(m,y),f=n.mul(w,f),f=n.add(f,p),new E(u,l,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(E.ZERO)}multiply(e){const{endo:r}=t;if(!o.isValidNot0(e))throw new Error("invalid scalar: out of range");let n,i;const s=e=>k.cached(this,e,e=>BC(E,e));if(r){const{k1neg:t,k1:o,k2neg:a,k2:c}=v(e),{p:u,f:l}=s(o),{p:f,f:d}=s(c);i=l.add(d),n=S(r.beta,u,f,t,a)}else{const{p:t,f:r}=s(e);n=t,i=r}return BC(E,[n,i])[0]}multiplyUnsafe(e){const{endo:r}=t,n=this;if(!o.isValid(e))throw new Error("invalid scalar: out of range");if(e===uI||n.is0())return E.ZERO;if(e===lI)return n;if(k.hasCache(this))return this.multiply(e);if(r){const{k1neg:t,k1:o,k2neg:i,k2:s}=v(e),{p1:a,p2:c}=function(e,t,r,n){let o=t,i=e.ZERO,s=e.ZERO;for(;r>PC||n>PC;)r&RC&&(i=i.add(o)),n&RC&&(s=s.add(o)),o=o.double(),r>>=RC,n>>=RC;return{p1:i,p2:s}}(E,n,o,s);return S(r.beta,a,c,t,i)}return k.unsafe(n,e)}multiplyAndAddUnsafe(e,t,r){const n=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(e){return w(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return s===lI||(e?e(E,this):k.unsafe(this,a).is0())}clearCofactor(){const{clearCofactor:e}=t;return s===lI?this:e?e(E,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(e=!0){return KT(e,"isCompressed"),this.assertValidity(),f(E,this,e)}toHex(e=!0){return Ek(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return BC(E,e)}static msm(e,t){return VC(E,o,e,t)}static fromPrivateKey(e){return E.BASE.multiply(pI(o,e))}}E.BASE=new E(i.Gx,i.Gy,n.ONE),E.ZERO=new E(n.ZERO,n.ONE,n.ZERO),E.Fp=n,E.Fn=o;const A=o.BITS,k=new qC(E,t.endo?Math.ceil(A/2):A);return E.BASE.precompute(8),E}function gI(e){return Uint8Array.of(e?2:3)}function mI(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function bI(e,t={}){const{Fn:r}=e,n=t.randomBytes||Lk,o=Object.assign(mI(e.Fp,r),{seed:_C(r.ORDER)});function i(e){try{return!!pI(r,e)}catch{return!1}}function s(e=n(o.seed)){return function(e,t,r=!1){const n=e.length,o=IC(t),i=_C(t);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);const s=gC(r?QT(e):ZT(e),t-aC)+aC;return r?JT(s,o):YT(s,o)}(WT(e,o.seed,"seed"),r.ORDER)}function a(t,n=!0){return e.BASE.multiply(pI(r,t)).toBytes(n)}function c(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:n,publicKey:i,publicKeyUncompressed:s}=o;if(r.allowedLengths||n===i)return;const a=$T("key",t).length;return a===i||a===s}return Object.freeze({getPublicKey:a,getSharedSecret:function(t,n,o=!0){if(!0===c(t))throw new Error("first arg must be private key");if(!1===c(n))throw new Error("second arg must be public key");const i=pI(r,t);return e.fromHex(n).multiply(i).toBytes(o)},keygen:function(e){const t=s(e);return{secretKey:t,publicKey:a(t)}},Point:e,utils:{isValidSecretKey:i,isValidPublicKey:function(t,r){const{publicKey:n,publicKeyUncompressed:i}=o;try{const o=t.length;return!(!0===r&&o!==n||!1===r&&o!==i)&&!!e.fromBytes(t)}catch{return!1}},randomSecretKey:s,isValidPrivateKey:i,randomPrivateKey:s,normPrivateKeyToScalar:e=>pI(r,e),precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)},lengths:o})}function vI(e,t,r={}){lk(t),oC(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const n=r.randomBytes||Lk,o=r.hmac||((e,...r)=>UT(t,e,Bk(...r))),{Fp:i,Fn:s}=e,{ORDER:a,BITS:c}=s,{keygen:u,getPublicKey:l,getSharedSecret:f,utils:d,lengths:h}=bI(e,r),p={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},y="compact";function g(e){return e>a>>lI}function m(e,t){if(!s.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class b{constructor(e,t,r){this.r=m("r",e),this.s=m("s",t),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(e,t=y){let r;if(function(e,t){iI(t);const r=h.signature;WT(e,"compact"===t?r:"recovered"===t?r+1:void 0,`${t} signature`)}(e,t),"der"===t){const{r:t,s:r}=cI.toSig(WT(e));return new b(t,r)}"recovered"===t&&(r=e[0],t="compact",e=e.subarray(1));const n=s.BYTES,o=e.subarray(0,n),i=e.subarray(n,2*n);return new b(s.fromBytes(o),s.fromBytes(i),r)}static fromHex(e,t){return this.fromBytes(Pk(e),t)}addRecoveryBit(e){return new b(this.r,this.s,e)}recoverPublicKey(t){const r=i.ORDER,{r:n,s:o,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error("recovery id invalid");if(a*fI<r&&c>1)throw new Error("recovery id is ambiguous for h>1 curve");const u=2===c||3===c?n+a:n;if(!i.isValid(u))throw new Error("recovery id 2 or 3 invalid");const l=i.toBytes(u),f=e.fromBytes(Bk(gI(!(1&c)),l)),d=s.inv(u),h=w($T("msgHash",t)),p=s.create(-h*d),y=s.create(o*d),g=e.BASE.multiplyUnsafe(p).add(f.multiplyUnsafe(y));if(g.is0())throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return g(this.s)}toBytes(e=y){if(iI(e),"der"===e)return Pk(cI.hexFromSig(this));const t=s.toBytes(this.r),r=s.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return Bk(Uint8Array.of(this.recovery),t,r)}return Bk(t,r)}toHex(e){return Ek(this.toBytes(e))}assertValidity(){}static fromCompact(e){return b.fromBytes($T("sig",e),"compact")}static fromDER(e){return b.fromBytes($T("sig",e),"der")}normalizeS(){return this.hasHighS()?new b(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Ek(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Ek(this.toBytes("compact"))}}const v=r.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=ZT(e),r=8*e.length-c;return r>0?t>>BigInt(r):t},w=r.bits2int_modN||function(e){return s.create(v(e))},x=nC(c);function S(e){return tC("num < 2^"+c,e,uI,x),s.toBytes(e)}function E(e,r){return WT(e,void 0,"message"),r?WT(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:u,getPublicKey:l,getSharedSecret:f,utils:d,lengths:h,Point:e,sign:function(r,i,a={}){r=$T("message",r);const{seed:c,k2sig:u}=function(t,r,o){if(["recovered","canonical"].some(e=>e in o))throw new Error("sign() legacy options not supported");const{lowS:i,prehash:a,extraEntropy:c}=sI(o,p);t=E(t,a);const u=w(t),l=pI(s,r),f=[S(l),S(u)];if(null!=c&&!1!==c){const e=!0===c?n(h.secretKey):c;f.push($T("extraEntropy",e))}const d=Bk(...f),y=u;return{seed:d,k2sig:function(t){const r=v(t);if(!s.isValidNot0(r))return;const n=s.inv(r),o=e.BASE.multiply(r).toAffine(),a=s.create(o.x);if(a===uI)return;const c=s.create(n*s.create(y+a*l));if(c===uI)return;let u=(o.x===a?0:2)|Number(o.y&lI),f=c;return i&&g(c)&&(f=s.neg(c),u^=1),new b(a,f,u)}}}(r,i,a);return function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");const n=e=>new Uint8Array(e),o=e=>Uint8Array.of(e);let i=n(e),s=n(e),a=0;const c=()=>{i.fill(1),s.fill(0),a=0},u=(...e)=>r(s,i,...e),l=(e=n(0))=>{s=u(o(0),e),i=u(),0!==e.length&&(s=u(o(1),e),i=u())},f=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){i=u();const t=i.slice();r.push(t),e+=i.length}return Bk(...r)};return(e,t)=>{let r;for(c(),l(e);!(r=t(f()));)l();return c(),r}}(t.outputLen,s.BYTES,o)(c,u)},verify:function(t,r,n,o={}){const{lowS:i,prehash:a,format:c}=sI(o,p);if(n=$T("publicKey",n),r=E($T("message",r),a),"strict"in o)throw new Error("options.strict was renamed to lowS");const u=void 0===c?function(e){let t;const r="string"==typeof e||ak(e),n=!r&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!r&&!n)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(n)t=new b(e.r,e.s);else if(r){try{t=b.fromBytes($T("sig",e),"der")}catch(e){if(!(e instanceof cI.Err))throw e}if(!t)try{t=b.fromBytes($T("sig",e),"compact")}catch{return!1}}return t||!1}(t):b.fromBytes($T("sig",t),c);if(!1===u)return!1;try{const t=e.fromBytes(n);if(i&&u.hasHighS())return!1;const{r:o,s:a}=u,c=w(r),l=s.inv(a),f=s.create(c*l),d=s.create(o*l),h=e.BASE.multiplyUnsafe(f).add(t.multiplyUnsafe(d));return!h.is0()&&s.create(h.x)===o}catch{return!1}},recoverPublicKey:function(e,t,r={}){const{prehash:n}=sI(r,p);return t=E(t,n),b.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:b,hash:t})}function wI(e){const{CURVE:t,curveOpts:r}=function(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp;let n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:r,Fn:CC(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}function xI(e){const{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:o}=wI(e);return function(e,t){const r=t.Point;return Object.assign({},t,{ProjectivePoint:r,CURVE:Object.assign({},e,TC(r.Fn.ORDER,r.Fn.BITS))})}(e,vI(yI(t,r),n,o))}function SI(e,t){const r=t=>xI({...e,hash:t});return{...r(t),create:r}}const EI={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},AI={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},kI={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},OI=CC(EI.p),TI=CC(AI.p),CI=CC(kI.p),II=SI({...EI,Fp:OI,lowS:!1},bO);SI({...AI,Fp:TI,lowS:!1},wO),SI({...kI,Fp:CI,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},vO);const _I=II,PI="base10",RI="base16",NI="base64pad",BI="base64url",jI="utf8";function MI(){return zE(Lk(32),RI)}function LI(e){return zE(qT(FE(e,RI)),RI)}function UI(e){return zE(qT(FE(e,jI)),RI)}function DI(e){return FE(`${e}`,PI)}function FI(e){return Number(zE(e,PI))}function zI(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function qI(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4;return t+"=".repeat(r)}function VI(e){if(2===FI(e.type))return zE(gS([e.type,e.sealed]),NI);if(1===FI(e.type)){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return zE(gS([e.type,e.senderPublicKey,e.iv,e.sealed]),NI)}return zE(gS([e.type,e.iv,e.sealed]),NI)}function HI(e){const t=FE((e.encoding||NI)===BI?qI(e.encoded):e.encoded,NI),r=t.slice(0,1);if(1===FI(r)){const e=33,n=e+12,o=t.slice(1,e),i=t.slice(e,n);return{type:r,sealed:t.slice(n),iv:i,senderPublicKey:o}}if(2===FI(r)){return{type:r,sealed:t.slice(1),iv:Lk(12)}}const n=t.slice(1,13);return{type:r,sealed:t.slice(13),iv:n}}function KI(e){const t=e?.type||0;if(1===t){if(typeof e?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function WI(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}function GI(e){return 2===e.type}function XI(e,t){const[r,n,o]=e.split("."),i=Buffer.from(qI(o),"base64");if(64!==i.length)throw new Error("Invalid signature length");const s=i.slice(0,32),a=i.slice(32,64),c=qT(`${r}.${n}`),u=function(e){const t=Buffer.from(e.x,"base64"),r=Buffer.from(e.y,"base64");return gS([new Uint8Array([4]),t,r])}(t);if(!_I.verify(gS([s,a]),c,u))throw new Error("Invalid signature");return fm(e).payload}function ZI(e){return e?.relay||{protocol:"irn"}}function QI(e){const t=qE[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}var YI=Object.defineProperty,JI=Object.defineProperties,$I=Object.getOwnPropertyDescriptors,e_=Object.getOwnPropertySymbols,t_=Object.prototype.hasOwnProperty,r_=Object.prototype.propertyIsEnumerable,n_=(e,t,r)=>t in e?YI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,o_=(e,t)=>{for(var r in t||(t={}))t_.call(t,r)&&n_(e,r,t[r]);if(e_)for(var r of e_(t))r_.call(t,r)&&n_(e,r,t[r]);return e};function i_(e,t="-"){const r={},n="relay"+t;return Object.keys(e).forEach(t=>{if(t.startsWith(n)){const o=t.replace(n,""),i=e[t];r[o]=i}}),r}function s_(e){if(!e.includes("wc:")){const t=DA(e);null!=t&&t.includes("wc:")&&(e=t)}const t=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,t),o=e.substring(t+1,r).split("@"),i=typeof r<"u"?e.substring(r):"",s=new URLSearchParams(i),a=Object.fromEntries(s.entries()),c="string"==typeof a.methods?a.methods.split(","):void 0;return{protocol:n,topic:a_(o[0]),version:parseInt(o[1],10),symKey:a.symKey,relay:i_(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function a_(e){return e.startsWith("//")?e.substring(2):e}function c_(e){const t=new URLSearchParams,r=o_(o_(((e,t)=>JI(e,$I(t)))(o_({},function(e,t="-"){const r={};return Object.keys(e).forEach(n=>{const o=n,i="relay"+t+o;e[o]&&(r[i]=e[o])}),r}(e.relay)),{symKey:e.symKey}),e.expiryTimestamp&&{expiryTimestamp:e.expiryTimestamp.toString()}),e.methods&&{methods:e.methods.join(",")});return Object.entries(r).sort(([e],[t])=>e.localeCompare(t)).forEach(([e,r])=>{void 0!==r&&t.append(e,String(r))}),`${e.protocol}:${e.topic}@${e.version}?${t}`}function u_(e,t,r){return`${e}?wc_ev=${r}&topic=${t}`}var l_=Object.defineProperty,f_=Object.defineProperties,d_=Object.getOwnPropertyDescriptors,h_=Object.getOwnPropertySymbols,p_=Object.prototype.hasOwnProperty,y_=Object.prototype.propertyIsEnumerable,g_=(e,t,r)=>t in e?l_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m_=(e,t)=>{for(var r in t||(t={}))p_.call(t,r)&&g_(e,r,t[r]);if(h_)for(var r of h_(t))y_.call(t,r)&&g_(e,r,t[r]);return e},b_=(e,t)=>f_(e,d_(t));function v_(e){const t=[];return e.forEach(e=>{const[r,n]=e.split(":");t.push(`${r}:${n}`)}),t}function w_(e){return e.includes(":")}function x_(e){return w_(e)?e.split(":")[0]:e}function S_(e){var t,r,n;const o={};if(!I_(e))return o;for(const[i,s]of Object.entries(e)){const e=w_(i)?[i]:s.chains,a=s.methods||[],c=s.events||[],u=x_(i);o[u]=b_(m_({},o[u]),{chains:BA(e,null==(t=o[u])?void 0:t.chains),methods:BA(a,null==(r=o[u])?void 0:r.methods),events:BA(c,null==(n=o[u])?void 0:n.events)})}return o}function E_(e,t){t=t.map(e=>e.replace("did:pkh:",""));const r=function(e){const t={};return e?.forEach(e=>{var r;const[n,o]=e.split(":");t[n]||(t[n]={accounts:[],chains:[],events:[],methods:[]}),t[n].accounts.push(e),null==(r=t[n].chains)||r.push(`${n}:${o}`)}),t}(t);for(const[t,n]of Object.entries(r))n.methods?n.methods=BA(n.methods,e):n.methods=e,n.events=["chainChanged","accountsChanged"];return r}const A_={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}},k_={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 O_(e,t){const{message:r,code:n}=k_[e];return{message:t?`${r} ${t}`:r,code:n}}function T_(e,t){const{message:r,code:n}=A_[e];return{message:t?`${r} ${t}`:r,code:n}}function C_(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function I_(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function __(e){return typeof e>"u"}function P_(e,t){return!(!t||!__(e))||"string"==typeof e&&!!e.trim().length}function R_(e,t){return!(!t||!__(e))||"number"==typeof e&&!isNaN(e)}function N_(e){return!(!P_(e,!1)||!e.includes(":"))&&2===e.split(":").length}function B_(e){let t=!0;return C_(e)?e.length&&(t=e.every(e=>P_(e,!1))):t=!1,t}function j_(e,t,r){let n=null;return Object.entries(e).forEach(([e,o])=>{if(n)return;const i=function(e,t,r){let n=null;return C_(t)&&t.length?t.forEach(e=>{n||N_(e)||(n=T_("UNSUPPORTED_CHAINS",`${r}, chain ${e} should be a string and conform to "namespace:chainId" format`))}):N_(e)||(n=T_("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}(e,eA(e,o),`${t} ${r}`);i&&(n=i)}),n}function M_(e,t){let r=null;return C_(e)?e.forEach(e=>{r||function(e){if(P_(e,!1)&&e.includes(":")){const t=e.split(":");if(3===t.length){const e=t[0]+":"+t[1];return!!t[2]&&N_(e)}}return!1}(e)||(r=T_("UNSUPPORTED_ACCOUNTS",`${t}, account ${e} should be a string and conform to "namespace:chainId:address" format`))}):r=T_("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function L_(e,t){let r=null;return Object.values(e).forEach(e=>{if(r)return;const n=function(e,t){let r=null;return B_(e?.methods)?B_(e?.events)||(r=T_("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=T_("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}(e,`${t}, namespace`);n&&(r=n)}),r}function U_(e,t){let r=null;if(e&&I_(e)){const n=L_(e,t);n&&(r=n);const o=function(e,t){let r=null;return Object.values(e).forEach(e=>{if(r)return;const n=M_(e?.accounts,`${t} namespace`);n&&(r=n)}),r}(e,t);o&&(r=o)}else r=O_("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function D_(e){return P_(e.protocol,!0)}function F_(e){return typeof e<"u"&&null!==typeof e}function z_(e,t){return!(!N_(t)||!function(e){const t=[];return Object.values(e).forEach(e=>{t.push(...v_(e.accounts))}),t}(e).includes(t))}function q_(e,t,r){return!!P_(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach(e=>{v_(e.accounts).includes(t)&&r.push(...e.methods)}),r}(e,t).includes(r)}function V_(e,t,r){return!!P_(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach(e=>{v_(e.accounts).includes(t)&&r.push(...e.events)}),r}(e,t).includes(r)}function H_(e,t,r){let n=null;const o=function(e){const t={};return Object.keys(e).forEach(r=>{var n;r.includes(":")?t[r]=e[r]:null==(n=e[r].chains)||n.forEach(n=>{t[n]={methods:e[r].methods,events:e[r].events}})}),t}(e),i=function(e){const t={};return Object.keys(e).forEach(r=>{if(r.includes(":"))t[r]=e[r];else{const n=v_(e[r].accounts);n?.forEach(n=>{t[n]={accounts:e[r].accounts.filter(e=>e.includes(`${n}:`)),methods:e[r].methods,events:e[r].events}})}}),t}(t),s=Object.keys(o),a=Object.keys(i),c=K_(Object.keys(e)),u=K_(Object.keys(t)),l=c.filter(e=>!u.includes(e));return l.length&&(n=O_("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${l.toString()}\n Received: ${Object.keys(t).toString()}`)),AA(s,a)||(n=O_("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${s.toString()}\n Approved: ${a.toString()}`)),Object.keys(t).forEach(e=>{if(!e.includes(":")||n)return;const o=v_(t[e].accounts);o.includes(e)||(n=O_("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e}\n Required: ${e}\n Approved: ${o.toString()}`))}),s.forEach(e=>{n||(AA(o[e].methods,i[e].methods)?AA(o[e].events,i[e].events)||(n=O_("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):n=O_("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))}),n}function K_(e){return[...new Set(e.map(e=>e.includes(":")?e.split(":")[0]:e))]}function W_(){const e=bA();return new Promise(t=>{switch(e){case dA:t(mA()&&navigator?.onLine);break;case lA:t(async function(){if(gA()&&typeof global<"u"&&null!=global&&global.NetInfo){const e=await(null==global?void 0:global.NetInfo.fetch());return e?.isConnected}return!0}());break;default:t(!0)}})}function G_(e){switch(bA()){case dA:!function(e){!gA()&&mA()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)))}(e);break;case lA:!function(e){gA()&&typeof global<"u"&&null!=global&&global.NetInfo&&global?.NetInfo.addEventListener(t=>e(t?.isConnected))}(e)}}const X_={};class Z_{static get(e){return X_[e]}static set(e,t){X_[e]=t}static delete(e){delete X_[e]}}function Q_({publicKey:e,signature:t,payload:r}){var n;const o=Y_(r.method),i=128|parseInt((null==(n=r.version)?void 0:n.toString())||"4"),s=function(e){const t=px.decode(e)[0];return 42===t?0:60===t?2:1}(r.address),a="00"===r.era?new Uint8Array([0]):Y_(r.era);if(1!==a.length&&2!==a.length)throw new Error("Invalid era length");const c=parseInt(r.nonce,16),u=new Uint8Array([255&c,c>>8&255]),l=BigInt(`0x${function(e){return e.startsWith("0x")?e.slice(2):e}(r.tip)}`),f=function(e){if(e<BigInt(1)<<BigInt(6))return new Uint8Array([Number(e<<BigInt(2))]);if(e<BigInt(1)<<BigInt(14)){const t=e<<BigInt(2)|BigInt(1);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255))])}if(e<BigInt(1)<<BigInt(30)){const t=e<<BigInt(2)|BigInt(2);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255)),Number(t>>BigInt(16)&BigInt(255)),Number(t>>BigInt(24)&BigInt(255))])}throw new Error("BigInt compact encoding not supported > 2^30")}(l),d=new Uint8Array([0,...e,s,...t,...a,...u,...f,...o]),h=function(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){const t=e<<2|1;return new Uint8Array([255&t,t>>8&255])}if(e<1<<30){const t=e<<2|2;return new Uint8Array([255&t,t>>8&255,t>>16&255,t>>24&255])}throw new Error("Compact encoding > 2^30 not supported")}(d.length+1);return new Uint8Array([...h,i,...d])}function Y_(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function J_(e){const t=Uint8Array.from(Buffer.from(e.signature,"hex")),r=function(e){const t=px.decode(e);if(t.length<33)throw new Error("Too short to contain a public key");return t.slice(1,33)}(e.transaction.address),n=Q_({publicKey:r,signature:t,payload:e.transaction});return function(e){const t=Y_(e),r=JE.blake2b(t,void 0,32);return"0x"+Buffer.from(r).toString("hex")}(Buffer.from(n).toString("hex"))}const $_="PARSE_ERROR",eP="INVALID_REQUEST",tP="METHOD_NOT_FOUND",rP="INVALID_PARAMS",nP="INTERNAL_ERROR",oP="SERVER_ERROR",iP=[-32700,-32600,-32601,-32602,-32603],sP={[$_]:{code:-32700,message:"Parse error"},[eP]:{code:-32600,message:"Invalid Request"},[tP]:{code:-32601,message:"Method not found"},[rP]:{code:-32602,message:"Invalid params"},[nP]:{code:-32603,message:"Internal error"},[oP]:{code:-32e3,message:"Server error"}},aP=oP;function cP(e){return Object.keys(sP).includes(e)?sP[e]:sP[aP]}var uP,lP={},fP={};var dP,hP,pP={};var yP=(hP||(hP=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Vf;t.__exportStar(function(){if(uP)return fP;function e(){return(null==z?void 0:z.crypto)||(null==z?void 0:z.msCrypto)||{}}function t(){const t=e();return t.subtle||t.webkitSubtle}return uP=1,Object.defineProperty(fP,"__esModule",{value:!0}),fP.isBrowserCryptoAvailable=fP.getSubtleCrypto=fP.getBrowerCrypto=void 0,fP.getBrowerCrypto=e,fP.getSubtleCrypto=t,fP.isBrowserCryptoAvailable=function(){return!!e()&&!!t()},fP}(),e),t.__exportStar(function(){if(dP)return pP;function e(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function t(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node}return dP=1,Object.defineProperty(pP,"__esModule",{value:!0}),pP.isBrowser=pP.isNode=pP.isReactNative=void 0,pP.isReactNative=e,pP.isNode=t,pP.isBrowser=function(){return!e()&&!t()},pP}(),e)}(lP)),lP);function gP(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function mP(e=6){return BigInt(gP(e))}function bP(e,t,r){return{id:r||gP(),jsonrpc:"2.0",method:e,params:t}}function vP(e,t){return{id:e,jsonrpc:"2.0",result:t}}function wP(e,t,r){return{id:e,jsonrpc:"2.0",error:xP(t,r)}}function xP(e,t){return void 0===e?cP(nP):("string"==typeof e&&(e=Object.assign(Object.assign({},cP(oP)),{message:e})),void 0!==t&&(e.data=t),function(e){return iP.includes(e)}(e.code)&&(e=function(e){const t=Object.values(sP).find(t=>t.code===e);return t||sP[aP]}(e.code)),e)}class SP{}class EP extends SP{constructor(){super()}}class AP extends EP{constructor(e){super()}}function kP(e,t){const r=function(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}function OP(e){return kP(e,"^wss?:")}function TP(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function CP(e){return TP(e)&&"method"in e}function IP(e){return TP(e)&&(_P(e)||PP(e))}function _P(e){return"result"in e}function PP(e){return"error"in e}class RP extends AP{constructor(e){super(e),this.events=new _s.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(bP(e.method,e.params||[],e.id||mP().toString()),t)}async requestStrict(e,t){return new Promise(async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,e=>{PP(e)?n(e.error):r(e.result)});try{await this.connection.send(e,t)}catch(e){n(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),IP(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",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(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}var NP,BP;const jP=e=>e.split("?")[0],MP=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:BP?NP:(BP=1,NP=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")});class LP{constructor(e){if(this.url=e,this.events=new _s.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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{typeof this.socket>"u"?t(new Error("Connection already closed")):(this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close())})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(zd(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!OP(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(new Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{const n=yP.isReactNative()?void 0:{rejectUnauthorized:(i=e,!new RegExp("wss?://localhost(:d{2,5})?").test(i))},o=new MP(e,[],n);var i;typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u"?o.onerror=e=>{const t=e;r(this.emitError(t.error))}:o.on("error",e=>{r(this.emitError(e))}),o.onopen=()=>{this.onOpen(o),t(o)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t="string"==typeof e.data?Fd(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),n=wP(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return function(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}(e,jP(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${jP(this.url)}`));return this.events.emit("register_error",t),t}}const UP="core",DP=`wc@2:${UP}:`,FP="error",zP={database:":memory:"},qP="client_ed25519_seed",VP=fd.ONE_DAY,HP=fd.SIX_HOURS,KP="wss://relay.walletconnect.org",WP="relayer_message",GP="relayer_message_ack",XP="relayer_connect",ZP="relayer_disconnect",QP="relayer_error",YP="relayer_connection_stalled",JP="relayer_publish",$P="payload",eR="connect",tR="disconnect",rR="error",nR="2.21.9",oR={link_mode:"link_mode",relay:"relay"},iR="inbound",sR="outbound",aR="WALLETCONNECT_LINK_MODE_APPS",cR="subscription_created",uR="subscription_deleted",lR="subscription_sync",fR="subscription_resubscribed",dR={wc_pairingDelete:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:fd.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:fd.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:fd.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:0},res:{ttl:fd.ONE_DAY,prompt:!1,tag:0}}},hR="pairing_create",pR="pairing_expire",yR="pairing_delete",gR="pairing_ping",mR="history_created",bR="history_updated",vR="history_deleted",wR="history_sync",xR="expirer_created",SR="expirer_deleted",ER="expirer_expired",AR="expirer_sync",kR="https://verify.walletconnect.org",OR=kR,TR=`${OR}/v3`,CR=["https://verify.walletconnect.com",kR],IR="pairing_started",_R="pairing_uri_validation_success",PR="pairing_uri_not_expired",RR="store_new_pairing",NR="subscribing_pairing_topic",BR="subscribe_pairing_topic_success",jR="existing_pairing",MR="pairing_not_expired",LR="emit_inactive_pairing",UR="emit_session_proposal",DR="no_internet_connection",FR="malformed_pairing_uri",zR="active_pairing_already_exists",qR="subscribe_pairing_topic_failure",VR="pairing_expired",HR="proposal_listener_not_found",KR="session_approve_started",WR="session_namespaces_validation_success",GR="subscribing_session_topic",XR="subscribe_session_topic_success",ZR="session_approve_publish_success",QR="store_session",YR="no_internet_connection",JR="proposal_expired",$R="subscribe_session_topic_failure",eN="session_approve_namespace_validation_failure",tN="proposal_not_found",rN="authenticated_session_approve_started",nN="create_authenticated_session_topic",oN="cacaos_verified",iN="store_authenticated_session",sN="subscribing_authenticated_session_topic",aN="subscribe_authenticated_session_topic_success",cN="publishing_authenticated_session_approve",uN="no_internet_connection",lN="invalid_cacao",fN="subscribe_authenticated_session_topic_failure",dN="authenticated_session_approve_publish_failure",hN="authenticated_session_pending_request_not_found";var pN=function(e,t){if(e.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 o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(255!==r[s])throw new TypeError(i+" is ambiguous");r[s]=o}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,o=0;e[t]===c;)n++,t++;for(var i=(e.length-t)*u+1>>>0,s=new Uint8Array(i);e[t];){var l=r[e.charCodeAt(t)];if(255===l)return;for(var f=0,d=i-1;(0!==l||f<o)&&-1!==d;d--,f++)l+=a*s[d]>>>0,s[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=f,t++}if(" "!==e[t]){for(var h=i-o;h!==i&&0===s[h];)h++;for(var p=new Uint8Array(n+(i-h)),y=n;h!==i;)p[y++]=s[h++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,i=t.length;o!==i&&0===t[o];)o++,r++;for(var s=(i-o)*l+1>>>0,u=new Uint8Array(s);o!==i;){for(var f=t[o],d=0,h=s-1;(0!==f||d<n)&&-1!==h;h--,d++)f+=256*u[h]>>>0,u[h]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");n=d,o++}for(var p=s-n;p!==s&&0===u[p];)p++;for(var y=c.repeat(r);p<s;++p)y+=e.charAt(u[p]);return y},decodeUnsafe:f,decode:function(e){var r=f(e);if(r)return r;throw new Error(`Non-${t} character`)}}},yN=pN;const gN=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class mN{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class bN{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return wN(this,e)}}class vN{constructor(e){this.decoders=e}or(e){return wN(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const wN=(e,t)=>new vN({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class xN{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new mN(e,t,r),this.decoder=new bN(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const SN=({name:e,prefix:t,encode:r,decode:n})=>new xN(e,t,r,n),EN=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=yN(r,t);return SN({prefix:e,name:t,encode:n,decode:e=>gN(o(e))})},AN=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>SN({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let i="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,i+=t[o&a>>s];if(s&&(i+=t[o&a<<r-s]),n)for(;i.length*r&7;)i+="=";return i})(e,n,r),decode:t=>((e,t,r,n)=>{const o={};for(let e=0;e<t.length;++e)o[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const s=new Uint8Array(i*r/8|0);let a=0,c=0,u=0;for(let t=0;t<i;++t){const i=o[e[t]];if(void 0===i)throw new SyntaxError(`Non-${n} character`);c=c<<r|i,a+=r,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),kN=SN({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var ON=Object.freeze({__proto__:null,identity:kN});const TN=AN({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var CN=Object.freeze({__proto__:null,base2:TN});const IN=AN({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var _N=Object.freeze({__proto__:null,base8:IN});const PN=EN({prefix:"9",name:"base10",alphabet:"0123456789"});var RN=Object.freeze({__proto__:null,base10:PN});const NN=AN({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),BN=AN({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var jN=Object.freeze({__proto__:null,base16:NN,base16upper:BN});const MN=AN({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),LN=AN({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),UN=AN({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),DN=AN({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),FN=AN({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),zN=AN({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),qN=AN({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),VN=AN({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),HN=AN({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var KN=Object.freeze({__proto__:null,base32:MN,base32upper:LN,base32pad:UN,base32padupper:DN,base32hex:FN,base32hexupper:zN,base32hexpad:qN,base32hexpadupper:VN,base32z:HN});const WN=EN({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),GN=EN({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var XN=Object.freeze({__proto__:null,base36:WN,base36upper:GN});const ZN=EN({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),QN=EN({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var YN=Object.freeze({__proto__:null,base58btc:ZN,base58flickr:QN});const JN=AN({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),$N=AN({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),eB=AN({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),tB=AN({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var rB=Object.freeze({__proto__:null,base64:JN,base64pad:$N,base64url:eB,base64urlpad:tB});const nB=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),oB=nB.reduce((e,t,r)=>(e[r]=t,e),[]),iB=nB.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);const sB=SN({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=oB[t],"")},decode:function(e){const t=[];for(const r of e){const e=iB[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var aB=Object.freeze({__proto__:null,base256emoji:sB}),cB=function e(t,r,n){r=r||[];for(var o=n=n||0;t>=fB;)r[n++]=255&t|uB,t/=128;for(;t&lB;)r[n++]=255&t|uB,t>>>=7;return r[n]=0|t,e.bytes=n-o+1,r},uB=128,lB=-128,fB=Math.pow(2,31);var dB=function e(t,r){var n,o=0,i=(r=r||0,0),s=r,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],o+=i<28?(n&pB)<<i:(n&pB)*Math.pow(2,i),i+=7}while(n>=hB);return e.bytes=s-r,o},hB=128,pB=127;var yB=Math.pow(2,7),gB=Math.pow(2,14),mB=Math.pow(2,21),bB=Math.pow(2,28),vB=Math.pow(2,35),wB=Math.pow(2,42),xB=Math.pow(2,49),SB=Math.pow(2,56),EB=Math.pow(2,63),AB={encode:cB,decode:dB,encodingLength:function(e){return e<yB?1:e<gB?2:e<mB?3:e<bB?4:e<vB?5:e<wB?6:e<xB?7:e<SB?8:e<EB?9:10}},kB=AB;const OB=(e,t,r=0)=>(kB.encode(e,t,r),t),TB=e=>kB.encodingLength(e),CB=(e,t)=>{const r=t.byteLength,n=TB(e),o=n+TB(r),i=new Uint8Array(o+r);return OB(e,i,0),OB(r,i,n),i.set(t,o),new IB(e,r,t,i)};class IB{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const _B=({name:e,code:t,encode:r})=>new PB(e,t,r);class PB{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?CB(this.code,t):t.then(e=>CB(this.code,e))}throw Error("Unknown type, must be binary type")}}const RB=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),NB=_B({name:"sha2-256",code:18,encode:RB("SHA-256")}),BB=_B({name:"sha2-512",code:19,encode:RB("SHA-512")});Object.freeze({__proto__:null,sha256:NB,sha512:BB});const jB=gN,MB={code:0,name:"identity",encode:jB,digest:e=>CB(0,jB(e))};Object.freeze({__proto__:null,identity:MB});new TextEncoder,new TextDecoder;const LB={...ON,...CN,..._N,...RN,...jN,...KN,...XN,...YN,...rB,...aB};function UB(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function DB(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const FB=DB("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>(new TextEncoder).encode(e.substring(1))),zB=DB("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{const t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?UB(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),qB={utf8:FB,"utf-8":FB,hex:LB.base16,latin1:zB,ascii:zB,binary:zB,...LB};var VB=Object.defineProperty,HB=(e,t,r)=>((e,t,r)=>t in e?VB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class KB{constructor(e,t){this.core=e,this.logger=t,HB(this,"keychain",new Map),HB(this,"name","keychain"),HB(this,"version","0.3"),HB(this,"initialized",!1),HB(this,"storagePrefix",DP),HB(this,"init",async()=>{if(!this.initialized){const e=await this.getKeyChain();typeof e<"u"&&(this.keychain=e),this.initialized=!0}}),HB(this,"has",e=>(this.isInitialized(),this.keychain.has(e))),HB(this,"set",async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()}),HB(this,"get",e=>{this.isInitialized();const t=this.keychain.get(e);if(typeof t>"u"){const{message:t}=O_("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}),HB(this,"del",async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()}),this.core=e,this.logger=xh(t,this.name)}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,kA(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?OA(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var WB=Object.defineProperty,GB=(e,t,r)=>((e,t,r)=>t in e?WB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class XB{constructor(e,t,r){this.core=e,this.logger=t,GB(this,"name","crypto"),GB(this,"keychain"),GB(this,"randomSessionIdentifier",MI()),GB(this,"initialized",!1),GB(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),GB(this,"hasKeys",e=>(this.isInitialized(),this.keychain.has(e))),GB(this,"getClientId",async()=>{this.isInitialized();return um(dm(await this.getClientSeed()).publicKey)}),GB(this,"generateKeyPair",()=>{this.isInitialized();const e=function(){const e=nI.utils.randomPrivateKey(),t=nI.getPublicKey(e);return{privateKey:zE(e,RI),publicKey:zE(t,RI)}}();return this.setPrivateKey(e.publicKey,e.privateKey)}),GB(this,"signJWT",async e=>{this.isInitialized();const t=dm(await this.getClientSeed()),r=this.randomSessionIdentifier,n=VP;return await hm(r,e,n,t)}),GB(this,"generateSharedKey",(e,t,r)=>{this.isInitialized();const n=function(e,t){const r=nI.getSharedSecret(FE(e,RI),FE(t,RI));return zE(zT(qT,r,void 0,void 0,32),RI)}(this.getPrivateKey(e),t);return this.setSymKey(n,r)}),GB(this,"setSymKey",async(e,t)=>{this.isInitialized();const r=t||LI(e);return await this.keychain.set(r,e),r}),GB(this,"deleteKeyPair",async e=>{this.isInitialized(),await this.keychain.del(e)}),GB(this,"deleteSymKey",async e=>{this.isInitialized(),await this.keychain.del(e)}),GB(this,"encode",async(e,t,r)=>{this.isInitialized();const n=KI(r),o=zd(t);if(GI(n))return function(e,t){const r=DI(2),n=Lk(12),o=VI({type:r,sealed:FE(e,jI),iv:n});return t===BI?zI(o):o}(o,r?.encoding);if(WI(n)){const t=n.senderPublicKey,r=n.receiverPublicKey;e=await this.generateSharedKey(t,r)}const i=this.getSymKey(e),{type:s,senderPublicKey:a}=n;return function(e){const t=DI(typeof e.type<"u"?e.type:0);if(1===FI(t)&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof e.senderPublicKey<"u"?FE(e.senderPublicKey,RI):void 0,n=typeof e.iv<"u"?FE(e.iv,RI):Lk(12),o=FE(e.symKey,RI),i=VI({type:t,sealed:MT(o,n).encrypt(FE(e.message,jI)),iv:n,senderPublicKey:r});return e.encoding===BI?zI(i):i}({type:s,symKey:i,message:o,senderPublicKey:a,encoding:r?.encoding})}),GB(this,"decode",async(e,t,r)=>{this.isInitialized();const n=function(e,t){const r=HI({encoded:e,encoding:t?.encoding});return KI({type:FI(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?zE(r.senderPublicKey,RI):void 0,receiverPublicKey:t?.receiverPublicKey})}(t,r);if(GI(n)){const e=function(e,t){const{sealed:r}=HI({encoded:e,encoding:t});return zE(r,jI)}(t,r?.encoding);return Fd(e)}if(WI(n)){const t=n.receiverPublicKey,r=n.senderPublicKey;e=await this.generateSharedKey(t,r)}try{const n=function(e){const t=FE(e.symKey,RI),{sealed:r,iv:n}=HI({encoded:e.encoded,encoding:e.encoding}),o=MT(t,n).decrypt(r);if(null===o)throw new Error("Failed to decrypt");return zE(o,jI)}({symKey:this.getSymKey(e),encoded:t,encoding:r?.encoding});return Fd(n)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}}),GB(this,"getPayloadType",(e,t=NI)=>FI(HI({encoded:e,encoding:t}).type)),GB(this,"getPayloadSenderPublicKey",(e,t=NI)=>{const r=HI({encoded:e,encoding:t});return r.senderPublicKey?zE(r.senderPublicKey,RI):void 0}),this.core=e,this.logger=xh(t,this.name),this.keychain=r||new KB(this.core,this.logger)}get context(){return wh(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(qP)}catch{e=MI(),await this.keychain.set(qP,e)}return function(e,t="utf8"){const r=qB[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):UB(globalThis.Buffer.from(e,"utf-8"))}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var ZB=Object.defineProperty,QB=Object.defineProperties,YB=Object.getOwnPropertyDescriptors,JB=Object.getOwnPropertySymbols,$B=Object.prototype.hasOwnProperty,ej=Object.prototype.propertyIsEnumerable,tj=(e,t,r)=>t in e?ZB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rj=(e,t,r)=>tj(e,"symbol"!=typeof t?t+"":t,r);class nj extends Ih{constructor(e,t){super(e,t),this.logger=e,this.core=t,rj(this,"messages",new Map),rj(this,"messagesWithoutClientAck",new Map),rj(this,"name","messages"),rj(this,"version","0.3"),rj(this,"initialized",!1),rj(this,"storagePrefix",DP),rj(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const e=await this.getRelayerMessages();typeof e<"u"&&(this.messages=e);const t=await this.getRelayerMessagesWithoutClientAck();typeof t<"u"&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}}),rj(this,"set",async(e,t,r)=>{this.isInitialized();const n=UI(t);let o=this.messages.get(e);if(typeof o>"u"&&(o={}),typeof o[n]<"u")return n;if(o[n]=t,this.messages.set(e,o),r===iR){const r=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,((e,t)=>QB(e,YB(t)))(((e,t)=>{for(var r in t||(t={}))$B.call(t,r)&&tj(e,r,t[r]);if(JB)for(var r of JB(t))ej.call(t,r)&&tj(e,r,t[r]);return e})({},r),{[n]:t}))}return await this.persist(),n}),rj(this,"get",e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t}),rj(this,"getWithoutAck",e=>{this.isInitialized();const t={};for(const r of e){const e=this.messagesWithoutClientAck.get(r)||{};t[r]=Object.values(e)}return t}),rj(this,"has",(e,t)=>{this.isInitialized();return typeof this.get(e)[UI(t)]<"u"}),rj(this,"ack",async(e,t)=>{this.isInitialized();const r=this.messagesWithoutClientAck.get(e);if(typeof r>"u")return;delete r[UI(t)],0===Object.keys(r).length?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,r),await this.persist()}),rj(this,"del",async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()}),this.logger=xh(e,this.name),this.core=t}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,kA(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,kA(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?OA(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?OA(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var oj=Object.defineProperty,ij=Object.defineProperties,sj=Object.getOwnPropertyDescriptors,aj=Object.getOwnPropertySymbols,cj=Object.prototype.hasOwnProperty,uj=Object.prototype.propertyIsEnumerable,lj=(e,t,r)=>t in e?oj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fj=(e,t)=>{for(var r in t||(t={}))cj.call(t,r)&&lj(e,r,t[r]);if(aj)for(var r of aj(t))uj.call(t,r)&&lj(e,r,t[r]);return e},dj=(e,t)=>ij(e,sj(t)),hj=(e,t,r)=>lj(e,"symbol"!=typeof t?t+"":t,r);class pj extends _h{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,hj(this,"events",new _s.EventEmitter),hj(this,"name","publisher"),hj(this,"queue",new Map),hj(this,"publishTimeout",fd.toMiliseconds(fd.ONE_MINUTE)),hj(this,"initialPublishTimeout",fd.toMiliseconds(15*fd.ONE_SECOND)),hj(this,"needsTransportRestart",!1),hj(this,"publish",async(e,t,r)=>{var n,o,i,s,a;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});const c=r?.ttl||HP,u=r?.prompt||!1,l=r?.tag||0,f=r?.id||mP().toString(),d=QI(ZI().protocol),h={id:f,method:r?.publishMethod||d.publish,params:fj({topic:e,message:t,ttl:c,prompt:u,tag:l,attestation:r?.attestation},r?.tvf)},p=`Failed to publish payload, please try again. id:${f} tag:${l}`;try{__(null==(n=h.params)?void 0:n.prompt)&&(null==(o=h.params)||delete o.prompt),__(null==(i=h.params)?void 0:i.tag)&&(null==(s=h.params)||delete s.tag);const a=new Promise(async e=>{const t=({id:r})=>{var n;(null==(n=h.id)?void 0:n.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(JP,t),e())};this.relayer.events.on(JP,t);const n=CA(new Promise((e,t)=>{this.rpcPublish(h,r).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${f} tag:${l}`);try{await n,this.events.removeListener(JP,t)}catch(e){this.queue.set(f,{request:h,opts:r,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,topic:e,message:t,opts:r}}),await CA(a,this.publishTimeout,p)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(a=r?.internal)&&a.throwOnFailedPublish)throw e}finally{this.queue.delete(f)}}),hj(this,"publishCustom",async e=>{var t,r,n,o,i;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:e});const{payload:s,opts:a={}}=e,{attestation:c,tvf:u,publishMethod:l,prompt:f,tag:d,ttl:h=fd.FIVE_MINUTES}=a,p=a.id||mP().toString(),y=QI(ZI().protocol),g=l||y.publish,m={id:p,method:g,params:fj(dj(fj({},s),{ttl:h,prompt:f,tag:d,attestation:c}),u)},b=`Failed to publish custom payload, please try again. id:${p} tag:${d}`;try{__(null==(t=m.params)?void 0:t.prompt)&&(null==(r=m.params)||delete r.prompt),__(null==(n=m.params)?void 0:n.tag)&&(null==(o=m.params)||delete o.tag);const e=new Promise(async e=>{const t=({id:r})=>{var n;(null==(n=m.id)?void 0:n.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(JP,t),e())};this.relayer.events.on(JP,t);const r=CA(new Promise((e,t)=>{this.rpcPublish(m,a).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${g} id:${p} tag:${d}`);try{await r,this.events.removeListener(JP,t)}catch(e){this.queue.set(p,{request:m,opts:a,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:p,payload:s,opts:a}}),await CA(e,this.publishTimeout,b)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(i=a?.internal)&&i.throwOnFailedPublish)throw e}finally{this.queue.delete(p)}}),hj(this,"on",(e,t)=>{this.events.on(e,t)}),hj(this,"once",(e,t)=>{this.events.once(e,t)}),hj(this,"off",(e,t)=>{this.events.off(e,t)}),hj(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.relayer=e,this.logger=xh(t,this.name),this.registerEventListeners()}get context(){return wh(this.logger)}async rpcPublish(e,t){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:e});const r=await this.relayer.request(e);return this.relayer.events.emit(JP,fj(fj({},e),t)),this.logger.debug("Successfully Published Payload"),r}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{var r;const n=e.attempt+1;this.queue.set(t,dj(fj({},e),{attempt:n})),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${null==(r=e.request.params)?void 0:r.tag}, attempt: ${n}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(yd,()=>{if(this.needsTransportRestart)return this.needsTransportRestart=!1,void this.relayer.events.emit(YP);this.checkQueue()}),this.relayer.on(GP,e=>{this.removeRequestFromQueue(e.id.toString())})}}var yj=Object.defineProperty,gj=(e,t,r)=>((e,t,r)=>t in e?yj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class mj{constructor(){gj(this,"map",new Map),gj(this,"set",(e,t)=>{const r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])}),gj(this,"get",e=>this.map.get(e)||[]),gj(this,"exists",(e,t)=>this.get(e).includes(t)),gj(this,"delete",(e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;const r=this.get(e);if(!this.exists(e,t))return;const n=r.filter(e=>e!==t);n.length?this.map.set(e,n):this.map.delete(e)}),gj(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}}var bj=Object.defineProperty,vj=Object.defineProperties,wj=Object.getOwnPropertyDescriptors,xj=Object.getOwnPropertySymbols,Sj=Object.prototype.hasOwnProperty,Ej=Object.prototype.propertyIsEnumerable,Aj=(e,t,r)=>t in e?bj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kj=(e,t)=>{for(var r in t||(t={}))Sj.call(t,r)&&Aj(e,r,t[r]);if(xj)for(var r of xj(t))Ej.call(t,r)&&Aj(e,r,t[r]);return e},Oj=(e,t)=>vj(e,wj(t)),Tj=(e,t,r)=>Aj(e,"symbol"!=typeof t?t+"":t,r);class Cj extends Nh{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,Tj(this,"subscriptions",new Map),Tj(this,"topicMap",new mj),Tj(this,"events",new _s.EventEmitter),Tj(this,"name","subscription"),Tj(this,"version","0.3"),Tj(this,"pending",new Map),Tj(this,"cached",[]),Tj(this,"initialized",!1),Tj(this,"storagePrefix",DP),Tj(this,"subscribeTimeout",fd.toMiliseconds(fd.ONE_MINUTE)),Tj(this,"initialSubscribeTimeout",fd.toMiliseconds(15*fd.ONE_SECOND)),Tj(this,"clientId"),Tj(this,"batchSubscribeTopicsLimit",500),Tj(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),Tj(this,"subscribe",async(e,t)=>{var r;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{const n=ZI(t),o={topic:e,relay:n,transportType:t?.transportType};null!=(r=t?.internal)&&r.skipSubscribe||this.pending.set(e,o);const i=await this.rpcSubscribe(e,n,t);return"string"==typeof i&&(this.onSubscribe(i,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),i}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}}),Tj(this,"unsubscribe",async(e,t)=>{this.isInitialized(),typeof t?.id<"u"?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)}),Tj(this,"isSubscribed",e=>new Promise(t=>{t(this.topicMap.topics.includes(e))})),Tj(this,"isKnownTopic",e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))})),Tj(this,"on",(e,t)=>{this.events.on(e,t)}),Tj(this,"once",(e,t)=>{this.events.once(e,t)}),Tj(this,"off",(e,t)=>{this.events.off(e,t)}),Tj(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),Tj(this,"start",async()=>{await this.onConnect()}),Tj(this,"stop",async()=>{await this.onDisconnect()}),Tj(this,"restart",async()=>{await this.restore(),await this.onRestart()}),Tj(this,"checkPending",async()=>{if(!(0!==this.pending.size||this.initialized&&this.relayer.connected))return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}),Tj(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(yd,async()=>{await this.checkPending()}),this.events.on(cR,async e=>{const t=cR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(uR,async e=>{const t=uR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}),this.relayer=e,this.logger=xh(t,this.name),this.clientId=""}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const r=this.topicMap.get(e);await Promise.all(r.map(async r=>await this.unsubscribeById(e,r,t)))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{const n=ZI(r);await this.restartToComplete({topic:e,id:t,relay:n}),await this.rpcUnsubscribe(e,t,n);const o=T_("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,r){var n,o;const i=await this.getSubscriptionId(e);if(null!=(n=r?.internal)&&n.skipSubscribe)return i;(!r||r?.transportType===oR.relay)&&await this.restartToComplete({topic:e,id:e,relay:t});const s={method:QI(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const a=null==(o=r?.internal)?void 0:o.throwOnFailedPublish;try{if(r?.transportType===oR.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(e=>this.logger.warn(e))},fd.toMiliseconds(fd.ONE_SECOND)),i;const t=new Promise(async t=>{const r=n=>{n.topic===e&&(this.events.removeListener(cR,r),t(n.id))};this.events.on(cR,r);try{const n=await CA(new Promise((e,t)=>{this.relayer.request(s).catch(e=>{this.logger.warn(e,e?.message),t(e)}).then(e)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(cR,r),t(n)}catch{}}),n=await CA(t,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!n&&a)throw new Error(`Subscribing to ${e} failed, please try again`);return n?i:null}catch(e){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(YP),a)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t={method:QI(e[0].relay.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{await await CA(new Promise(e=>{this.relayer.request(t).catch(e=>this.logger.warn(e)).then(e)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(YP)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t={method:QI(e[0].relay.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};let r;this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{r=await await CA(new Promise((e,r)=>{this.relayer.request(t).catch(e=>{this.logger.warn(e),r(e)}).then(e)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(YP)}return r}rpcUnsubscribe(e,t,r){const n={method:QI(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,Oj(kj({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,kj({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,kj({},t)),this.topicMap.set(t.topic,e),this.events.emit(cR,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:t}=O_("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(uR,Oj(kj({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(lR)}async onRestart(){if(this.cached.length){const e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<t;r++){const t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(fR)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size&&!e.every(e=>{var t;return e.topic===(null==(t=this.subscriptions.get(e.id))?void 0:t.topic)})){const{message:e}=O_("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async e=>Oj(kj({},e),{id:await this.getSubscriptionId(e.topic)})))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(await function(e){return new Promise(t=>setTimeout(t,e))}(fd.toMiliseconds(fd.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(t.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return UI(e+await this.getClientId())}}var Ij=Object.defineProperty,_j=Object.getOwnPropertySymbols,Pj=Object.prototype.hasOwnProperty,Rj=Object.prototype.propertyIsEnumerable,Nj=(e,t,r)=>t in e?Ij(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bj=(e,t)=>{for(var r in t||(t={}))Pj.call(t,r)&&Nj(e,r,t[r]);if(_j)for(var r of _j(t))Rj.call(t,r)&&Nj(e,r,t[r]);return e},jj=(e,t,r)=>Nj(e,"symbol"!=typeof t?t+"":t,r);class Mj extends Ph{constructor(e){super(e),jj(this,"protocol","wc"),jj(this,"version",2),jj(this,"core"),jj(this,"logger"),jj(this,"events",new _s.EventEmitter),jj(this,"provider"),jj(this,"messages"),jj(this,"subscriber"),jj(this,"publisher"),jj(this,"name","relayer"),jj(this,"transportExplicitlyClosed",!1),jj(this,"initialized",!1),jj(this,"connectionAttemptInProgress",!1),jj(this,"relayUrl"),jj(this,"projectId"),jj(this,"packageName"),jj(this,"bundleId"),jj(this,"hasExperiencedNetworkDisruption",!1),jj(this,"pingTimeout"),jj(this,"heartBeatTimeout",fd.toMiliseconds(fd.THIRTY_SECONDS+fd.FIVE_SECONDS)),jj(this,"reconnectTimeout"),jj(this,"connectPromise"),jj(this,"reconnectInProgress",!1),jj(this,"requestsInFlight",[]),jj(this,"connectTimeout",fd.toMiliseconds(15*fd.ONE_SECOND)),jj(this,"request",async e=>{var t,r;this.logger.debug("Publishing Request Payload");const n=e.id||mP().toString();await this.toEstablishConnection();try{this.logger.trace({id:n,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - publishing...");const o=`${n}:${(null==(r=e.params)?void 0:r.tag)||""}`;this.requestsInFlight.push(o);const i=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==o),i}catch(e){throw this.logger.debug(`Failed to Publish Request: ${n}`),e}}),jj(this,"resetPingTimeout",()=>{yA()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,r,n;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),null==(n=null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.terminate)||n.call(r)}catch(e){this.logger.warn(e,e?.message)}},this.heartBeatTimeout))}),jj(this,"onPayloadHandler",e=>{this.onProviderPayload(e),this.resetPingTimeout()}),jj(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected 🛜"),this.startPingTimeout(),this.events.emit(XP)}),jj(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected 🛑"),this.requestsInFlight=[],this.onProviderDisconnect()}),jj(this,"onProviderErrorHandler",e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit(QP,e),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),jj(this,"registerProviderListeners",()=>{this.provider.on($P,this.onPayloadHandler),this.provider.on(eR,this.onConnectHandler),this.provider.on(tR,this.onDisconnectHandler),this.provider.on(rR,this.onProviderErrorHandler)}),this.core=e.core,this.logger=typeof e.logger<"u"&&"string"!=typeof e.logger?xh(e.logger,this.name):th(vh({level:e.logger||"error"})),this.messages=new nj(this.logger,e.core),this.subscriber=new Cj(this,this.logger),this.publisher=new pj(this,this.logger),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||KP,gA()&&typeof global<"u"&&typeof(null==global?void 0:global.Platform)<"u"&&"android"===(null==global?void 0:global.Platform.OS)?this.packageName=vA():gA()&&typeof global<"u"&&typeof(null==global?void 0:global.Platform)<"u"&&"ios"===(null==global?void 0:global.Platform.OS)&&(this.bundleId=vA()),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e?.message))}get context(){return wh(this.logger)}get connected(){var e,t,r;return 1===(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)||!1}get connecting(){var e,t,r;return 0===(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)||void 0!==this.connectPromise||!1}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:oR.relay},sR)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){var r,n,o;this.isInitialized(),(null==t||!t.transportType||"relay"===t?.transportType)&&await this.toEstablishConnection();const i=typeof(null==(r=t?.internal)?void 0:r.throwOnFailedPublish)>"u"||(null==(n=t?.internal)?void 0:n.throwOnFailedPublish);let s,a=(null==(o=this.subscriber.topicMap.get(e))?void 0:o[0])||"";const c=t=>{t.topic===e&&(this.subscriber.off(cR,c),s())};return await Promise.all([new Promise(e=>{s=e,this.subscriber.on(cR,c)}),new Promise(async(r,n)=>{a=await this.subscriber.subscribe(e,Bj({internal:{throwOnFailedPublish:i}},t)).catch(e=>{i&&n(e)})||a,r()})]),a}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await CA(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(this.subscriber.hasAnyTopics){if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(t,r)=>{await this.connect(e).then(t).catch(r).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}else this.logger.info("Starting WS connection skipped because the client has no topics to work with.")}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await W_())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(0===e?.length)return void this.logger.trace("Batch message events is empty. Ignoring...");const t=e.sort((e,t)=>e.publishedAt-t.publishedAt);this.logger.debug(`Batch of ${t.length} message events sorted`);for(const e of t)try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,"Error while processing batch message event: "+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){const{topic:r}=e;if(!t.sessionExists){const e={topic:r,expiry:PA(fd.FIVE_MINUTES),relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,e)}this.events.emit(WP,e),await this.recordMessageEvent(e,iR)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let t=1;for(;t<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise(async(e,t)=>{const r=()=>{t(new Error("Connection interrupted while trying to connect"))};this.provider.once(tR,r),await CA(new Promise((e,t)=>{this.provider.connect().then(e).catch(t)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(e=>{t(e)}).finally(()=>{this.provider.off(tR,r),clearTimeout(this.reconnectTimeout)}),await new Promise(async(e,r)=>{const n=()=>{t(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(tR,n),await this.subscriber.start().then(e).catch(r).finally(()=>{this.provider.off(tR,n)})}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(e){await this.subscriber.stop();const t=e;this.logger.warn({},t.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(e=>setTimeout(e,fd.toMiliseconds(1*t))),t++}}startPingTimeout(){var e,t,r,n,o;if(yA())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(o=null==(n=null==(r=this.provider)?void 0:r.connection)?void 0:n.socket)||o.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new RP(new LP(EA({sdkVersion:nR,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){const{topic:r,message:n}=e;await this.messages.set(r,n,t)}async shouldIgnoreMessageEvent(e){const{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;const n=this.messages.has(t,r);return n&&this.logger.warn(`Ignoring duplicate message: ${r}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),CP(e)){if(!e.method.endsWith("_subscription"))return;const t=e.params,{topic:r,message:n,publishedAt:o,attestation:i}=t.data,s={topic:r,message:n,publishedAt:o,transportType:oR.relay,attestation:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(Bj({type:"event",event:t.id},s)),this.events.emit(t.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}else IP(e)&&this.events.emit(GP,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,iR),this.events.emit(WP,e))}async acknowledgePayload(e){const t=vP(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off($P,this.onPayloadHandler),this.provider.off(eR,this.onConnectHandler),this.provider.off(tR,this.onDisconnectHandler),this.provider.off(rR,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await W_();G_(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,e?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(yd,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&function(){var e;return!mA()||!Im.getDocument()||"visible"===(null==(e=Im.getDocument())?void 0:e.visibilityState)}())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(ZP),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},fd.toMiliseconds(.1)))))}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise)return void await this.connectPromise;await this.connect()}}}function Lj(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Uj(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Dj="[object Arguments]",Fj="[object Object]";function zj(){}function qj(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function Vj(e,t,r,n,o,i,s){const a=s(e,t,r,n,o,i);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Hj(e,t,i,s)}return Hj(e,t,i,s)}function Hj(e,t,r,n){if(Object.is(e,t))return!0;let o=Uj(e),i=Uj(t);if(o===Dj&&(o=Fj),i===Dj&&(i=Fj),o!==i)return!1;switch(o){case"[object String]":return e.toString()===t.toString();case"[object Number]":return function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}(e.valueOf(),t.valueOf());case"[object Boolean]":case"[object Date]":case"[object Symbol]":return Object.is(e.valueOf(),t.valueOf());case"[object RegExp]":return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}const s=(r=r??new Map).get(e),a=r.get(t);if(null!=s&&null!=a)return s===t;r.set(e,t),r.set(t,e);try{switch(o){case"[object Map]":if(e.size!==t.size)return!1;for(const[o,i]of e.entries())if(!t.has(o)||!Vj(i,t.get(o),o,e,t,r,n))return!1;return!0;case"[object Set]":{if(e.size!==t.size)return!1;const o=Array.from(e.values()),i=Array.from(t.values());for(let s=0;s<o.length;s++){const a=o[s],c=i.findIndex(o=>Vj(a,o,void 0,e,t,r,n));if(-1===c)return!1;i.splice(c,1)}return!0}case"[object Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":case"[object BigUint64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object BigInt64Array]":case"[object Float32Array]":case"[object Float64Array]":if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!Vj(e[o],t[o],o,e,t,r,n))return!1;return!0;case"[object ArrayBuffer]":return e.byteLength===t.byteLength&&Hj(new Uint8Array(e),new Uint8Array(t),r,n);case"[object DataView]":return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&Hj(new Uint8Array(e),new Uint8Array(t),r,n);case"[object Error]":return e.name===t.name&&e.message===t.message;case Fj:{if(!(Hj(e.constructor,t.constructor,r,n)||qj(e)&&qj(t)))return!1;const o=[...Object.keys(e),...Lj(e)],i=[...Object.keys(t),...Lj(t)];if(o.length!==i.length)return!1;for(let i=0;i<o.length;i++){const s=o[i],a=e[s];if(!Object.hasOwn(t,s))return!1;if(!Vj(a,t[s],s,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function Kj(e,t){return function(e,t,r){return Vj(e,t,void 0,void 0,void 0,void 0,r)}(e,t,zj)}var Wj=Object.defineProperty,Gj=Object.getOwnPropertySymbols,Xj=Object.prototype.hasOwnProperty,Zj=Object.prototype.propertyIsEnumerable,Qj=(e,t,r)=>t in e?Wj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yj=(e,t)=>{for(var r in t||(t={}))Xj.call(t,r)&&Qj(e,r,t[r]);if(Gj)for(var r of Gj(t))Zj.call(t,r)&&Qj(e,r,t[r]);return e},Jj=(e,t,r)=>Qj(e,"symbol"!=typeof t?t+"":t,r);class $j extends Rh{constructor(e,t,r,n=DP,o=void 0){super(e,t,r,n),this.core=e,this.logger=t,this.name=r,Jj(this,"map",new Map),Jj(this,"version","0.3"),Jj(this,"cached",[]),Jj(this,"initialized",!1),Jj(this,"getKey"),Jj(this,"storagePrefix",DP),Jj(this,"recentlyDeleted",[]),Jj(this,"recentlyDeletedLimit",200),Jj(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{this.getKey&&null!==e&&!__(e)?this.map.set(this.getKey(e),e):function(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}(e)?this.map.set(e.id,e):function(e){return e?.topic}(e)&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)}),Jj(this,"set",async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())}),Jj(this,"get",e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e))),Jj(this,"getAll",e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(r=>Kj(t[r],e[r]))):this.values)),Jj(this,"update",async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});const r=Yj(Yj({},this.getData(e)),t);this.map.set(e,r),await this.persist()}),Jj(this,"delete",async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())}),this.logger=xh(t,this.name),this.storagePrefix=n,this.getKey=o}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:t}=O_("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}const{message:t}=O_("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:e}=O_("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var eM=Object.defineProperty,tM=(e,t,r)=>((e,t,r)=>t in e?eM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class rM{constructor(e,t){this.core=e,this.logger=t,tM(this,"name","pairing"),tM(this,"version","0.3"),tM(this,"events",new Ps),tM(this,"pairings"),tM(this,"initialized",!1),tM(this,"storagePrefix",DP),tM(this,"ignoredPayloadTypes",[1]),tM(this,"registeredMethods",[]),tM(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),tM(this,"register",({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]}),tM(this,"create",async e=>{this.isInitialized();const t=MI(),r=await this.core.crypto.setSymKey(t),n=PA(fd.FIVE_MINUTES),o={protocol:"irn"},i={topic:r,expiry:n,relay:o,active:!1,methods:e?.methods},s=c_({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:o,expiryTimestamp:n,methods:e?.methods});return this.events.emit(hR,i),this.core.expirer.set(r,n),await this.pairings.set(r,i),await this.core.relayer.subscribe(r,{transportType:e?.transportType,internal:e?.internal}),{topic:r,uri:s}}),tM(this,"pair",async e=>{this.isInitialized();const t=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[IR]}});this.isValidPair(e,t);const{topic:r,symKey:n,relay:o,expiryTimestamp:i,methods:s}=s_(e.uri);let a;if(t.props.properties.topic=r,t.addTrace(_R),t.addTrace(PR),this.pairings.keys.includes(r)){if(a=this.pairings.get(r),t.addTrace(jR),a.active)throw t.setError(zR),new Error(`Pairing already exists: ${r}. Please try again with a new connection URI.`);t.addTrace(MR)}const c=i||PA(fd.FIVE_MINUTES),u={topic:r,relay:o,expiry:c,active:!1,methods:s};this.core.expirer.set(r,c),await this.pairings.set(r,u),t.addTrace(RR),e.activatePairing&&await this.activate({topic:r}),this.events.emit(hR,u),t.addTrace(LR),this.core.crypto.keychain.has(r)||await this.core.crypto.setSymKey(n,r),t.addTrace(NR);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{t.setError(DR)}try{await this.core.relayer.subscribe(r,{relay:o})}catch(e){throw t.setError(qR),e}return t.addTrace(BR),u}),tM(this,"activate",async({topic:e})=>{this.isInitialized();const t=PA(fd.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})}),tM(this,"ping",async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:t}=e;if(this.pairings.keys.includes(t)){const e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:n,reject:o}=TA();this.events.once(NA("pairing_ping",e),({error:e})=>{e?o(e):n()}),await r()}}),tM(this,"updateExpiry",async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})}),tM(this,"updateMetadata",async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})}),tM(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),tM(this,"disconnect",async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",T_("USER_DISCONNECTED")),await this.deletePairing(t))}),tM(this,"formatUriFromPairing",e=>{this.isInitialized();const{topic:t,relay:r,expiry:n,methods:o}=e,i=this.core.crypto.keychain.get(t);return c_({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:i,relay:r,expiryTimestamp:n,methods:o})}),tM(this,"sendRequest",async(e,t,r)=>{const n=bP(t,r),o=await this.core.crypto.encode(e,n),i=dR[t].req;return this.core.history.set(e,n),this.core.relayer.publish(e,o,i),n.id}),tM(this,"sendResult",async(e,t,r)=>{const n=vP(e,r),o=await this.core.crypto.encode(t,n),i=(await this.core.history.get(t,e)).request.method,s=dR[i].res;await this.core.relayer.publish(t,o,s),await this.core.history.resolve(n)}),tM(this,"sendError",async(e,t,r)=>{const n=wP(e,r),o=await this.core.crypto.encode(t,n),i=(await this.core.history.get(t,e)).request.method,s=dR[i]?dR[i].res:dR.unregistered_method.res;await this.core.relayer.publish(t,o,s),await this.core.history.resolve(n)}),tM(this,"deletePairing",async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,T_("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])}),tM(this,"cleanup",async()=>{const e=this.pairings.getAll().filter(e=>RA(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))}),tM(this,"onRelayEventRequest",async e=>{const{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return await this.onPairingPingRequest(t,r);case"wc_pairingDelete":return await this.onPairingDeleteRequest(t,r);default:return await this.onUnknownRpcMethodRequest(t,r)}}),tM(this,"onRelayEventResponse",async e=>{const{topic:t,payload:r}=e,n=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===n?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(n)}),tM(this,"onPairingPingRequest",async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit(gR,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),tM(this,"onPairingPingResponse",(e,t)=>{const{id:r}=t;setTimeout(()=>{_P(t)?this.events.emit(NA("pairing_ping",r),{}):PP(t)&&this.events.emit(NA("pairing_ping",r),{error:t.error})},500)}),tM(this,"onPairingDeleteRequest",async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(yR,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),tM(this,"onUnknownRpcMethodRequest",async(e,t)=>{const{id:r,method:n}=t;try{if(this.registeredMethods.includes(n))return;const t=T_("WC_METHOD_UNSUPPORTED",n);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),tM(this,"onUnknownRpcMethodResponse",e=>{this.registeredMethods.includes(e)||this.logger.error(T_("WC_METHOD_UNSUPPORTED",e))}),tM(this,"isValidPair",(e,t)=>{var r;if(!F_(e)){const{message:r}=O_("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(FR),new Error(r)}if(!function(e){function t(e){try{return typeof new URL(e)<"u"}catch{return!1}}try{if(P_(e,!1))return!!t(e)||t(DA(e))}catch{}return!1}(e.uri)){const{message:r}=O_("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(FR),new Error(r)}const n=s_(e?.uri);if(null==(r=n?.relay)||!r.protocol){const{message:e}=O_("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(FR),new Error(e)}if(null==n||!n.symKey){const{message:e}=O_("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(FR),new Error(e)}if(null!=n&&n.expiryTimestamp&&fd.toMiliseconds(n?.expiryTimestamp)<Date.now()){t.setError(VR);const{message:e}=O_("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(e)}}),tM(this,"isValidPing",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)}),tM(this,"isValidDisconnect",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)}),tM(this,"isValidPairingTopic",async e=>{if(!P_(e,!1)){const{message:t}=O_("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.pairings.keys.includes(e)){const{message:t}=O_("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(RA(this.pairings.get(e).expiry)){await this.deletePairing(e);const{message:t}=O_("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}),this.core=e,this.logger=xh(t,this.name),this.pairings=new $j(this.core,this.logger,this.name,this.storagePrefix)}get context(){return wh(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(WP,async e=>{const{topic:t,message:r,transportType:n}=e;if(this.pairings.keys.includes(t)&&n!==oR.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{const e=await this.core.crypto.decode(t,r);CP(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):IP(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,r)}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(ER,async e=>{const{topic:t}=_A(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(pR,{topic:t}))})}}var nM=Object.defineProperty,oM=(e,t,r)=>((e,t,r)=>t in e?nM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class iM extends Ch{constructor(e,t){super(e,t),this.core=e,this.logger=t,oM(this,"records",new Map),oM(this,"events",new _s.EventEmitter),oM(this,"name","history"),oM(this,"version","0.3"),oM(this,"cached",[]),oM(this,"initialized",!1),oM(this,"storagePrefix",DP),oM(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),oM(this,"set",(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;const n={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:PA(fd.THIRTY_DAYS)};this.records.set(n.id,n),this.persist(),this.events.emit(mR,n)}),oM(this,"resolve",async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;const t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=PP(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(bR,t))}),oM(this,"get",async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t))),oM(this,"delete",(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach(r=>{if(r.topic===e){if(typeof t<"u"&&r.id!==t)return;this.records.delete(r.id),this.events.emit(vR,r)}}),this.persist()}),oM(this,"exists",async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e)),oM(this,"on",(e,t)=>{this.events.on(e,t)}),oM(this,"once",(e,t)=>{this.events.once(e,t)}),oM(this,"off",(e,t)=>{this.events.off(e,t)}),oM(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=xh(t,this.name)}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const r={topic:t.topic,request:bP(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:t}=O_("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(wR)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:e}=O_("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(mR,e=>{const t=mR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(bR,e=>{const t=bR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(vR,e=>{const t=vR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(yd,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{fd.toMiliseconds(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(vR,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var sM=Object.defineProperty,aM=(e,t,r)=>((e,t,r)=>t in e?sM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class cM extends Bh{constructor(e,t){super(e,t),this.core=e,this.logger=t,aM(this,"expirations",new Map),aM(this,"events",new _s.EventEmitter),aM(this,"name","expirer"),aM(this,"version","0.3"),aM(this,"cached",[]),aM(this,"initialized",!1),aM(this,"storagePrefix",DP),aM(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),aM(this,"has",e=>{try{const t=this.formatTarget(e);return typeof this.getExpiration(t)<"u"}catch{return!1}}),aM(this,"set",(e,t)=>{this.isInitialized();const r=this.formatTarget(e),n={target:r,expiry:t};this.expirations.set(r,n),this.checkExpiry(r,n),this.events.emit(xR,{target:r,expiration:n})}),aM(this,"get",e=>{this.isInitialized();const t=this.formatTarget(e);return this.getExpiration(t)}),aM(this,"del",e=>{if(this.isInitialized(),this.has(e)){const t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(SR,{target:t,expiration:r})}}),aM(this,"on",(e,t)=>{this.events.on(e,t)}),aM(this,"once",(e,t)=>{this.events.once(e,t)}),aM(this,"off",(e,t)=>{this.events.off(e,t)}),aM(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=xh(t,this.name)}get context(){return wh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return function(e){return IA("topic",e)}(e);if("number"==typeof e)return function(e){return IA("id",e)}(e);const{message:t}=O_("UNKNOWN_TYPE","Target type: "+typeof e);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(AR)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:e}=O_("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:t}=O_("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),new Error(t)}return t}checkExpiry(e,t){const{expiry:r}=t;fd.toMiliseconds(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(ER,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(yd,()=>this.checkExpirations()),this.events.on(xR,e=>{const t=xR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(ER,e=>{const t=ER;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(SR,e=>{const t=SR;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}}var uM=Object.defineProperty,lM=(e,t,r)=>((e,t,r)=>t in e?uM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class fM extends jh{constructor(e,t,r){super(e,t,r),this.core=e,this.logger=t,this.store=r,lM(this,"name","verify-api"),lM(this,"abortController"),lM(this,"isDevEnv"),lM(this,"verifyUrlV3",TR),lM(this,"storagePrefix",DP),lM(this,"version",2),lM(this,"publicKey"),lM(this,"fetchPromise"),lM(this,"init",async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&fd.toMiliseconds(null==(e=this.publicKey)?void 0:e.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),lM(this,"register",async e=>{if(!mA()||this.isDevEnv)return;const t=window.location.origin,{id:r,decryptedId:n}=e,o=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${r}&decryptedId=${n}`;try{const e=Im.getDocument(),t=this.startAbortTimer(5*fd.ONE_SECOND),n=await new Promise((n,i)=>{const s=()=>{window.removeEventListener("message",c),e.body.removeChild(a),i("attestation aborted")};this.abortController.signal.addEventListener("abort",s);const a=e.createElement("iframe");a.src=o,a.style.display="none",a.addEventListener("error",s,{signal:this.abortController.signal});const c=o=>{if(o.data&&"string"==typeof o.data)try{const i=JSON.parse(o.data);if("verify_attestation"===i.type){if(fm(i.attestation).payload.id!==r)return;clearInterval(t),e.body.removeChild(a),this.abortController.signal.removeEventListener("abort",s),window.removeEventListener("message",c),n(null===i.attestation?"":i.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(a),window.addEventListener("message",c,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",n),n}catch(e){this.logger.warn(e)}return""}),lM(this,"resolve",async e=>{if(this.isDevEnv)return"";const{attestationId:t,hash:r,encryptedId:n}=e;if(""===t)return void this.logger.debug("resolve: attestationId is empty, skipping");if(t){if(fm(t).payload.id!==n)return;const e=await this.isValidJwtAttestation(t);if(e)return e.isVerified?e:void this.logger.warn("resolve: jwt attestation: origin url not verified")}if(!r)return;const o=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(r,o)}),lM(this,"fetchAttestation",async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);const r=this.startAbortTimer(5*fd.ONE_SECOND),n=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(r),200===n.status?await n.json():void 0}),lM(this,"getVerifyUrl",e=>{let t=e||OR;return CR.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${OR}`),t=OR),t}),lM(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const e=this.startAbortTimer(fd.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}}),lM(this,"persistPublicKey",async e=>{this.logger.debug("persisting public key to local storage",e),await this.store.setItem(this.storeKey,e),this.publicKey=e}),lM(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),lM(this,"isValidJwtAttestation",async e=>{const t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}const r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(e,r)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}}),lM(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),lM(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{const t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});const e=await this.fetchPromise;return this.fetchPromise=void 0,e}),lM(this,"validateAttestation",(e,t)=>{const r=XI(e,t.publicKey),n={hasExpired:fd.toMiliseconds(r.exp)<Date.now(),payload:r};if(n.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:n.payload.origin,isScam:n.payload.isScam,isVerified:n.payload.isVerified}}),this.logger=xh(t,this.name),this.abortController=new AbortController,this.isDevEnv=UA(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return wh(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),fd.toMiliseconds(e))}}var dM=Object.defineProperty,hM=(e,t,r)=>((e,t,r)=>t in e?dM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class pM extends Mh{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,hM(this,"context","echo"),hM(this,"registerDeviceToken",async e=>{const{clientId:t,token:r,notificationType:n,enableEncrypted:o=!1}=e,i=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:n,token:r,always_raw:o})})}),this.logger=xh(t,this.context)}}var yM=Object.defineProperty,gM=Object.getOwnPropertySymbols,mM=Object.prototype.hasOwnProperty,bM=Object.prototype.propertyIsEnumerable,vM=(e,t,r)=>t in e?yM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wM=(e,t)=>{for(var r in t||(t={}))mM.call(t,r)&&vM(e,r,t[r]);if(gM)for(var r of gM(t))bM.call(t,r)&&vM(e,r,t[r]);return e},xM=(e,t,r)=>vM(e,"symbol"!=typeof t?t+"":t,r);class SM extends Lh{constructor(e,t,r=!0){super(e,t,r),this.core=e,this.logger=t,xM(this,"context","event-client"),xM(this,"storagePrefix",DP),xM(this,"storageVersion",.1),xM(this,"events",new Map),xM(this,"shouldPersist",!1),xM(this,"init",async()=>{if(!UA())try{const e={eventId:LA(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:SA(this.core.relayer.protocol,this.core.relayer.version,nR)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}}),xM(this,"createEvent",e=>{const{event:t="ERROR",type:r="",properties:{topic:n,trace:o}}=e,i=LA(),s=this.core.projectId||"",a=Date.now(),c=wM({eventId:i,timestamp:a,props:{event:t,type:r,properties:{topic:n,trace:o}},bundleId:s,domain:this.getAppDomain()},this.setMethods(i));return this.telemetryEnabled&&(this.events.set(i,c),this.shouldPersist=!0),c}),xM(this,"getEvent",e=>{const{eventId:t,topic:r}=e;if(t)return this.events.get(t);const n=Array.from(this.events.values()).find(e=>e.props.properties.topic===r);return n?wM(wM({},n),this.setMethods(n.eventId)):void 0}),xM(this,"deleteEvent",e=>{const{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0}),xM(this,"setEventListeners",()=>{this.core.heartbeat.on(yd,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{fd.fromMiliseconds(Date.now())-fd.fromMiliseconds(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})}),xM(this,"setMethods",e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)})),xM(this,"addTrace",(e,t)=>{const r=this.events.get(e);r&&(r.props.properties.trace.push(t),this.events.set(e,r),this.shouldPersist=!0)}),xM(this,"setError",(e,t)=>{const r=this.events.get(e);r&&(r.props.type=t,r.timestamp=Date.now(),this.events.set(e,r),this.shouldPersist=!0)}),xM(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),xM(this,"restore",async()=>{try{const e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,wM(wM({},e),this.setMethods(e.eventId)))})}catch(e){this.logger.warn(e)}}),xM(this,"submit",async()=>{if(!this.telemetryEnabled||0===this.events.size)return;const e=[];for(const[t,r]of this.events)r.props.type&&e.push(r);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(const t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}}),xM(this,"sendEvent",async e=>{const t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${nR}${t}`,{method:"POST",body:JSON.stringify(e)})}),xM(this,"getAppDomain",()=>xA().url),this.logger=xh(t,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var EM=Object.defineProperty,AM=Object.getOwnPropertySymbols,kM=Object.prototype.hasOwnProperty,OM=Object.prototype.propertyIsEnumerable,TM=(e,t,r)=>t in e?EM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,CM=(e,t)=>{for(var r in t||(t={}))kM.call(t,r)&&TM(e,r,t[r]);if(AM)for(var r of AM(t))OM.call(t,r)&&TM(e,r,t[r]);return e},IM=(e,t,r)=>TM(e,"symbol"!=typeof t?t+"":t,r);class _M extends kh{constructor(e){var t;super(e),IM(this,"protocol","wc"),IM(this,"version",2),IM(this,"name",UP),IM(this,"relayUrl"),IM(this,"projectId"),IM(this,"customStoragePrefix"),IM(this,"events",new _s.EventEmitter),IM(this,"logger"),IM(this,"heartbeat"),IM(this,"relayer"),IM(this,"crypto"),IM(this,"storage"),IM(this,"history"),IM(this,"expirer"),IM(this,"pairing"),IM(this,"verify"),IM(this,"echoClient"),IM(this,"linkModeSupportedApps"),IM(this,"eventClient"),IM(this,"initialized",!1),IM(this,"logChunkController"),IM(this,"on",(e,t)=>this.events.on(e,t)),IM(this,"once",(e,t)=>this.events.once(e,t)),IM(this,"off",(e,t)=>this.events.off(e,t)),IM(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),IM(this,"dispatchEnvelope",({topic:e,message:t,sessionExists:r})=>{if(!e||!t)return;const n={topic:e,message:t,publishedAt:Date.now(),transportType:oR.link_mode};this.relayer.onLinkMessageEvent(n,{sessionExists:r})});const r=this.getGlobalCore(e?.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(e){console.warn("Failed to copy global core",e)}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||KP,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=vh({level:"string"==typeof e?.logger&&e.logger?e.logger:FP,name:UP}),{logger:o,chunkLoggerController:i}=Sh({opts:n,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=i,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=xh(o,this.name),this.heartbeat=new gd,this.crypto=new XB(this,this.logger,e?.keychain),this.history=new iM(this,this.logger),this.expirer=new cM(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new Zd(CM(CM({},zP),e?.storageOptions)),this.relayer=new Mj({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new rM(this,this.logger),this.verify=new fM(this,this.logger,this.storage),this.echoClient=new pM(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new SM(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(e){const t=new _M(e);await t.initialize();const r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return wh(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(aR,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(aR)||[],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}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;const t=`_walletConnectCore_${e}`,r=`${t}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[t]}catch(e){return void console.warn("Failed to get global WalletConnect core",e)}}setGlobalCore(e){var t;try{if(this.isGlobalCoreDisabled())return;const r=`_walletConnectCore_${(null==(t=e.opts)?void 0:t.customStoragePrefix)||""}`;globalThis[r]=e}catch(e){console.warn("Failed to set global WalletConnect core",e)}}isGlobalCoreDisabled(){try{return typeof process<"u"&&"true"===process.env.DISABLE_GLOBAL_CORE}catch{return!0}}}const PM=_M,RM="client",NM=`wc@2:${RM}:`,BM=RM,jM="error",MM="WALLETCONNECT_DEEPLINK_CHOICE",LM="Proposal expired",UM=fd.SEVEN_DAYS,DM={wc_sessionPropose:{req:{ttl:fd.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:1104},res:{ttl:fd.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:1106},res:{ttl:fd.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:fd.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:fd.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:1112},res:{ttl:fd.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:fd.ONE_DAY,prompt:!1,tag:1114},res:{ttl:fd.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:fd.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:fd.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:fd.FIVE_MINUTES,prompt:!1,tag:1119}}},FM={min:fd.FIVE_MINUTES,max:fd.SEVEN_DAYS},zM="IDLE",qM="ACTIVE",VM={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},HM=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],KM="wc@1.5:auth:",WM=`${KM}:PUB_KEY`;var GM=Object.defineProperty,XM=Object.defineProperties,ZM=Object.getOwnPropertyDescriptors,QM=Object.getOwnPropertySymbols,YM=Object.prototype.hasOwnProperty,JM=Object.prototype.propertyIsEnumerable,$M=(e,t,r)=>t in e?GM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eL=(e,t)=>{for(var r in t||(t={}))YM.call(t,r)&&$M(e,r,t[r]);if(QM)for(var r of QM(t))JM.call(t,r)&&$M(e,r,t[r]);return e},tL=(e,t)=>XM(e,ZM(t)),rL=(e,t,r)=>$M(e,"symbol"!=typeof t?t+"":t,r);class nL extends zh{constructor(e){super(e),rL(this,"name","engine"),rL(this,"events",new Ps),rL(this,"initialized",!1),rL(this,"requestQueue",{state:zM,queue:[]}),rL(this,"sessionRequestQueue",{state:zM,queue:[]}),rL(this,"emittedSessionRequests",new FA({limit:500})),rL(this,"requestQueueDelay",fd.ONE_SECOND),rL(this,"expectedPairingMethodMap",new Map),rL(this,"recentlyDeletedMap",new Map),rL(this,"recentlyDeletedLimit",200),rL(this,"relayMessageCache",[]),rL(this,"pendingSessions",new Map),rL(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(DM)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},fd.toMiliseconds(this.requestQueueDelay)))}),rL(this,"connect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const t=tL(eL({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t),t.optionalNamespaces=function(e,t){var r,n,o,i,s,a;const c=S_(e),u=S_(t),l={},f=Object.keys(c).concat(Object.keys(u));for(const e of f)l[e]={chains:BA(null==(r=c[e])?void 0:r.chains,null==(n=u[e])?void 0:n.chains),methods:BA(null==(o=c[e])?void 0:o.methods,null==(i=u[e])?void 0:i.methods),events:BA(null==(s=c[e])?void 0:s.events,null==(a=u[e])?void 0:a.events)};return l}(t.requiredNamespaces,t.optionalNamespaces),t.requiredNamespaces={};const{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:o,sessionProperties:i,scopedProperties:s,relays:a}=t;let c,u=r,l=!1;try{if(u){const e=this.client.core.pairing.pairings.get(u);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),l=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${u}) failed`),e}if(!u||!l){const{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});u=e,c=t}if(!u){const{message:e}=O_("NO_MATCHING_KEY",`connect() pairing topic: ${u}`);throw new Error(e)}const f=await this.client.core.crypto.generateKeyPair(),d=DM.wc_sessionPropose.req.ttl||fd.FIVE_MINUTES,h=PA(d),p=tL(eL(eL({requiredNamespaces:n,optionalNamespaces:o,relays:a??[{protocol:"irn"}],proposer:{publicKey:f,metadata:this.client.metadata},expiryTimestamp:h,pairingTopic:u},i&&{sessionProperties:i}),s&&{scopedProperties:s}),{id:gP()}),y=NA("session_connect",p.id),{reject:g,resolve:m,done:b}=TA(d,LM),v=({id:e})=>{e===p.id&&(this.client.events.off("proposal_expire",v),this.pendingSessions.delete(p.id),this.events.emit(y,{error:{message:LM,code:0}}))};return this.client.events.on("proposal_expire",v),this.events.once(y,({error:e,session:t})=>{this.client.events.off("proposal_expire",v),e?g(e):t&&m(t)}),await this.sendProposeSession({proposal:p,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:p.id}}}),await this.setProposal(p.id,p),{uri:c,approval:b}}),rL(this,"pair",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}}),rL(this,"approve",async e=>{var t,r,n;const o=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[KR]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw o.setError(YR),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),o.setError(tN),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(eN),e}const{id:i,relayProtocol:s,namespaces:a,sessionProperties:c,scopedProperties:u,sessionConfig:l}=e,f=this.client.proposal.get(i);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:d,proposer:h,requiredNamespaces:p,optionalNamespaces:y}=f;let g=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:d});g||(g=null==(n=this.client.core.eventClient)?void 0:n.createEvent({type:KR,properties:{topic:d,trace:[KR,WR]}}));const m=await this.client.core.crypto.generateKeyPair(),b=h.publicKey,v=await this.client.core.crypto.generateSharedKey(m,b),w=eL(eL(eL({relay:{protocol:s??"irn"},namespaces:a,controller:{publicKey:m,metadata:this.client.metadata},expiry:PA(UM)},c&&{sessionProperties:c}),u&&{scopedProperties:u}),l&&{sessionConfig:l}),x=oR.relay;g.addTrace(GR);try{await this.client.core.relayer.subscribe(v,{transportType:x,internal:{skipSubscribe:!0}})}catch(e){throw g.setError($R),e}g.addTrace(XR);const S=tL(eL({},w),{topic:v,requiredNamespaces:p,optionalNamespaces:y,pairingTopic:d,acknowledged:!1,self:w.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:m,transportType:oR.relay});await this.client.session.set(v,S),g.addTrace(QR);try{await this.sendApproveSession({sessionTopic:v,proposal:f,pairingProposalResponse:{relay:{protocol:s??"irn"},responderPublicKey:m},sessionSettleRequest:w,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:i}}}),g.addTrace(ZR)}catch(e){throw this.client.logger.error(e),this.client.session.delete(v,T_("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(v),e}return this.client.core.eventClient.deleteEvent({eventId:g.eventId}),await this.client.core.pairing.updateMetadata({topic:d,metadata:h.metadata}),await this.deleteProposal(i),await this.client.core.pairing.activate({topic:d}),await this.setExpiry(v,PA(UM)),{topic:v,acknowledged:()=>Promise.resolve(this.client.session.get(v))}}),rL(this,"reject",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}const{id:t,reason:r}=e;let n;try{n=this.client.proposal.get(t).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${t}) failed`),e}n&&await this.sendError({id:t,topic:n,error:r,rpcOpts:DM.wc_sessionPropose.reject}),await this.deleteProposal(t)}),rL(this,"update",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}const{topic:t,namespaces:r}=e,{done:n,resolve:o,reject:i}=TA(),s=gP(),a=mP().toString(),c=this.client.session.get(t).namespaces;return this.events.once(NA("session_update",s),({error:e})=>{e?i(e):o()}),await this.client.session.update(t,{namespaces:r}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:s,relayRpcId:a}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),i(e)}),{acknowledged:n}}),rL(this,"extend",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}const{topic:t}=e,r=gP(),{done:n,resolve:o,reject:i}=TA();return this.events.once(NA("session_extend",r),({error:e})=>{e?i(e):o()}),await this.setExpiry(t,PA(UM)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch(e=>{i(e)}),{acknowledged:n}}),rL(this,"request",async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}const{chainId:t,request:r,topic:n,expiry:o=DM.wc_sessionRequest.req.ttl}=e,i=this.client.session.get(n);i?.transportType===oR.relay&&await this.confirmOnlineStateOrThrow();const s=gP(),a=mP().toString(),{done:c,resolve:u,reject:l}=TA(o,"Request expired. Please try again.");this.events.once(NA("session_request",s),({error:e,result:t})=>{e?l(e):u(t)});const f="wc_sessionRequest",d=this.getAppLinkIfEnabled(i.peer.metadata,i.transportType);if(d)return await this.sendRequest({clientRpcId:s,relayRpcId:a,topic:n,method:f,params:{request:tL(eL({},r),{expiryTimestamp:PA(o)}),chainId:t},expiry:o,throwOnFailedPublish:!0,appLink:d}).catch(e=>l(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:s}),await c();const h={request:tL(eL({},r),{expiryTimestamp:PA(o)}),chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:s,relayRpcId:a,topic:n,method:f,params:h,expiry:o,throwOnFailedPublish:!0,tvf:this.getTVFParams(s,h)}).catch(e=>l(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:s}),e()}),new Promise(async e=>{var t;if(null==(t=i.sessionConfig)||!t.disableDeepLink){const e=await async function(e,t){let r="";try{if(mA()&&(r=localStorage.getItem(t),r))return r;r=await e.getItem(t)}catch(e){console.error(e)}return r}(this.client.core.storage,MM);await jA({id:s,topic:n,wcDeepLink:e})}e()}),c()]).then(e=>e[2])}),rL(this,"respond",async e=>{this.isInitialized(),await this.isValidRespond(e);const{topic:t,response:r}=e,{id:n}=r,o=this.client.session.get(t);o.transportType===oR.relay&&await this.confirmOnlineStateOrThrow();const i=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);_P(r)?await this.sendResult({id:n,topic:t,result:r.result,throwOnFailedPublish:!0,appLink:i}):PP(r)&&await this.sendError({id:n,topic:t,error:r.error,appLink:i}),this.cleanupAfterResponse(e)}),rL(this,"ping",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=gP(),r=mP().toString(),{done:n,resolve:o,reject:i}=TA();this.events.once(NA("session_ping",e),({error:e})=>{e?i(e):o()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:r}),n()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:t}))}),rL(this,"emit",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);const{topic:t,event:r,chainId:n}=e,o=mP().toString(),i=gP();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:n},throwOnFailedPublish:!0,relayRpcId:o,clientRpcId:i})}),rL(this,"disconnect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);const{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:T_("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else{if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:e}=O_("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw new Error(e)}await this.client.core.pairing.disconnect({topic:t})}}),rL(this,"find",e=>(this.isInitialized(),this.client.session.getAll().filter(t=>function(e,t){const{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),o=Object.keys(r);let i=!0;return!!AA(o,n)&&(n.forEach(t=>{const{accounts:n,methods:o,events:s}=e.namespaces[t],a=v_(n),c=r[t];AA(eA(t,c),a)&&AA(c.methods,o)&&AA(c.events,s)||(i=!1)}),i)}(t,e)))),rL(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),rL(this,"authenticate",async(e,t)=>{var r;this.isInitialized(),this.isValidAuthenticate(e);const n=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(r=this.client.metadata.redirect)?void 0:r.linkMode),o=n?oR.link_mode:oR.relay;o===oR.relay&&await this.confirmOnlineStateOrThrow();const{chains:i,statement:s="",uri:a,domain:c,nonce:u,type:l,exp:f,nbf:d,methods:h=[],expiry:p}=e,y=[...e.resources||[]],{topic:g,uri:m}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:g,uri:m}});const b=await this.client.core.crypto.generateKeyPair(),v=LI(b);if(await Promise.all([this.client.auth.authKeys.set(WM,{responseTopic:v,publicKey:b}),this.client.auth.pairingTopics.set(v,{topic:v,pairingTopic:g})]),await this.client.core.relayer.subscribe(v,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${g}`),h.length>0){const{namespace:e}=$E(i[0]);let t=tT(e,"request",h);iT(y)&&(t=rT(t,y.pop())),y.push(t)}const w=p&&p>DM.wc_sessionAuthenticate.req.ttl?p:DM.wc_sessionAuthenticate.req.ttl,x={authPayload:{type:l??"caip122",chains:i,statement:s,aud:a,domain:c,version:"1",nonce:u,iat:(new Date).toISOString(),exp:f,nbf:d,resources:y},requester:{publicKey:b,metadata:this.client.metadata},expiryTimestamp:PA(w)},S={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:i,methods:[...new Set(["personal_sign",...h])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:g,proposer:{publicKey:b,metadata:this.client.metadata},expiryTimestamp:PA(DM.wc_sessionPropose.req.ttl),id:gP()},{done:E,resolve:A,reject:k}=TA(w,"Request expired"),O=gP(),T=NA("session_connect",S.id),C=NA("session_request",O),I=async({error:e,session:t})=>{this.events.off(C,_),e?k(e):t&&A({session:t})},_=async e=>{var r,n,i;if(await this.deletePendingAuthRequest(O,{message:"fulfilled",code:0}),e.error){const t=T_("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off(T,I),k(e.error.message))}await this.deleteProposal(S.id),this.events.off(T,I);const{cacaos:s,responder:a}=e.result,c=[],u=[];for(const e of s){await ZO({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),k(T_("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:t}=e,r=iT(t.resources),n=[GO(t.iss)],o=XO(t.iss);if(r){const e=nT(r),t=oT(r);c.push(...e),n.push(...t)}for(const e of n)u.push(`${e}:${o}`)}const l=await this.client.core.crypto.generateSharedKey(b,a.publicKey);let f;c.length>0&&(f={topic:l,acknowledged:!0,self:{publicKey:b,metadata:this.client.metadata},peer:a,controller:a.publicKey,expiry:PA(UM),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:g,namespaces:E_([...new Set(c)],[...new Set(u)]),transportType:o},await this.client.core.relayer.subscribe(l,{transportType:o}),await this.client.session.set(l,f),g&&await this.client.core.pairing.updateMetadata({topic:g,metadata:a.metadata}),f=this.client.session.get(l)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(n=a.metadata.redirect)&&n.linkMode&&null!=(i=a.metadata.redirect)&&i.universal&&t&&(this.client.core.addLinkModeSupportedApp(a.metadata.redirect.universal),this.client.session.update(l,{transportType:oR.link_mode})),A({auths:s,session:f})};let P;this.events.once(T,I),this.events.once(C,_);try{if(n){const e=bP("wc_sessionAuthenticate",x,O);this.client.core.history.set(g,e);const r=await this.client.core.crypto.encode("",e,{type:2,encoding:BI});P=u_(t,g,r)}else await Promise.all([this.sendRequest({topic:g,method:"wc_sessionAuthenticate",params:x,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:O}),this.sendRequest({topic:g,method:"wc_sessionPropose",params:S,expiry:DM.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:S.id})])}catch(e){throw this.events.off(T,I),this.events.off(C,_),e}return await this.setProposal(S.id,S),await this.setAuthRequest(O,{request:tL(eL({},x),{verifyContext:{}}),pairingTopic:g,transportType:o}),{uri:P??m,response:E}}),rL(this,"approveSessionAuthenticate",async e=>{const{id:t,auths:r}=e,n=this.client.core.eventClient.createEvent({properties:{topic:t.toString(),trace:[rN]}});try{this.isInitialized()}catch(e){throw n.setError(uN),e}const o=this.getPendingAuthRequest(t);if(!o)throw n.setError(hN),new Error(`Could not find pending auth request with id ${t}`);const i=o.transportType||oR.relay;i===oR.relay&&await this.confirmOnlineStateOrThrow();const s=o.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=LI(s),u={type:1,receiverPublicKey:s,senderPublicKey:a},l=[],f=[];for(const e of r){if(!await ZO({cacao:e,projectId:this.client.core.projectId})){n.setError(lN);const e=T_("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:t,topic:c,error:e,encodeOpts:u}),new Error(e.message)}n.addTrace(oN);const{p:r}=e,o=iT(r.resources),i=[GO(r.iss)],s=XO(r.iss);if(o){const e=nT(o),t=oT(o);l.push(...e),i.push(...t)}for(const e of i)f.push(`${e}:${s}`)}const d=await this.client.core.crypto.generateSharedKey(a,s);let h;if(n.addTrace(nN),l?.length>0){h={topic:d,acknowledged:!0,self:{publicKey:a,metadata:this.client.metadata},peer:{publicKey:s,metadata:o.requester.metadata},controller:s,expiry:PA(UM),authentication:r,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:E_([...new Set(l)],[...new Set(f)]),transportType:i},n.addTrace(sN);try{await this.client.core.relayer.subscribe(d,{transportType:i})}catch(e){throw n.setError(fN),e}n.addTrace(aN),await this.client.session.set(d,h),n.addTrace(iN),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}n.addTrace(cN);try{await this.sendResult({topic:c,id:t,result:{cacaos:r,responder:{publicKey:a,metadata:this.client.metadata}},encodeOpts:u,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,i)})}catch(e){throw n.setError(dN),e}return await this.client.auth.requests.delete(t,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:n.eventId}),{session:h}}),rL(this,"rejectSessionAuthenticate",async e=>{this.isInitialized();const{id:t,reason:r}=e,n=this.getPendingAuthRequest(t);if(!n)throw new Error(`Could not find pending auth request with id ${t}`);n.transportType===oR.relay&&await this.confirmOnlineStateOrThrow();const o=n.requester.publicKey,i=await this.client.core.crypto.generateKeyPair(),s=LI(o),a={type:1,receiverPublicKey:o,senderPublicKey:i};await this.sendError({id:t,topic:s,error:r,encodeOpts:a,rpcOpts:DM.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(n.requester.metadata,n.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.deleteProposal(t)}),rL(this,"formatAuthMessage",e=>{this.isInitialized();const{request:t,iss:r}=e;return QO(t,r)}),rL(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{const e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)}),rL(this,"cleanupDuplicatePairings",async e=>{if(e.pairingTopic)try{const t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(r=>{var n,o;return(null==(n=r.peerMetadata)?void 0:n.url)&&(null==(o=r.peerMetadata)?void 0:o.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic});if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}}),rL(this,"deleteSession",async e=>{var t;const{topic:r,expirerHasDeleted:n=!1,emitEvent:o=!0,id:i=0}=e,{self:s}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,T_("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(s.publicKey)&&await this.client.core.crypto.deleteKeyPair(s.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(MM).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEach(e=>{e.topic===r&&this.deletePendingSessionRequest(e.id,T_("USER_DISCONNECTED"))}),r===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=zM),o&&this.client.events.emit("session_delete",{id:i,topic:r})}),rL(this,"deleteProposal",async(e,t)=>{if(t)try{const t=this.client.proposal.get(e),r=this.client.core.eventClient.getEvent({topic:t.pairingTopic});r?.setError(JR)}catch{}await Promise.all([this.client.proposal.delete(e,T_("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")}),rL(this,"deletePendingSessionRequest",async(e,t,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),r&&(this.sessionRequestQueue.state=zM,this.client.events.emit("session_request_expire",{id:e}))}),rL(this,"deletePendingAuthRequest",async(e,t,r=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])}),rL(this,"setExpiry",async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))}),rL(this,"setProposal",async(e,t)=>{this.client.core.expirer.set(e,PA(DM.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)}),rL(this,"setAuthRequest",async(e,t)=>{const{request:r,pairingTopic:n,transportType:o=oR.relay}=t;this.client.core.expirer.set(e,r.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:e,pairingTopic:n,verifyContext:r.verifyContext,transportType:o})}),rL(this,"setPendingSessionRequest",async e=>{const{id:t,topic:r,params:n,verifyContext:o}=e,i=n.request.expiryTimestamp||PA(DM.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,i),await this.client.pendingRequest.set(t,{id:t,topic:r,params:n,verifyContext:o})}),rL(this,"sendRequest",async e=>{const{topic:t,method:r,params:n,expiry:o,relayRpcId:i,clientRpcId:s,throwOnFailedPublish:a,appLink:c,tvf:u,publishOpts:l={}}=e,f=bP(r,n,s);let d;const h=!!c;try{const e=h?BI:NI;d=await this.client.core.crypto.encode(t,f,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t} failed`),e}let p;if(HM.includes(r)){const e=UI(JSON.stringify(f)),t=UI(d);p=await this.client.core.verify.register({id:t,decryptedId:e})}const y=eL(eL({},DM[r].req),l);if(y.attestation=p,o&&(y.ttl=o),i&&(y.id=i),this.client.core.history.set(t,f),h){const e=u_(c,t,d);await global.Linking.openURL(e,this.client.name)}else y.tvf=tL(eL({},u),{correlationId:f.id}),a?(y.internal=tL(eL({},y.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(t,d,y)):this.client.core.relayer.publish(t,d,y).catch(e=>this.client.logger.error(e));return f.id}),rL(this,"sendProposeSession",async e=>{const{proposal:t,publishOpts:r}=e,n=bP("wc_sessionPropose",t,t.id);this.client.core.history.set(t.pairingTopic,n);const o=await this.client.core.crypto.encode(t.pairingTopic,n,{encoding:NI}),i=UI(JSON.stringify(n)),s=UI(o),a=await this.client.core.verify.register({id:s,decryptedId:i});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:o},opts:tL(eL({},r),{publishMethod:"wc_proposeSession",attestation:a})})}),rL(this,"sendApproveSession",async e=>{const{sessionTopic:t,pairingProposalResponse:r,proposal:n,sessionSettleRequest:o,publishOpts:i}=e,s=vP(n.id,r),a=await this.client.core.crypto.encode(n.pairingTopic,s,{encoding:NI}),c=bP("wc_sessionSettle",o,i?.id),u=await this.client.core.crypto.encode(t,c,{encoding:NI});this.client.core.history.set(t,c),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:n.pairingTopic,sessionProposalResponse:a,sessionSettlementRequest:u},opts:tL(eL({},i),{publishMethod:"wc_approveSession"})})}),rL(this,"sendResult",async e=>{const{id:t,topic:r,result:n,throwOnFailedPublish:o,encodeOpts:i,appLink:s}=e,a=vP(t,n);let c;const u=s&&typeof(null==global?void 0:global.Linking)<"u";try{const e=u?BI:NI;c=await this.client.core.crypto.encode(r,a,tL(eL({},i||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${r} failed`),e}let l,f;try{l=await this.client.core.history.get(r,t);const e=l.request;try{f=this.getTVFParams(t,e.params,n)}catch(e){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${e?.message}`)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${r}, ${t}) failed`),e}if(u){const e=u_(s,r,c);await global.Linking.openURL(e,this.client.name)}else{const e=l.request.method,n=DM[e].res;n.tvf=tL(eL({},f),{correlationId:t}),o?(n.internal=tL(eL({},n.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,c,n)):this.client.core.relayer.publish(r,c,n).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(a)}),rL(this,"sendError",async e=>{const{id:t,topic:r,error:n,encodeOpts:o,rpcOpts:i,appLink:s}=e,a=wP(t,n);let c;const u=s&&typeof(null==global?void 0:global.Linking)<"u";try{const e=u?BI:NI;c=await this.client.core.crypto.encode(r,a,tL(eL({},o||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${r} failed`),e}let l;try{l=await this.client.core.history.get(r,t)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${r}, ${t}) failed`),e}if(u){const e=u_(s,r,c);await global.Linking.openURL(e,this.client.name)}else{const e=l.request.method,t=i||DM[e].res;this.client.core.relayer.publish(r,c,t)}await this.client.core.history.resolve(a)}),rL(this,"cleanup",async()=>{const e=[],t=[];this.client.session.getAll().forEach(t=>{let r=!1;RA(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{RA(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])}),rL(this,"onProviderMessageEvent",async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)}),rL(this,"onRelayEventRequest",async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()}),rL(this,"processRequestsQueue",async()=>{if(this.requestQueue.state!==qM){for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=qM;const e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=zM}else this.client.logger.info("Request queue already active, skipping...")}),rL(this,"processRequest",async e=>{const{topic:t,payload:r,attestation:n,transportType:o,encryptedId:i}=e,s=r.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:s}))switch(s){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:t,payload:r,attestation:n,encryptedId:i});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,r);case"wc_sessionPing":return await this.onSessionPingRequest(t,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:r,attestation:n,encryptedId:i,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(t,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:r,attestation:n,encryptedId:i,transportType:o});default:return this.client.logger.info(`Unsupported request method ${s}`)}}),rL(this,"onRelayEventResponse",async e=>{const{topic:t,payload:r,transportType:n}=e,o=(await this.client.core.history.get(t,r.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r,n);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${o}`)}}),rL(this,"onRelayEventUnknownPayload",e=>{const{topic:t}=e,{message:r}=O_("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw new Error(r)}),rL(this,"shouldIgnorePairingRequest",e=>{const{topic:t,requestMethod:r}=e,n=this.expectedPairingMethodMap.get(t);return!(!n||n.includes(r))&&!!(n.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),rL(this,"onSessionProposeRequest",async e=>{const{topic:t,payload:r,attestation:n,encryptedId:o}=e,{params:i,id:s}=r;try{const e=this.client.core.eventClient.getEvent({topic:t});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError(HR)),this.isValidConnect(eL({},r.params));const a=i.expiryTimestamp||PA(DM.wc_sessionPropose.req.ttl),c=eL({id:s,pairingTopic:t,expiryTimestamp:a,attestation:n,encryptedId:o},i);await this.setProposal(s,c);const u=await this.getVerifyContext({attestationId:n,hash:UI(JSON.stringify(r)),encryptedId:o,metadata:c.proposer.metadata});e?.addTrace(UR),this.client.events.emit("session_proposal",{id:s,params:c,verifyContext:u})}catch(e){await this.sendError({id:s,topic:t,error:e,rpcOpts:DM.wc_sessionPropose.autoReject}),this.client.logger.error(e)}}),rL(this,"onSessionProposeResponse",async(e,t,r)=>{const{id:n}=t;if(_P(t)){const{result:o}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const i=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:i});const s=i.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:s});const a=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});const c=await this.client.core.crypto.generateSharedKey(s,a);this.pendingSessions.set(n,{sessionTopic:c,pairingTopic:e,proposalId:n,publicKey:s});const u=await this.client.core.relayer.subscribe(c,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:u}),await this.client.core.pairing.activate({topic:e})}else if(PP(t)){await this.deleteProposal(n);const e=NA("session_connect",n);if(0===this.events.listenerCount(e))throw new Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}}),rL(this,"onSessionSettleRequest",async(e,t)=>{const{id:r,params:n}=t;try{this.isValidSessionSettleRequest(n);const{relay:r,controller:o,expiry:i,namespaces:s,sessionProperties:a,scopedProperties:c,sessionConfig:u}=t.params,l=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!l)return this.client.logger.error(`Pending session not found for topic ${e}`);const f=this.client.proposal.get(l.proposalId),d=tL(eL(eL(eL({topic:e,relay:r,expiry:i,namespaces:s,acknowledged:!0,pairingTopic:l.pairingTopic,requiredNamespaces:f.requiredNamespaces,optionalNamespaces:f.optionalNamespaces,controller:o.publicKey,self:{publicKey:l.publicKey,metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata}},a&&{sessionProperties:a}),c&&{scopedProperties:c}),u&&{sessionConfig:u}),{transportType:oR.relay});await this.client.session.set(d.topic,d),await this.setExpiry(d.topic,d.expiry),await this.client.core.pairing.updateMetadata({topic:l.pairingTopic,metadata:d.peer.metadata}),this.client.events.emit("session_connect",{session:d}),this.events.emit(NA("session_connect",l.proposalId),{session:d}),this.pendingSessions.delete(l.proposalId),this.deleteProposal(l.proposalId,!1),this.cleanupDuplicatePairings(d),await this.sendResult({id:t.id,topic:e,result:!0})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),rL(this,"onSessionSettleResponse",async(e,t)=>{const{id:r}=t;_P(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(NA("session_approve",r),{})):PP(t)&&(await this.client.session.delete(e,T_("USER_DISCONNECTED")),this.events.emit(NA("session_approve",r),{error:t.error}))}),rL(this,"onSessionUpdateRequest",async(e,t)=>{const{params:r,id:n}=t;try{const t=`${e}_session_update`,o=Z_.get(t);if(o&&this.isRequestOutOfSync(o,n))return this.client.logger.warn(`Discarding out of sync request - ${n}`),void this.sendError({id:n,topic:e,error:T_("INVALID_UPDATE_REQUEST")});this.isValidUpdate(eL({topic:e},r));try{Z_.set(t,n),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:n,topic:e,result:!0})}catch(e){throw Z_.delete(t),e}this.client.events.emit("session_update",{id:n,topic:e,params:r})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}}),rL(this,"isRequestOutOfSync",(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3)),rL(this,"onSessionUpdateResponse",(e,t)=>{const{id:r}=t,n=NA("session_update",r);if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners`);_P(t)?this.events.emit(NA("session_update",r),{}):PP(t)&&this.events.emit(NA("session_update",r),{error:t.error})}),rL(this,"onSessionExtendRequest",async(e,t)=>{const{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,PA(UM)),await this.sendResult({id:r,topic:e,result:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),rL(this,"onSessionExtendResponse",(e,t)=>{const{id:r}=t,n=NA("session_extend",r);if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners`);_P(t)?this.events.emit(NA("session_extend",r),{}):PP(t)&&this.events.emit(NA("session_extend",r),{error:t.error})}),rL(this,"onSessionPingRequest",async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),rL(this,"onSessionPingResponse",(e,t)=>{const{id:r}=t,n=NA("session_ping",r);setTimeout(()=>{if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners 2176`);_P(t)?this.events.emit(NA("session_ping",r),{}):PP(t)&&this.events.emit(NA("session_ping",r),{error:t.error})},500)}),rL(this,"onSessionDeleteRequest",async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise(t=>{this.client.core.relayer.once(JP,async()=>{t(await this.deleteSession({topic:e,id:r}))})}),this.sendResult({id:r,topic:e,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:T_("USER_DISCONNECTED")})]).catch(e=>this.client.logger.error(e))}catch(e){this.client.logger.error(e)}}),rL(this,"onSessionRequest",async e=>{var t,r,n;const{topic:o,payload:i,attestation:s,encryptedId:a,transportType:c}=e,{id:u,params:l}=i;try{await this.isValidRequest(eL({topic:o},l));const e=this.client.session.get(o),i={id:u,topic:o,params:l,verifyContext:await this.getVerifyContext({attestationId:s,hash:UI(JSON.stringify(bP("wc_sessionRequest",l,u))),encryptedId:a,metadata:e.peer.metadata,transportType:c})};await this.setPendingSessionRequest(i),c===oR.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(r=e.peer.metadata.redirect)?void 0:r.universal),null!=(n=this.client.signConfig)&&n.disableRequestQueue?this.emitSessionRequest(i):(this.addSessionRequestToSessionRequestQueue(i),this.processSessionRequestQueue())}catch(e){await this.sendError({id:u,topic:o,error:e}),this.client.logger.error(e)}}),rL(this,"onSessionRequestResponse",(e,t)=>{const{id:r}=t,n=NA("session_request",r);if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners`);_P(t)?this.events.emit(NA("session_request",r),{result:t.result}):PP(t)&&this.events.emit(NA("session_request",r),{error:t.error})}),rL(this,"onSessionEventRequest",async(e,t)=>{const{id:r,params:n}=t;try{const t=`${e}_session_event_${n.event.name}`,o=Z_.get(t);if(o&&this.isRequestOutOfSync(o,r))return void this.client.logger.info(`Discarding out of sync request - ${r}`);this.isValidEmit(eL({topic:e},n)),this.client.events.emit("session_event",{id:r,topic:e,params:n}),Z_.set(t,r)}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),rL(this,"onSessionAuthenticateResponse",(e,t)=>{const{id:r}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),_P(t)?this.events.emit(NA("session_request",r),{result:t.result}):PP(t)&&this.events.emit(NA("session_request",r),{error:t.error})}),rL(this,"onSessionAuthenticateRequest",async e=>{var t;const{topic:r,payload:n,attestation:o,encryptedId:i,transportType:s}=e;try{const{requester:e,authPayload:a,expiryTimestamp:c}=n.params,u=await this.getVerifyContext({attestationId:o,hash:UI(JSON.stringify(n)),encryptedId:i,metadata:e.metadata,transportType:s}),l={requester:e,pairingTopic:r,id:n.id,authPayload:a,verifyContext:u,expiryTimestamp:c};await this.setAuthRequest(n.id,{request:l,pairingTopic:r,transportType:s}),s===oR.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:n.params,id:n.id,verifyContext:u})}catch(e){this.client.logger.error(e);const t=n.params.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),i=this.getAppLinkIfEnabled(n.params.requester.metadata,s),a={type:1,receiverPublicKey:t,senderPublicKey:o};await this.sendError({id:n.id,topic:r,error:e,encodeOpts:a,rpcOpts:DM.wc_sessionAuthenticate.autoReject,appLink:i})}}),rL(this,"addSessionRequestToSessionRequestQueue",e=>{this.sessionRequestQueue.queue.push(e)}),rL(this,"cleanupAfterResponse",e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=zM,this.processSessionRequestQueue()},fd.toMiliseconds(this.requestQueueDelay))}),rL(this,"cleanupPendingSentRequestsForTopic",({topic:e,error:t})=>{const r=this.client.core.history.pending;r.length>0&&r.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{const r=NA("session_request",e.request.id);if(0===this.events.listenerCount(r))throw new Error(`emitting ${r} without any listeners`);this.events.emit(NA("session_request",e.request.id),{error:t})})}),rL(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===qM)return void this.client.logger.info("session request queue is already active.");const e=this.sessionRequestQueue.queue[0];if(e)try{this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}else this.client.logger.info("session request queue is empty.")}),rL(this,"emitSessionRequest",e=>{this.emittedSessionRequests.has(e.id)?this.client.logger.warn({id:e.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${e.id}`):(this.sessionRequestQueue.state=qM,this.emittedSessionRequests.add(e.id),this.client.events.emit("session_request",e))}),rL(this,"onPairingCreated",e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;const t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);t&&this.onSessionProposeRequest({topic:e.topic,payload:bP("wc_sessionPropose",tL(eL({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties}),t.id),attestation:t.attestation,encryptedId:t.encryptedId})}),rL(this,"isValidConnect",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw new Error(t)}const{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:n,sessionProperties:o,scopedProperties:i,relays:s}=e;if(__(t)||await this.isValidPairingTopic(t),!function(e,t){let r=!1;return t&&!e?r=!0:e&&C_(e)&&e.length&&e.forEach(e=>{r=D_(e)}),r}(s,!0)){const{message:e}=O_("MISSING_OR_INVALID",`connect() relays: ${s}`);throw new Error(e)}if(!__(r)&&0!==I_(r)){const e="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(e):this.client.logger.warn(e),this.validateNamespaces(r,"requiredNamespaces")}if(!__(n)&&0!==I_(n)&&this.validateNamespaces(n,"optionalNamespaces"),__(o)||this.validateSessionProps(o,"sessionProperties"),!__(i)){this.validateSessionProps(i,"scopedProperties");const e=Object.keys(r||{}).concat(Object.keys(n||{}));if(!Object.keys(i).every(t=>e.includes(t.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(i)}, required/optional namespaces: ${JSON.stringify(e)}`)}}),rL(this,"validateNamespaces",(e,t)=>{const r=function(e,t,r){let n=null;if(e&&I_(e)){const o=L_(e,t);o&&(n=o);const i=j_(e,t,r);i&&(n=i)}else n=O_("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}(e,"connect()",t);if(r)throw new Error(r.message)}),rL(this,"isValidApprove",async e=>{if(!F_(e))throw new Error(O_("MISSING_OR_INVALID",`approve() params: ${e}`).message);const{id:t,namespaces:r,relayProtocol:n,sessionProperties:o,scopedProperties:i}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);const s=this.client.proposal.get(t),a=U_(r,"approve()");if(a)throw new Error(a.message);const c=H_(s.requiredNamespaces,r,"approve()");if(c)throw new Error(c.message);if(!P_(n,!0)){const{message:e}=O_("MISSING_OR_INVALID",`approve() relayProtocol: ${n}`);throw new Error(e)}if(__(o)||this.validateSessionProps(o,"sessionProperties"),!__(i)){this.validateSessionProps(i,"scopedProperties");const e=new Set(Object.keys(r));if(!Object.keys(i).every(t=>e.has(t.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(i)}, approved namespaces: ${Array.from(e).join(", ")}`)}}),rL(this,"isValidReject",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`reject() params: ${e}`);throw new Error(t)}const{id:t,reason:r}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!function(e){return!!(e&&"object"==typeof e&&e.code&&R_(e.code,!1)&&e.message&&P_(e.message,!1))}(r)){const{message:e}=O_("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw new Error(e)}}),rL(this,"isValidSessionSettleRequest",e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw new Error(t)}const{relay:t,controller:r,namespaces:n,expiry:o}=e;if(!D_(t)){const{message:e}=O_("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(e)}const i=function(e,t){let r=null;return P_(e?.publicKey,!1)||(r=O_("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}(r,"onSessionSettleRequest()");if(i)throw new Error(i.message);const s=U_(n,"onSessionSettleRequest()");if(s)throw new Error(s.message);if(RA(o)){const{message:e}=O_("EXPIRED","onSessionSettleRequest()");throw new Error(e)}}),rL(this,"isValidUpdate",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`update() params: ${e}`);throw new Error(t)}const{topic:t,namespaces:r}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);const n=this.client.session.get(t),o=U_(r,"update()");if(o)throw new Error(o.message);const i=H_(n.requiredNamespaces,r,"update()");if(i)throw new Error(i.message)}),rL(this,"isValidExtend",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`extend() params: ${e}`);throw new Error(t)}const{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)}),rL(this,"isValidRequest",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`request() params: ${e}`);throw new Error(t)}const{topic:t,request:r,chainId:n,expiry:o}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);const{namespaces:i}=this.client.session.get(t);if(!z_(i,n)){const{message:e}=O_("MISSING_OR_INVALID",`request() chainId: ${n}`);throw new Error(e)}if(!function(e){return!(__(e)||!P_(e.method,!1))}(r)){const{message:e}=O_("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw new Error(e)}if(!q_(i,n,r.method)){const{message:e}=O_("MISSING_OR_INVALID",`request() method: ${r.method}`);throw new Error(e)}if(o&&!function(e,t){return R_(e,!1)&&e<=t.max&&e>=t.min}(o,FM)){const{message:e}=O_("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${FM.min} and ${FM.max}`);throw new Error(e)}}),rL(this,"isValidRespond",async e=>{var t;if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`respond() params: ${e}`);throw new Error(t)}const{topic:r,response:n}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(!function(e){return!(__(e)||__(e.result)&&__(e.error)||!R_(e.id,!1)||!P_(e.jsonrpc,!1))}(n)){const{message:e}=O_("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw new Error(e)}}),rL(this,"isValidPing",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),rL(this,"isValidEmit",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`emit() params: ${e}`);throw new Error(t)}const{topic:t,event:r,chainId:n}=e;await this.isValidSessionTopic(t);const{namespaces:o}=this.client.session.get(t);if(!z_(o,n)){const{message:e}=O_("MISSING_OR_INVALID",`emit() chainId: ${n}`);throw new Error(e)}if(!function(e){return!(__(e)||!P_(e.name,!1))}(r)){const{message:e}=O_("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}if(!V_(o,n,r.name)){const{message:e}=O_("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}}),rL(this,"isValidDisconnect",async e=>{if(!F_(e)){const{message:t}=O_("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),rL(this,"isValidAuthenticate",e=>{const{chains:t,uri:r,domain:n,nonce:o}=e;if(!Array.isArray(t)||0===t.length)throw new Error("chains is required and must be a non-empty array");if(!P_(r,!1))throw new Error("uri is required parameter");if(!P_(n,!1))throw new Error("domain is required parameter");if(!P_(o,!1))throw new Error("nonce is required parameter");if([...new Set(t.map(e=>$E(e).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:i}=$E(t[0]);if("eip155"!==i)throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),rL(this,"getVerifyContext",async e=>{const{attestationId:t,hash:r,encryptedId:n,metadata:o,transportType:i}=e,s={verified:{verifyUrl:o.verifyUrl||OR,validation:"UNKNOWN",origin:o.url||""}};try{if(i===oR.link_mode){const e=this.getAppLinkIfEnabled(o,i);return s.verified.validation=e&&new URL(e).origin===new URL(o.url).origin?"VALID":"INVALID",s}const e=await this.client.core.verify.resolve({attestationId:t,hash:r,encryptedId:n,verifyUrl:o.verifyUrl});e&&(s.verified.origin=e.origin,s.verified.isScam=e.isScam,s.verified.validation=e.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(s)}`),s}),rL(this,"validateSessionProps",(e,t)=>{Object.values(e).forEach((r,n)=>{if(null==r){const{message:o}=O_("MISSING_OR_INVALID",`${t} must contain an existing value for each key. Received: ${r} for key ${Object.keys(e)[n]}`);throw new Error(o)}})}),rL(this,"getPendingAuthRequest",e=>{const t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0}),rL(this,"addToRecentlyDeleted",(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0;const t=this.recentlyDeletedLimit/2;for(const r of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(r)}}}),rL(this,"checkRecentlyDeleted",e=>{const t=this.recentlyDeletedMap.get(e);if(t){const{message:r}=O_("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw new Error(r)}}),rL(this,"isLinkModeEnabled",(e,t)=>{var r,n,o,i,s,a,c,u,l;return!(!e||t!==oR.link_mode)&&(!0===(null==(n=null==(r=this.client.metadata)?void 0:r.redirect)?void 0:n.linkMode)&&void 0!==(null==(i=null==(o=this.client.metadata)?void 0:o.redirect)?void 0:i.universal)&&""!==(null==(a=null==(s=this.client.metadata)?void 0:s.redirect)?void 0:a.universal)&&void 0!==(null==(c=e?.redirect)?void 0:c.universal)&&""!==(null==(u=e?.redirect)?void 0:u.universal)&&!0===(null==(l=e?.redirect)?void 0:l.linkMode)&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&typeof(null==global?void 0:global.Linking)<"u")}),rL(this,"getAppLinkIfEnabled",(e,t)=>{var r;return this.isLinkModeEnabled(e,t)?null==(r=e?.redirect)?void 0:r.universal:void 0}),rL(this,"handleLinkModeMessage",({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;const t=MA(e,"topic")||"",r=decodeURIComponent(MA(e,"wc_ev")||""),n=this.client.session.keys.includes(t);n&&this.client.session.update(t,{transportType:oR.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:r,sessionExists:n})}),rL(this,"registerLinkModeListeners",async()=>{var e;if(UA()||gA()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){const e=null==global?void 0:global.Linking;if(typeof e<"u"){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);const t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}}),rL(this,"getTVFParams",(e,t,r)=>{var n,o,i;if(null==(n=t.request)||!n.method)return{};const s={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{const e=this.extractTxHashesFromResult(t.request,r);s.txHashes=e,s.contractAddresses=this.isValidContractData(t.request.params)?[null==(i=null==(o=t.request.params)?void 0:o[0])?void 0:i.to]:[]}catch(e){this.client.logger.warn("Error getting TVF params",e)}return s}),rL(this,"isValidContractData",e=>{var t;if(!e)return!1;try{const r=e?.data||(null==(t=e?.[0])?void 0:t.data);if(!r.startsWith("0x"))return!1;const n=r.slice(2);return!!/^[0-9a-fA-F]*$/.test(n)&&n.length%2==0}catch{}return!1}),rL(this,"extractTxHashesFromResult",(e,t)=>{var r;try{if(!t)return[];const n=e.method,o=VM[n];if("sui_signTransaction"===n)return[BO(t.transactionBytes)];if("near_signTransaction"===n)return[jO(t)];if("near_signTransactions"===n)return t.map(e=>jO(e));if("xrpl_signTransactionFor"===n||"xrpl_signTransaction"===n)return[null==(r=t.tx_json)?void 0:r.hash];if("polkadot_signTransaction"===n)return[J_({transaction:e.params.transactionPayload,signature:t.signature})];if("algo_signTxn"===n)return C_(t)?t.map(e=>MO(e)):[MO(t)];if("cosmos_signDirect"===n)return[UO(t)];if("wallet_sendCalls"===n)return function(e){var t,r;const n=[];try{if("string"==typeof e)return n.push(e),n;if("object"!=typeof e)return n;null!=e&&e.id&&n.push(e.id);const o=null==(r=null==(t=e?.capabilities)?void 0:t.caip345)?void 0:r.transactionHashes;o&&n.push(...o)}catch(e){console.warn("getWalletSendCallsHashes failed: ",e)}return n}(t);if("string"==typeof t)return[t];const i=t[o.key];if(C_(i))return"solana_signAllTransactions"===n?i.map(e=>function(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);const n=r[0];if(0===n)throw new Error("No signatures found");const o=1+64*n;if(r.length<o)throw new Error("Transaction data too short for claimed signature count");if(r.length<100)throw new Error("Transaction too short");const i=Buffer.from(e,"base64").slice(1,65);return px.encode(i)}(e)):i;if("string"==typeof i)return[i]}catch(e){this.client.logger.warn("Error extracting tx hashes from result",e)}return[]})}async processPendingMessageEvents(){try{const e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(const[e,r]of Object.entries(t))for(const t of r)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn("processPendingMessageEvents failed",e)}}isInitialized(){if(!this.initialized){const{message:e}=O_("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(WP,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){const{topic:t,message:r,attestation:n,transportType:o}=e,{publicKey:i}=this.client.auth.authKeys.keys.includes(WM)?this.client.auth.authKeys.get(WM):{responseTopic:void 0,publicKey:void 0};try{const e=await this.client.core.crypto.decode(t,r,{receiverPublicKey:i,encoding:o===oR.link_mode?BI:NI});CP(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:n,transportType:o,encryptedId:UI(r)})):IP(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:o}),this.client.core.history.delete(t,e.id)):await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:o}),await this.client.core.relayer.messages.ack(t,r)}catch(e){this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(ER,async e=>{const{topic:t,id:r}=_A(e.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,O_("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,O_("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))})}registerPairingEvents(){this.client.core.pairing.events.on(hR,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(yR,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!P_(e,!1)){const{message:t}=O_("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=O_("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(RA(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=O_("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!P_(e,!1)){const{message:t}=O_("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=O_("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(RA(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=O_("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=O_("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else{if(!this.client.core.pairing.pairings.keys.includes(e)){if(P_(e,!1)){const{message:t}=O_("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}{const{message:t}=O_("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}this.isValidPairingTopic(e)}}async isValidProposalId(e){if(!function(e){return"number"==typeof e}(e)){const{message:t}=O_("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=O_("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(RA(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=O_("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class oL extends $j{constructor(e,t){super(e,t,"proposal",NM),this.core=e,this.logger=t}}class iL extends $j{constructor(e,t){super(e,t,"session",NM),this.core=e,this.logger=t}}class sL extends $j{constructor(e,t){super(e,t,"request",NM,e=>e.id),this.core=e,this.logger=t}}class aL extends $j{constructor(e,t){super(e,t,"authKeys",KM,()=>WM),this.core=e,this.logger=t}}class cL extends $j{constructor(e,t){super(e,t,"pairingTopics",KM),this.core=e,this.logger=t}}class uL extends $j{constructor(e,t){super(e,t,"requests",KM,e=>e.id),this.core=e,this.logger=t}}var lL=Object.defineProperty,fL=(e,t,r)=>((e,t,r)=>t in e?lL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class dL{constructor(e,t){this.core=e,this.logger=t,fL(this,"authKeys"),fL(this,"pairingTopics"),fL(this,"requests"),this.authKeys=new aL(this.core,this.logger),this.pairingTopics=new cL(this.core,this.logger),this.requests=new uL(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var hL=Object.defineProperty,pL=(e,t,r)=>((e,t,r)=>t in e?hL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class yL extends Fh{constructor(e){super(e),pL(this,"protocol","wc"),pL(this,"version",2),pL(this,"name",BM),pL(this,"metadata"),pL(this,"core"),pL(this,"logger"),pL(this,"events",new _s.EventEmitter),pL(this,"engine"),pL(this,"session"),pL(this,"proposal"),pL(this,"pendingRequest"),pL(this,"auth"),pL(this,"signConfig"),pL(this,"on",(e,t)=>this.events.on(e,t)),pL(this,"once",(e,t)=>this.events.once(e,t)),pL(this,"off",(e,t)=>this.events.off(e,t)),pL(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),pL(this,"removeAllListeners",e=>this.events.removeAllListeners(e)),pL(this,"connect",async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"pair",async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"approve",async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"reject",async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"update",async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"extend",async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"request",async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"respond",async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"ping",async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"emit",async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"disconnect",async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"find",e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}}),pL(this,"authenticate",async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"formatAuthMessage",e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"approveSessionAuthenticate",async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),pL(this,"rejectSessionAuthenticate",async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),this.name=e?.name||BM,this.metadata=wA(e?.metadata),this.signConfig=e?.signConfig;const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:th(vh({level:e?.logger||jM}));this.core=e?.core||new PM(e),this.logger=xh(t,this.name),this.session=new iL(this.core,this.logger),this.proposal=new oL(this.core,this.logger),this.pendingRequest=new sL(this.core,this.logger),this.engine=new nL(this),this.auth=new dL(this.core,this.logger)}static async init(e){const t=new yL(e);return await t.initialize(),t}get context(){return wh(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var gL,mL,bL=!1,vL=function(e){return d(void 0,void 0,void 0,function(){return h(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.connect({optionalNamespaces:{stellar:{methods:["stellar_signXDR","stellar_signAndSubmitXDR","stellar_signMessage"],chains:[ns,os],events:[]}}})];case 1:return[2,t.sent()];case 2:return t.sent(),[2,null];case 3:return[2]}})})},wL=function(){var e=Al(),t=me(function(e){return e}),r=Q.useState(""),o=r[0],i=r[1],s=t.config,a=t.wallets,c=t.connectEmail,u=t.setShowAllWallets,l=s.appearance,f=s.loginMethods||[],p=f.includes("passkey"),y=Q.useMemo(function(){var e=w([],f,!0).filter(function(e){return"passkey"!==e});return w(w([],e,!0),p?["passkey"]:[],!0)},[f,p]),g=Q.useMemo(function(){return a.length>3?a.slice(2):[]},[a]),m=Q.useMemo(function(){return a.length<=3?a:t.showAllWallets?a.slice(2,a.length):a.slice(0,2)},[a,t.showAllWallets]);Q.useEffect(function(){t.walletConnect&&vL(t.walletConnect.client).then(function(e){t.setWalletConnectClient(t.walletConnect.client,e)}).catch(function(e){})},[]);var b=function(){c(o)},v=function(){return xl.jsxs("div",{className:"bluxcc:my-1 bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:[xl.jsx("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:z-10",style:{borderTop:"".concat(l.borderWidth," dashed ").concat(l.borderColor)}}),xl.jsx("span",{className:"bluxcc:z-20 bluxcc:w-auto bluxcc:px-2 bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",style:{background:l.background,color:l.borderColor},children:e("or")})]})};return xl.jsxs("div",{className:"bluxcc:w-full",children:[l.logo&&xl.jsx("div",{className:"bluxcc:my-6 bluxcc:flex bluxcc:max-h-20 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:xl.jsx("img",{src:l.logo,alt:s.appName,width:152,height:60,className:"bluxcc:max-h-[80px] bluxcc:max-w-[180px] bluxcc:select-none",loading:"eager",decoding:"async",draggable:"false",style:{contentVisibility:"auto"}})}),xl.jsx("div",{className:"",children:y.map(function(r,o){var s=y[o+1],a=y[o-1],c=y.includes("wallet"),f=c&&!t.showAllWallets&&"wallet"===r&&"email"===s||c&&"email"===r&&"wallet"!==a;return"wallet"===r?xl.jsx(Y.Fragment,{children:xl.jsxs("div",{className:"bluxcc:max-h-[324px] bluxcc:space-y-2 bluxcc:overflow-y-auto overflowStyle",children:[m.map(function(e){return xl.jsx(hf,n({},e,{label:e.name,startIcon:_f(e.name,Iu(l.background)),onClick:function(){return r=e,d(void 0,void 0,void 0,function(){return h(this,function(e){return r.name===oe.WalletConnect?t.setRoute(se.WALLET_CONNECT):zf(t,r),[2]})});var r}}),e.name)}),g.length>0&&!t.showAllWallets&&xl.jsx(hf,{endArrow:!0,label:e("allStellarWallets"),startIcon:xl.jsx(kf,{fill:xu(l.background)}),onClick:function(){u(!0)}}),f&&v()]})},"wallet"):t.showAllWallets||"email"!==r?t.showAllWallets||"passkey"!==r?null:xl.jsx("button",{className:"bluxcc:mt-6! bluxcc:bg-transparent bluxcc:flex bluxcc:h-4 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:leading-7 bluxcc:font-medium",style:{color:l.accentColor,fontFamily:l.fontFamily},children:e("logInWithPasskey")},"passkey"):xl.jsx(Y.Fragment,{children:xl.jsxs(xl.Fragment,{children:[xl.jsx(hf,{inputType:"email",variant:"input",startIcon:xl.jsx(Vl,{fill:l.textColor}),onChange:function(e){return i(e)},onEnter:b,onSubmit:b}),f&&v()]})},"email")})}),xl.jsx("footer",{className:"bluxcc:w-full bluxcc:pt-[17px] bluxcc:text-center bluxcc:text-xs bluxcc:font-medium",children:xl.jsx("a",{"aria-label":"blux website",href:"https://blux.cc",target:"_blank",rel:"noreferrer",className:"bluxcc:no-underline",style:{color:l.textColor,font:l.fontFamily},children:e("poweredByBlux")})})]})},xL=Object.defineProperty,SL=Object.getOwnPropertySymbols,EL=Object.prototype.hasOwnProperty,AL=Object.prototype.propertyIsEnumerable,kL=(e,t,r)=>t in e?xL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OL=(e,t)=>{for(var r in t||(t={}))EL.call(t,r)&&kL(e,r,t[r]);if(SL)for(var r of SL(t))AL.call(t,r)&&kL(e,r,t[r]);return e},TL=(e,t)=>{var r={};for(var n in e)EL.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&SL)for(var n of SL(e))t.indexOf(n)<0&&AL.call(e,n)&&(r[n]=e[n]);return r};(e=>{const t=class t{constructor(e,r,n,i){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(n);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const r=this.getPenaltyScore();r<e&&(i=t,e=r),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(r,n){const o=e.QrSegment.makeSegments(r);return t.encodeSegments(o,n)}static encodeBinary(r,n){const o=e.QrSegment.makeBytes(r);return t.encodeSegments([o],n)}static encodeSegments(e,n,i=1,a=40,c=-1,u=!0){if(!(t.MIN_VERSION<=i&&i<=a&&a<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let l,f;for(l=i;;l++){const r=8*t.getNumDataCodewords(l,n),o=s.getTotalBits(e,l);if(o<=r){f=o;break}if(l>=a)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])u&&f<=8*t.getNumDataCodewords(l,e)&&(n=e);let d=[];for(const t of e){r(t.mode.modeBits,4,d),r(t.numChars,t.mode.numCharCountBits(l),d);for(const e of t.getData())d.push(e)}o(d.length==f);const h=8*t.getNumDataCodewords(l,n);o(d.length<=h),r(0,Math.min(4,h-d.length),d),r(0,(8-d.length%8)%8,d),o(d.length%8==0);for(let e=236;d.length<h;e^=253)r(e,8,d);let p=[];for(;8*p.length<d.length;)p.push(0);return d.forEach((e,t)=>p[t>>>3]|=e<<7-(7&t)),new t(l,n,p,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let r=0;r<t;r++)for(let n=0;n<t;n++)0==r&&0==n||0==r&&n==t-1||r==t-1&&0==n||this.drawAlignmentPattern(e[r],e[n]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let r=t;for(let e=0;e<10;e++)r=r<<1^1335*(r>>>9);const i=21522^(t<<10|r);o(i>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,n(i,e));this.setFunctionModule(8,7,n(i,6)),this.setFunctionModule(8,8,n(i,7)),this.setFunctionModule(7,8,n(i,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,n(i,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,n(i,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,n(i,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const r=n(t,e),o=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(o,i,r),this.setFunctionModule(i,o,r)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let n=-4;n<=4;n++){const o=Math.max(Math.abs(n),Math.abs(r)),i=e+n,s=t+r;0<=i&&i<this.size&&0<=s&&s<this.size&&this.setFunctionModule(i,s,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)this.setFunctionModule(e+n,t+r,1!=Math.max(Math.abs(n),Math.abs(r)))}setFunctionModule(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0}addEccAndInterleave(e){const r=this.version,n=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(r,n))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][r],s=t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][r],a=Math.floor(t.getNumRawDataModules(r)/8),c=i-a%i,u=Math.floor(a/i);let l=[];const f=t.reedSolomonComputeDivisor(s);for(let r=0,n=0;r<i;r++){let o=e.slice(n,n+u-s+(r<c?0:1));n+=o.length;const i=t.reedSolomonComputeRemainder(o,f);r<c&&o.push(0),l.push(o.concat(i))}let d=[];for(let e=0;e<l[0].length;e++)l.forEach((t,r)=>{(e!=u-s||r>=c)&&d.push(t[e])});return o(d.length==a),d}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let o=0;o<this.size;o++)for(let i=0;i<2;i++){const s=t-i,a=!(t+1&2)?this.size-1-o:o;!this.isFunction[a][s]&&r<8*e.length&&(this.modules[a][s]=n(e[r>>>3],7-(7&r)),r++)}}o(r==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let r=0;r<this.size;r++){let n;switch(e){case 0:n=(r+t)%2==0;break;case 1:n=t%2==0;break;case 2:n=r%3==0;break;case 3:n=(r+t)%3==0;break;case 4:n=(Math.floor(r/3)+Math.floor(t/2))%2==0;break;case 5:n=r*t%2+r*t%3==0;break;case 6:n=(r*t%2+r*t%3)%2==0;break;case 7:n=((r+t)%2+r*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][r]&&n&&(this.modules[t][r]=!this.modules[t][r])}}getPenaltyScore(){let e=0;for(let r=0;r<this.size;r++){let n=!1,o=0,i=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[r][s]==n?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),n||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),n=this.modules[r][s],o=1);e+=this.finderPenaltyTerminateAndCount(n,o,i)*t.PENALTY_N3}for(let r=0;r<this.size;r++){let n=!1,o=0,i=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][r]==n?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),n||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),n=this.modules[s][r],o=1);e+=this.finderPenaltyTerminateAndCount(n,o,i)*t.PENALTY_N3}for(let r=0;r<this.size-1;r++)for(let n=0;n<this.size-1;n++){const o=this.modules[r][n];o==this.modules[r][n+1]&&o==this.modules[r+1][n]&&o==this.modules[r+1][n+1]&&(e+=t.PENALTY_N2)}let r=0;for(const e of this.modules)r=e.reduce((e,t)=>e+(t?1:0),r);const n=this.size*this.size,i=Math.ceil(Math.abs(20*r-10*n)/n)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let r=[6];for(let n=this.size-7;r.length<e;n-=t)r.splice(1,0,n);return r}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return o(208<=r&&r<=29648),r}static getNumDataCodewords(e,r){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let r=[];for(let t=0;t<e-1;t++)r.push(0);r.push(1);let n=1;for(let o=0;o<e;o++){for(let e=0;e<r.length;e++)r[e]=t.reedSolomonMultiply(r[e],n),e+1<r.length&&(r[e]^=r[e+1]);n=t.reedSolomonMultiply(n,2)}return r}static reedSolomonComputeRemainder(e,r){let n=r.map(e=>0);for(const o of e){const e=o^n.shift();n.push(0),r.forEach((r,o)=>n[o]^=t.reedSolomonMultiply(r,e))}return n}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^285*(r>>>7),r^=(t>>>n&1)*e;return o(r>>>8==0),r}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const r=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(r&&e[0]>=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};function r(e,t,r){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let n=t-1;n>=0;n--)r.push(e>>>n&1)}function n(e,t){return!!(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;const i=class e{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let n=[];for(const e of t)r(e,8,n);return new e(e.Mode.BYTE,t.length,n)}static makeNumeric(t){if(!e.isNumeric(t))throw new RangeError("String contains non-numeric characters");let n=[];for(let e=0;e<t.length;){const o=Math.min(t.length-e,3);r(parseInt(t.substring(e,e+o),10),3*o+1,n),e+=o}return new e(e.Mode.NUMERIC,t.length,n)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let n,o=[];for(n=0;n+2<=t.length;n+=2){let i=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n));i+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n+1)),r(i,11,o)}return n<t.length&&r(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n)),6,o),new e(e.Mode.ALPHANUMERIC,t.length,o)}static makeSegments(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let n=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)r(t,8,n);else if(t<16384)r(2,2,n),r(t,14,n);else{if(!(t<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,n),r(t,21,n)}return new e(e.Mode.ECI,0,n)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let r=0;for(const n of e){const e=n.mode.numCharCountBits(t);if(n.numChars>=1<<e)return 1/0;r+=4+e+n.bitData.length}return r}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let r=0;r<e.length;r++)"%"!=e.charAt(r)?t.push(e.charCodeAt(r)):(t.push(parseInt(e.substring(r+1,r+3),16)),r+=2);return t}};i.NUMERIC_REGEX=/^[0-9]*$/,i.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,i.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let s=i;e.QrSegment=i})(gL||(gL={})),(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})((mL=gL||(gL={})).QrCode||(mL.QrCode={})),(e=>{(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||(e.QrSegment={}))})(gL||(gL={}));var CL=gL,IL={L:CL.QrCode.Ecc.LOW,M:CL.QrCode.Ecc.MEDIUM,Q:CL.QrCode.Ecc.QUARTILE,H:CL.QrCode.Ecc.HIGH},_L=128,PL="L",RL="#FFFFFF",NL="#000000",BL=!1,jL=1;
38
38
  /**
39
39
  * @license qrcode.react
40
40
  * Copyright (c) Paul O'Shannessy
41
41
  * SPDX-License-Identifier: ISC
42
- */function ML(e,t=0){const r=[];return e.forEach(function(e,n){let o=null;e.forEach(function(i,s){if(!i&&null!==o)return r.push(`M${o+t} ${n+t}h${s-o}v1H${o+t}z`),void(o=null);if(s!==e.length-1)i&&null===o&&(o=s);else{if(!i)return;null===o?r.push(`M${s+t},${n+t} h1v1H${s+t}z`):r.push(`M${o+t},${n+t} h${s+1-o}v1H${o+t}z`)}})}),r.join("")}function LL(e,t){return e.slice().map((e,r)=>r<t.y||r>=t.y+t.h?e:e.map((e,r)=>(r<t.x||r>=t.x+t.w)&&e))}function UL({value:e,level:t,minVersion:r,includeMargin:n,marginSize:o,imageSettings:i,size:s,boostLevel:a}){let c=Y.useMemo(()=>{const n=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...CL.QrSegment.makeSegments(t)),e),[]);return CL.QrCode.encodeSegments(n,IL[t],r,void 0,void 0,a)},[e,t,r,a]);const{cells:u,margin:l,numCells:f,calculatedImageSettings:d}=Y.useMemo(()=>{let e=c.getModules();const t=function(e,t){return null!=t?Math.max(Math.floor(t),0):e?4:0}(n,o),r=e.length+2*t,a=function(e,t,r,n){if(null==n)return null;const o=e.length+2*r,i=Math.floor(.1*t),s=o/t,a=(n.width||i)*s,c=(n.height||i)*s,u=null==n.x?e.length/2-a/2:n.x*s,l=null==n.y?e.length/2-c/2:n.y*s,f=null==n.opacity?1:n.opacity;let d=null;if(n.excavate){let e=Math.floor(u),t=Math.floor(l);d={x:e,y:t,w:Math.ceil(a+u-e),h:Math.ceil(c+l-t)}}return{x:u,y:l,h:c,w:a,excavation:d,opacity:f,crossOrigin:n.crossOrigin}}(e,s,t,i);return{cells:e,margin:t,numCells:r,calculatedImageSettings:a}},[c,s,i,n,o]);return{qrcode:c,margin:l,cells:u,numCells:f,calculatedImageSettings:d}}var DL=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}(),FL=Y.forwardRef(function(e,t){const r=e,{value:n,size:o=_L,level:i=PL,bgColor:s=RL,fgColor:a=NL,includeMargin:c=BL,minVersion:u=jL,boostLevel:l,marginSize:f,imageSettings:d}=r,h=TL(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:p}=h,y=TL(h,["style"]),g=null==d?void 0:d.src,m=Y.useRef(null),b=Y.useRef(null),v=Y.useCallback(e=>{m.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t]),[w,x]=Y.useState(!1),{margin:S,cells:E,numCells:A,calculatedImageSettings:k}=UL({value:n,level:i,minVersion:u,boostLevel:l,includeMargin:c,marginSize:f,imageSettings:d,size:o});Y.useEffect(()=>{if(null!=m.current){const e=m.current,t=e.getContext("2d");if(!t)return;let r=E;const n=b.current,i=null!=k&&null!==n&&n.complete&&0!==n.naturalHeight&&0!==n.naturalWidth;i&&null!=k.excavation&&(r=LL(E,k.excavation));const c=window.devicePixelRatio||1;e.height=e.width=o*c;const u=o/A*c;t.scale(u,u),t.fillStyle=s,t.fillRect(0,0,A,A),t.fillStyle=a,DL?t.fill(new Path2D(ML(r,S))):E.forEach(function(e,r){e.forEach(function(e,n){e&&t.fillRect(n+S,r+S,1,1)})}),k&&(t.globalAlpha=k.opacity),i&&t.drawImage(n,k.x+S,k.y+S,k.w,k.h)}}),Y.useEffect(()=>{x(!1)},[g]);const O=OL({height:o,width:o},p);let T=null;return null!=g&&(T=Y.createElement("img",{src:g,key:g,style:{display:"none"},onLoad:()=>{x(!0)},ref:b,crossOrigin:null==k?void 0:k.crossOrigin})),Y.createElement(Y.Fragment,null,Y.createElement("canvas",OL({style:O,height:o,width:o,ref:v,role:"img"},y)),T)});FL.displayName="QRCodeCanvas";var zL=Y.forwardRef(function(e,t){const r=e,{value:n,size:o=_L,level:i=PL,bgColor:s=RL,fgColor:a=NL,includeMargin:c=BL,minVersion:u=jL,boostLevel:l,title:f,marginSize:d,imageSettings:h}=r,p=TL(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:y,cells:g,numCells:m,calculatedImageSettings:b}=UL({value:n,level:i,minVersion:u,boostLevel:l,includeMargin:c,marginSize:d,imageSettings:h,size:o});let v=g,w=null;null!=h&&null!=b&&(null!=b.excavation&&(v=LL(g,b.excavation)),w=Y.createElement("image",{href:h.src,height:b.h,width:b.w,x:b.x+y,y:b.y+y,preserveAspectRatio:"none",opacity:b.opacity,crossOrigin:b.crossOrigin}));const x=ML(v,y);return Y.createElement("svg",OL({height:o,width:o,viewBox:`0 0 ${m} ${m}`,ref:t,role:"img"},p),!!f&&Y.createElement("title",null,f),Y.createElement("path",{fill:s,d:`M0,0 h${m}v${m}H0z`,shapeRendering:"crispEdges"}),Y.createElement("path",{fill:a,d:x,shapeRendering:"crispEdges"}),w)});zL.displayName="QRCodeSVG";var qL=function(e){var t=e.value,r=e.title,i=void 0===r?"":r,s=e.size,a=void 0===s?184:s,c=e.bgColor,u=void 0===c?"#ffffff":c,l=e.fgColor,f=void 0===l?"#00020f":l,d=e.level,h=void 0===d?"Q":d,p=e.imgSize,y=void 0===p?51:p,g=o(e,["value","title","size","bgColor","fgColor","level","imgSize"]);return xl.jsx(FL,n({className:"bluxcc:z-10",value:t,title:i,size:a,bgColor:u,fgColor:f,level:h,marginSize:1,imageSettings:{src:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw8NDQ8NDQ0PDQ0PDw4NDw0NDQ8PDQ0NFREWFhURExUYHSggGBolGxUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDQ0OFQ4PFSsdExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAKwBJgMBIgACEQEDEQH/xAAXAAEBAQEAAAAAAAAAAAAAAAAAAQIH/8QAIRABAQABBAAHAAAAAAAAAAAAAAERAiFhgSIxQVFxsfD/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A7iAAACW8d+ygAAACSAoAAAAAAAAAAAAAAADOrVZZJptluLczwzFub9dtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmd/LtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLwoAAAAAQAAAAAAAAAAAAAAAAAABL+5UAAAAAAAAAAAEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAJYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAARQAAAAAAAAAAAAEwoAAAACSqAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAS59NvmZ2yoAAAAAAAAAAAAACAomFAAAAAAAABKoAAAAA//2Q==",x:void 0,y:void 0,height:y,width:y,opacity:1,excavate:!0}},g))},VL=function(e){var t=e.fill,r=void 0===t?"black":t,n=e.background,o=void 0===n?"transparent":n;return xl.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("rect",{width:"52",height:"52",fill:o}),xl.jsx("path",{d:"M41.0809 6.06641H6.16162V11.0858H41.0809V6.06641Z",fill:r}),xl.jsx("path",{d:"M11.0193 21.8516V6H6V21.8516V23.6323V28.6516V41.2032V46.2226V46.2387H11.0193V46.2226H41.0838V41.2032H11.0193V28.6516H41.0838V23.6323H11.0193V21.8516Z",fill:r}),xl.jsx("path",{d:"M46.0001 11.1621H41.1614V23.7428H46.0001V11.1621Z",fill:r}),xl.jsx("path",{d:"M46.0001 28.582H41.1614V41.1627H46.0001V28.582Z",fill:r})]})},HL=function(){var e,t=Al(),r=me(function(e){return e}),n=me(function(e){return e}).setAlert,o=r.config.appearance,i=null===(e=r.user)||void 0===e?void 0:e.address;return xl.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-[208px] bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:o.borderRadius,color:o.textColor,borderColor:o.borderColor,backgroundColor:o.fieldBackground,borderWidth:o.borderWidth},children:[xl.jsx(qL,{size:184,value:i,bgColor:o.fieldBackground,fgColor:o.accentColor,level:"Q"}),xl.jsx("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:o.background},children:xl.jsx(VL,{fill:o.accentColor,background:o.fieldBackground})})]}),xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:space-y-2 bluxcc:font-medium",children:[xl.jsx("p",{className:"bluxcc:text-lg",children:"Your Address"}),xl.jsx("div",{className:"bluxcc:w-full bluxcc:px-2.5 bluxcc:py-3 bluxcc:h-14",style:{borderRadius:o.borderRadius,color:o.textColor,borderColor:o.borderColor,backgroundColor:o.fieldBackground,borderWidth:o.borderWidth},children:xl.jsx("p",{className:"bluxcc:w-[292px] bluxcc:text-sm bluxcc:!leading-[16px] bluxcc:break-all",style:{color:Tu(o.textColor,.7)},children:i})})]}),xl.jsx(lf,{}),xl.jsx(gf,{size:"large",state:"enabled",variant:"tonal",style:{color:o.accentColor},onClick:function(){vu(i),n("info",t("address_copied")),setTimeout(function(){n("none","")},1e3)},endIcon:xl.jsx(Bl,{fill:o.accentColor}),children:t("copy_address")})]})},KL=function(){var e,t,r,n=Al(),o=me(function(e){return e}),i=(t=o.config.networks,r=Object.entries(du).filter(function(e){return t.includes(e[1])}).map(function(e){return bu(e[0])}),r);return xl.jsxs("div",{style:{font:o.config.appearance.fontFamily},className:"bluxcc:mt-4 bluxcc:mb-10 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[xl.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-[68px] bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:xl.jsx(Wl,{})}),xl.jsxs("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[xl.jsx("p",{className:"bluxcc:text-2xl",children:n("wrongNetwork")}),xl.jsx("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5 bluxcc:tracking-[-2%] bluxcc:mx-3",children:n("wrongNetworkMessage",{currentNetwork:bu(Au(null===(e=o.user)||void 0===e?void 0:e.walletPassphrase)),switchNetwork:i.join(" or ")})})]})]})},WL=function(e){var t,r=e.tabs,n=me(function(e){return e.config.appearance}),o=Q.useState(0),i=o[0],s=o[1];return xl.jsxs(xl.Fragment,{children:[xl.jsx("div",{className:"bluxcc:flex bluxcc:gap-3 bluxcc:py-3",children:r.map(function(e,t){var r=i===t;return xl.jsxs("button",{role:"tab",onClick:function(){return s(t)},"aria-label":e.label,id:"bluxcc-button","aria-selected":i===t,tabIndex:i===t?0:-1,className:"bluxcc:flex bluxcc:gap-2 bluxcc:h-20 bluxcc:w-24 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:px-7 bluxcc:py-4 bluxcc:text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{background:r?Tu(n.accentColor,.1):n.background,color:r?n.accentColor:n.textColor,borderRadius:n.borderRadius},children:[xl.jsx("span",{children:r?e.activeIcon:e.inActiveIcon}),xl.jsx("span",{children:e.label})]},t)})}),xl.jsx("div",{className:"bluxcc:max-h-[312px] bluxcc:h-[312px] w-full bluxcc:overflow-auto overflowStyle",role:"tabpanel","aria-labelledby":"tab-".concat(i),children:xl.jsx("div",{className:"bluxcc:absolute bluxcc:left-0 bluxcc:right-0 bluxcc:max-h-[312px] bluxcc:h-[312px] bluxcc:overflow-auto overflowStyle",children:null===(t=r[i])||void 0===t?void 0:t.content})})]})},GL=function(e){var t=e.assets,r=Q.useState(null),n=r[0],o=r[1],i=me(function(e){return e.config.appearance}),s=Al();return xl.jsxs("div",{className:"bluxcc:h-full bluxcc:w-full bluxcc:overflow-auto overflowStyle",children:[t.map(function(e,r){return xl.jsxs("button",{id:"bluxcc-button",onMouseEnter:function(){return o(r)},onMouseLeave:function(){return o(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:py-2 bluxcc:px-4",style:{background:n===r?i.fieldBackground:"transparent",color:i.textColor,borderBottomStyle:"dashed",borderBottomWidth:r<t.length-1?i.borderWidth:"0px",borderBottomColor:i.borderColor,transition:"all 0.2s ease-in-out",fontFamily:i.fontFamily},children:[xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[xl.jsx("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:i.borderRadius,background:i.fieldBackground,border:"".concat(i.borderWidth," solid ").concat(i.borderColor)},children:"native"===e.assetType?xl.jsx(kf,{fill:xu(i.fieldBackground)}):xl.jsx(of,{fill:xu(i.fieldBackground)})}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col",children:[xl.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.assetCode}),xl.jsx("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Tu(i.textColor,.7)},children:e.assetCode})]})]}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:text-right",children:[xl.jsx("span",{className:"bluxcc:font-medium",children:Cu(e.assetBalance)}),xl.jsxs("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Tu(i.textColor,.7)},children:[Cu(e.valueInCurrency||"0"),"$"]})]})]},e.assetType+e.assetIssuer)}),0===t.length&&xl.jsx("div",{style:{color:Tu(i.textColor,.7)},className:"bluxcc:mb-2 bluxcc:text-center bluxcc:h-full bluxcc:flex bluxcc:justify-center bluxcc:items-center",children:s("noAssetsFound")})]})},XL=function(){var e=Al(),t=me(function(e){return e.config.appearance}),r=me(function(e){return e.balances}),o=r.loading,i=r.error,s=r.balances.map(function(e){return n(n({},mu(e)),{logo:xl.jsx(kf,{})})}),a=[{label:e("assets"),activeIcon:xl.jsx(Yl,{fill:t.accentColor}),inActiveIcon:xl.jsx(Yl,{fill:t.textColor}),content:xl.jsx(GL,{assets:s})}];return o?"Loading":i?"Error, try again.":xl.jsx(WL,{tabs:a})},ZL=Y.memo(function(e){var t,r,n,o,i,s=e.tx,a=me(function(e){return e}),c=a.config.appearance,u=Su((null===(t=a.stellar)||void 0===t?void 0:t.activeNetwork)||"",a.config.explorer,"transactionUrl",s.hash);return xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-start bluxcc:gap-3",children:[xl.jsx("div",{className:"bluxcc:flex bluxcc:size-10 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",style:{background:c.background},children:function(e){switch(e){case"Receive":return xl.jsx(zl,{});case"Send":return xl.jsx(Dl,{});default:return xl.jsx(Fl,{})}}(s.title)}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start",children:[xl.jsx("p",{className:"bluxcc:text-start bluxcc:text-xs bluxcc:font-medium",style:{color:c.textColor},children:s.title}),xl.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium",children:s.description})]})]}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:text-xs",style:{color:Tu(c.textColor,.6)},children:[(r=s.date,n=new Date(r),o=n.getUTCDate(),i=n.toLocaleString("en-US",{month:"short"}),"".concat(o," ").concat(i)),xl.jsx("button",{id:"bluxcc-button",className:"bluxcc:flex bluxcc:size-8 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",title:"View transaction details",onClick:function(){u&&window.open(u,"_blank","noopener,noreferrer")},style:{background:c.fieldBackground},children:xl.jsx("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:xl.jsx(ql,{})})})]})]})}),QL=function(e){return"native"===e.asset_type?"XLM":e.asset_code||"Pool"},YL=function(){var e,t,r=Al(),n=me(function(e){return e}),o=me(function(e){return e.transactions}),i=o.loading,s=o.transactions,a=Q.useState([]),c=a[0],u=a[1],l=n.config.appearance,f=null===(e=n.user)||void 0===e?void 0:e.address,d=Su(null===(t=n.stellar)||void 0===t?void 0:t.activeNetwork,n.config.explorer,"accountUrl",f);Q.useEffect(function(){if(s){for(var e=[],t=0,n=s;t<n.length;t++){var o=n[t],i=o.operations[0],a={hash:o.hash,description:"",date:o.created_at,title:Ru(i.type)};if(o.operations.length>1)a.title=r("multiOperation");else if("payment"===i.type){var c=r("send");i.to.toLowerCase()===f.toLowerCase()&&(c=r("receive")),a.title=c,a.description="".concat(Cu(i.amount)," ").concat(QL(i))}else i.type!==ae.Horizon.HorizonApi.OperationResponseType.pathPaymentStrictSend&&i.type!==ae.Horizon.HorizonApi.OperationResponseType.pathPayment||(a.title=r("swap"),a.description="Received ".concat(QL(i)));e.push(a)}u(e)}},[s]);var h=!i&&0===c.length;return xl.jsxs("div",{className:"bluxcc:flex bluxcc:h-[355px] bluxcc:flex-col",children:[i?xl.jsx("div",{style:{color:Tu(l.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:r("loadingActivity")}):h?xl.jsx("div",{style:{color:Tu(l.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:r("noActivityFound")}):c.map(function(e,t){return xl.jsx("div",{style:{borderBottomStyle:"dashed",borderBottomWidth:t<c.length-1?l.borderWidth:"0px",borderBottomColor:l.borderColor},className:"bluxcc:p-2",children:xl.jsx(ZL,{tx:e})},t)}),c.length>0&&d&&xl.jsx("div",{className:"bluxcc:absolute bluxcc:bottom-4 bluxcc:left-1/2 bluxcc:!mt-4 bluxcc:w-[calc(100%-3rem)] bluxcc:-translate-x-1/2 bluxcc:transform",children:xl.jsx(gf,{state:"enabled",variant:"outline",size:"medium",onClick:function(){d&&window.open(d,"_blank","noopener,noreferrer")},children:r("seeAllInExplorer")})})]})},JL=function(e){var t=e.operationsCount,r=e.sender,n=e.receiver,o=e.network,i=e.estimatedFee,s=e.action,a=me(function(e){return e.config.appearance}),c=me(function(e){return e}).setAlert,u=[{label:"Action",value:bu(s)},{label:"Operations",value:t.toString()},{label:"Sender",value:Pu(r,5),isHighlighted:!0,isCopyable:!0,copyValue:r},{label:"Network",value:hu[o].name},{label:"Estimated Fee",value:"".concat(i," XLM")}];return n&&u.splice(3,0,{label:"To",value:Pu(n,5),isHighlighted:!0,isCopyable:!0,copyValue:n}),xl.jsx("div",{className:"bluxcc:w-full bluxcc:text-sm bluxcc:text-gray-800",children:u.map(function(e,t){var r=e.label,n=e.value,o=e.isHighlighted,i=e.isCopyable,s=e.copyValue;return xl.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:px-4 bluxcc:py-2",style:t===u.length-1?{}:{borderBottomColor:a.borderColor,borderBottomStyle:"dashed",borderBottomWidth:a.borderWidth},children:[xl.jsx("span",{style:{color:a.textColor},children:r}),i?xl.jsx("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent",style:{color:o?a.accentColor:a.textColor},onClick:function(){return s&&(vu(s),c("info","Address Copied"),void setTimeout(function(){c("none","")},1e3))},children:n}):xl.jsx("span",{style:{color:o?a.accentColor:a.textColor},children:n})]},t)})})},$L=function(e){return d(void 0,void 0,void 0,function(){var t,r,o;return h(this,function(i){switch(i.label){case 0:if(!(t=e.sendTransaction))return e.setRoute(se.FAILED),[2];e.setRoute(se.WAITING),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,$u(t.wallet,t.xdr,null===(o=e.user)||void 0===o?void 0:o.address,t.options.network,e.config.transports||{})];case 2:return r=i.sent(),e.setSendTransaction(n(n({},t),{result:r}),!0,se.WAITING),setTimeout(function(){e.setRoute(se.SUCCESSFUL)},400),[3,4];case 3:return i.sent(),setTimeout(function(){e.setRoute(se.FAILED)},200),[3,4];case 4:return[2]}})})},eU=function(){var e,t=Al(),r=me(function(e){return e}),n=r.config.appearance,o=r.user,i=r.stellar,s=r.sendTransaction;if(!s||!o||!i)return xl.jsx("div",{children:xl.jsx("p",{children:t("invalidXdr")})});var a=s.xdr,c=s.options,u=Xu(a,c.network);if(!u)return xl.jsx("div",{children:xl.jsx("p",{children:t("invalidXdr")})});var l,f,p=0===r.balances.balances.length?"0":r.balances.balances.find(function(e){return"native"===e.asset_type}).balance,y=o.authValue===oe.Lobstr,g=(l=i.activeNetwork,f=Object.entries(du).find(function(e){return e[1]===l}),f?f[0].toUpperCase():"MAINNET");return xl.jsxs("div",{className:"bluxcc:w-full",children:[xl.jsxs("p",{className:"bluxcc:mx-3 bluxcc:my-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[xl.jsxs("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[r.config.appName," "]}),t("signTransactionPrompt")]}),xl.jsx(JL,{operationsCount:u.operations,sender:u.sender,receiver:u.receiver,network:c.network,estimatedFee:u.estimatedFee.toString(),action:u.action}),y&&xl.jsx("p",{className:"bluxcc:!my-2 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:!text-xs bluxcc:text-alert-error",children:t("lobstrWarning",{network:g})}),xl.jsxs("div",{className:"bluxcc:inline-flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{marginTop:y?"0px":"16px",borderRadius:n.borderRadius,borderColor:n.borderColor},children:[xl.jsxs("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:[xl.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:t("yourWallet")}),xl.jsx("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(Tu(n.textColor,.8))},children:o.address?Pu(null===(e=r.user)||void 0===e?void 0:e.address,5):t("noAddressFound")})]}),xl.jsx("div",{className:"bluxcc:overflow-hidden bluxcc:px-[10px] bluxcc:py-2",style:{borderRadius:n.borderRadius,backgroundColor:n.fieldBackground,color:n.textColor},children:xl.jsxs("p",{className:"bluxcc:max-w-[90px] bluxcc:text-xs bluxcc:font-normal",children:[p?Cu(p):"0"," XLM"]})})]}),xl.jsx(lf,{}),xl.jsx(gf,{size:"large",state:"enabled",variant:"fill",onClick:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return $L(r),[2]})})},children:t("approve")})]})},tU=function(){var e=Al(),t=me(function(e){return e.config.appearance}),r={logo:xl.jsx(kf,{}),assetBalance:.43332,valueInCurrency:203},n=[{label:e("network"),value:"Stellar",link:!0},{label:e("address"),value:"GFGE...MKLW",copyable:!0},{label:e("market_cap"),value:"2.45M"},{label:e("total_volume"),value:323},{label:e("all_time_high"),value:323}];return xl.jsxs("div",{children:[xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:my-4",children:[xl.jsx("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:t.borderColor,borderWidth:t.borderWidth},children:r.logo}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col",children:[xl.jsxs("span",{className:"bluxcc:text-2xl bluxcc:font-medium",style:{color:t.accentColor},children:["$",Cu(r.valueInCurrency)]}),xl.jsxs("span",{className:"bluxcc:text-sm bluxcc:font-medium",style:{color:Tu(t.textColor,.7)},children:[Cu(r.assetBalance)," XLM"]})]})]}),xl.jsx("div",{className:"bluxcc:space-y-1",children:n.map(function(e,r){return xl.jsxs("div",{className:"bluxcc:flex bluxcc:font-medium bluxcc:items-center bluxcc:justify-between bluxcc:text-xs bluxcc:h-8 bluxcc:px-4",style:{borderBottom:r<n.length-1?"".concat(t.borderWidth," dashed ").concat(t.borderColor):"none"},children:[xl.jsx("span",{children:e.label}),xl.jsxs("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1 bluxcc:text-xs",style:{color:e.copyable||e.link?t.accentColor:Tu(t.textColor,.7)},children:[e.link?xl.jsx("a",{href:"#",target:"_blank",rel:"noreferrer",style:{color:t.accentColor},className:"bluxcc:no-underline",children:e.value}):e.value,e.copyable&&xl.jsx(Nl,{fill:t.accentColor})]})]},r)})})]})},rU={purple:{id:"purple_gradient",colors:[[.992,.878,1],[.992,.878,1],[.592,.451,1],[.792,.663,1]]}},nU=function(e){var t,r=e.theme,n=void 0===r?"purple":r,o=e.className,i=void 0===o?"":o,s=e.children,a=e.animationSpeed,c=void 0===a?1:a,u=e.onClick,l=e.style,f=e.size,d=void 0===f?"100%":f,h=Q.useRef(null),p=Q.useRef(null);return Q.useEffect(function(){var e=h.current;if(e){var t=e.getContext("webgl");if(t){var r=e.getBoundingClientRect();e.width=r.width,e.height=r.height;var o=function(e,r){var n=t.createShader(r);return t.shaderSource(n,e),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS),n},i=t.createProgram(),s=o("\n attribute vec2 aPos;\n varying vec2 vUv;\n void main() {\n vUv = (aPos + 1.0) * 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n }\n ",t.VERTEX_SHADER),a=o("\n precision mediump float;\n uniform float uTime;\n uniform vec2 uResolution;\n uniform vec3 uColor1;\n uniform vec3 uColor2;\n uniform vec3 uColor3;\n uniform vec3 uColor4;\n varying vec2 vUv;\n\n float noise(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n float smoothNoise(vec2 st) {\n vec2 i=floor(st),f=fract(st);\n float a=noise(i);\n float b=noise(i+vec2(1.,0.));\n float c=noise(i+vec2(0.,1.));\n float d=noise(i+vec2(1.,1.));\n vec2 u=f*f*(3.-2.*f);\n return mix(a,b,u.x)+(c-a)*u.y*(1.-u.x)+(d-b)*u.x*u.y;\n }\n float fbm(vec2 st){\n float v=0.,a=0.7;\n for(int i=0;i<2;i++){\n v+=a*smoothNoise(st);\n st*=1.8;a*=0.4;\n }\n return v;\n }\n\n void main(){\n vec2 st=vUv;\n float time=uTime*0.12;\n vec2 center=vec2(0.5);\n vec2 fromCenter=st-center;\n float rot=time*0.3;\n float c=cos(rot),s=sin(rot);\n vec2 rotated=vec2(\n fromCenter.x*c-fromCenter.y*s,\n fromCenter.x*s+fromCenter.y*c\n )+center;\n\n vec2 pos=st;\n pos+=vec2(\n fbm(rotated*1.2+time*0.4)*0.08,\n fbm(rotated*1.2+time*0.5+50.0)*0.08\n );\n\n float mixX=clamp(pos.x+fbm(rotated*1.0+time*0.6)*0.25,0.,1.);\n float mixY=clamp(pos.y+fbm(rotated*1.0+time*0.7)*0.25,0.,1.);\n\n vec3 topColors=mix(uColor1,uColor2,smoothstep(0.1,0.9,mixX));\n vec3 bottomColors=mix(uColor3,uColor4,smoothstep(0.1,0.9,mixX));\n vec3 finalColor=mix(topColors,bottomColors,smoothstep(0.1,0.9,mixY));\n\n gl_FragColor=vec4(finalColor,1.0);\n }\n ",t.FRAGMENT_SHADER);t.attachShader(i,s),t.attachShader(i,a),t.linkProgram(i),t.useProgram(i);var u=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW);var l=t.getAttribLocation(i,"aPos");t.enableVertexAttribArray(l),t.vertexAttribPointer(l,2,t.FLOAT,!1,0,0);var f=t.getUniformLocation(i,"uTime"),d=t.getUniformLocation(i,"uResolution"),y=t.getUniformLocation(i,"uColor1"),g=t.getUniformLocation(i,"uColor2"),m=t.getUniformLocation(i,"uColor3"),b=t.getUniformLocation(i,"uColor4"),v=rU[n].colors;t.uniform2f(d,r.width,r.height),t.uniform3fv(y,v[0]),t.uniform3fv(g,v[1]),t.uniform3fv(m,v[2]),t.uniform3fv(b,v[3]);var w=0,x=function(){p.current=requestAnimationFrame(x),w+=.015*c,t.uniform1f(f,w),t.viewport(0,0,e.width,e.height),t.drawArrays(t.TRIANGLE_STRIP,0,4)};return x(),function(){p.current&&cancelAnimationFrame(p.current),t.deleteProgram(i),t.deleteBuffer(u)}}}},[n,c]),xl.jsxs("div",{onClick:u,className:"relative overflow-hidden ".concat(i),style:l,"data-gradient-id":(null===(t=rU[n])||void 0===t?void 0:t.id)||"unknown_gradient",children:[xl.jsx("canvas",{ref:h,className:"absolute inset-0 z-0",style:{width:d,height:d}}),s&&xl.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:s})]})},oU=function(){var e=Al(),t=me(function(e){return e.config.appearance}),r=[rf,ef,nf,tf];return xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:select-none bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:font-medium bluxcc:mt-4 bluxcc:mb-2",style:{color:t.textColor},children:[xl.jsx(nU,{theme:"purple",animationSpeed:3,style:{borderRadius:t.borderRadius},className:"bluxcc:size-[264px] bluxcc:mx-6 bluxcc:overflow-hidden bluxcc:flex bluxcc:items-center",children:xl.jsx("div",{className:"bluxcc:marquee_outer",children:xl.jsx("div",{className:"bluxcc:marquee_track bluxcc:gap-2.5",children:w(w(w(w([],r,!0),r,!0),r,!0),r,!0).map(function(e,r){return xl.jsx("div",{style:{borderRadius:"0px"!==t.borderRadius?"16px":"0px"},className:"bluxcc:size-[82px] bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:bg-primary-500",children:xl.jsx(e,{fill:"#fff"})},r)})})})}),xl.jsx("p",{className:"bluxcc:text-2xl bluxcc:mt-[26px] bluxcc:mb-2 bluxcc:px-6 ",children:e("wallet_infra")}),xl.jsx("p",{className:"bluxcc:text-sm text-center",children:e("blux_gateway")})]})},iU=function(){var e=Al(),t=Q.useState({address:""}),r=t[0],o=t[1],i=Q.useState({});i[0];var s,a=i[1],c={logo:xl.jsx(kf,{}),name:"xlm",valueInCurrency:203},u=me(function(e){return e.config.appearance});return xl.jsxs("div",{children:[xl.jsx(Mf,{autoFocus:!0,type:"text",label:e("enter_token_address"),placeholder:e("enter_address"),value:r.address,onChange:(s="address",function(e){o(function(t){var r;return n(n({},t),((r={})[s]=e.target.value,r))}),a(function(e){var t;return n(n({},e),((t={})[s]="",t))})}),onButtonClick:function(){},button:xl.jsx("span",{style:{color:u.accentColor},className:"bluxcc:flex bluxcc:justify-between",children:e("check")})}),xl.jsx("div",{className:"bluxcc:h-56 bluxcc:my-4",style:{borderRadius:u.borderRadius,border:"".concat(u.borderWidth," solid ").concat(u.borderColor)},children:xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",children:[xl.jsx("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:u.borderColor,borderWidth:u.borderWidth},children:c.logo}),c.name,xl.jsx("div",{className:"bluxcc:flex bluxcc:flex-col",children:xl.jsxs("span",{className:"bluxcc:text-2xl bluxcc:font-medium",style:{color:u.accentColor},children:["$",Cu(c.valueInCurrency)]})})]})}),xl.jsx(lf,{}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:gap-4",children:[xl.jsx(gf,{state:"disabled",variant:"outline",children:e("cancel")}),xl.jsx(gf,{state:"enabled",variant:"fill",size:"large",children:e("add_token")})]})]})},sU=function(e){return d(void 0,void 0,void 0,function(){var t,r,o;return h(this,function(i){switch(i.label){case 0:if(!(t=e.signMessage))return e.setRoute(se.FAILED),[2];e.setRoute(se.WAITING),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Gu(t.wallet,t.message,null===(o=e.user)||void 0===o?void 0:o.address,t.options.network)];case 2:return r=i.sent(),e.setSignMessage(n(n({},t),{result:r}),!0,se.WAITING),setTimeout(function(){e.setRoute(se.SUCCESSFUL)},400),[3,4];case 3:return i.sent(),setTimeout(function(){e.setRoute(se.FAILED)},200),[3,4];case 4:return[2]}})})},aU=function(){var e,t,r=Al(),n=me(function(e){return e}),o=n.config.appearance,i=n.signMessage;if(!i)return null;return xl.jsxs("div",{children:[xl.jsxs("div",{className:"bluxcc:p-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[xl.jsxs("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[n.config.appName," "]}),r("sign_permission")]}),xl.jsx("div",{className:"bluxcc:h-24 bluxcc:p-4 bluxcc:font-mono bluxcc:text-xs bluxcc:overflow-auto",style:{border:"".concat(o.borderWidth," solid ").concat(o.borderColor),borderRadius:o.borderRadius},children:i.message}),xl.jsxs("div",{className:"bluxcc:inline-flex bluxcc:mt-4 bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{borderRadius:o.borderRadius,borderColor:o.borderColor},children:[xl.jsx("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:xl.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:r("yourWallet")})}),xl.jsx("div",{className:"bluxcc:overflow-hidden bluxcc:px-[10px] bluxcc:py-2",style:{borderRadius:o.borderRadius,backgroundColor:o.fieldBackground,color:o.textColor},children:xl.jsx("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(Tu(o.textColor,.8))},children:(null===(e=n.user)||void 0===e?void 0:e.address)?Pu(null===(t=n.user)||void 0===t?void 0:t.address,5):r("noAddressFound")})})]}),xl.jsx(lf,{}),xl.jsx(gf,{size:"large",state:"enabled",variant:"fill",onClick:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return sU(n),[2]})})},children:r("approve")})]})},cU=function(){var e,t,r=Al(),n=me(function(e){return e});return xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[xl.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:xl.jsx(Kl,{})}),xl.jsxs("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[xl.jsx("p",{className:"bluxcc:text-xl",children:"login"===n.waitingStatus?r("loginFailed"):r("signingFailed",{walletName:null!==(t=null===(e=n.user)||void 0===e?void 0:e.authValue)&&void 0!==t?t:"wallet"})}),xl.jsx("p",{className:"bluxcc:text-sm",children:"login"===n.waitingStatus?r("loginRetryMessage"):r("signingRetryMessage")})]}),xl.jsx(lf,{}),xl.jsx(gf,{onClick:function(){var e;"signMessage"===n.waitingStatus?sU(n):"sendTransaction"===n.waitingStatus?$L(n):"login"===n.waitingStatus&&zf(n,fu[(null===(e=n.user)||void 0===e?void 0:e.authValue)||"Rabet"])},state:"enabled",variant:"outline",children:r("tryAgain")})]})},uU=function(){var e=Al(),t=me(function(e){return e}),r=t.config.appearance;Q.useEffect(function(){d(void 0,void 0,void 0,function(){return h(this,function(e){return zf(t,fu[oe.WalletConnect]),[2]})})},[]);if(!t.walletConnect)return null;if(!t.walletConnect.connection||!t.walletConnect.client)return null;var n=t.walletConnect.connection.uri;return xl.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-[208px] bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:r.borderRadius,color:r.textColor,borderColor:r.borderColor,backgroundColor:r.fieldBackground,borderWidth:r.borderWidth},children:[xl.jsx(qL,{size:184,value:n,bgColor:r.fieldBackground,fgColor:r.accentColor,level:"Q",imgSize:40}),xl.jsx("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:r.background},children:xl.jsx(Tf,{fill:r.accentColor,background:r.fieldBackground})})]}),xl.jsx("div",{className:"bluxcc:mt-4 bluxcc:font-medium",children:xl.jsx("p",{className:"bluxcc:text-lg",children:"Scan this QR code with your phone"})}),xl.jsx(lf,{}),xl.jsx(gf,{size:"large",state:"enabled",variant:"tonal",style:{color:r.accentColor},onClick:function(){return function(r){vu(r),t.setAlert("info",e("address_copied")),setTimeout(function(){t.setAlert("none","")},1e3)}(n)},children:"Copy URI"})]})},lU=function(){var e,t=Al(),r=Q.useState(!1),o=r[0],i=r[1],s=Q.useState(""),a=s[0],c=s[1],u=me(function(e){return e}),l=Q.useState(null),f=l[0],d=l[1],h=u.config.appearance,p=u.balances.balances.filter(function(e){return"liquidity_pool_shares"!==e.asset_type}).filter(function(e){return"0.0000000"!==e.balance}).map(function(e){return"native"===e.asset_type?{assetIssuer:"",assetCode:"XLM",assetBalance:e.balance,assetType:e.asset_type}:{assetBalance:e.balance,assetCode:e.asset_code,assetType:e.asset_type,assetIssuer:e.asset_issuer}}),y=0!==(e=p).length?e:[te],g=function(){return o?h.accentColor:h.borderColor};return xl.jsxs("div",{className:"bluxcc:h-[360px] bluxcc:w-full",children:[xl.jsx("div",{children:xl.jsxs("div",{onFocus:function(){return i(!0)},onBlur:function(){return i(!1)},onMouseEnter:function(e){o||(e.currentTarget.style.borderColor=h.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){o||(e.currentTarget.style.borderColor=h.borderColor)},className:"bluxcc:flex bluxcc:h-14 bluxcc:items-center bluxcc:gap-2 bluxcc:p-4",style:{background:h.fieldBackground,borderWidth:h.borderWidth,"--tw-ring-color":g(),borderRadius:h.borderRadius,borderColor:g(),color:h.textColor},children:[xl.jsx(_l,{fill:h.textColor}),xl.jsx("input",{autoFocus:!0,type:"text",id:"bluxcc-input",placeholder:t("search"),value:a,onChange:function(e){return c(e.target.value)},className:"bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base",style:{color:h.textColor}})]})}),xl.jsxs("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:mt-4 bluxcc:gap-2 bluxcc:overflow-y-auto overflowStyle bluxcc:max-h-[300px]",children:[y.map(function(e,t){return xl.jsxs("button",{id:"bluxcc-button",onClick:function(){!function(e){var t,r="sendAsset";"swapTo"===u.selectAsset.field?r="swapToAsset":"swapFrom"===u.selectAsset.field&&(r="swapFromAsset"),u.setSelectAsset(n(n({},u.selectAsset),((t={})[r]=e,t)));var o=wu(u.selectAsset.field);u.setRoute(o)}(e)},onMouseEnter:function(){return d(t)},onMouseLeave:function(){return d(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:px-4 bluxcc:py-3",style:{background:f===t?h.fieldBackground:"transparent",color:h.textColor,borderBottomStyle:"dashed",borderBottomWidth:t<y.length-1?h.borderWidth:"0px",borderBottomColor:h.borderColor,transition:"all 0.2s ease-in-out",fontFamily:h.fontFamily},children:[xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[xl.jsx("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:h.borderRadius,background:h.fieldBackground,border:"".concat(h.borderWidth," solid ").concat(h.borderColor)},children:"native"===e.assetType?xl.jsx(kf,{fill:xu(h.fieldBackground)}):xl.jsx(of,{fill:xu(h.fieldBackground)})}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col",children:[xl.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.assetCode}),xl.jsx("span",{className:"bluxcc:text-xs",style:{color:Tu(h.textColor,.7)},children:e.assetCode})]})]}),xl.jsx("span",{className:"bluxcc:font-medium",children:Cu(e.assetBalance)})]},e.assetType+e.assetIssuer)}),0===y.length&&xl.jsx("div",{style:{color:h.textColor},className:"bluxcc:mt-2 bluxcc:text-center",children:t("noAssetsFound")})]})]})},fU=function(){var e=me(function(e){return e}),t=function(){var e,t,r=me(function(e){return e}),n=Q.useState({error:null,loading:!0,balances:[]}),o=n[0],i=n[1],s=null===(e=r.user)||void 0===e?void 0:e.address;return Q.useEffect(function(){i({error:null,loading:!0,balances:[]}),qu({address:s}).then(function(e){i({error:null,loading:!1,balances:e})}).catch(function(e){i({error:e,loading:!1,balances:[]})})},[s,null===(t=r.stellar)||void 0===t?void 0:t.servers]),o}(),r=function(){var e,t,r=me(function(e){return e}),o=Q.useState({error:null,loading:!0,transactions:[]}),i=o[0],s=o[1],a=null===(e=r.user)||void 0===e?void 0:e.address;return Q.useEffect(function(){s({error:null,loading:!0,transactions:[]}),Ku({limit:5,order:"desc",forAccount:a}).then(function(e){for(var t=e.response,r=[],o=0,i=t.records;o<i.length;o++){var a=i[o];r.push(a.operations())}Promise.all(r).then(function(e){var r=t.records.map(function(t,r){return n(n({},t),{operations:e[r].records})});s({error:null,loading:!1,transactions:r})})}).catch(function(e){s({error:e,loading:!1,transactions:[]})})},[a,null===(t=r.stellar)||void 0===t?void 0:t.servers]),i}(),o=function(){e.setBalances(t),e.setTransactions(r),i()},i=function(){var r=t.balances,o=r.find(function(e){return"native"===e.asset_type});if(e.modal.route!==se.SEND&&e.modal.route!==se.SWAP&&e.modal.route!==se.SELECT_ASSET&&0!==r.length&&o){var i=mu(o);r.length>1&&(i=mu(r[1])),e.setSelectAsset(n(n({},e.selectAsset),{swapToAsset:i,sendAsset:mu(o),swapFromAsset:mu(o)}))}};Q.useEffect(function(){o();var e=setInterval(function(){o()},1e4);return function(){clearInterval(e)}},[t,r,e.modal.route])},dU=function(){var e,t,r;fU();var n=me(function(e){return e});!function(e){var t,r,n=Q.useState(!1),o=n[0],i=n[1];Q.useEffect(function(){var t=setInterval(function(){var t;e.authState.isAuthenticated&&(null===(t=e.user)||void 0===t?void 0:t.authValue)&&"wallet"===e.user.authMethod?Ou(fu[e.user.authValue]).then(function(t){var r;t&&e.config.networks.includes(t)&&(null===(r=e.stellar)||void 0===r?void 0:r.activeNetwork)!==t&&!e.networkSyncDisabled?Fu(t):t&&!e.config.networks.includes(t)?(e.setNetworkSyncDisabled(!1),i(!0)):i(!1)}).catch(function(){i(!1)}):i(!1)},1e3);return function(){clearInterval(t),i(!1)}},[e.authState.isAuthenticated,e.config.networks,null===(t=e.user)||void 0===t?void 0:t.authValue,null===(r=e.stellar)||void 0===r?void 0:r.activeNetwork]),Q.useEffect(function(){e.modal.isOpen?o||e.modal.route!==se.WRONG_NETWORK||e.closeModal():setTimeout(function(){o&&e.config.promptOnWrongNetwork?e.openModal(se.WRONG_NETWORK):e.closeModal()},300)},[o,e.modal.isOpen])}(n);var o=n.modal,i=n.closeModal,s=n.setShowAllWallets,a=o.route,c=function(){var e;return(e={})[se.ONBOARDING]={title:"logInOrSignUp",Component:xl.jsx(wL,{})},e[se.PROFILE]={title:"profile",Component:xl.jsx(pf,{})},e[se.WAITING]={title:"",Component:xl.jsx(Pf,{})},e[se.SUCCESSFUL]={title:"",Component:xl.jsx(Ff,{})},e[se.FAILED]={title:"",Component:xl.jsx(cU,{})},e[se.SEND_TRANSACTION]={title:"confirmation",Component:xl.jsx(eU,{})},e[se.SEND]={title:"send",Component:xl.jsx(Lf,{})},e[se.ACTIVITY]={title:"activity",Component:xl.jsx(YL,{})},e[se.RECEIVE]={title:"receive",Component:xl.jsx(HL,{})},e[se.SWAP]={title:"swap",Component:xl.jsx(Bf,{})},e[se.BALANCES]={title:"balances",Component:xl.jsx(XL,{})},e[se.BALANCE_DETAILS]={title:"",Component:xl.jsx(tU,{})},e[se.OTP]={title:"",Component:xl.jsx(Df,{})},e[se.WRONG_NETWORK]={title:"",Component:xl.jsx(KL,{})},e[se.ABOUT]={title:"whatIsBlux",Component:xl.jsx(oU,{})},e[se.ADD_TOKEN]={title:"addToken",Component:xl.jsx(iU,{})},e[se.SIGN_MESSAGE]={title:"signMessage",Component:xl.jsx(aU,{})},e[se.SELECT_ASSET]={title:"selectAsset",Component:xl.jsx(lU,{})},e[se.WALLET_CONNECT]={title:"walletConnect",Component:xl.jsx(uU,{})},e}()[a],u=a===se.WRONG_NETWORK,l=a===se.WAITING,f=a===se.SUCCESSFUL,d=a===se.SIGN_MESSAGE||a===se.SEND_TRANSACTION||a===se.FAILED,h=a===se.WRONG_NETWORK||l||f,p=l&&"sendTransaction"!==n.waitingStatus||a===se.ONBOARDING&&n.showAllWallets||[se.ACTIVITY,se.SEND,se.OTP,se.BALANCES,se.RECEIVE,se.SWAP,se.BALANCE_DETAILS,se.ABOUT,se.ADD_TOKEN,se.WALLET_CONNECT].includes(a)?"back":a===se.ONBOARDING?"info":void 0,y=n.modal.dynamicTitle||c.title,g=function(){if(!u){i(),s(!1);var e=n.waitingStatus,t="signMessage"===e;if(t||"sendTransaction"===e){var r=t?n.signMessage:n.sendTransaction;if(r){var o=r.resolver,a=r.rejecter,c=r.result;f&&o&&c?(o(c),setTimeout(function(){n.cleanUp(e)},200)):d&&a&&(a("User rejected the transaction"),setTimeout(function(){n.cleanUp(e)},200))}}}};return Q.useEffect(function(){n.authState.isAuthenticated||(n.signMessage&&(n.cleanUp("signMessage"),n.signMessage.rejecter("User logged out during the process.")),n.sendTransaction&&(n.cleanUp("sendTransaction"),n.sendTransaction.rejecter("User logged out during the process.")))},[n.authState]),Q.useEffect(function(){var e,t,r,o=ku((null===(e=n.stellar)||void 0===e?void 0:e.activeNetwork)||"",null!==(t=n.config.transports)&&void 0!==t?t:{}),i=o.horizon,s=o.soroban;n.setStellar({activeNetwork:(null===(r=n.stellar)||void 0===r?void 0:r.activeNetwork)||"",servers:{horizon:new ae.Horizon.Server(i),soroban:new ae.rpc.Server(s)}})},[n.config.transports,n.config.networks,null===(e=n.stellar)||void 0===e?void 0:e.activeNetwork]),xl.jsxs(El,{isOpen:o.isOpen,isSticky:u||n.config.isPersistent,onClose:g,isPersistent:null!==(t=n.config.isPersistent)&&void 0!==t&&t,appearance:n.config.appearance,children:[xl.jsx(uf,{icon:p,onBack:function(){if(a===se.WAITING||a===se.OTP&&!n.authState.isAuthenticated||a===se.ABOUT||a===se.WALLET_CONNECT)n.setRoute(se.ONBOARDING);else if(n.showAllWallets)s(!1);else if([se.SEND,se.ACTIVITY,se.BALANCES,se.RECEIVE,se.SWAP].includes(a))n.setRoute(se.PROFILE);else if([se.BALANCE_DETAILS,se.ADD_TOKEN].includes(a))n.setRoute(se.BALANCES);else if(a===se.SELECT_ASSET){var e=wu(n.selectAsset.field);n.setRoute(e)}},onInfo:function(){n.setRoute(se.ABOUT)},onClose:g,title:y,closeButton:!h,isPersistent:null!==(r=n.config.isPersistent)&&void 0!==r&&r}),c.Component]})};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('/*! tailwindcss v4.1.13 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--bluxcc-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bluxcc-color-gray-800:#333;--bluxcc-color-white:#fff;--bluxcc-spacing:0.25rem;--bluxcc-text-xs:0.75rem;--bluxcc-text-xs--line-height:1.33333;--bluxcc-text-sm:0.875rem;--bluxcc-text-sm--line-height:1.42857;--bluxcc-text-base:1rem;--bluxcc-text-base--line-height:1.5;--bluxcc-text-lg:1.125rem;--bluxcc-text-lg--line-height:1.55556;--bluxcc-text-xl:1.25rem;--bluxcc-text-xl--line-height:1.4;--bluxcc-text-2xl:1.5rem;--bluxcc-text-2xl--line-height:1.33333;--bluxcc-font-weight-normal:400;--bluxcc-font-weight-medium:500;--bluxcc-font-weight-semibold:600;--bluxcc-animate-spin:spin 1s linear infinite;--bluxcc-default-transition-duration:150ms;--bluxcc-default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--bluxcc-color-primary-500:#0c1083;--bluxcc-color-light-red-50:#ffe5e5;--bluxcc-color-light-blue-50:#e5fbff;--bluxcc-color-alert-info:#5093ff;--bluxcc-color-alert-error:#ec2929;--bluxcc-color-alert-success:#00bd81;--bluxcc-color-alert-warning:#fa8f02}}@layer utilities{.bluxcc\\:absolute{position:absolute!important}.bluxcc\\:fixed{position:fixed!important}.bluxcc\\:relative{position:relative!important}.bluxcc\\:inset-0{inset:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:right-0{right:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-0{bottom:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-3{bottom:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:bottom-4{bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:left-0{left:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:left-1\\/2{left:50%!important}.bluxcc\\:z-10{z-index:10!important}.bluxcc\\:z-20{z-index:20!important}.bluxcc\\:z-40{z-index:40!important}.bluxcc\\:z-9999999{z-index:9999999!important}.bluxcc\\:mx-3{margin-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mx-6{margin-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:\\!my-2{margin-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:my-1{margin-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:my-2{margin-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:my-4{margin-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:my-6{margin-block:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:my-\\[5px\\]{margin-block:5px!important}.bluxcc\\:\\!mt-4{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-0{margin-top:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:mt-0\\.5{margin-top:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mt-1{margin-top:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mt-2{margin-top:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mt-3{margin-top:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mt-4,.bluxcc\\:mt-4\\!{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-6,.bluxcc\\:mt-6\\!{margin-top:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mt-\\[26px\\]{margin-top:26px!important}.bluxcc\\:\\!mr-2{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mr-1{margin-right:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mr-2{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-1{margin-bottom:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mb-2{margin-bottom:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-6{margin-bottom:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mb-10{margin-bottom:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:ml-1\\.5{margin-left:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:ml-4{margin-left:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:ml-auto{margin-left:auto!important}.bluxcc\\:box-border{box-sizing:border-box!important}.bluxcc\\:flex{display:flex!important}.bluxcc\\:inline-flex{display:inline-flex!important}.bluxcc\\:size-5{height:calc(var(--bluxcc-spacing)*5)!important;width:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:size-8{height:calc(var(--bluxcc-spacing)*8)!important;width:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:size-10{height:calc(var(--bluxcc-spacing)*10)!important;width:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:size-14{height:calc(var(--bluxcc-spacing)*14)!important;width:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:size-20{height:calc(var(--bluxcc-spacing)*20)!important;width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:size-24{height:calc(var(--bluxcc-spacing)*24)!important;width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:size-\\[64px\\]{height:64px!important;width:64px!important}.bluxcc\\:size-\\[68px\\]{height:68px!important;width:68px!important}.bluxcc\\:size-\\[82px\\]{height:82px!important;width:82px!important}.bluxcc\\:size-\\[208px\\]{height:208px!important;width:208px!important}.bluxcc\\:size-\\[264px\\]{height:264px!important;width:264px!important}.bluxcc\\:h-3\\.5{height:calc(var(--bluxcc-spacing)*3.5)!important}.bluxcc\\:h-4{height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:h-8{height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:h-10{height:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:h-12{height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:h-14,.bluxcc\\:h-14\\!{height:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:h-16{height:calc(var(--bluxcc-spacing)*16)!important}.bluxcc\\:h-20{height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:h-24{height:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:h-56{height:calc(var(--bluxcc-spacing)*56)!important}.bluxcc\\:h-\\[52px\\]{height:52px!important}.bluxcc\\:h-\\[312px\\]{height:312px!important}.bluxcc\\:h-\\[355px\\]{height:355px!important}.bluxcc\\:h-\\[360px\\]{height:360px!important}.bluxcc\\:h-full{height:100%!important}.bluxcc\\:max-h-12{max-height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:max-h-20{max-height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:max-h-\\[80px\\]{max-height:80px!important}.bluxcc\\:max-h-\\[300px\\]{max-height:300px!important}.bluxcc\\:max-h-\\[312px\\]{max-height:312px!important}.bluxcc\\:max-h-\\[324px\\]{max-height:324px!important}.bluxcc\\:w-12{width:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:w-20{width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:w-24{width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:w-\\[68px\\]\\!{width:68px!important}.bluxcc\\:w-\\[100px\\]{width:100px!important}.bluxcc\\:w-\\[292px\\]{width:292px!important}.bluxcc\\:w-\\[360px\\]\\!{width:360px!important}.bluxcc\\:w-\\[calc\\(100\\%-3rem\\)\\]{width:calc(100% - 3rem)!important}.bluxcc\\:w-auto{width:auto!important}.bluxcc\\:w-full{width:100%!important}.bluxcc\\:max-w-\\[90px\\]{max-width:90px!important}.bluxcc\\:max-w-\\[180px\\]{max-width:180px!important}.bluxcc\\:max-w-\\[184px\\]{max-width:184px!important}.bluxcc\\:flex-1{flex:1!important}.bluxcc\\:shrink-0{flex-shrink:0!important}.bluxcc\\:grow{flex-grow:1!important}.bluxcc\\:-translate-x-1\\/2{--tw-translate-x:-50%!important;translate:var(--tw-translate-x) var(--tw-translate-y)!important}.bluxcc\\:transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)!important}.bluxcc\\:animate-spin{animation:var(--bluxcc-animate-spin)!important}.bluxcc\\:flex-col{flex-direction:column!important}.bluxcc\\:items-center{align-items:center!important}.bluxcc\\:justify-between{justify-content:space-between!important}.bluxcc\\:justify-center{justify-content:center!important}.bluxcc\\:justify-start{justify-content:flex-start!important}.bluxcc\\:gap-1,.bluxcc\\:gap-1\\!{gap:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:gap-1\\.5{gap:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:gap-2{gap:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:gap-2\\.5{gap:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:gap-3{gap:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:gap-4{gap:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*1*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*1*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*2*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*2*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-x-3{:where(&>:not(:last-child)){--tw-space-x-reverse:0!important;margin-inline-end:calc(var(--bluxcc-spacing)*3*(1 - var(--tw-space-x-reverse)))!important;margin-inline-start:calc(var(--bluxcc-spacing)*3*var(--tw-space-x-reverse))!important}}.bluxcc\\:overflow-auto{overflow:auto!important}.bluxcc\\:overflow-hidden{overflow:hidden!important}.bluxcc\\:overflow-y-auto{overflow-y:auto!important}.bluxcc\\:rounded-full{border-radius:calc(infinity * 1px)!important}.bluxcc\\:rounded-b-none\\!{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.bluxcc\\:border{border-style:var(--tw-border-style)!important;border-width:1px!important}.bluxcc\\:border-2{border-style:var(--tw-border-style)!important;border-width:2px!important}.bluxcc\\:border-none{--tw-border-style:none!important;border-style:none!important}.bluxcc\\:border-alert-error{border-color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:border-alert-info{border-color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:border-alert-success{border-color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:border-alert-warning{border-color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:bg-light-blue-50{background-color:var(--bluxcc-color-light-blue-50)!important}.bluxcc\\:bg-light-red-50{background-color:var(--bluxcc-color-light-red-50)!important}.bluxcc\\:bg-primary-500{background-color:var(--bluxcc-color-primary-500)!important}.bluxcc\\:bg-transparent{background-color:transparent!important}.bluxcc\\:bg-white{background-color:var(--bluxcc-color-white)!important}.bluxcc\\:p-1{padding:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:p-2{padding:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:p-4{padding:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:\\!px-3{padding-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:px-2{padding-inline:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:px-2\\.5{padding-inline:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:px-3{padding-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:px-4{padding-inline:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-6{padding-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:px-7{padding-inline:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:px-\\[10px\\]{padding-inline:10px!important}.bluxcc\\:\\!py-1,.bluxcc\\:py-1{padding-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:py-2{padding-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:py-3{padding-block:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:py-4{padding-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pt-\\[17px\\]{padding-top:17px!important}.bluxcc\\:pr-3{padding-right:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:pb-4{padding-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pl-2{padding-left:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:text-center{text-align:center!important}.bluxcc\\:text-left{text-align:left!important}.bluxcc\\:text-right{text-align:right!important}.bluxcc\\:text-start{text-align:start!important}.bluxcc\\:font-mono{font-family:var(--bluxcc-font-mono)!important}.bluxcc\\:\\!text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:\\!text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:\\!text-xs{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:text-2xl{font-size:var(--bluxcc-text-2xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-2xl--line-height))!important}.bluxcc\\:text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:text-lg{font-size:var(--bluxcc-text-lg)!important;line-height:var(--tw-leading,var(--bluxcc-text-lg--line-height))!important}.bluxcc\\:text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-xl{font-size:var(--bluxcc-text-xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-xl--line-height))!important}.bluxcc\\:text-xs{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:text-\\[10px\\]{font-size:10px!important}.bluxcc\\:\\!leading-\\[16px\\]{--tw-leading:16px!important;line-height:16px!important}.bluxcc\\:leading-4{--tw-leading:calc(var(--bluxcc-spacing)*4)!important;line-height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:leading-5{--tw-leading:calc(var(--bluxcc-spacing)*5)!important;line-height:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:leading-7{--tw-leading:calc(var(--bluxcc-spacing)*7)!important;line-height:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:font-medium{--tw-font-weight:var(--bluxcc-font-weight-medium)!important;font-weight:var(--bluxcc-font-weight-medium)!important}.bluxcc\\:font-normal{--tw-font-weight:var(--bluxcc-font-weight-normal)!important;font-weight:var(--bluxcc-font-weight-normal)!important}.bluxcc\\:font-semibold{--tw-font-weight:var(--bluxcc-font-weight-semibold)!important;font-weight:var(--bluxcc-font-weight-semibold)!important}.bluxcc\\:tracking-\\[-2\\%\\]{--tw-tracking:-2%!important;letter-spacing:-2%!important}.bluxcc\\:break-all{word-break:break-all!important}.bluxcc\\:whitespace-nowrap{white-space:nowrap!important}.bluxcc\\:text-alert-error{color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:text-alert-info{color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:text-alert-success{color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:text-alert-warning{color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:text-gray-800{color:var(--bluxcc-color-gray-800)!important}.bluxcc\\:capitalize{text-transform:capitalize!important}.bluxcc\\:no-underline{text-decoration-line:none!important}.bluxcc\\:outline-hidden{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}.bluxcc\\:transition-\\[border-radius\\,background\\,border-color\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius,background,border-color!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-\\[border-radius\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-all{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:all!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-colors{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-transform{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:transform,translate,scale,rotate!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:duration-200{--tw-duration:200ms!important;transition-duration:.2s!important}.bluxcc\\:duration-300{--tw-duration:300ms!important;transition-duration:.3s!important}.bluxcc\\:outline-none{--tw-outline-style:none!important;outline-style:none!important}.bluxcc\\:select-none{-webkit-user-select:none!important;user-select:none!important}.bluxcc\\:placeholder\\:text-base\\!{&::placeholder{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}}.bluxcc\\:focus\\:ring-1{&:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}}.bluxcc\\:focus\\:outline-hidden{&:focus{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}}}.overflowStyle::-webkit-scrollbar{width:.1px}[class*=" bluxcc"]::backdrop,[class*=" bluxcc"]::file-selector-button,[class*=" bluxcc"]:after,[class*=" bluxcc"]:before,[class^=bluxcc],[class^=bluxcc]::backdrop,[class^=bluxcc]::file-selector-button,[class^=bluxcc]:after,[class^=bluxcc]:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}[class*=" bluxcc"] h1,[class*=" bluxcc"] h2,[class*=" bluxcc"] h3,[class*=" bluxcc"] h4,[class*=" bluxcc"] h5,[class*=" bluxcc"] h6,[class^=bluxcc] h1,[class^=bluxcc] h2,[class^=bluxcc] h3,[class^=bluxcc] h4,[class^=bluxcc] h5,[class^=bluxcc] h6{font-size:inherit;font-weight:inherit}[class*=" bluxcc"] menu,[class*=" bluxcc"] ol,[class*=" bluxcc"] ul,[class^=bluxcc] menu,[class^=bluxcc] ol,[class^=bluxcc] ul{list-style:none}[class*=" bluxcc"] audio,[class*=" bluxcc"] canvas,[class*=" bluxcc"] embed,[class*=" bluxcc"] iframe,[class*=" bluxcc"] img,[class*=" bluxcc"] object,[class*=" bluxcc"] svg,[class*=" bluxcc"] video,[class^=bluxcc] audio,[class^=bluxcc] canvas,[class^=bluxcc] embed,[class^=bluxcc] iframe,[class^=bluxcc] img,[class^=bluxcc] object,[class^=bluxcc] svg,[class^=bluxcc] video{display:block;vertical-align:middle}[class*=" bluxcc"] img,[class*=" bluxcc"] video,[class^=bluxcc] img,[class^=bluxcc] video{height:auto;max-width:100%}#bluxcc-input[type=number]::-webkit-inner-spin-button,#bluxcc-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0}#bluxcc-input[type=number]{-moz-appearance:textfield!important}#bluxcc-input:-webkit-autofill,#bluxcc-input:-webkit-autofill:active,#bluxcc-input:-webkit-autofill:focus,#bluxcc-input:-webkit-autofill:hover{-webkit-text-fill-color:var(--input-text-color)!important;-webkit-box-shadow:inset 0 0 0 1000px transparent!important;box-shadow:inset 0 0 0 1000px transparent!important;color:var(--input-text-color)!important;transition:background-color 5000s ease-in-out 0s!important}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.bluxcc\\:animate-fadeIn{animation:fadeIn .5s ease-in-out}.bluxcc\\:animate-fadeOut{animation:fadeOut .3s ease-in-out}@keyframes marquee{0%{transform:translateX(-16%)}to{transform:translateX(-100%)}}.bluxcc\\:marquee_outer{position:relative;width:100%}.bluxcc\\:marquee_track{animation:marquee 40s linear infinite;display:flex;width:max-content;will-change:transform}.bluxcc\\:marquee_track:hover{animation-play-state:paused}#bluxcc-button{cursor:pointer}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes spin{to{transform:rotate(1turn)}}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-duration:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}');var hU=null,pU=!1,yU=null,gU=null,mU=function(e){void 0===e&&(e=document.body),pU&&(hU&&(hU.unmount(),hU=null),yU&&gU&&gU.contains(yU)&&gU.removeChild(yU)),gU=e,yU=document.createElement("div"),e.appendChild(yU),(hU=bl.createRoot(yU)).render(Q.createElement(dU))};return e.blux=tl,e.createConfig=function(e,t){var r,o;pU=!0,mU(t);var i=e.excludeWallets||["lobstr","albedo"];i=i.map(function(e){return e.toLowerCase()});var s=!0;void 0!==e.promptOnWrongNetwork&&(s=e.promptOnWrongNetwork);var a=n(n(n({},e),{excludeWallets:i,appearance:n(n({},ce),null==e?void 0:e.appearance),defaultNetwork:"",promptOnWrongNetwork:s,lang:e.lang||"en",explorer:e.explorer||"stellarchain",loginMethods:e.loginMethods||["wallet"],showWalletUIs:void 0===e.showWalletUIs||e.showWalletUIs}),(null==e?void 0:e.walletConnect)?{walletConnect:e.walletConnect}:{});!function(e,t,r){if(0===e.length)throw new Error("No network is set in config.networks.");var n=null!=t?t:e[0];if(!e.includes(n))throw new Error("config.defaultNetwork is not listed in config.networks.");for(var o=0,i=e;o<i.length;o++){var s=i[o];if(!(hu[s]||r&&r[s]))throw new Error("Must set transports for custom network ".concat(s))}}(e.networks,e.defaultNetwork,e.transports),a.defaultNetwork=null!==(r=e.defaultNetwork)&&void 0!==r?r:e.networks[0];var c,u=ku(a.defaultNetwork,null!==(o=e.transports)&&void 0!==o?o:{}),l=u.horizon,f=u.soroban,p=pe(),y=p.setConfig,g=p.setWallets,m=p.setIsReady;(0,p.setStellar)({activeNetwork:a.defaultNetwork,servers:{horizon:new ae.Horizon.Server(l),soroban:new ae.rpc.Server(f)}}),y(a),(c=i,new Promise(function(e){"complete"===document.readyState?_u(c).then(function(t){e(t)}):window.addEventListener("load",function(){_u(c).then(function(t){e(t)})})})).then(function(e){var t=e.filter(function(e){return!i.includes(e.name.toLowerCase())});g(t),m(!0)}),e.walletConnect&&function(e,t){d(void 0,void 0,void 0,function(){var r,n,o,i;return h(this,function(s){switch(s.label){case 0:if(bL)return[2];bL=!0,s.label=1;case 1:return s.trys.push([1,4,,5]),r=pe(),n=new _M({projectId:e.projectId}),[4,yL.init({core:n,metadata:{name:t,url:e.url,icons:e.icons,description:e.description}})];case 2:return o=s.sent(),r.setWalletConnectClient(o,null),[4,vL(o)];case 3:return i=s.sent(),r.setWalletConnectClient(o,i),[3,5];case 4:return s.sent(),[3,5];case 5:return[2]}})})}(e.walletConnect,e.appName)},e.getAccount=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:if(Lu(),t=Uu(e.address),r=Du(e.network).horizon,!ae.StrKey.isValidEd25519PublicKey(t))throw new Error("Invalid address");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,r.loadAccount(t)];case 2:return[2,n.sent()];case 3:return n.sent(),[2,null];case 4:return[2]}})})},e.getAccounts=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("accounts",[],e),e.forSigner&&(t=t.forSigner(e.forSigner)),e.forAsset&&(t=t.forAsset(e.forAsset)),e.sponsor&&(t=t.sponsor(e.sponsor)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getAssets=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("assets",[],e),e.forCode&&(t=t.forCode(e.forCode)),e.forIssuer&&(t=t.forIssuer(e.forIssuer)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getBalances=qu,e.getClaimableBalances=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("claimableBalances",[],e),e.asset&&(t=t.asset(e.asset)),e.claimant&&(t=t.claimant(e.claimant)),e.sponsor&&(t=t.sponsor(e.sponsor)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getEffects=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("effects",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forOperation&&(t=t.forOperation(e.forOperation)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getInitialState=de,e.getLedgers=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("ledgers",[],e),e.ledger&&(t=t.ledger(e.ledger)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getLiquidityPools=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("liquidityPools",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forAssets&&(t=t.forAssets.apply(t,e.forAssets)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getNetwork=function(){var e,t=pe();if(0===t.config.networks.length)throw new Error("getNetwork must be called after createConfig");return(null===(e=t.stellar)||void 0===e?void 0:e.activeNetwork)||""},e.getOffers=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("offers",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.buying&&(t=t.buying(e.buying)),e.selling&&(t=t.selling(e.selling)),e.sponsor&&(t=t.sponsor(e.sponsor)),e.seller&&(t=t.seller(e.seller)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getOperations=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("operations",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getOrderbook=function(e,t){return d(void 0,void 0,void 0,function(){var r,n;return h(this,function(o){switch(o.label){case 0:return Lu(),[4,(r=zu("orderbook",e,t)).call()];case 1:return n=o.sent(),[2,{builder:r,response:n}]}})})},e.getPayments=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("payments",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getState=le,e.getStrictReceivePaths=Vu,e.getStrictSendPaths=Hu,e.getTradeAggregation=function(e,t){return d(void 0,void 0,void 0,function(){var r,n;return h(this,function(o){switch(o.label){case 0:return Lu(),[4,(r=zu("tradeAggregation",e,t)).call()];case 1:return n=o.sent(),[2,{builder:r,response:n}]}})})},e.getTrades=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("trades",[],e),e.forAssetPair&&(t=t.forAssetPair(e.forAssetPair[0],e.forAssetPair[1])),e.forOffer&&(t=t.forOffer(e.forOffer)),e.forType&&(t=t.forType(e.forType)),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getTransactions=Ku,e.networks=Wu,e.setAppearance=rl,e.subscribe=fe,e.switchNetwork=function(e){var t=pe();Fu(e),t.setNetworkSyncDisabled(!0)},e.useExportedStore=function(e){return $(ue,e)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
42
+ */function ML(e,t=0){const r=[];return e.forEach(function(e,n){let o=null;e.forEach(function(i,s){if(!i&&null!==o)return r.push(`M${o+t} ${n+t}h${s-o}v1H${o+t}z`),void(o=null);if(s!==e.length-1)i&&null===o&&(o=s);else{if(!i)return;null===o?r.push(`M${s+t},${n+t} h1v1H${s+t}z`):r.push(`M${o+t},${n+t} h${s+1-o}v1H${o+t}z`)}})}),r.join("")}function LL(e,t){return e.slice().map((e,r)=>r<t.y||r>=t.y+t.h?e:e.map((e,r)=>(r<t.x||r>=t.x+t.w)&&e))}function UL({value:e,level:t,minVersion:r,includeMargin:n,marginSize:o,imageSettings:i,size:s,boostLevel:a}){let c=Y.useMemo(()=>{const n=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...CL.QrSegment.makeSegments(t)),e),[]);return CL.QrCode.encodeSegments(n,IL[t],r,void 0,void 0,a)},[e,t,r,a]);const{cells:u,margin:l,numCells:f,calculatedImageSettings:d}=Y.useMemo(()=>{let e=c.getModules();const t=function(e,t){return null!=t?Math.max(Math.floor(t),0):e?4:0}(n,o),r=e.length+2*t,a=function(e,t,r,n){if(null==n)return null;const o=e.length+2*r,i=Math.floor(.1*t),s=o/t,a=(n.width||i)*s,c=(n.height||i)*s,u=null==n.x?e.length/2-a/2:n.x*s,l=null==n.y?e.length/2-c/2:n.y*s,f=null==n.opacity?1:n.opacity;let d=null;if(n.excavate){let e=Math.floor(u),t=Math.floor(l);d={x:e,y:t,w:Math.ceil(a+u-e),h:Math.ceil(c+l-t)}}return{x:u,y:l,h:c,w:a,excavation:d,opacity:f,crossOrigin:n.crossOrigin}}(e,s,t,i);return{cells:e,margin:t,numCells:r,calculatedImageSettings:a}},[c,s,i,n,o]);return{qrcode:c,margin:l,cells:u,numCells:f,calculatedImageSettings:d}}var DL=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}(),FL=Y.forwardRef(function(e,t){const r=e,{value:n,size:o=_L,level:i=PL,bgColor:s=RL,fgColor:a=NL,includeMargin:c=BL,minVersion:u=jL,boostLevel:l,marginSize:f,imageSettings:d}=r,h=TL(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:p}=h,y=TL(h,["style"]),g=null==d?void 0:d.src,m=Y.useRef(null),b=Y.useRef(null),v=Y.useCallback(e=>{m.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t]),[w,x]=Y.useState(!1),{margin:S,cells:E,numCells:A,calculatedImageSettings:k}=UL({value:n,level:i,minVersion:u,boostLevel:l,includeMargin:c,marginSize:f,imageSettings:d,size:o});Y.useEffect(()=>{if(null!=m.current){const e=m.current,t=e.getContext("2d");if(!t)return;let r=E;const n=b.current,i=null!=k&&null!==n&&n.complete&&0!==n.naturalHeight&&0!==n.naturalWidth;i&&null!=k.excavation&&(r=LL(E,k.excavation));const c=window.devicePixelRatio||1;e.height=e.width=o*c;const u=o/A*c;t.scale(u,u),t.fillStyle=s,t.fillRect(0,0,A,A),t.fillStyle=a,DL?t.fill(new Path2D(ML(r,S))):E.forEach(function(e,r){e.forEach(function(e,n){e&&t.fillRect(n+S,r+S,1,1)})}),k&&(t.globalAlpha=k.opacity),i&&t.drawImage(n,k.x+S,k.y+S,k.w,k.h)}}),Y.useEffect(()=>{x(!1)},[g]);const O=OL({height:o,width:o},p);let T=null;return null!=g&&(T=Y.createElement("img",{src:g,key:g,style:{display:"none"},onLoad:()=>{x(!0)},ref:b,crossOrigin:null==k?void 0:k.crossOrigin})),Y.createElement(Y.Fragment,null,Y.createElement("canvas",OL({style:O,height:o,width:o,ref:v,role:"img"},y)),T)});FL.displayName="QRCodeCanvas";var zL=Y.forwardRef(function(e,t){const r=e,{value:n,size:o=_L,level:i=PL,bgColor:s=RL,fgColor:a=NL,includeMargin:c=BL,minVersion:u=jL,boostLevel:l,title:f,marginSize:d,imageSettings:h}=r,p=TL(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:y,cells:g,numCells:m,calculatedImageSettings:b}=UL({value:n,level:i,minVersion:u,boostLevel:l,includeMargin:c,marginSize:d,imageSettings:h,size:o});let v=g,w=null;null!=h&&null!=b&&(null!=b.excavation&&(v=LL(g,b.excavation)),w=Y.createElement("image",{href:h.src,height:b.h,width:b.w,x:b.x+y,y:b.y+y,preserveAspectRatio:"none",opacity:b.opacity,crossOrigin:b.crossOrigin}));const x=ML(v,y);return Y.createElement("svg",OL({height:o,width:o,viewBox:`0 0 ${m} ${m}`,ref:t,role:"img"},p),!!f&&Y.createElement("title",null,f),Y.createElement("path",{fill:s,d:`M0,0 h${m}v${m}H0z`,shapeRendering:"crispEdges"}),Y.createElement("path",{fill:a,d:x,shapeRendering:"crispEdges"}),w)});zL.displayName="QRCodeSVG";var qL=function(e){var t=e.value,r=e.title,i=void 0===r?"":r,s=e.size,a=void 0===s?184:s,c=e.bgColor,u=void 0===c?"#ffffff":c,l=e.fgColor,f=void 0===l?"#00020f":l,d=e.level,h=void 0===d?"Q":d,p=e.imgSize,y=void 0===p?51:p,g=o(e,["value","title","size","bgColor","fgColor","level","imgSize"]);return xl.jsx(FL,n({className:"bluxcc:z-10",value:t,title:i,size:a,bgColor:u,fgColor:f,level:h,marginSize:1,imageSettings:{src:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw8NDQ8NDQ0PDQ0PDw4NDw0NDQ8PDQ0NFREWFhURExUYHSggGBolGxUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDQ0OFQ4PFSsdExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAKwBJgMBIgACEQEDEQH/xAAXAAEBAQEAAAAAAAAAAAAAAAAAAQIH/8QAIRABAQABBAAHAAAAAAAAAAAAAAERAiFhgSIxQVFxsfD/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A7iAAACW8d+ygAAACSAoAAAAAAAAAAAAAAADOrVZZJptluLczwzFub9dtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmd/LtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLwoAAAAAQAAAAAAAAAAAAAAAAAABL+5UAAAAAAAAAAAEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAJYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAARQAAAAAAAAAAAAEwoAAAACSqAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAS59NvmZ2yoAAAAAAAAAAAAACAomFAAAAAAAABKoAAAAA//2Q==",x:void 0,y:void 0,height:y,width:y,opacity:1,excavate:!0}},g))},VL=function(e){var t=e.fill,r=void 0===t?"black":t,n=e.background,o=void 0===n?"transparent":n;return xl.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl.jsx("rect",{width:"52",height:"52",fill:o}),xl.jsx("path",{d:"M41.0809 6.06641H6.16162V11.0858H41.0809V6.06641Z",fill:r}),xl.jsx("path",{d:"M11.0193 21.8516V6H6V21.8516V23.6323V28.6516V41.2032V46.2226V46.2387H11.0193V46.2226H41.0838V41.2032H11.0193V28.6516H41.0838V23.6323H11.0193V21.8516Z",fill:r}),xl.jsx("path",{d:"M46.0001 11.1621H41.1614V23.7428H46.0001V11.1621Z",fill:r}),xl.jsx("path",{d:"M46.0001 28.582H41.1614V41.1627H46.0001V28.582Z",fill:r})]})},HL=function(){var e,t=Al(),r=me(function(e){return e}),n=me(function(e){return e}).setAlert,o=r.config.appearance,i=null===(e=r.user)||void 0===e?void 0:e.address;return xl.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-[208px] bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:o.borderRadius,color:o.textColor,borderColor:o.borderColor,backgroundColor:o.fieldBackground,borderWidth:o.borderWidth},children:[xl.jsx(qL,{size:184,value:i,bgColor:o.fieldBackground,fgColor:o.accentColor,level:"Q"}),xl.jsx("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:o.background},children:xl.jsx(VL,{fill:o.accentColor,background:o.fieldBackground})})]}),xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:space-y-2 bluxcc:font-medium",children:[xl.jsx("p",{className:"bluxcc:text-lg",children:"Your Address"}),xl.jsx("div",{className:"bluxcc:w-full bluxcc:px-2.5 bluxcc:py-3 bluxcc:h-14",style:{borderRadius:o.borderRadius,color:o.textColor,borderColor:o.borderColor,backgroundColor:o.fieldBackground,borderWidth:o.borderWidth},children:xl.jsx("p",{className:"bluxcc:w-[292px] bluxcc:text-sm bluxcc:!leading-[16px] bluxcc:break-all",style:{color:Tu(o.textColor,.7)},children:i})})]}),xl.jsx(lf,{}),xl.jsx(gf,{size:"large",state:"enabled",variant:"tonal",style:{color:o.accentColor},onClick:function(){vu(i),n("info",t("address_copied")),setTimeout(function(){n("none","")},1e3)},endIcon:xl.jsx(Bl,{fill:o.accentColor}),children:t("copy_address")})]})},KL=function(){var e,t,r,n=Al(),o=me(function(e){return e}),i=(t=o.config.networks,r=Object.entries(du).filter(function(e){return t.includes(e[1])}).map(function(e){return bu(e[0])}),r);return xl.jsxs("div",{style:{font:o.config.appearance.fontFamily},className:"bluxcc:mt-4 bluxcc:mb-10 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[xl.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-[68px] bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:xl.jsx(Wl,{})}),xl.jsxs("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[xl.jsx("p",{className:"bluxcc:text-2xl",children:n("wrongNetwork")}),xl.jsx("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5 bluxcc:tracking-[-2%] bluxcc:mx-3",children:n("wrongNetworkMessage",{currentNetwork:bu(Au(null===(e=o.user)||void 0===e?void 0:e.walletPassphrase)),switchNetwork:i.join(" or ")})})]})]})},WL=function(e){var t,r=e.tabs,n=me(function(e){return e.config.appearance}),o=Q.useState(0),i=o[0],s=o[1];return xl.jsxs(xl.Fragment,{children:[xl.jsx("div",{className:"bluxcc:flex bluxcc:gap-3 bluxcc:py-3",children:r.map(function(e,t){var r=i===t;return xl.jsxs("button",{role:"tab",onClick:function(){return s(t)},"aria-label":e.label,id:"bluxcc-button","aria-selected":i===t,tabIndex:i===t?0:-1,className:"bluxcc:flex bluxcc:gap-2 bluxcc:h-20 bluxcc:w-24 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:px-7 bluxcc:py-4 bluxcc:text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{background:r?Tu(n.accentColor,.1):n.background,color:r?n.accentColor:n.textColor,borderRadius:n.borderRadius},children:[xl.jsx("span",{children:r?e.activeIcon:e.inActiveIcon}),xl.jsx("span",{children:e.label})]},t)})}),xl.jsx("div",{className:"bluxcc:max-h-[312px] bluxcc:h-[312px] w-full bluxcc:overflow-auto overflowStyle",role:"tabpanel","aria-labelledby":"tab-".concat(i),children:xl.jsx("div",{className:"bluxcc:absolute bluxcc:left-0 bluxcc:right-0 bluxcc:max-h-[312px] bluxcc:h-[312px] bluxcc:overflow-auto overflowStyle",children:null===(t=r[i])||void 0===t?void 0:t.content})})]})},GL=function(e){var t=e.assets,r=Q.useState(null),n=r[0],o=r[1],i=me(function(e){return e.config.appearance}),s=Al();return xl.jsxs("div",{className:"bluxcc:h-full bluxcc:w-full bluxcc:overflow-auto overflowStyle",children:[t.map(function(e,r){return xl.jsxs("button",{id:"bluxcc-button",onMouseEnter:function(){return o(r)},onMouseLeave:function(){return o(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:py-2 bluxcc:px-4",style:{background:n===r?i.fieldBackground:"transparent",color:i.textColor,borderBottomStyle:"dashed",borderBottomWidth:r<t.length-1?i.borderWidth:"0px",borderBottomColor:i.borderColor,transition:"all 0.2s ease-in-out",fontFamily:i.fontFamily},children:[xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[xl.jsx("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:i.borderRadius,background:i.fieldBackground,border:"".concat(i.borderWidth," solid ").concat(i.borderColor)},children:"native"===e.assetType?xl.jsx(kf,{fill:xu(i.fieldBackground)}):xl.jsx(of,{fill:xu(i.fieldBackground)})}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col",children:[xl.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.assetCode}),xl.jsx("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Tu(i.textColor,.7)},children:e.assetCode})]})]}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:text-right",children:[xl.jsx("span",{className:"bluxcc:font-medium",children:Cu(e.assetBalance)}),xl.jsxs("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Tu(i.textColor,.7)},children:[Cu(e.valueInCurrency||"0"),"$"]})]})]},e.assetType+e.assetIssuer)}),0===t.length&&xl.jsx("div",{style:{color:Tu(i.textColor,.7)},className:"bluxcc:mb-2 bluxcc:text-center bluxcc:h-full bluxcc:flex bluxcc:justify-center bluxcc:items-center",children:s("noAssetsFound")})]})},XL=function(){var e=Al(),t=me(function(e){return e.config.appearance}),r=me(function(e){return e.balances}),o=r.loading,i=r.error,s=r.balances.map(function(e){return n(n({},mu(e)),{logo:xl.jsx(kf,{})})}),a=[{label:e("assets"),activeIcon:xl.jsx(Yl,{fill:t.accentColor}),inActiveIcon:xl.jsx(Yl,{fill:t.textColor}),content:xl.jsx(GL,{assets:s})}];return o?"Loading":i?"Error, try again.":xl.jsx(WL,{tabs:a})},ZL=Y.memo(function(e){var t,r,n,o,i,s=e.tx,a=me(function(e){return e}),c=a.config.appearance,u=Su((null===(t=a.stellar)||void 0===t?void 0:t.activeNetwork)||"",a.config.explorer,"transactionUrl",s.hash);return xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-start bluxcc:gap-3",children:[xl.jsx("div",{className:"bluxcc:flex bluxcc:size-10 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",style:{background:c.background},children:function(e){switch(e){case"Receive":return xl.jsx(zl,{});case"Send":return xl.jsx(Dl,{});default:return xl.jsx(Fl,{})}}(s.title)}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start",children:[xl.jsx("p",{className:"bluxcc:text-start bluxcc:text-xs bluxcc:font-medium",style:{color:c.textColor},children:s.title}),xl.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium",children:s.description})]})]}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:text-xs",style:{color:Tu(c.textColor,.6)},children:[(r=s.date,n=new Date(r),o=n.getUTCDate(),i=n.toLocaleString("en-US",{month:"short"}),"".concat(o," ").concat(i)),xl.jsx("button",{id:"bluxcc-button",className:"bluxcc:flex bluxcc:size-8 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",title:"View transaction details",onClick:function(){u&&window.open(u,"_blank","noopener,noreferrer")},style:{background:c.fieldBackground},children:xl.jsx("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:xl.jsx(ql,{})})})]})]})}),QL=function(e){return"native"===e.asset_type?"XLM":e.asset_code||"Pool"},YL=function(){var e,t,r=Al(),n=me(function(e){return e}),o=me(function(e){return e.transactions}),i=o.loading,s=o.transactions,a=Q.useState([]),c=a[0],u=a[1],l=n.config.appearance,f=null===(e=n.user)||void 0===e?void 0:e.address,d=Su(null===(t=n.stellar)||void 0===t?void 0:t.activeNetwork,n.config.explorer,"accountUrl",f);Q.useEffect(function(){if(s){for(var e=[],t=0,n=s;t<n.length;t++){var o=n[t],i=o.operations[0],a={hash:o.hash,description:"",date:o.created_at,title:Ru(i.type)};if(o.operations.length>1)a.title=r("multiOperation");else if("payment"===i.type){var c=r("send");i.to.toLowerCase()===f.toLowerCase()&&(c=r("receive")),a.title=c,a.description="".concat(Cu(i.amount)," ").concat(QL(i))}else i.type!==ae.Horizon.HorizonApi.OperationResponseType.pathPaymentStrictSend&&i.type!==ae.Horizon.HorizonApi.OperationResponseType.pathPayment||(a.title=r("swap"),a.description="Received ".concat(QL(i)));e.push(a)}u(e)}},[s]);var h=!i&&0===c.length;return xl.jsxs("div",{className:"bluxcc:flex bluxcc:h-[355px] bluxcc:flex-col",children:[i?xl.jsx("div",{style:{color:Tu(l.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:r("loadingActivity")}):h?xl.jsx("div",{style:{color:Tu(l.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:r("noActivityFound")}):c.map(function(e,t){return xl.jsx("div",{style:{borderBottomStyle:"dashed",borderBottomWidth:t<c.length-1?l.borderWidth:"0px",borderBottomColor:l.borderColor},className:"bluxcc:p-2",children:xl.jsx(ZL,{tx:e})},t)}),c.length>0&&d&&xl.jsx("div",{className:"bluxcc:absolute bluxcc:bottom-4 bluxcc:left-1/2 bluxcc:!mt-4 bluxcc:w-[calc(100%-3rem)] bluxcc:-translate-x-1/2 bluxcc:transform",children:xl.jsx(gf,{state:"enabled",variant:"outline",size:"medium",onClick:function(){d&&window.open(d,"_blank","noopener,noreferrer")},children:r("seeAllInExplorer")})})]})},JL=function(e){var t=e.operationsCount,r=e.sender,n=e.receiver,o=e.network,i=e.estimatedFee,s=e.action,a=me(function(e){return e.config.appearance}),c=me(function(e){return e}).setAlert,u=[{label:"Action",value:bu(s)},{label:"Operations",value:t.toString()},{label:"Sender",value:Pu(r,5),isHighlighted:!0,isCopyable:!0,copyValue:r},{label:"Network",value:hu[o].name},{label:"Estimated Fee",value:"".concat(i," XLM")}];return n&&u.splice(3,0,{label:"To",value:Pu(n,5),isHighlighted:!0,isCopyable:!0,copyValue:n}),xl.jsx("div",{className:"bluxcc:w-full bluxcc:text-sm bluxcc:text-gray-800",children:u.map(function(e,t){var r=e.label,n=e.value,o=e.isHighlighted,i=e.isCopyable,s=e.copyValue;return xl.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:px-4 bluxcc:py-2",style:t===u.length-1?{}:{borderBottomColor:a.borderColor,borderBottomStyle:"dashed",borderBottomWidth:a.borderWidth},children:[xl.jsx("span",{style:{color:a.textColor},children:r}),i?xl.jsx("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent",style:{color:o?a.accentColor:a.textColor},onClick:function(){return s&&(vu(s),c("info","Address Copied"),void setTimeout(function(){c("none","")},1e3))},children:n}):xl.jsx("span",{style:{color:o?a.accentColor:a.textColor},children:n})]},t)})})},$L=function(e){return d(void 0,void 0,void 0,function(){var t,r,o;return h(this,function(i){switch(i.label){case 0:if(!(t=e.sendTransaction))return e.setRoute(se.FAILED),[2];e.setRoute(se.WAITING),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,$u(t.wallet,t.xdr,null===(o=e.user)||void 0===o?void 0:o.address,t.options.network,e.config.transports||{})];case 2:return r=i.sent(),e.setSendTransaction(n(n({},t),{result:r}),!0,se.WAITING),setTimeout(function(){e.setRoute(se.SUCCESSFUL)},400),[3,4];case 3:return i.sent(),setTimeout(function(){e.setRoute(se.FAILED)},200),[3,4];case 4:return[2]}})})},eU=function(){var e,t=Al(),r=me(function(e){return e}),n=r.config.appearance,o=r.user,i=r.stellar,s=r.sendTransaction;if(!s||!o||!i)return xl.jsx("div",{children:xl.jsx("p",{children:t("invalidXdr")})});var a=s.xdr,c=s.options,u=Xu(a,c.network);if(!u)return xl.jsx("div",{children:xl.jsx("p",{children:t("invalidXdr")})});var l,f,p=0===r.balances.balances.length?"0":r.balances.balances.find(function(e){return"native"===e.asset_type}).balance,y=o.authValue===oe.Lobstr,g=(l=i.activeNetwork,f=Object.entries(du).find(function(e){return e[1]===l}),f?f[0].toUpperCase():"MAINNET");return xl.jsxs("div",{className:"bluxcc:w-full",children:[xl.jsxs("p",{className:"bluxcc:mx-3 bluxcc:my-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[xl.jsxs("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[r.config.appName," "]}),t("signTransactionPrompt")]}),xl.jsx(JL,{operationsCount:u.operations,sender:u.sender,receiver:u.receiver,network:c.network,estimatedFee:u.estimatedFee.toString(),action:u.action}),y&&xl.jsx("p",{className:"bluxcc:!my-2 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:!text-xs bluxcc:text-alert-error",children:t("lobstrWarning",{network:g})}),xl.jsxs("div",{className:"bluxcc:inline-flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{marginTop:y?"0px":"16px",borderRadius:n.borderRadius,borderColor:n.borderColor},children:[xl.jsxs("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:[xl.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:t("yourWallet")}),xl.jsx("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(Tu(n.textColor,.8))},children:o.address?Pu(null===(e=r.user)||void 0===e?void 0:e.address,5):t("noAddressFound")})]}),xl.jsx("div",{className:"bluxcc:overflow-hidden bluxcc:px-[10px] bluxcc:py-2",style:{borderRadius:n.borderRadius,backgroundColor:n.fieldBackground,color:n.textColor},children:xl.jsxs("p",{className:"bluxcc:max-w-[90px] bluxcc:text-xs bluxcc:font-normal",children:[p?Cu(p):"0"," XLM"]})})]}),xl.jsx(lf,{}),xl.jsx(gf,{size:"large",state:"enabled",variant:"fill",onClick:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return $L(r),[2]})})},children:t("approve")})]})},tU=function(){var e=Al(),t=me(function(e){return e.config.appearance}),r={logo:xl.jsx(kf,{}),assetBalance:.43332,valueInCurrency:203},n=[{label:e("network"),value:"Stellar",link:!0},{label:e("address"),value:"GFGE...MKLW",copyable:!0},{label:e("market_cap"),value:"2.45M"},{label:e("total_volume"),value:323},{label:e("all_time_high"),value:323}];return xl.jsxs("div",{children:[xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:my-4",children:[xl.jsx("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:t.borderColor,borderWidth:t.borderWidth},children:r.logo}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col",children:[xl.jsxs("span",{className:"bluxcc:text-2xl bluxcc:font-medium",style:{color:t.accentColor},children:["$",Cu(r.valueInCurrency)]}),xl.jsxs("span",{className:"bluxcc:text-sm bluxcc:font-medium",style:{color:Tu(t.textColor,.7)},children:[Cu(r.assetBalance)," XLM"]})]})]}),xl.jsx("div",{className:"bluxcc:space-y-1",children:n.map(function(e,r){return xl.jsxs("div",{className:"bluxcc:flex bluxcc:font-medium bluxcc:items-center bluxcc:justify-between bluxcc:text-xs bluxcc:h-8 bluxcc:px-4",style:{borderBottom:r<n.length-1?"".concat(t.borderWidth," dashed ").concat(t.borderColor):"none"},children:[xl.jsx("span",{children:e.label}),xl.jsxs("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1 bluxcc:text-xs",style:{color:e.copyable||e.link?t.accentColor:Tu(t.textColor,.7)},children:[e.link?xl.jsx("a",{href:"#",target:"_blank",rel:"noreferrer",style:{color:t.accentColor},className:"bluxcc:no-underline",children:e.value}):e.value,e.copyable&&xl.jsx(Nl,{fill:t.accentColor})]})]},r)})})]})},rU={purple:{id:"purple_gradient",colors:[[.992,.878,1],[.992,.878,1],[.592,.451,1],[.792,.663,1]]}},nU=function(e){var t,r=e.theme,n=void 0===r?"purple":r,o=e.className,i=void 0===o?"":o,s=e.children,a=e.animationSpeed,c=void 0===a?1:a,u=e.onClick,l=e.style,f=e.size,d=void 0===f?"100%":f,h=Q.useRef(null),p=Q.useRef(null);return Q.useEffect(function(){var e=h.current;if(e){var t=e.getContext("webgl");if(t){var r=e.getBoundingClientRect();e.width=r.width,e.height=r.height;var o=function(e,r){var n=t.createShader(r);return t.shaderSource(n,e),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS),n},i=t.createProgram(),s=o("\n attribute vec2 aPos;\n varying vec2 vUv;\n void main() {\n vUv = (aPos + 1.0) * 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n }\n ",t.VERTEX_SHADER),a=o("\n precision mediump float;\n uniform float uTime;\n uniform vec2 uResolution;\n uniform vec3 uColor1;\n uniform vec3 uColor2;\n uniform vec3 uColor3;\n uniform vec3 uColor4;\n varying vec2 vUv;\n\n float noise(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n float smoothNoise(vec2 st) {\n vec2 i=floor(st),f=fract(st);\n float a=noise(i);\n float b=noise(i+vec2(1.,0.));\n float c=noise(i+vec2(0.,1.));\n float d=noise(i+vec2(1.,1.));\n vec2 u=f*f*(3.-2.*f);\n return mix(a,b,u.x)+(c-a)*u.y*(1.-u.x)+(d-b)*u.x*u.y;\n }\n float fbm(vec2 st){\n float v=0.,a=0.7;\n for(int i=0;i<2;i++){\n v+=a*smoothNoise(st);\n st*=1.8;a*=0.4;\n }\n return v;\n }\n\n void main(){\n vec2 st=vUv;\n float time=uTime*0.12;\n vec2 center=vec2(0.5);\n vec2 fromCenter=st-center;\n float rot=time*0.3;\n float c=cos(rot),s=sin(rot);\n vec2 rotated=vec2(\n fromCenter.x*c-fromCenter.y*s,\n fromCenter.x*s+fromCenter.y*c\n )+center;\n\n vec2 pos=st;\n pos+=vec2(\n fbm(rotated*1.2+time*0.4)*0.08,\n fbm(rotated*1.2+time*0.5+50.0)*0.08\n );\n\n float mixX=clamp(pos.x+fbm(rotated*1.0+time*0.6)*0.25,0.,1.);\n float mixY=clamp(pos.y+fbm(rotated*1.0+time*0.7)*0.25,0.,1.);\n\n vec3 topColors=mix(uColor1,uColor2,smoothstep(0.1,0.9,mixX));\n vec3 bottomColors=mix(uColor3,uColor4,smoothstep(0.1,0.9,mixX));\n vec3 finalColor=mix(topColors,bottomColors,smoothstep(0.1,0.9,mixY));\n\n gl_FragColor=vec4(finalColor,1.0);\n }\n ",t.FRAGMENT_SHADER);t.attachShader(i,s),t.attachShader(i,a),t.linkProgram(i),t.useProgram(i);var u=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW);var l=t.getAttribLocation(i,"aPos");t.enableVertexAttribArray(l),t.vertexAttribPointer(l,2,t.FLOAT,!1,0,0);var f=t.getUniformLocation(i,"uTime"),d=t.getUniformLocation(i,"uResolution"),y=t.getUniformLocation(i,"uColor1"),g=t.getUniformLocation(i,"uColor2"),m=t.getUniformLocation(i,"uColor3"),b=t.getUniformLocation(i,"uColor4"),v=rU[n].colors;t.uniform2f(d,r.width,r.height),t.uniform3fv(y,v[0]),t.uniform3fv(g,v[1]),t.uniform3fv(m,v[2]),t.uniform3fv(b,v[3]);var w=0,x=function(){p.current=requestAnimationFrame(x),w+=.015*c,t.uniform1f(f,w),t.viewport(0,0,e.width,e.height),t.drawArrays(t.TRIANGLE_STRIP,0,4)};return x(),function(){p.current&&cancelAnimationFrame(p.current),t.deleteProgram(i),t.deleteBuffer(u)}}}},[n,c]),xl.jsxs("div",{onClick:u,className:"relative overflow-hidden ".concat(i),style:l,"data-gradient-id":(null===(t=rU[n])||void 0===t?void 0:t.id)||"unknown_gradient",children:[xl.jsx("canvas",{ref:h,className:"absolute inset-0 z-0",style:{width:d,height:d}}),s&&xl.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:s})]})},oU=function(){var e=Al(),t=me(function(e){return e.config.appearance}),r=[rf,ef,nf,tf];return xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:select-none bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:font-medium bluxcc:mt-4 bluxcc:mb-2",style:{color:t.textColor},children:[xl.jsx(nU,{theme:"purple",animationSpeed:3,style:{borderRadius:t.borderRadius},className:"bluxcc:size-[264px] bluxcc:mx-6 bluxcc:overflow-hidden bluxcc:flex bluxcc:items-center",children:xl.jsx("div",{className:"bluxcc:marquee_outer",children:xl.jsx("div",{className:"bluxcc:marquee_track bluxcc:gap-2.5",children:w(w(w(w([],r,!0),r,!0),r,!0),r,!0).map(function(e,r){return xl.jsx("div",{style:{borderRadius:"0px"!==t.borderRadius?"16px":"0px"},className:"bluxcc:size-[82px] bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:bg-primary-500",children:xl.jsx(e,{fill:"#fff"})},r)})})})}),xl.jsx("p",{className:"bluxcc:text-2xl bluxcc:mt-[26px] bluxcc:mb-2 bluxcc:px-6 ",children:e("wallet_infra")}),xl.jsx("p",{className:"bluxcc:text-sm text-center",children:e("blux_gateway")})]})},iU=function(){var e=Al(),t=Q.useState({address:""}),r=t[0],o=t[1],i=Q.useState({});i[0];var s,a=i[1],c={logo:xl.jsx(kf,{}),name:"xlm",valueInCurrency:203},u=me(function(e){return e.config.appearance});return xl.jsxs("div",{children:[xl.jsx(Mf,{autoFocus:!0,type:"text",label:e("enter_token_address"),placeholder:e("enter_address"),value:r.address,onChange:(s="address",function(e){o(function(t){var r;return n(n({},t),((r={})[s]=e.target.value,r))}),a(function(e){var t;return n(n({},e),((t={})[s]="",t))})}),onButtonClick:function(){},button:xl.jsx("span",{style:{color:u.accentColor},className:"bluxcc:flex bluxcc:justify-between",children:e("check")})}),xl.jsx("div",{className:"bluxcc:h-56 bluxcc:my-4",style:{borderRadius:u.borderRadius,border:"".concat(u.borderWidth," solid ").concat(u.borderColor)},children:xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",children:[xl.jsx("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:u.borderColor,borderWidth:u.borderWidth},children:c.logo}),c.name,xl.jsx("div",{className:"bluxcc:flex bluxcc:flex-col",children:xl.jsxs("span",{className:"bluxcc:text-2xl bluxcc:font-medium",style:{color:u.accentColor},children:["$",Cu(c.valueInCurrency)]})})]})}),xl.jsx(lf,{}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:gap-4",children:[xl.jsx(gf,{state:"disabled",variant:"outline",children:e("cancel")}),xl.jsx(gf,{state:"enabled",variant:"fill",size:"large",children:e("add_token")})]})]})},sU=function(e){return d(void 0,void 0,void 0,function(){var t,r,o;return h(this,function(i){switch(i.label){case 0:if(!(t=e.signMessage))return e.setRoute(se.FAILED),[2];e.setRoute(se.WAITING),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Gu(t.wallet,t.message,null===(o=e.user)||void 0===o?void 0:o.address,t.options.network)];case 2:return r=i.sent(),e.setSignMessage(n(n({},t),{result:r}),!0,se.WAITING),setTimeout(function(){e.setRoute(se.SUCCESSFUL)},400),[3,4];case 3:return i.sent(),setTimeout(function(){e.setRoute(se.FAILED)},200),[3,4];case 4:return[2]}})})},aU=function(){var e,t,r=Al(),n=me(function(e){return e}),o=n.config.appearance,i=n.signMessage;if(!i)return null;return xl.jsxs("div",{children:[xl.jsxs("div",{className:"bluxcc:p-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[xl.jsxs("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[n.config.appName," "]}),r("sign_permission")]}),xl.jsx("div",{className:"bluxcc:h-24 bluxcc:p-4 bluxcc:font-mono bluxcc:text-xs bluxcc:overflow-auto",style:{border:"".concat(o.borderWidth," solid ").concat(o.borderColor),borderRadius:o.borderRadius},children:i.message}),xl.jsxs("div",{className:"bluxcc:inline-flex bluxcc:mt-4 bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{borderRadius:o.borderRadius,borderColor:o.borderColor},children:[xl.jsx("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:xl.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:r("yourWallet")})}),xl.jsx("div",{className:"bluxcc:overflow-hidden bluxcc:px-[10px] bluxcc:py-2",style:{borderRadius:o.borderRadius,backgroundColor:o.fieldBackground,color:o.textColor},children:xl.jsx("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(Tu(o.textColor,.8))},children:(null===(e=n.user)||void 0===e?void 0:e.address)?Pu(null===(t=n.user)||void 0===t?void 0:t.address,5):r("noAddressFound")})})]}),xl.jsx(lf,{}),xl.jsx(gf,{size:"large",state:"enabled",variant:"fill",onClick:function(){return d(void 0,void 0,void 0,function(){return h(this,function(e){return sU(n),[2]})})},children:r("approve")})]})},cU=function(){var e,t,r=Al(),n=me(function(e){return e});return xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[xl.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:xl.jsx(Kl,{})}),xl.jsxs("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[xl.jsx("p",{className:"bluxcc:text-xl",children:"login"===n.waitingStatus?r("loginFailed"):r("signingFailed",{walletName:null!==(t=null===(e=n.user)||void 0===e?void 0:e.authValue)&&void 0!==t?t:"wallet"})}),xl.jsx("p",{className:"bluxcc:text-sm",children:"login"===n.waitingStatus?r("loginRetryMessage"):r("signingRetryMessage")})]}),xl.jsx(lf,{}),xl.jsx(gf,{onClick:function(){var e;"signMessage"===n.waitingStatus?sU(n):"sendTransaction"===n.waitingStatus?$L(n):"login"===n.waitingStatus&&zf(n,fu[(null===(e=n.user)||void 0===e?void 0:e.authValue)||"Rabet"])},state:"enabled",variant:"outline",children:r("tryAgain")})]})},uU=function(){var e=Al(),t=me(function(e){return e}),r=t.config.appearance;Q.useEffect(function(){d(void 0,void 0,void 0,function(){return h(this,function(e){return zf(t,fu[oe.WalletConnect]),[2]})})},[]);if(!t.walletConnect)return null;if(!t.walletConnect.connection||!t.walletConnect.client)return null;var n=t.walletConnect.connection.uri;return xl.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[xl.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-[208px] bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:r.borderRadius,color:r.textColor,borderColor:r.borderColor,backgroundColor:r.fieldBackground,borderWidth:r.borderWidth},children:[xl.jsx(qL,{size:184,value:n,bgColor:r.fieldBackground,fgColor:r.accentColor,level:"Q",imgSize:40}),xl.jsx("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:r.background},children:xl.jsx(Tf,{fill:r.accentColor,background:r.fieldBackground})})]}),xl.jsx("div",{className:"bluxcc:mt-4 bluxcc:font-medium",children:xl.jsx("p",{className:"bluxcc:text-lg",children:"Scan this QR code with your phone"})}),xl.jsx(lf,{}),xl.jsx(gf,{size:"large",state:"enabled",variant:"tonal",style:{color:r.accentColor},onClick:function(){return function(r){vu(r),t.setAlert("info",e("address_copied")),setTimeout(function(){t.setAlert("none","")},1e3)}(n)},children:"Copy URI"})]})},lU=function(){var e,t=Al(),r=Q.useState(!1),o=r[0],i=r[1],s=Q.useState(""),a=s[0],c=s[1],u=me(function(e){return e}),l=Q.useState(null),f=l[0],d=l[1],h=u.config.appearance,p=u.balances.balances.filter(function(e){return"liquidity_pool_shares"!==e.asset_type}).filter(function(e){return"0.0000000"!==e.balance}).map(function(e){return"native"===e.asset_type?{assetIssuer:"",assetCode:"XLM",assetBalance:e.balance,assetType:e.asset_type}:{assetBalance:e.balance,assetCode:e.asset_code,assetType:e.asset_type,assetIssuer:e.asset_issuer}}),y=0!==(e=p).length?e:[te],g=function(){return o?h.accentColor:h.borderColor};return xl.jsxs("div",{className:"bluxcc:h-[360px] bluxcc:w-full",children:[xl.jsx("div",{children:xl.jsxs("div",{onFocus:function(){return i(!0)},onBlur:function(){return i(!1)},onMouseEnter:function(e){o||(e.currentTarget.style.borderColor=h.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){o||(e.currentTarget.style.borderColor=h.borderColor)},className:"bluxcc:flex bluxcc:h-14 bluxcc:items-center bluxcc:gap-2 bluxcc:p-4",style:{background:h.fieldBackground,borderWidth:h.borderWidth,"--tw-ring-color":g(),borderRadius:h.borderRadius,borderColor:g(),color:h.textColor},children:[xl.jsx(_l,{fill:h.textColor}),xl.jsx("input",{autoFocus:!0,type:"text",id:"bluxcc-input",placeholder:t("search"),value:a,onChange:function(e){return c(e.target.value)},className:"bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base",style:{color:h.textColor}})]})}),xl.jsxs("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:mt-4 bluxcc:gap-2 bluxcc:overflow-y-auto overflowStyle bluxcc:max-h-[300px]",children:[y.map(function(e,t){return xl.jsxs("button",{id:"bluxcc-button",onClick:function(){!function(e){var t,r="sendAsset";"swapTo"===u.selectAsset.field?r="swapToAsset":"swapFrom"===u.selectAsset.field&&(r="swapFromAsset"),u.setSelectAsset(n(n({},u.selectAsset),((t={})[r]=e,t)));var o=wu(u.selectAsset.field);u.setRoute(o)}(e)},onMouseEnter:function(){return d(t)},onMouseLeave:function(){return d(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:px-4 bluxcc:py-3",style:{background:f===t?h.fieldBackground:"transparent",color:h.textColor,borderBottomStyle:"dashed",borderBottomWidth:t<y.length-1?h.borderWidth:"0px",borderBottomColor:h.borderColor,transition:"all 0.2s ease-in-out",fontFamily:h.fontFamily},children:[xl.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[xl.jsx("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:h.borderRadius,background:h.fieldBackground,border:"".concat(h.borderWidth," solid ").concat(h.borderColor)},children:"native"===e.assetType?xl.jsx(kf,{fill:xu(h.fieldBackground)}):xl.jsx(of,{fill:xu(h.fieldBackground)})}),xl.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col",children:[xl.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.assetCode}),xl.jsx("span",{className:"bluxcc:text-xs",style:{color:Tu(h.textColor,.7)},children:e.assetCode})]})]}),xl.jsx("span",{className:"bluxcc:font-medium",children:Cu(e.assetBalance)})]},e.assetType+e.assetIssuer)}),0===y.length&&xl.jsx("div",{style:{color:h.textColor},className:"bluxcc:mt-2 bluxcc:text-center",children:t("noAssetsFound")})]})]})},fU=function(){var e=me(function(e){return e}),t=function(){var e,t,r=me(function(e){return e}),n=Q.useState({error:null,loading:!0,balances:[]}),o=n[0],i=n[1],s=null===(e=r.user)||void 0===e?void 0:e.address;return Q.useEffect(function(){i({error:null,loading:!0,balances:[]}),qu({address:s}).then(function(e){i({error:null,loading:!1,balances:e})}).catch(function(e){i({error:e,loading:!1,balances:[]})})},[s,null===(t=r.stellar)||void 0===t?void 0:t.servers]),o}(),r=function(){var e,t,r=me(function(e){return e}),o=Q.useState({error:null,loading:!0,transactions:[]}),i=o[0],s=o[1],a=null===(e=r.user)||void 0===e?void 0:e.address;return Q.useEffect(function(){s({error:null,loading:!0,transactions:[]}),Ku({limit:5,order:"desc",forAccount:a}).then(function(e){for(var t=e.response,r=[],o=0,i=t.records;o<i.length;o++){var a=i[o];r.push(a.operations())}Promise.all(r).then(function(e){var r=t.records.map(function(t,r){return n(n({},t),{operations:e[r].records})});s({error:null,loading:!1,transactions:r})})}).catch(function(e){s({error:e,loading:!1,transactions:[]})})},[a,null===(t=r.stellar)||void 0===t?void 0:t.servers]),i}(),o=function(){e.setBalances(t),e.setTransactions(r),i()},i=function(){var r=t.balances,o=r.find(function(e){return"native"===e.asset_type});if(e.modal.route!==se.SEND&&e.modal.route!==se.SWAP&&e.modal.route!==se.SELECT_ASSET&&0!==r.length&&o){var i=mu(o);r.length>1&&(i=mu(r[1])),e.setSelectAsset(n(n({},e.selectAsset),{swapToAsset:i,sendAsset:mu(o),swapFromAsset:mu(o)}))}};Q.useEffect(function(){o();var e=setInterval(function(){o()},1e4);return function(){clearInterval(e)}},[t,r,e.modal.route])},dU=function(){var e,t,r;fU();var n=me(function(e){return e});!function(e){var t,r,n=Q.useState(!1),o=n[0],i=n[1];Q.useEffect(function(){var t=setInterval(function(){var t;e.authState.isAuthenticated&&(null===(t=e.user)||void 0===t?void 0:t.authValue)&&"wallet"===e.user.authMethod?Ou(fu[e.user.authValue]).then(function(t){var r;t&&e.config.networks.includes(t)&&(null===(r=e.stellar)||void 0===r?void 0:r.activeNetwork)!==t&&!e.networkSyncDisabled?Fu(t):t&&!e.config.networks.includes(t)?(e.setNetworkSyncDisabled(!1),i(!0)):i(!1)}).catch(function(){i(!1)}):i(!1)},1e3);return function(){clearInterval(t),i(!1)}},[e.authState.isAuthenticated,e.config.networks,null===(t=e.user)||void 0===t?void 0:t.authValue,null===(r=e.stellar)||void 0===r?void 0:r.activeNetwork]),Q.useEffect(function(){e.modal.isOpen?o||e.modal.route!==se.WRONG_NETWORK||e.closeModal():setTimeout(function(){o&&e.config.promptOnWrongNetwork?e.openModal(se.WRONG_NETWORK):e.closeModal()},300)},[o,e.modal.isOpen])}(n);var o=n.modal,i=n.closeModal,s=n.setShowAllWallets,a=o.route,c=function(){var e;return(e={})[se.ONBOARDING]={title:"logInOrSignUp",Component:xl.jsx(wL,{})},e[se.PROFILE]={title:"profile",Component:xl.jsx(pf,{})},e[se.WAITING]={title:"",Component:xl.jsx(Pf,{})},e[se.SUCCESSFUL]={title:"",Component:xl.jsx(Ff,{})},e[se.FAILED]={title:"",Component:xl.jsx(cU,{})},e[se.SEND_TRANSACTION]={title:"confirmation",Component:xl.jsx(eU,{})},e[se.SEND]={title:"send",Component:xl.jsx(Lf,{})},e[se.ACTIVITY]={title:"activity",Component:xl.jsx(YL,{})},e[se.RECEIVE]={title:"receive",Component:xl.jsx(HL,{})},e[se.SWAP]={title:"swap",Component:xl.jsx(Bf,{})},e[se.BALANCES]={title:"balances",Component:xl.jsx(XL,{})},e[se.BALANCE_DETAILS]={title:"",Component:xl.jsx(tU,{})},e[se.OTP]={title:"",Component:xl.jsx(Df,{})},e[se.WRONG_NETWORK]={title:"",Component:xl.jsx(KL,{})},e[se.ABOUT]={title:"whatIsBlux",Component:xl.jsx(oU,{})},e[se.ADD_TOKEN]={title:"addToken",Component:xl.jsx(iU,{})},e[se.SIGN_MESSAGE]={title:"signMessage",Component:xl.jsx(aU,{})},e[se.SELECT_ASSET]={title:"selectAsset",Component:xl.jsx(lU,{})},e[se.WALLET_CONNECT]={title:"walletConnect",Component:xl.jsx(uU,{})},e}()[a],u=a===se.WRONG_NETWORK,l=a===se.WAITING,f=a===se.SUCCESSFUL,d=a===se.SIGN_MESSAGE||a===se.SEND_TRANSACTION||a===se.FAILED,h=a===se.WRONG_NETWORK||l||f,p=l&&"sendTransaction"!==n.waitingStatus||a===se.ONBOARDING&&n.showAllWallets||[se.ACTIVITY,se.SEND,se.OTP,se.BALANCES,se.RECEIVE,se.SWAP,se.BALANCE_DETAILS,se.ABOUT,se.ADD_TOKEN,se.WALLET_CONNECT].includes(a)?"back":a===se.ONBOARDING?"info":void 0,y=n.modal.dynamicTitle||c.title,g=function(){if(!u){i(),s(!1);var e=n.waitingStatus,t="signMessage"===e;if(t||"sendTransaction"===e){var r=t?n.signMessage:n.sendTransaction;if(r){var o=r.resolver,a=r.rejecter,c=r.result;f&&o&&c?(o(c),setTimeout(function(){n.cleanUp(e)},200)):d&&a&&(a("User rejected the transaction"),setTimeout(function(){n.cleanUp(e)},200))}}}};return Q.useEffect(function(){n.authState.isAuthenticated||(n.signMessage&&(n.cleanUp("signMessage"),n.signMessage.rejecter("User logged out during the process.")),n.sendTransaction&&(n.cleanUp("sendTransaction"),n.sendTransaction.rejecter("User logged out during the process.")))},[n.authState]),Q.useEffect(function(){var e,t,r,o=ku((null===(e=n.stellar)||void 0===e?void 0:e.activeNetwork)||"",null!==(t=n.config.transports)&&void 0!==t?t:{}),i=o.horizon,s=o.soroban;n.setStellar({activeNetwork:(null===(r=n.stellar)||void 0===r?void 0:r.activeNetwork)||"",servers:{horizon:new ae.Horizon.Server(i),soroban:new ae.rpc.Server(s)}})},[n.config.transports,n.config.networks,null===(e=n.stellar)||void 0===e?void 0:e.activeNetwork]),xl.jsxs(El,{isOpen:o.isOpen,isSticky:u||n.config.isPersistent,onClose:g,isPersistent:null!==(t=n.config.isPersistent)&&void 0!==t&&t,appearance:n.config.appearance,children:[xl.jsx(uf,{icon:p,onBack:function(){if(a===se.WAITING||a===se.OTP&&!n.authState.isAuthenticated||a===se.ABOUT||a===se.WALLET_CONNECT)n.setRoute(se.ONBOARDING);else if(n.showAllWallets)s(!1);else if([se.SEND,se.ACTIVITY,se.BALANCES,se.RECEIVE,se.SWAP].includes(a))n.setRoute(se.PROFILE);else if([se.BALANCE_DETAILS,se.ADD_TOKEN].includes(a))n.setRoute(se.BALANCES);else if(a===se.SELECT_ASSET){var e=wu(n.selectAsset.field);n.setRoute(e)}},onInfo:function(){n.setRoute(se.ABOUT)},onClose:g,title:y,closeButton:!h,isPersistent:null!==(r=n.config.isPersistent)&&void 0!==r&&r}),c.Component]})};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('/*! tailwindcss v4.1.13 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--bluxcc-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bluxcc-color-gray-800:#333;--bluxcc-color-white:#fff;--bluxcc-spacing:0.25rem;--bluxcc-text-xs:0.75rem;--bluxcc-text-xs--line-height:1.33333;--bluxcc-text-sm:0.875rem;--bluxcc-text-sm--line-height:1.42857;--bluxcc-text-base:1rem;--bluxcc-text-base--line-height:1.5;--bluxcc-text-lg:1.125rem;--bluxcc-text-lg--line-height:1.55556;--bluxcc-text-xl:1.25rem;--bluxcc-text-xl--line-height:1.4;--bluxcc-text-2xl:1.5rem;--bluxcc-text-2xl--line-height:1.33333;--bluxcc-font-weight-normal:400;--bluxcc-font-weight-medium:500;--bluxcc-font-weight-semibold:600;--bluxcc-animate-spin:spin 1s linear infinite;--bluxcc-default-transition-duration:150ms;--bluxcc-default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--bluxcc-color-primary-500:#0c1083;--bluxcc-color-light-red-50:#ffe5e5;--bluxcc-color-light-blue-50:#e5fbff;--bluxcc-color-alert-info:#5093ff;--bluxcc-color-alert-error:#ec2929;--bluxcc-color-alert-success:#00bd81;--bluxcc-color-alert-warning:#fa8f02}}@layer utilities{.bluxcc\\:absolute{position:absolute!important}.bluxcc\\:fixed{position:fixed!important}.bluxcc\\:relative{position:relative!important}.bluxcc\\:inset-0{inset:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:right-0{right:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-0{bottom:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-3{bottom:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:bottom-4{bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:left-0{left:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:left-1\\/2{left:50%!important}.bluxcc\\:z-10{z-index:10!important}.bluxcc\\:z-20{z-index:20!important}.bluxcc\\:z-40{z-index:40!important}.bluxcc\\:z-9999999{z-index:9999999!important}.bluxcc\\:mx-3{margin-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mx-6{margin-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:\\!my-2{margin-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:my-1{margin-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:my-2{margin-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:my-4{margin-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:my-6{margin-block:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:my-\\[5px\\]{margin-block:5px!important}.bluxcc\\:\\!mt-4{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-0{margin-top:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:mt-0\\.5{margin-top:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mt-1{margin-top:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mt-2{margin-top:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mt-3{margin-top:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mt-4,.bluxcc\\:mt-4\\!{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-6,.bluxcc\\:mt-6\\!{margin-top:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mt-\\[26px\\]{margin-top:26px!important}.bluxcc\\:\\!mr-2{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mr-1{margin-right:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mr-2{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-1{margin-bottom:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mb-2{margin-bottom:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-6{margin-bottom:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mb-10{margin-bottom:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:ml-1\\.5{margin-left:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:ml-4{margin-left:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:ml-auto{margin-left:auto!important}.bluxcc\\:box-border{box-sizing:border-box!important}.bluxcc\\:flex{display:flex!important}.bluxcc\\:inline-flex{display:inline-flex!important}.bluxcc\\:size-5{height:calc(var(--bluxcc-spacing)*5)!important;width:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:size-8{height:calc(var(--bluxcc-spacing)*8)!important;width:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:size-10{height:calc(var(--bluxcc-spacing)*10)!important;width:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:size-14{height:calc(var(--bluxcc-spacing)*14)!important;width:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:size-20{height:calc(var(--bluxcc-spacing)*20)!important;width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:size-24{height:calc(var(--bluxcc-spacing)*24)!important;width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:size-\\[64px\\]{height:64px!important;width:64px!important}.bluxcc\\:size-\\[68px\\]{height:68px!important;width:68px!important}.bluxcc\\:size-\\[82px\\]{height:82px!important;width:82px!important}.bluxcc\\:size-\\[208px\\]{height:208px!important;width:208px!important}.bluxcc\\:size-\\[264px\\]{height:264px!important;width:264px!important}.bluxcc\\:h-3\\.5{height:calc(var(--bluxcc-spacing)*3.5)!important}.bluxcc\\:h-4{height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:h-8{height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:h-10{height:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:h-12{height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:h-14,.bluxcc\\:h-14\\!{height:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:h-16{height:calc(var(--bluxcc-spacing)*16)!important}.bluxcc\\:h-20{height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:h-24{height:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:h-56{height:calc(var(--bluxcc-spacing)*56)!important}.bluxcc\\:h-\\[52px\\]{height:52px!important}.bluxcc\\:h-\\[312px\\]{height:312px!important}.bluxcc\\:h-\\[355px\\]{height:355px!important}.bluxcc\\:h-\\[360px\\]{height:360px!important}.bluxcc\\:h-full{height:100%!important}.bluxcc\\:max-h-12{max-height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:max-h-20{max-height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:max-h-\\[80px\\]{max-height:80px!important}.bluxcc\\:max-h-\\[300px\\]{max-height:300px!important}.bluxcc\\:max-h-\\[312px\\]{max-height:312px!important}.bluxcc\\:max-h-\\[324px\\]{max-height:324px!important}.bluxcc\\:w-12{width:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:w-20{width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:w-24{width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:w-\\[68px\\]\\!{width:68px!important}.bluxcc\\:w-\\[100px\\]{width:100px!important}.bluxcc\\:w-\\[292px\\]{width:292px!important}.bluxcc\\:w-\\[360px\\]\\!{width:360px!important}.bluxcc\\:w-\\[calc\\(100\\%-3rem\\)\\]{width:calc(100% - 3rem)!important}.bluxcc\\:w-auto{width:auto!important}.bluxcc\\:w-full{width:100%!important}.bluxcc\\:max-w-\\[90px\\]{max-width:90px!important}.bluxcc\\:max-w-\\[180px\\]{max-width:180px!important}.bluxcc\\:max-w-\\[184px\\]{max-width:184px!important}.bluxcc\\:flex-1{flex:1!important}.bluxcc\\:shrink-0{flex-shrink:0!important}.bluxcc\\:grow{flex-grow:1!important}.bluxcc\\:-translate-x-1\\/2{--tw-translate-x:-50%!important;translate:var(--tw-translate-x) var(--tw-translate-y)!important}.bluxcc\\:transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)!important}.bluxcc\\:animate-spin{animation:var(--bluxcc-animate-spin)!important}.bluxcc\\:flex-col{flex-direction:column!important}.bluxcc\\:items-center{align-items:center!important}.bluxcc\\:justify-between{justify-content:space-between!important}.bluxcc\\:justify-center{justify-content:center!important}.bluxcc\\:justify-start{justify-content:flex-start!important}.bluxcc\\:gap-1,.bluxcc\\:gap-1\\!{gap:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:gap-1\\.5{gap:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:gap-2{gap:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:gap-2\\.5{gap:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:gap-3{gap:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:gap-4{gap:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*1*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*1*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*2*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*2*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-x-3{:where(&>:not(:last-child)){--tw-space-x-reverse:0!important;margin-inline-end:calc(var(--bluxcc-spacing)*3*(1 - var(--tw-space-x-reverse)))!important;margin-inline-start:calc(var(--bluxcc-spacing)*3*var(--tw-space-x-reverse))!important}}.bluxcc\\:overflow-auto{overflow:auto!important}.bluxcc\\:overflow-hidden{overflow:hidden!important}.bluxcc\\:overflow-y-auto{overflow-y:auto!important}.bluxcc\\:rounded-full{border-radius:calc(infinity * 1px)!important}.bluxcc\\:rounded-b-none\\!{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.bluxcc\\:border{border-style:var(--tw-border-style)!important;border-width:1px!important}.bluxcc\\:border-2{border-style:var(--tw-border-style)!important;border-width:2px!important}.bluxcc\\:border-none{--tw-border-style:none!important;border-style:none!important}.bluxcc\\:border-alert-error{border-color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:border-alert-info{border-color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:border-alert-success{border-color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:border-alert-warning{border-color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:bg-light-blue-50{background-color:var(--bluxcc-color-light-blue-50)!important}.bluxcc\\:bg-light-red-50{background-color:var(--bluxcc-color-light-red-50)!important}.bluxcc\\:bg-primary-500{background-color:var(--bluxcc-color-primary-500)!important}.bluxcc\\:bg-transparent{background-color:transparent!important}.bluxcc\\:bg-white{background-color:var(--bluxcc-color-white)!important}.bluxcc\\:p-1{padding:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:p-2{padding:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:p-4{padding:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:\\!px-3{padding-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:px-2{padding-inline:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:px-2\\.5{padding-inline:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:px-3{padding-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:px-4{padding-inline:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-6{padding-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:px-7{padding-inline:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:px-\\[10px\\]{padding-inline:10px!important}.bluxcc\\:\\!py-1,.bluxcc\\:py-1{padding-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:py-2{padding-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:py-3{padding-block:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:py-4{padding-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pt-\\[17px\\]{padding-top:17px!important}.bluxcc\\:pr-3{padding-right:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:pb-4{padding-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pl-2{padding-left:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:text-center{text-align:center!important}.bluxcc\\:text-left{text-align:left!important}.bluxcc\\:text-right{text-align:right!important}.bluxcc\\:text-start{text-align:start!important}.bluxcc\\:font-mono{font-family:var(--bluxcc-font-mono)!important}.bluxcc\\:\\!text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:\\!text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:\\!text-xs{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:text-2xl{font-size:var(--bluxcc-text-2xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-2xl--line-height))!important}.bluxcc\\:text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:text-lg{font-size:var(--bluxcc-text-lg)!important;line-height:var(--tw-leading,var(--bluxcc-text-lg--line-height))!important}.bluxcc\\:text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-xl{font-size:var(--bluxcc-text-xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-xl--line-height))!important}.bluxcc\\:text-xs{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:text-\\[10px\\]{font-size:10px!important}.bluxcc\\:\\!leading-\\[16px\\]{--tw-leading:16px!important;line-height:16px!important}.bluxcc\\:leading-4{--tw-leading:calc(var(--bluxcc-spacing)*4)!important;line-height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:leading-5{--tw-leading:calc(var(--bluxcc-spacing)*5)!important;line-height:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:leading-7{--tw-leading:calc(var(--bluxcc-spacing)*7)!important;line-height:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:font-medium{--tw-font-weight:var(--bluxcc-font-weight-medium)!important;font-weight:var(--bluxcc-font-weight-medium)!important}.bluxcc\\:font-normal{--tw-font-weight:var(--bluxcc-font-weight-normal)!important;font-weight:var(--bluxcc-font-weight-normal)!important}.bluxcc\\:font-semibold{--tw-font-weight:var(--bluxcc-font-weight-semibold)!important;font-weight:var(--bluxcc-font-weight-semibold)!important}.bluxcc\\:tracking-\\[-2\\%\\]{--tw-tracking:-2%!important;letter-spacing:-2%!important}.bluxcc\\:break-all{word-break:break-all!important}.bluxcc\\:whitespace-nowrap{white-space:nowrap!important}.bluxcc\\:text-alert-error{color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:text-alert-info{color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:text-alert-success{color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:text-alert-warning{color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:text-gray-800{color:var(--bluxcc-color-gray-800)!important}.bluxcc\\:capitalize{text-transform:capitalize!important}.bluxcc\\:no-underline{text-decoration-line:none!important}.bluxcc\\:outline-hidden{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}.bluxcc\\:transition-\\[border-radius\\,background\\,border-color\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius,background,border-color!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-\\[border-radius\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-all{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:all!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-colors{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-transform{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:transform,translate,scale,rotate!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:duration-200{--tw-duration:200ms!important;transition-duration:.2s!important}.bluxcc\\:duration-300{--tw-duration:300ms!important;transition-duration:.3s!important}.bluxcc\\:outline-none{--tw-outline-style:none!important;outline-style:none!important}.bluxcc\\:select-none{-webkit-user-select:none!important;user-select:none!important}.bluxcc\\:placeholder\\:text-base\\!{&::placeholder{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}}.bluxcc\\:focus\\:ring-1{&:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}}.bluxcc\\:focus\\:outline-hidden{&:focus{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}}}.overflowStyle::-webkit-scrollbar{width:.1px}[class*=" bluxcc"]::backdrop,[class*=" bluxcc"]::file-selector-button,[class*=" bluxcc"]:after,[class*=" bluxcc"]:before,[class^=bluxcc],[class^=bluxcc]::backdrop,[class^=bluxcc]::file-selector-button,[class^=bluxcc]:after,[class^=bluxcc]:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}[class*=" bluxcc"] h1,[class*=" bluxcc"] h2,[class*=" bluxcc"] h3,[class*=" bluxcc"] h4,[class*=" bluxcc"] h5,[class*=" bluxcc"] h6,[class^=bluxcc] h1,[class^=bluxcc] h2,[class^=bluxcc] h3,[class^=bluxcc] h4,[class^=bluxcc] h5,[class^=bluxcc] h6{font-size:inherit;font-weight:inherit}[class*=" bluxcc"] menu,[class*=" bluxcc"] ol,[class*=" bluxcc"] ul,[class^=bluxcc] menu,[class^=bluxcc] ol,[class^=bluxcc] ul{list-style:none}[class*=" bluxcc"] audio,[class*=" bluxcc"] canvas,[class*=" bluxcc"] embed,[class*=" bluxcc"] iframe,[class*=" bluxcc"] img,[class*=" bluxcc"] object,[class*=" bluxcc"] svg,[class*=" bluxcc"] video,[class^=bluxcc] audio,[class^=bluxcc] canvas,[class^=bluxcc] embed,[class^=bluxcc] iframe,[class^=bluxcc] img,[class^=bluxcc] object,[class^=bluxcc] svg,[class^=bluxcc] video{display:block;vertical-align:middle}[class*=" bluxcc"] img,[class*=" bluxcc"] video,[class^=bluxcc] img,[class^=bluxcc] video{height:auto;max-width:100%}#bluxcc-input[type=number]::-webkit-inner-spin-button,#bluxcc-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0}#bluxcc-input[type=number]{-moz-appearance:textfield!important}#bluxcc-input:-webkit-autofill,#bluxcc-input:-webkit-autofill:active,#bluxcc-input:-webkit-autofill:focus,#bluxcc-input:-webkit-autofill:hover{-webkit-text-fill-color:var(--input-text-color)!important;-webkit-box-shadow:inset 0 0 0 1000px transparent!important;box-shadow:inset 0 0 0 1000px transparent!important;color:var(--input-text-color)!important;transition:background-color 5000s ease-in-out 0s!important}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.bluxcc\\:animate-fadeIn{animation:fadeIn .5s ease-in-out}.bluxcc\\:animate-fadeOut{animation:fadeOut .3s ease-in-out}@keyframes marquee{0%{transform:translateX(-16%)}to{transform:translateX(-100%)}}.bluxcc\\:marquee_outer{position:relative;width:100%}.bluxcc\\:marquee_track{animation:marquee 40s linear infinite;display:flex;width:max-content;will-change:transform}.bluxcc\\:marquee_track:hover{animation-play-state:paused}#bluxcc-button{cursor:pointer}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes spin{to{transform:rotate(1turn)}}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-duration:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}');var hU=null,pU=!1,yU=null,gU=null,mU=function(e){void 0===e&&(e=document.body),pU&&(hU&&queueMicrotask(function(){try{hU&&(hU.unmount(),hU=null)}catch(e){}}),yU&&gU&&gU.contains(yU)&&gU.removeChild(yU)),gU=e,yU=document.createElement("div"),e.appendChild(yU),(hU=bl.createRoot(yU)).render(Q.createElement(dU))};return e.Asset=ae.Asset,e.blux=tl,e.createConfig=function(e,t){var r,o;pU=!0,mU(t);var i=e.excludeWallets||["lobstr","albedo"];i=i.map(function(e){return e.toLowerCase()});var s=!0;void 0!==e.promptOnWrongNetwork&&(s=e.promptOnWrongNetwork);var a=n(n(n({},e),{excludeWallets:i,appearance:n(n({},ce),null==e?void 0:e.appearance),defaultNetwork:"",promptOnWrongNetwork:s,lang:e.lang||"en",explorer:e.explorer||"stellarchain",loginMethods:e.loginMethods||["wallet"],showWalletUIs:void 0===e.showWalletUIs||e.showWalletUIs}),(null==e?void 0:e.walletConnect)?{walletConnect:e.walletConnect}:{});!function(e,t,r){if(0===e.length)throw new Error("No network is set in config.networks.");var n=null!=t?t:e[0];if(!e.includes(n))throw new Error("config.defaultNetwork is not listed in config.networks.");for(var o=0,i=e;o<i.length;o++){var s=i[o];if(!(hu[s]||r&&r[s]))throw new Error("Must set transports for custom network ".concat(s))}}(e.networks,e.defaultNetwork,e.transports),a.defaultNetwork=null!==(r=e.defaultNetwork)&&void 0!==r?r:e.networks[0];var c,u=ku(a.defaultNetwork,null!==(o=e.transports)&&void 0!==o?o:{}),l=u.horizon,f=u.soroban,p=pe(),y=p.setConfig,g=p.setWallets,m=p.setIsReady;(0,p.setStellar)({activeNetwork:a.defaultNetwork,servers:{horizon:new ae.Horizon.Server(l),soroban:new ae.rpc.Server(f)}}),y(a),(c=i,new Promise(function(e){"complete"===document.readyState?_u(c).then(function(t){e(t)}):window.addEventListener("load",function(){_u(c).then(function(t){e(t)})})})).then(function(e){var t=e.filter(function(e){return!i.includes(e.name.toLowerCase())});g(t),m(!0)}),e.walletConnect&&function(e,t){d(void 0,void 0,void 0,function(){var r,n,o,i;return h(this,function(s){switch(s.label){case 0:if(bL)return[2];bL=!0,s.label=1;case 1:return s.trys.push([1,4,,5]),r=pe(),n=new _M({projectId:e.projectId}),[4,yL.init({core:n,metadata:{name:t,url:e.url,icons:e.icons,description:e.description}})];case 2:return o=s.sent(),r.setWalletConnectClient(o,null),[4,vL(o)];case 3:return i=s.sent(),r.setWalletConnectClient(o,i),[3,5];case 4:return s.sent(),[3,5];case 5:return[2]}})})}(e.walletConnect,e.appName)},e.getAccount=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:if(Lu(),t=Uu(e.address),r=Du(e.network).horizon,!ae.StrKey.isValidEd25519PublicKey(t))throw new Error("Invalid address");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,r.loadAccount(t)];case 2:return[2,n.sent()];case 3:return n.sent(),[2,null];case 4:return[2]}})})},e.getAccounts=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("accounts",[],e),e.forSigner&&(t=t.forSigner(e.forSigner)),e.forAsset&&(t=t.forAsset(e.forAsset)),e.sponsor&&(t=t.sponsor(e.sponsor)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getAssets=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("assets",[],e),e.forCode&&(t=t.forCode(e.forCode)),e.forIssuer&&(t=t.forIssuer(e.forIssuer)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getBalances=qu,e.getClaimableBalances=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("claimableBalances",[],e),e.asset&&(t=t.asset(e.asset)),e.claimant&&(t=t.claimant(e.claimant)),e.sponsor&&(t=t.sponsor(e.sponsor)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getEffects=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("effects",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forOperation&&(t=t.forOperation(e.forOperation)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getInitialState=de,e.getLedgers=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("ledgers",[],e),e.ledger&&(t=t.ledger(e.ledger)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getLiquidityPools=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("liquidityPools",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forAssets&&(t=t.forAssets.apply(t,e.forAssets)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getNetwork=function(){var e,t=pe();if(0===t.config.networks.length)throw new Error("getNetwork must be called after createConfig");return(null===(e=t.stellar)||void 0===e?void 0:e.activeNetwork)||""},e.getOffers=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("offers",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.buying&&(t=t.buying(e.buying)),e.selling&&(t=t.selling(e.selling)),e.sponsor&&(t=t.sponsor(e.sponsor)),e.seller&&(t=t.seller(e.seller)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getOperations=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("operations",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getOrderbook=function(e,t){return d(void 0,void 0,void 0,function(){var r,n;return h(this,function(o){switch(o.label){case 0:return Lu(),[4,(r=zu("orderbook",e,t)).call()];case 1:return n=o.sent(),[2,{builder:r,response:n}]}})})},e.getPayments=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("payments",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getState=le,e.getStrictReceivePaths=Vu,e.getStrictSendPaths=Hu,e.getTradeAggregation=function(e,t){return d(void 0,void 0,void 0,function(){var r,n;return h(this,function(o){switch(o.label){case 0:return Lu(),[4,(r=zu("tradeAggregation",e,t)).call()];case 1:return n=o.sent(),[2,{builder:r,response:n}]}})})},e.getTrades=function(e){return d(void 0,void 0,void 0,function(){var t,r;return h(this,function(n){switch(n.label){case 0:return Lu(),t=zu("trades",[],e),e.forAssetPair&&(t=t.forAssetPair(e.forAssetPair[0],e.forAssetPair[1])),e.forOffer&&(t=t.forOffer(e.forOffer)),e.forType&&(t=t.forType(e.forType)),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},e.getTransactions=Ku,e.networks=Wu,e.setAppearance=rl,e.subscribe=fe,e.switchNetwork=function(e){var t=pe();Fu(e),t.setNetworkSyncDisabled(!0)},e.useExportedStore=function(e){return $(ue,e)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});