PageSourceSearch

https://baes.app/_next/static/chunks/b05c4168.282dce953f9f0a6a.js

js baes.app collected 2026-10-08 19:34:46 UTC 475,687 bytes, 6 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9458],{45290:(e,t,n)=>{n.d(t,{default:()=>cY});var r,i,o=n(89492),a=n.n(o),s=n(41868),l=n.n(s),c=n(20931),d=n.n(c),u=n(13704),h=n(76874),f=n(61125);function p(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;var g=void 0!==n.g?n.g:"u">typeof self?self:"u">typeof window?window:{},m=[],y=[],v="u">typeof Uint8Array?Uint8Array:Array,b=!1;function E(){b=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)m[t]=e[t],y[e.charCodeAt(t)]=t;y[45]=62,y[95]=63}function w(e){var t;b||E();for(var n=e.length,r=n%3,i="",o=[],a=0,s=n-r;a<s;a+=16383)o.push(function(e,t,n){for(var r,i=[],o=t;o<n;o+=3)i.push(m[(r=(e[o]<<16)+(e[o+1]<<8)+e[o+2])>>18&63]+m[r>>12&63]+m[r>>6&63]+m[63&r]);return i.join("")}(e,a,a+16383>s?s:a+16383));return 1===r?(i+=m[(t=e[n-1])>>2],i+=m[t<<4&63],i+="=="):2===r&&(i+=m[(t=(e[n-2]<<8)+e[n-1])>>10],i+=m[t>>4&63],i+=m[t<<2&63],i+="="),o.push(i),o.join("")}function C(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,c=l>>1,d=-7,u=n?i-1:0,h=n?-1:1,f=e[t+u];for(u+=h,o=f&(1<<-d)-1,f>>=-d,d+=s;d>0;o=256*o+e[t+u],u+=h,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=r;d>0;a=256*a+e[t+u],u+=h,d-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)}function _(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,d=(1<<c)-1,u=d>>1,h=5960464477539062e-23*(23===i),f=r?0:o-1,p=r?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+u>=1?h/l:h*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=d?(s=0,a=d):a+u>=1?(s=(t*l-1)*Math.pow(2,i),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*g}var S={}.toString,x=Array.isArray||function(e){return"[object Array]"==S.call(e)};L.TYPED_ARRAY_SUPPORT=void 0===g.TYPED_ARRAY_SUPPORT||g.TYPED_ARRAY_SUPPORT;var k=M();function M(){return L.TYPED_ARRAY_SUPPORT?0x7fffffff:0x3fffffff}function A(e,t){if(M()<t)throw RangeError("Invalid typed array length");return L.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=L.prototype:(null===e&&(e=new L(t)),e.length=t),e}function L(e,t,n){if(!(L.TYPED_ARRAY_SUPPORT||this instanceof L))return new L(e,t,n);if("number"==typeof e){if("string"==typeof t)throw Error("If encoding is specified then the first argument must be a string");return O(this,e)}return P(this,e,t,n)}function P(e,t,n,r){if("number"==typeof t)throw TypeError('"value" argument must not be a number');return"u">typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),L.TYPED_ARRAY_SUPPORT?(e=t).__proto__=L.prototype:e=R(e,t),e}(e,t,n,r):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!L.isEncoding(n))throw TypeError('"encoding" must be a valid string encoding');var r=0|N(t,n),i=(e=A(e,r)).write(t,n);return i!==r&&(e=e.slice(0,i)),e}(e,t,n):function(e,t){if($(t)){var n,r=0|T(t.length);return 0===(e=A(e,r)).length||t.copy(e,0,0,r),e}if(t){if("u">typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?A(e,0):R(e,t);if("Buffer"===t.type&&x(t.data))return R(e,t.data)}throw TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function I(e){if("number"!=typeof e)throw TypeError('"size" argument must be a number');if(e<0)throw RangeError('"size" argument must not be negative')}function O(e,t){if(I(t),e=A(e,t<0?0:0|T(t)),!L.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function R(e,t){var n=t.length<0?0:0|T(t.length);e=A(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function T(e){if(e>=M())throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M().toString(16)+" bytes");return 0|e}function $(e){return!(null==e||!e._isBuffer)}function N(e,t){if($(e))return e.length;if("u">
vendor: 15,432 bytes, line 1
1typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Q(e).length;default:if(r)return X(e).length;t=(""+t).toLowerCase(),r=!0}}function D(e,t,n){var r,i,o,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){var r,i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var o="",a=t;a<n;++a){o+=(r=e[a])<16?"0"+r.toString(16):r.toString(16)}return o}(this,t,n);case"utf8":case"utf-8":return F(this,t,n);case"ascii":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}(this,t,n);case"latin1":case"binary":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}(this,t,n);case"base64":return r=this,i=t,o=n,0===i&&o===r.length?w(r):w(r.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}(this,t,n);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function B(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function K(e,t,n,r,i){if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>0x7fffffff?n=0x7fffffff:n<-0x80000000&&(n=-0x80000000),isNaN(n*=1)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return -1;n=e.length-1}else if(n<0){if(!i)return -1;n=0}if("string"==typeof t&&(t=L.from(t,r)),$(t))return 0===t.length?-1:j(e,t,n,r,i);if("number"==typeof t)return t&=255,L.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):j(e,[t],n,r,i);throw TypeError("val must be string, number or Buffer")}function j(e,t,n,r,i){var o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var d=-1;for(o=n;o<s;o++)if(c(e,o)===c(t,-1===d?0:o-d)){if(-1===d&&(d=o),o-d+1===l)return d*a}else -1!==d&&(o-=o-d),d=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var u=!0,h=0;h<l;h++)if(c(e,o+h)!==c(t,h)){u=!1;break}if(u)return o}return -1}function U(e,t,n,r){return ee(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function F(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,l,c=e[i],d=null,u=c>239?4:c>223?3:c>191?2:1;if(i+u<=n)switch(u){case 1:c<128&&(d=c);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&c)<<6|63&o)>127&&(d=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(d=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(d=l)}null===d?(d=65533,u=1):d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|1023&d),r.push(d),i+=u}var h=r.length;if(h<=H)return String.fromCharCode.apply(String,r);for(var f="",p=0;p<h;)f+=String.fromCharCode.apply(String,r.slice(p,p+=H));return f}L.poolSize=8192,L._augment=function(e){return e.__proto__=L.prototype,e},L.from=function(e,t,n){return P(null,e,t,n)},L.TYPED_ARRAY_SUPPORT&&(L.prototype.__proto__=Uint8Array.prototype,L.__proto__=Uint8Array,"u">typeof Symbol&&Symbol.species&&L[Symbol.species]),L.alloc=function(e,t,n){return I(e),e<=0?A(null,e):void 0!==t?"string"==typeof n?A(null,e).fill(t,n):A(null,e).fill(t):A(null,e)},L.allocUnsafe=function(e){return O(null,e)},L.allocUnsafeSlow=function(e){return O(null,e)},L.isBuffer=et,L.compare=function(e,t){if(!$(e)||!$(t))throw TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},L.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}},L.concat=function(e,t){if(!x(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return L.alloc(0);if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var n,r=L.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!$(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},L.byteLength=N,L.prototype._isBuffer=!0,L.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)B(this,t,t+1);return this},L.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)B(this,t,t+3),B(this,t+1,t+2);return this},L.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)B(this,t,t+7),B(this,t+1,t+6),B(this,t+2,t+5),B(this,t+3,t+4);return this},L.prototype.toString=function(){var e=0|this.length;return 0===e?"":0==arguments.length?F(this,0,e):D.apply(this,arguments)},L.prototype.equals=function(e){if(!$(e))throw TypeError("Argument must be a Buffer");return this===e||0===L.compare(this,e)},L.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},L.prototype.compare=function(e,t,n,r,i){if(!$(e))throw TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return -1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),d=0;d<s;++d)if(l[d]!==c[d]){o=l[d],a=c[d];break}return o<a?-1:+(a<o)},L.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},L.prototype.indexOf=function(e,t,n){return K(this,e,t,n,!0)},L.prototype.lastIndexOf=function(e,t,n){return K(this,e,t,n,!1)},L.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i,o,a,s,l,c,d=this.length-t;if((void 0===n||n>d)&&(n=d),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var u=!1;;)switch(r){case"hex":return function(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))break;e[n+a]=s}return a}(this,e,t,n);case"utf8":case"utf-8":return i=t,o=n,ee(X(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return U(this,e,t,n);case"base64":return a=t,s=n,ee(Q(e),this,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=t,c=n,ee(function(e,t){for(var n,r,i=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i.push(n%256),i.push(r);return i}(e,this.length-l),this,l,c);default:if(u)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),u=!0}},L.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var H=4096;function z(e,t,n){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>n)throw RangeError("Trying to access beyond buffer length")}function q(e,t,n,r,i,o){if(!$(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function V(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function W(e,t,n,r){t<0&&(t=0xffffffff+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function G(e,t,n,r,i,o){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function Z(e,t,n,r,i){return i||G(e,0,n,4),_(e,t,n,r,23,4),n+4}function Y(e,t,n,r,i){return i||G(e,0,n,8),_(e,t,n,r,52,8),n+8}L.prototype.slice=function(e,t){var n,r=this.length;if((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),L.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=L.prototype;else{var i=t-e;n=new L(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},L.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||z(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},L.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||z(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},L.prototype.readUInt8=function(e,t){return t||z(e,1,this.length),this[e]},L.prototype.readUInt16LE=function(e,t){return t||z(e,2,this.length),this[e]|this[e+1]<<8},L.prototype.readUInt16BE=function(e,t){return t||z(e,2,this.length),this[e]<<8|this[e+1]},L.prototype.readUInt32LE=function(e,t){return t||z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},L.prototype.readUInt32BE=function(e,t){return t||z(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},L.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||z(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},L.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||z(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},L.prototype.readInt8=function(e,t){return t||z(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},L.prototype.readInt16LE=function(e,t){t||z(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?0xffff0000|n:n},L.prototype.readInt16BE=function(e,t){t||z(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?0xffff0000|n:n},L.prototype.readInt32LE=function(e,t){return t||z(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},L.prototype.readInt32BE=function(e,t){return t||z(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},L.prototype.readFloatLE=function(e,t){return t||z(e,4,this.length),C(this,e,!0,23,4)},L.prototype.readFloatBE=function(e,t){return t||z(e,4,this.length),C(this,e,!1,23,4)},L.prototype.readDoubleLE=function(e,t){return t||z(e,8,this.length),C(this,e,!0,52,8)},L.prototype.readDoubleBE=function(e,t){return t||z(e,8,this.length),C(this,e,!1,52,8)},L.prototype.writeUIntLE=function(e,t,n,r){e*=1,t|=0,n|=0,r||q(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},L.prototype.writeUIntBE=function(e,t,n,r){e*=1,t|=0,n|=0,r||q(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},L.prototype.writeUInt8=function(e,t,n){return e*=1,t|=0,n||q(this,e,t,1,255,0),L.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},L.prototype.writeUInt16LE=function(e,t,n){return e*=1,t|=0,n||q(this,e,t,2,65535,0),L.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):V(this,e,t,!0),t+2},L.prototype.writeUInt16BE=function(e,t,n){return e*=1,t|=0,n||q(this,e,t,2,65535,0),L.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):V(this,e,t,!1),t+2},L.prototype.writeUInt32LE=function(e,t,n){return e*=1,t|=0,n||q(this,e,t,4,0xffffffff,0),L.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):W(this,e,t,!0),t+4},L.prototype.writeUInt32BE=function(e,t,n){return e*=1,t|=0,n||q(this,e,t,4,0xffffffff,0),L.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},L.prototype.writeIntLE=function(e,t,n,r){if(e*=1,t|=0,!r){var i=Math.pow(2,8*n-1);q(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},L.prototype.writeIntBE=function(e,t,n,r){if(e*=1,t|=0,!r){var i=Math.pow(2,8*n-1);q(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},L.prototype.writeInt8=function(e,t,n){return e*=1,t|=0,n||q(this,e,t,1,127,-128),L.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},L.prototype.writeInt16LE=function(e,t,n){return e*=1,t|=0,n||q(this,e,t,2,32767,-32768),L.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):V(this,e,t,!0),t+2},L.prototype.writeInt16BE=function(e,t,n){return e*=1,t|=0,n||q(this,e,t,2,32767,-32768),L.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):V(this,e,t,!1),t+2},L.prototype.writeInt32LE=function(e,t,n){return e*=1,t|=0,n||q(this,e,t,4,0x7fffffff,-0x80000000),L.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):W(this,e,t,!0),t+4},L.prototype.writeInt32BE=function(e,t,n){return e*=1,t|=0,n||q(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),L.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},L.prototype.writeFloatLE=function(e,t,n){return Z(this,e,t,!0,n)},L.prototype.writeFloatBE=function(e,t,n){return Z(this,e,t,!1,n)},L.prototype.writeDoubleLE=function(e,t,n){return Y(this,e,t,!0,n)},L.prototype.writeDoubleBE=function(e,t,n){return Y(this,e,t,!1,n)},L.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("sourceStart out of bounds");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!L.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},L.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i,o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!L.isEncoding(r))throw TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=$(e)?e:X(new L(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var J=/[^+\/0-9A-Za-z-_]/g;function X(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319||a+1===r){(t-=3)>
1-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Q(e){return function(e){b||E();var t,n,r,i,o,a,s=e.length;if(s%4>0)throw Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:+("="===e[s-1]),a=new v(3*s/4-o),r=o>0?s-4:s;var l=0;for(t=0,n=0;t<r;t+=4,n+=3)i=y[e.charCodeAt(t)]<<18|y[e.charCodeAt(t+1)]<<12|y[e.charCodeAt(t+2)]<<6|y[e.charCodeAt(t+3)],a[l++]=i>>16&255,a[l++]=i>>8&255,a[l++]=255&i;return 2===o?(i=y[e.charCodeAt(t)]<<2|y[e.charCodeAt(t+1)]>>4,a[l++]=255&i):1===o&&(i=y[e.charCodeAt(t)]<<10|y[e.charCodeAt(t+1)]<<4|y[e.charCodeAt(t+2)]>>2,a[l++]=i>>8&255,a[l++]=255&i),a}(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(J,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ee(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function et(e){return null!=e&&(!!e._isBuffer||en(e)||"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&en(e.slice(0,0)))}function en(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var er=Object.freeze({__proto__:null,Buffer:L,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),L.alloc(+e)},isBuffer:et,kMaxLength:k}),ei="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==n.g?n.g:"u">typeof self?self:{};function eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ea(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var es={},el={},ec={};function ed(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, not ${e}`)}function eu(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function eh(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function ef(e,...t){if(!eh(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function ep(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("hash must be wrapped by utils.wrapConstructor");ed(e.outputLen),ed(e.blockLen)}function eg(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function em(e,t){ef(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}Object.defineProperty(ec,"__esModule",{value:!0}),ec.isBytes=eh,ec.number=ed,ec.bool=eu,ec.bytes=ef,ec.hash=ep,ec.exists=eg,ec.output=em,ec.default={number:ed,bool:eu,bytes:ef,hash:ep,exists:eg,output:em},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapCipher=e.Hash=e.nextTick=e.isLE=e.createView=e.u32=e.u16=e.u8=void 0,e.bytesToHex=r,e.hexToBytes=o,e.hexToNumber=a,e.bytesToNumberBE=function(e){return a(r(e))},e.numberToBytesBE=function(e,t){return o(e.toString(16).padStart(2*t,"0"))},e.asyncLoop=async function(t,n,r){let i=Date.now();for(let o=0;o<t;o++){r(o);let t=Date.now()-i;t>=0&&t<n||(await (0,e.nextTick)(),i+=t)}},e.utf8ToBytes=s,e.bytesToUtf8=function(e){return(new TextDecoder).decode(e)},e.toBytes=function(e){if("string"==typeof e)e=s(e);else{if(!(0,t.isBytes)(e))throw Error("Uint8Array expected, got "+typeof e);e=c(e)}return e},e.concatBytes=function(...e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];(0,t.bytes)(i),n+=i.length}let r=new Uint8Array(n);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r},e.checkOpts=function(e,t){if(null==t||"object"!=typeof t)throw Error("options must be defined");return Object.assign(e,t)},e.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},e.setBigUint64=l,e.u64Lengths=function(t,n){let r=new Uint8Array(16),i=(0,e.createView)(r);return l(i,0,BigInt(n?n.length:0),!0),l(i,8,BigInt(t.length),!0),r},e.isAligned32=function(e){return e.byteOffset%4==0},e.copyBytes=c,e.clean=function(...e){for(let t=0;t<e.length;t++)e[t].fill(0)};let t=ec;if(e.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),e.u16=e=>new Uint16Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/2)),e.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),e.createView=e=>
1new DataView(e.buffer,e.byteOffset,e.byteLength),e.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!e.isLE)throw Error("Non little-endian hardware is not supported");let n=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function r(e){(0,t.bytes)(e);let r="";for(let t=0;t<e.length;t++)r+=n[e[t]];return r}function i(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function o(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,n=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(n);for(let t=0,o=0;t<n;t++,o+=2){let n=i(e.charCodeAt(o)),a=i(e.charCodeAt(o+1));if(void 0===n||void 0===a)throw Error('hex string expected, got non-hex character "'+(e[o]+e[o+1])+'" at index '+o);r[t]=16*n+a}return r}function a(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function s(e){if("string"!=typeof e)throw Error("string expected, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function l(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);let i=BigInt(32),o=BigInt(0xffffffff),a=Number(n>>i&o),s=Number(n&o),l=4*!!r,c=4*!r;e.setUint32(t+l,a,r),e.setUint32(t+c,s,r)}function c(e){return Uint8Array.from(e)}e.nextTick=async()=>{},e.Hash=class{},e.wrapCipher=(e,t)=>(Object.assign(t,e),t)}(el);var ey={},ev={};
1Object.defineProperty(ev,"__esModule",{value:!0}),ev.AEAD_TAG_LENGTH=ev.XCHACHA20_NONCE_LENGTH=ev.CURVE25519_PUBLIC_KEY_SIZE=ev.ETH_PUBLIC_KEY_SIZE=ev.UNCOMPRESSED_PUBLIC_KEY_SIZE=ev.COMPRESSED_PUBLIC_KEY_SIZE=ev.SECRET_KEY_LENGTH=void 0,ev.SECRET_KEY_LENGTH=32,ev.COMPRESSED_PUBLIC_KEY_SIZE=33,ev.UNCOMPRESSED_PUBLIC_KEY_SIZE=65,ev.ETH_PUBLIC_KEY_SIZE=64,ev.CURVE25519_PUBLIC_KEY_SIZE=32,ev.XCHACHA20_NONCE_LENGTH=24,ev.AEAD_TAG_LENGTH=16,Object.defineProperty(ey,"__esModule",{value:!0}),ey.ephemeralKeySize=ey.symmetricNonceLength=ey.symmetricAlgorithm=ey.isHkdfKeyCompressed=ey.isEphemeralKeyCompressed=ey.ellipticCurve=ey.ECIES_CONFIG=void 0,ey.ECIES_CONFIG=new function(){this.ellipticCurve="secp256k1",this.isEphemeralKeyCompressed=!1,this.isHkdfKeyCompressed=!1,this.symmetricAlgorithm="aes-256-gcm",this.symmetricNonceLength=16},ey.ellipticCurve=function(){return ey.ECIES_CONFIG.ellipticCurve},ey.isEphemeralKeyCompressed=function(){return ey.ECIES_CONFIG.isEphemeralKeyCompressed},ey.isHkdfKeyCompressed=function(){return ey.ECIES_CONFIG.isHkdfKeyCompressed},ey.symmetricAlgorithm=function(){return ey.ECIES_CONFIG.symmetricAlgorithm},ey.symmetricNonceLength=function(){return ey.ECIES_CONFIG.symmetricNonceLength},ey.ephemeralKeySize=function(){var e={secp256k1:ey.ECIES_CONFIG.isEphemeralKeyCompressed?ev.COMPRESSED_PUBLIC_KEY_SIZE:ev.UNCOMPRESSED_PUBLIC_KEY_SIZE,x25519:ev.CURVE25519_PUBLIC_KEY_SIZE,ed25519:ev.CURVE25519_PUBLIC_KEY_SIZE};if(ey.ECIES_CONFIG.ellipticCurve in e)return e[ey.ECIES_CONFIG.ellipticCurve];throw Error("Not implemented")};var eb={},eE={},ew={},eC={},e_={},eS={};Object.defineProperty(eS,"__esModule",{value:!0}),eS.crypto=void 0,eS.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.gcm=e.ctr=e.cbc=e.utils=void 0,e.randomBytes=r,e.getWebcryptoSubtle=i,e.managedNonce=function(e){return(0,t.number)(e.nonceLength),(t,...i)=>({encrypt(o,...a){let{nonceLength:s}=e,l=r(s),c=e(t,l,...i).encrypt(o,...a),d=(0,n.concatBytes)(l,c);return c.fill(0),d},decrypt(n,...r){let{nonceLength:o}=e,a=n.subarray(0,o),s=n.subarray(o);return e(t,a,...i).decrypt(s,...r)}})};let t=ec,n=el;function r(e=32){if(eS.crypto&&"function"==typeof eS.crypto.getRandomValues)return eS.crypto.getRandomValues(new Uint8Array(e));if(eS.crypto&&"function"==typeof eS.crypto.randomBytes)return eS.crypto.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}function i(){if(eS.crypto&&"object"==typeof eS.crypto.subtle&&null!=eS.crypto.subtle)return eS.crypto.subtle;throw Error("crypto.subtle must be defined")}e.utils={async encrypt(e,t,n,r){let o=i(),a=await o.importKey("raw",e,t,!0,["encrypt"]);return new Uint8Array(await o.encrypt(n,a,r))},async decrypt(e,t,n,r){let o=i(),a=await o.importKey("raw",e,t,!0,["decrypt"]);return new Uint8Array(await o.decrypt(n,a,r))}};let o="AES-CBC",a="AES-CTR",s="AES-GCM";function l(n){return(r,i,l)=>{(0,t.bytes)(r),(0,t.bytes)(i);let c={name:n,length:8*r.length},d=function(e,t,n){if(e===o)return{name:o,iv:t};if(e===a)return{name:a,counter:t,length:64};if(e===s)return n?{name:s,iv:t,additionalData:n}:{name:s,iv:t};throw Error("unknown aes block mode")}(n,i,l);return{encrypt:n=>((0,t.bytes)(n),e.utils.encrypt(r,c,d,n)),decrypt:n=>((0,t.bytes)(n),e.utils.decrypt(r,c,d,n))}}}e.cbc=l(o),e.ctr=l(a),e.gcm=l(s)}(e_);var ex={},ek={},eM={},eA={};function eL(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, not ${e}`)}function eP(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function eI(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function eO(e,...t){if(!eI(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function eR(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");eL(e.outputLen),eL(e.blockLen)}function eT(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function e$(e,t){eO(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}
1Object.defineProperty(eA,"__esModule",{value:!0}),eA.isBytes=eI,eA.number=eL,eA.bool=eP,eA.bytes=eO,eA.hash=eR,eA.exists=eT,eA.output=e$,eA.default={number:eL,bool:eP,bytes:eO,hash:eR,exists:eT,output:e$};var eN={},eD={};Object.defineProperty(eD,"__esModule",{value:!0}),eD.crypto=void 0,eD.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=void 0,e.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name},e.byteSwap32=function(t){for(let n=0;n<t.length;n++)t[n]=(0,e.byteSwap)(t[n])},e.bytesToHex=function(e){(0,n.bytes)(e);let t="";for(let n=0;n<e.length;n++)t+=r[e[n]];return t},e.hexToBytes=function(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,n=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(n);for(let t=0,o=0;t<n;t++,o+=2){let n=i(e.charCodeAt(o)),a=i(e.charCodeAt(o+1));if(void 0===n||void 0===a)throw Error('hex string expected, got non-hex character "'+(e[o]+e[o+1])+'" at index '+o);r[t]=16*n+a}return r},e.asyncLoop=async function(t,n,r){let i=Date.now();for(let o=0;o<t;o++){r(o);let t=Date.now()-i;t>=0&&t<n||(await (0,e.nextTick)(),i+=t)}},e.utf8ToBytes=o,e.toBytes=a,e.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){let i=e[r];(0,n.bytes)(i),t+=i.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r},e.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==s.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)},e.wrapConstructor=function(e){let t=t=>e().update(a(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},e.wrapConstructorWithOpts=function(e){let t=(t,n)=>e(n).update(a(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},e.wrapXOFConstructorWithOpts=function(e){let t=(t,n)=>e(n).update(a(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},e.randomBytes=function(e=32){if(t.crypto&&"function"==typeof t.crypto.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&"function"==typeof t.crypto.randomBytes)return t.crypto.randomBytes(e);throw Error("crypto.getRandomValues must be defined")};let t=eD,n=eA;e.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),e.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),e.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),e.rotr=(e,t)=>e<<32-t|e>>>t,e.rotl=(e,t)=>
1e<<t|e>>>32-t>>>0,e.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],e.byteSwap=e=>e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255,e.byteSwapIfBE=e.isLE?e=>e:t=>(0,e.byteSwap)(t);let r=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function i(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function o(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function a(e){return"string"==typeof e&&(e=o(e)),(0,n.bytes)(e),e}e.nextTick=async()=>{},e.Hash=class{clone(){return this._cloneInto()}};let s={}.toString}(eN),Object.defineProperty(eM,"__esModule",{value:!0}),eM.HashMD=eM.Maj=eM.Chi=void 0;let eB=eN;eM.Chi=(e,t,n)=>e&t^~e&n,eM.Maj=(e,t,n)=>e&t^e&n^t&n,eM.HashMD=class extends eB.Hash{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,eB.createView)(this.buffer)}update(e){(0,eA.exists)(this);let{view:t,buffer:n,blockLen:r}=this,i=(e=(0,eB.toBytes)(e)).length;for(let o=0;o<i;){let a=Math.min(r-this.pos,i-o);if(a!==r)n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===r&&(this.process(t,0),this.pos=0);else{let t=(0,eB.createView)(e);for(;r<=i-o;o+=r)this.process(t,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,eA.exists)(this),(0,eA.output)(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>r-o&&(this.process(n,0),o=0);for(let e=o;e<r;e++)t[e]=0;!function(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);let i=BigInt(32),o=BigInt(0xffffffff),a=Number(n>>i&o),s=Number(n&o),l=4*!!r,c=4*!r;e.setUint32(t+l,a,r),e.setUint32(t+c,s,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);let a=(0,eB.createView)(e),s=this.outputLen;if(s%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=s/4,c=this.get();if(l>c.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)a.setUint32(4*e,c[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:o,pos:a}=this;return e.length=r,e.pos=a,e.finished=i,e.destroyed=o,r%t&&e.buffer.set(n),e}};var eK={};Object.defineProperty(eK,"__esModule",{value:!0}),eK.add5L=eK.add5H=eK.add4H=eK.add4L=eK.add3H=eK.add3L=eK.rotlBL=eK.rotlBH=eK.rotlSL=eK.rotlSH=eK.rotr32L=eK.rotr32H=eK.rotrBL=eK.rotrBH=eK.rotrSL=eK.rotrSH=eK.shrSL=eK.shrSH=eK.toBig=void 0,eK.fromBig=eF,eK.split=eH,eK.add=e3;let ej=BigInt(0x100000000-1),eU=BigInt(32);function eF(e,t=!1){return t?{h:Number(e&ej),l:Number(e>>eU&ej)}:{h:0|Number(e>>eU&ej),l:0|Number(e&ej)}}
1function eH(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:a}=eF(e[i],t);[n[i],r[i]]=[o,a]}return[n,r]}let ez=(e,t)=>BigInt(e>>>0)<<eU|BigInt(t>>>0);eK.toBig=ez;let eq=(e,t,n)=>e>>>n;eK.shrSH=eq;let eV=(e,t,n)=>e<<32-n|t>>>n;eK.shrSL=eV;let eW=(e,t,n)=>e>>>n|t<<32-n;eK.rotrSH=eW;let eG=(e,t,n)=>e<<32-n|t>>>n;eK.rotrSL=eG;let eZ=(e,t,n)=>e<<64-n|t>>>n-32;eK.rotrBH=eZ;let eY=(e,t,n)=>e>>>n-32|t<<64-n;eK.rotrBL=eY;let eJ=(e,t)=>t;eK.rotr32H=eJ;let eX=(e,t)=>e;eK.rotr32L=eX;let eQ=(e,t,n)=>e<<n|t>>>32-n;eK.rotlSH=eQ;let e0=(e,t,n)=>t<<n|e>>>32-n;eK.rotlSL=e0;let e1=(e,t,n)=>t<<n-32|e>>>64-n;eK.rotlBH=e1;let e2=(e,t,n)=>e<<n-32|t>>>64-n;function e3(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/0x100000000|0)|0,l:0|i}}eK.rotlBL=e2;let e5=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);eK.add3L=e5;let e8=(e,t,n,r)=>t+n+r+(e/0x100000000|0)|0;eK.add3H=e8;let e4=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);eK.add4L=e4;let e6=(e,t,n,r,i)=>t+n+r+i+(e/0x100000000|0)|0;eK.add4H=e6;let e7=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0);eK.add5L=e7;let e9=(e,t,n,r,i,o)=>t+n+r+i+o+(e/0x100000000|0)|0;eK.add5H=e9,eK.default={fromBig:eF,split:eH,toBig:ez,shrSH:eq,shrSL:eV,rotrSH:eW,rotrSL:eG,rotrBH:eZ,rotrBL:eY,rotr32H:eJ,rotr32L:eX,rotlSH:eQ,rotlSL:e0,rotlBH:e1,rotlBL:e2,add:e3,add3L:e5,add3H:e8,add4L:e4,add4H:e6,add5H:e9,add5L:e7},Object.defineProperty(ek,"__esModule",{value:!0}),ek.sha384=ek.sha512_256=ek.sha512_224=ek.sha512=ek.SHA384=ek.SHA512_256=ek.SHA512_224=ek.SHA512=void 0;let te=eM,[tt,tn]=eK.default.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","0xf40e3585
15771202a","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))),tr=new Uint32Array(80),ti=new Uint32Array(80);class to extends te.HashMD{constructor(){super(128,64,16,!1),this.Ah=0x6a09e667,this.Al=-0xc4336f8,this.Bh=-0x4498517b,this.Bl=-0x7b3558c5,this.Ch=0x3c6ef372,this.Cl=-0x16b07d5,this.Dh=-0x5ab00ac6,this.Dl=0x5f1d36f1,this.Eh=0x510e527f,this.El=-0x52197d2f,this.Fh=-0x64fa9774,this.Fl=0x2b3e6c1f,this.Gh=0x1f83d9ab,this.Gl=-0x4be4295,this.Hh=0x5be0cd19,this.Hl=0x137e2179}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:o,Dh:a,Dl:s,Eh:l,El:c,Fh:d,Fl:u,Gh:h,Gl:f,Hh:p,Hl:g}=this;return[e,t,n,r,i,o,a,s,l,c,d,u,h,f,p,g]}set(e,t,n,r,i,o,a,s,l,c,d,u,h,f,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|l,this.El=0|c,this.Fh=0|d,this.Fl=0|u,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let n=0;n<16;n++,t+=4)tr[n]=e.getUint32(t),ti[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|tr[e-15],n=0|ti[e-15],r=eK.default.rotrSH(t,n,1)^eK.default.rotrSH(t,n,8)^eK.default.shrSH(t,n,7),i=eK.default.rotrSL(t,n,1)^eK.default.rotrSL(t,n,8)^eK.default.shrSL(t,n,7),o=0|tr[e-2],a=0|ti[e-2],s=eK.default.rotrSH(o,a,19)^eK.default.rotrBH(o,a,61)^eK.default.shrSH(o,a,6),l=eK.default.rotrSL(o,a,19)^eK.default.rotrBL(o,a,61)^eK.default.shrSL(o,a,6),c=eK.default.add4L(i,l,ti[e-7],ti[e-16]),d=eK.default.add4H(c,r,s,tr[e-7],tr[e-16]);tr[e]=0|d,ti[e]=0|c}let{Ah:n,Al:r,Bh:i,Bl:o,Ch:a,Cl:s,Dh:l,Dl:c,Eh:d,El:u,Fh:h,Fl:f,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let e=0;e<80;e++){let t=eK.default.rotrSH(d,u,14)^eK.default.rotrSH(d,u,18)^eK.default.rotrBH(d,u,41),v=eK.default.rotrSL(d,u,14)^eK.default.rotrSL(d,u,18)^eK.default.rotrBL(d,u,41),b=d&h^~d&p,E=u&f^~u&g,w=eK.default.add5L(y,v,E,tn[e],ti[e]),C=eK.default.add5H(w,m,t,b,tt[e],tr[e]),_=0|w,S=eK.default.rotrSH(n,r,28)^eK.default.rotrBH(n,r,34)^eK.default.rotrBH(n,r,39),x=eK.default.rotrSL(n,r,28)^eK.default.rotrBL(n,r,34)^eK.default.rotrBL(n,r,39),k=n&i^n&a^i&a,M=r&o^r&s^o&s;m=0|p,y=0|g,p=0|h,g=0|f,h=0|d,f=0|u,({h:d,l:u}=eK.default.add(0|l,0|c,0|C,0|_)),l=0|a,c=0|s,a=0|i,s=0|o,i=0|n,o=0|r;let A=eK.default.add3L(_,x,M);n=eK.default.add3H(A,C,S,k),r=0|A}({h:n,l:r}=eK.default.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:o}=eK.default.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:a,l:s}=eK.default.add(0|this.Ch,0|this.Cl,0|a,0|s)),({h:l,l:c}=eK.default.add(0|this.Dh,0|this.Dl,0|l,0|c)),({h:d,l:u}=eK.default.add(0|this.Eh,0|this.El,0|d,0|u)),({h:h,l:f}=eK.default.add(0|this.Fh,0|this.Fl,0|h,0|f)),({h:p,l:g}=eK.default.add(0|this.Gh,0|this.Gl,0|p,0|g)),({h:m,l:y}=eK.default.add(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(n,r,i,o,a,s,l,c,d,u,h,f,p,g,m,y)}roundClean(){tr.fill(0),ti.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)}}ek.SHA512=to;class ta extends to{constructor(){super(),this.Ah=-0x73c2c838,this.Al=0x19544da2,this.Bh=0x73e19966,this.Bl=-0x76232b2a,this.Ch=0x1dfab7ae,this.Cl=0x32ff9c82,this.Dh=0x679dd514,this.Dl=0x582f9fcf,this.Eh=0xf6d2b69,this.El=0x7bd44da8,this.Fh=0x77e36f73,this.Fl=0x4c48942,this.Gh=0x3f9d85a8,this.Gl=0x6a1d36c8,this.Hh=0x1112e6ad,this.Hl=-0x6e296d5f,this.outputLen=28}}ek.SHA512_224=ta;class ts extends to{constructor(){super(),this.Ah=0x22312194,this.Al=-0x3d408d4,this.Bh=-0x60aaa05d,this.Bl=-0x37b39b3e,this.Ch=0x2393b86b,this.Cl=0x6f53b151,this.Dh=-0x69c788e7,this.Dl=0x5940eabd,this.Eh=-0x69d7c11e,this.El=-0x5771001d,this.Fh=-0x41a1e1db,this.Fl=0x53863992,this.Gh=0x2b0199fc,this.Gl=0x2c85b8aa,this.Hh=0xeb72ddc,this.Hl=-0x7e3ad35e,this.outputLen=32}}ek.SHA512_256=ts;class tl extends to{constructor(){super(),this.Ah=-0x344462a3,this.Al=-0x3efa6128,this.Bh=0x629a292a,this.Bl=0x367cd507,this.Ch=-0x6ea6fea6,this.Cl=0x3070dd17,this.Dh=0x152fecd8,this.Dl=-0x8f1a6c7,this.Eh=0x67332667,this.El=-4191439,this.Fh=-0x714bb579,this.Fl=0x68581511,this.Gh=-0x24f3d1f3,this.Gl=0x64f98fa7,this.Hh=0x47b5481d,this.Hl=-0x4105b05c,this.outputLen=48}}ek.SHA384=tl,ek.sha512=(0,eN.wrapConstructor)(()=>new to),ek.sha512_224=(0,eN.wrapConstructor)(()=>new ta),ek.sha512_256=(0,eN.wrapConstructor)(()=>new ts),ek.sha384=(0,eN.wrapConstructor)(()=>new tl);var tc={},td={},tu={},th={};Object.defineProperty(th,"__esModule",{value:!0}),th.notImplemented=th.bitMask=void 0,th.isBytes=tm,th.abytes=ty,th.abool=function(e,t){if("boolean"!=typeof t)throw Error(`${e} must be valid boolean, got "${t}".`)},th.bytesToHex=tb,th.numberToHexUnpadded=tE,th.hexToNumber=tw,th.hexToBytes=t_,th.bytesToNumberBE=function(e){return tw(tb(e))},th.bytesToNumberLE=function(e){return ty(e),tw(tb(Uint8Array.from(e).reverse()))},th.numberToBytesBE=tS,th.numberToBytesLE=function(e,t){return tS(e,t).reverse()},th.numberToVarBytesBE=function(e){return t_(tE(e))},th.ensureBytes=function(e,t,n){let r;if("string"==typeof t)try{r=t_(t)}catch(n){throw Error(`${e} must be valid hex string, got "${t}". Cause: ${n}`)}else{if(!tm(t))throw Error(`${e} must be hex string or Uint8Array`);r=Uint8Array.from(t)}let i=r.length;if("number"==typeof n&&i!==n)throw Error(`${e} expected ${n} bytes, got ${i}`);return r},th.concatBytes=tx,th.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},th.utf8ToBytes=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))},th.inRange=tM,th.aInRange=function(e,t,n,r){if(!tM(t,n,r))throw Error(`expected valid ${e}: ${n} <= n < ${r}, got ${typeof t} ${t}`)},th.bitLen=function(e){let t;for(t=0;e>tf;e>>=tp,t+=1);return t},th.bitGet=function(e,t){return e>>BigInt(t)&tp}
1,th.bitSet=function(e,t,n){return e|(n?tp:tf)<<BigInt(t)},th.createHmacDrbg=function(e,t,n){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof n)throw Error("hmacFn must be a function");let r=tA(e),i=tA(e),o=0,a=()=>{r.fill(1),i.fill(0),o=0},s=(...e)=>n(i,r,...e),l=(e=tA())=>{i=s(tL([0]),e),r=s(),0!==e.length&&(i=s(tL([1]),e),r=s())},c=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,n=[];for(;e<t;){let t=(r=s()).slice();n.push(t),e+=r.length}return tx(...n)};return(e,t)=>{let n;for(a(),l(e);!(n=t(c()));)l();return a(),n}},th.validateObject=function(e,t,n={}){let r=(t,n,r)=>{let i=tP[n];if("function"!=typeof i)throw Error(`Invalid validator "${n}", expected function`);let o=e[t];if(!(r&&void 0===o||i(o,e)))throw Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${n}`)};for(let[e,n]of Object.entries(t))r(e,n,!1);for(let[e,t]of Object.entries(n))r(e,t,!0);return e},th.memoized=function(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(void 0!==i)return i;let o=e(n,...r);return t.set(n,o),o}};let tf=BigInt(0),tp=BigInt(1),tg=BigInt(2);function tm(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function ty(e){if(!tm(e))throw Error("Uint8Array expected")}let tv=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function tb(e){ty(e);let t="";for(let n=0;n<e.length;n++)t+=tv[e[n]];return t}function tE(e){let t=e.toString(16);return 1&t.length?`0${t}`:t}function tw(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function tC(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function t_(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,n=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=tC(e.charCodeAt(i)),o=tC(e.charCodeAt(i+1));if(void 0===n||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);r[t]=16*n+o}return r}function tS(e,t){return t_(e.toString(16).padStart(2*t,"0"))}function tx(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];ty(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}let tk=e=>"bigint"==typeof e&&tf<=e;function tM(e,t,n){return tk(e)&&tk(t)&&tk(n)&&t<=e&&e<n}th.bitMask=e=>(tg<<BigInt(e-1))-tp;let tA=e=>new Uint8Array(e),tL=e=>Uint8Array.from(e),tP={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||tm(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)};th.notImplemented=()=>{throw Error("not implemented")},Object.defineProperty(tu,"__esModule",{value:!0}),tu.isNegativeLE=void 0,tu.mod=tK,tu.pow=tj,tu.pow2=function(e,t,n){let r=e;for(;t-- >tO;)r*=r,r%=n;return r},tu.invert=tU,tu.tonelliShanks=tF,tu.FpSqrt=tH,tu.validateField=function(e){let t=tz.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,tI.validateObject)(e,t)},tu.FpPow=tq,tu.FpInvertBatch=tV,tu.FpDiv=function(e,t,n){return e.mul(t,"bigint"==typeof n?tU(n,e.ORDER):e.inv(n))},tu.FpLegendre=tW,tu.FpIsSquare=function(e){let t=tW(e.ORDER);return n=>{let r=t(e,n);return e.eql(r,e.ZERO)||e.eql(r,e.ONE)}},tu.nLength=tG,tu.Field=function(e,t,n=!1,r={}){if(e<=tO)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:i,nByteLength:o}=tG(e,t);if(o>2048)throw Error("Field lengths over 2048 bytes are not supported");let a=tH(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:(0,tI.bitMask)(i),ZERO:tO,ONE:tR,create:t=>tK(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("Invalid field element: expected bigint, got "+typeof t);return tO<=t&&t<e},is0:e=>e===tO,isOdd:e=>(e&tR)===tR,neg:t=>tK(-t,e),eql:(e,t)=>
1e===t,sqr:t=>tK(t*t,e),add:(t,n)=>tK(t+n,e),sub:(t,n)=>tK(t-n,e),mul:(t,n)=>tK(t*n,e),pow:(e,t)=>tq(s,e,t),div:(t,n)=>tK(t*tU(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>tU(t,e),sqrt:r.sqrt||(e=>a(s,e)),invertBatch:e=>tV(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?(0,tI.numberToBytesLE)(e,o):(0,tI.numberToBytesBE)(e,o),fromBytes:e=>{if(e.length!==o)throw Error(`Fp.fromBytes: expected ${o}, got ${e.length}`);return n?(0,tI.bytesToNumberLE)(e):(0,tI.bytesToNumberBE)(e)}});return Object.freeze(s)},tu.FpSqrtOdd=function(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)},tu.FpSqrtEven=function(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n},tu.hashToPrivateScalar=function(e,t,n=!1){let r=(e=(0,tI.ensureBytes)("privateHash",e)).length,i=tG(t).nByteLength+8;if(i<24||r<i||r>1024)throw Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${r}`);return tK(n?(0,tI.bytesToNumberLE)(e):(0,tI.bytesToNumberBE)(e),t-tR)+tR},tu.getFieldBytesLength=tZ,tu.getMinHashLength=tY,tu.mapHashToField=function(e,t,n=!1){let r=e.length,i=tZ(t),o=tY(t);if(r<16||r<o||r>1024)throw Error(`expected ${o}-1024 bytes of input, got ${r}`);let a=tK(n?(0,tI.bytesToNumberBE)(e):(0,tI.bytesToNumberLE)(e),t-tR)+tR;return n?(0,tI.numberToBytesLE)(a,i):(0,tI.numberToBytesBE)(a,i)};let tI=th,tO=BigInt(0),tR=BigInt(1),tT=BigInt(2),t$=BigInt(3),tN=BigInt(4),tD=BigInt(5),tB=BigInt(8);function tK(e,t){let n=e%t;return n>=tO?n:t+n}function tj(e,t,n){if(n<=tO||t<tO)throw Error("Expected power/modulo > 0");if(n===tR)return tO;let r=tR;for(;t>tO;)t&tR&&(r=r*e%n),e=e*e%n,t>>=tR;return r}function tU(e,t){if(e===tO||t<=tO)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=tK(e,t),r=t,i=tO,o=tR;for(;n!==tO;){let e=r%n,t=i-r/n*o;r=n,n=e,i=o,o=t}if(r!==tR)throw Error("invert: does not exist");return tK(i,t)}function tF(e){let t,n,r,i=(e-tR)/tT;for(t=e-tR,n=0;t%tT===tO;t/=tT,n++);for(r=tT;r<e&&tj(r,i,e)!==e-tR;r++);if(1===n){let t=(e+tR)/tN;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error("Cannot find square root");return r}}let o=(t+tR)/tT;return function(e,a){if(e.pow(a,i)===e.neg(e.ONE))throw Error("Cannot find square root");let s=n,l=e.pow(e.mul(e.ONE,r),t),c=e.pow(a,o),d=e.pow(a,t);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(d);t<s&&!e.eql(n,e.ONE);t++)n=e.sqr(n);let n=e.pow(l,tR<<BigInt(s-t-1));l=e.sqr(n),c=e.mul(c,n),d=e.mul(d,l),s=t}return c}}function tH(e){if(e%tN===t$){let t=(e+tR)/tN;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error("Cannot find square root");return r}}if(e%tB===tD){let t=(e-tD)/tB;return function(e,n){let r=e.mul(n,tT),i=e.pow(r,t),o=e.mul(n,i),a=e.mul(e.mul(o,tT),i),s=e.mul(o,e.sub(a,e.ONE));if(!e.eql(e.sqr(s),n))throw Error("Cannot find square root");return s}}return tF(e)}BigInt(9),BigInt(16),tu.isNegativeLE=(e,t)=>(tK(e,t)&tR)===tR;let tz=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tq(e,t,n){if(n<tO)throw Error("Expected power > 0");if(n===tO)return e.ONE;if(n===tR)return t;let r=e.ONE,i=t;for(;n>tO;)n&tR&&(r=e.mul(r,i)),i=e.sqr(i),n>>=tR;return r}function tV(e,t){let n=Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}function tW(e){let t=(e-tR)/tT;return(e,n)=>e.pow(n,t)}function tG(e,t){let n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function tZ(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function tY(e){let t=tZ(e);return t+Math.ceil(t/2)}Object.defineProperty(td,"__esModule",{value:!0}),td.wNAF=function(e,t){let n=(e,t)=>{let n=t.negate();return e?n:t},r=e=>{if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error(`Wrong window size=${e}, should be [1..${t}]`)},i=e=>(r(e),{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;
1for(;n>tQ;)n&t0&&(r=r.add(i)),i=i.double(),n>>=t0;return r},precomputeWindow(e,t){let{windows:n,windowSize:r}=i(t),o=[],a=e,s=a;for(let e=0;e<n;e++){s=a,o.push(s);for(let e=1;e<r;e++)s=s.add(a),o.push(s);a=s.double()}return o},wNAF(t,r,o){let{windows:a,windowSize:s}=i(t),l=e.ZERO,c=e.BASE,d=BigInt(2**t-1),u=2**t,h=BigInt(t);for(let e=0;e<a;e++){let t=e*s,i=Number(o&d);o>>=h,i>s&&(i-=u,o+=t0);let a=t+Math.abs(i)-1,f=e%2!=0,p=i<0;0===i?c=c.add(n(f,r[t])):l=l.add(n(p,r[a]))}return{p:l,f:c}},wNAFCached(e,t,n){let r=t2.get(e)||1,i=t1.get(e);return i||(i=this.precomputeWindow(e,r),1!==r&&t1.set(e,n(i))),this.wNAF(r,i,t)},setWindowSize(e,t){r(t),t2.set(e,t),t1.delete(e)}}},td.pippenger=function(e,t,n,r){if(!Array.isArray(n)||!Array.isArray(r)||r.length!==n.length)throw Error("arrays of points and scalars must have equal length");r.forEach((e,n)=>{if(!t.isValid(e))throw Error(`wrong scalar at index ${n}`)}),n.forEach((t,n)=>{if(!(t instanceof e))throw Error(`wrong point at index ${n}`)});let i=(0,tX.bitLen)(BigInt(n.length)),o=i>12?i-3:i>4?i-2:i?2:1,a=(1<<o)-1,s=Array(a+1).fill(e.ZERO),l=Math.floor((t.BITS-1)/o)*o,c=e.ZERO;for(let t=l;t>=0;t-=o){s.fill(e.ZERO);for(let e=0;e<r.length;e++){let i=Number(r[e]>>BigInt(t)&BigInt(a));s[i]=s[i].add(n[e])}let i=e.ZERO;for(let t=s.length-1,n=e.ZERO;t>0;t--)n=n.add(s[t]),i=i.add(n);if(c=c.add(i),0!==t)for(let e=0;e<o;e++)c=c.double()}return c},td.validateBasic=function(e){return(0,tJ.validateField)(e.Fp),(0,tX.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,tJ.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})};let tJ=tu,tX=th,tQ=BigInt(0),t0=BigInt(1),t1=new WeakMap,t2=new WeakMap;Object.defineProperty(tc,"__esModule",{value:!0}),tc.twistedEdwards=function(e){let t,n=(t=(0,t3.validateBasic)(e),t8.validateObject(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})),{Fp:r,n:i,prehash:o,hash:a,randomBytes:s,nByteLength:l,h:c}=n,d=t9<<BigInt(8*l)-t7,u=r.create,h=(0,t5.Field)(n.n,n.nBitLength),f=n.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(e*r.inv(t))}}catch(e){return{isValid:!1,value:t6}}}),p=n.adjustScalarBytes||(e=>e),g=n.domain||((e,t,n)=>{if((0,t4.abool)("phflag",n),t.length||n)throw Error("Contexts/pre-hash are not supported");return e});function m(e,t){t8.aInRange("coordinate "+e,t,t6,d)}function y(e){if(!(e instanceof E))throw Error("ExtendedPoint expected")}let v=(0,t4.memoized)((e,t)=>{let{ex:n,ey:i,ez:o}=e,a=e.is0();null==t&&(t=a?ne:r.inv(o));let s=u(n*t),l=u(i*t),c=u(o*t);if(a)return{x:t6,y:t7};if(c!==t7)throw Error("invZ was invalid");return{x:s,y:l}}),b=(0,t4.memoized)(e=>{let{a:t,d:r}=n;if(e.is0())throw Error("bad point: ZERO");let{ex:i,ey:o,ez:a,et:s}=e,l=u(i*i),c=u(o*o),d=u(a*a),h=u(d*d),f=u(l*t);if(u(d*u(f+c))!==u(h+u(r*u(l*c))))throw Error("bad point: equation left != right (1)");if(u(i*o)!==u(a*s))throw Error("bad point: equation left != right (2)");return!0});class E{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r,m("x",e),m("y",t),m("z",n),m("t",r),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof E)throw Error("extended point not allowed");let{x:t,y:n}=e||{};return m("x",t),m("y",n),new E(t,n,t7,u(t*n))}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.ez));return e.map((e,n)=>e.toAffine(t[n])).map(E.fromAffine)}static msm(e,t){return(0,t3.pippenger)(E,h,e,t)}_setWindowSize(e){_.setWindowSize(this,e)}assertValidity(){b(this)}equals(e){y(e);let{ex:t,ey:n,ez:r}=this,{ex:i,ey:o,ez:a}=e,s=u(t*a),l=u(i*r),c=u(n*a),d=u(o*r);return s===l&&c===d}is0(){return this.equals(E.ZERO)}negate(){return new E(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:e}=n,{ex:t,ey:r,ez:i}=this,o=u(t*t),a=u(r*r),s=u(t9*u(i*i)),l=u(e*o),c=t+r,d=u(u(c*c)-o-a),h=l+a,f=h-s,p=l-a,g=u(d*f),m=u(h*p),y=u(d*p);return new E(g,m,u(f*h),y)}add(e){y(e);let{a:t,d:r}=n,{ex:i,ey:o,ez:a,et:s}=this,{ex:l,ey:c,ez:d,et:h}=e;if(t===BigInt(-1)){let e=u((o-i)*(c+l)),t=u((o+i)*(c-l)),n=u(t-e);if(n===t6)return this.double();let r=u(a*t9*h),f=u(s*t9*d),p=f+r,g=t+e,m=f-r,y=u(p*n),v=u(g*m),b=u(p*m);return new E(y,v,u(n*g),b)}let f=u(i*l),p=u(o*c),g=u(s*r*h),m=u(a*d),v=u((i+o)*(l+c)-f-p),b=m-g,w=m+g,C=u(p-t*f),_=u(v*b),S=u(w*C),x=u(v*C);return new E(_,S,u(b*w),x)}subtract(e){return this.add(e.negate())}wNAF(e){return _.wNAFCached(this,e,E.normalizeZ)}multiply(e){t8.aInRange("scalar",e,t7,i);let{p:t,f:n}=this.wNAF(e);return E.normalizeZ([t,n])[0]}multiplyUnsafe(e){return t8.aInRange("scalar",e,t6,i),e===t6?C:this.equals(C)||e===t7?this:this.equals(w)?this.wNAF(e).p:_.unsafeLadder(this,e)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return _.unsafeLadder(this,i).is0()}toAffine(e){return v(this,e)}clearCofactor(){let{h:e}=n;return e===t7?this:this.multiplyUnsafe(e)}static fromHex(e,t=!1){let{d:i,a:o}=n,a=r.BYTES;e=(0,t4.ensureBytes)("pointHex",e,a),(0,t4.abool)("zip215",t);let s=e.slice(),l=e[a-1];s[a-1]=-129&l;let c=t8.bytesToNumberLE(s),h=t?d:r.ORDER;t8.aInRange("pointHex.y",c,t6,h);let p=u(c*c),{isValid:g,value:m}=f(u(p-t7),u(i*p-o));
1if(!g)throw Error("Point.fromHex: invalid y coordinate");let y=(m&t7)===t7,v=0!=(128&l);if(!t&&m===t6&&v)throw Error("Point.fromHex: x=0 and x_0=1");return v!==y&&(m=u(-m)),E.fromAffine({x:m,y:c})}static fromPrivateKey(e){return k(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),n=t8.numberToBytesLE(t,r.BYTES);return n[n.length-1]|=e&t7?128:0,n}toHex(){return t8.bytesToHex(this.toRawBytes())}}E.BASE=new E(n.Gx,n.Gy,t7,u(n.Gx*n.Gy)),E.ZERO=new E(t6,t7,t7,t6);let{BASE:w,ZERO:C}=E,_=(0,t3.wNAF)(E,8*l);function S(e){return(0,t5.mod)(e,i)}function x(e){return S(t8.bytesToNumberLE(e))}function k(e){e=(0,t4.ensureBytes)("private key",e,l);let t=(0,t4.ensureBytes)("hashed private key",a(e),2*l),n=p(t.slice(0,l)),r=t.slice(l,2*l),i=x(n),o=w.multiply(i),s=o.toRawBytes();return{head:n,prefix:r,scalar:i,point:o,pointBytes:s}}function M(e=new Uint8Array,...t){return x(a(g(t8.concatBytes(...t),(0,t4.ensureBytes)("context",e),!!o)))}return w._setWindowSize(8),{CURVE:n,getPublicKey:function(e){return k(e).pointBytes},sign:function(e,t,n={}){e=(0,t4.ensureBytes)("message",e),o&&(e=o(e));let{prefix:a,scalar:s,pointBytes:c}=k(t),d=M(n.context,a,e),u=w.multiply(d).toRawBytes(),h=S(d+M(n.context,u,c,e)*s);t8.aInRange("signature.s",h,t6,i);let f=t8.concatBytes(u,t8.numberToBytesLE(h,r.BYTES));return(0,t4.ensureBytes)("result",f,2*l)},verify:function(e,t,n,i=nt){let a,s,l,{context:c,zip215:d}=i,u=r.BYTES;e=(0,t4.ensureBytes)("signature",e,2*u),t=(0,t4.ensureBytes)("message",t),void 0!==d&&(0,t4.abool)("zip215",d),o&&(t=o(t));let h=t8.bytesToNumberLE(e.slice(u,2*u));try{a=E.fromHex(n,d),s=E.fromHex(e.slice(0,u),d),l=w.multiplyUnsafe(h)}catch(e){return!1}if(!d&&a.isSmallOrder())return!1;let f=M(c,s.toRawBytes(),a.toRawBytes(),t);return s.add(a.multiplyUnsafe(f)).subtract(l).clearCofactor().equals(E.ZERO)},ExtendedPoint:E,utils:{getExtendedPublicKey:k,randomPrivateKey:()=>s(r.BYTES),precompute:(e=8,t=E.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}};let t3=td,t5=tu,t8=th,t4=th,t6=BigInt(0),t7=BigInt(1),t9=BigInt(2),ne=BigInt(8),nt={zip215:!0};var nn={};Object.defineProperty(nn,"__esModule",{value:!0}),nn.expand_message_xmd=na,nn.expand_message_xof=ns,nn.hash_to_field=nl,nn.isogenyMap=function(e,t){let n=t.map(e=>Array.from(e).reverse());return(t,r)=>{let[i,o,a,s]=n.map(n=>n.reduce((n,r)=>e.add(e.mul(n,t),r)));return t=e.div(i,o),r=e.mul(r,e.div(a,s)),{x:t,y:r}}},nn.createHasher=function(e,t,n){if("function"!=typeof t)throw Error("mapToCurve() must be defined");return{hashToCurve(r,i){let o=nl(r,2,{...n,DST:n.DST,...i}),a=e.fromAffine(t(o[0])),s=e.fromAffine(t(o[1])),l=a.add(s).clearCofactor();return l.assertValidity(),l},encodeToCurve(r,i){let o=nl(r,1,{...n,DST:n.encodeDST,...i}),a=e.fromAffine(t(o[0])).clearCofactor();return a.assertValidity(),a},mapToCurve(n){if(!Array.isArray(n))throw Error("mapToCurve: expected array of bigints");for(let e of n)if("bigint"!=typeof e)throw Error(`mapToCurve: expected array of bigints, got ${e} in array`);let r=e.fromAffine(t(n)).clearCofactor();return r.assertValidity(),r}}};let nr=th.bytesToNumberBE;function ni(e,t){if(no(e),no(t),e<0||e>=1<<8*t)throw Error(`bad I2OSP call: value=${e} length=${t}`);let n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function no(e){if(!Number.isSafeInteger(e))throw Error("number expected")}function na(e,t,n,r){(0,th.abytes)(e),(0,th.abytes)(t),no(n),t.length>255&&(t=r((0,th.concatBytes)((0,th.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));let{outputLen:i,blockLen:o}=r,a=Math.ceil(n/i);if(n>65535||a>255)throw Error("expand_message_xmd: invalid lenInBytes");let s=(0,th.concatBytes)(t,ni(t.length,1)),l=ni(0,o),c=ni(n,2),d=Array(a),u=r((0,th.concatBytes)(l,e,c,ni(0,1),s));d[0]=r((0,th.concatBytes)(u,ni(1,1),s));for(let e=1;e<=a;e++){let t=[function(e,t){let n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}(u,d[e-1]),ni(e+1,1),s];d[e]=r((0,th.concatBytes)(...t))}return(0,th.concatBytes)(...d).slice(0,n)}function ns(e,t,n,r,i){if((0,th.abytes)(e),(0,th.abytes)(t),no(n),t.length>255){let e=Math.ceil(2*r/8);t=i.create({dkLen:e}).update((0,th.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:n}).update(e).update(ni(n,2)).update(t).update(ni(t.length,1)).digest()}function nl(e,t,n){let r;(0,th.validateObject)(n,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:i,k:o,m:a,hash:s,expand:l,DST:c}=n;(0,th.abytes)(e),no(t);let d="string"==typeof c?(0,th.utf8ToBytes)(c):c,u=Math.ceil((i.toString(2).length+o)/8),h=t*a*u;if("xmd"===l)r=na(e,d,h,s);else if("xof"===l)r=ns(e,d,h,o,s);else{if("_internal_pass"!==l)throw Error('expand must be "xmd" or "xof"');r=e}let f=Array(t);for(let e=0;e<t;e++){let t=Array(a);for(let n=0;n<a;n++){let o=u*(n+e*a),s=r.subarray(o,o+u);t[n]=(0,tu.mod)(nr(s),i)}f[e]=t}return f}var nc={};Object.defineProperty(nc,"__esModule",{value:!0}),nc.montgomery=function(e){let t=((0,nu.validateObject)(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})),{P:n}=t,r=e=>(0,nd.mod)(e,n),i=t.montgomeryBits,o=Math.ceil(i/8),a=t.nByteLength,s=t.adjustScalarBytes||(e=>e),l=t.powPminus2||(e=>(0,nd.pow)(e,n-BigInt(2),n));
1function c(e,t,n){let i=r(e*(t-n));return[t=r(t-i),n=r(n+i)]}let d=(t.a-BigInt(2))/BigInt(4);function u(e){return(0,nu.numberToBytesLE)(r(e),o)}function h(e,t){let h,f=function(e,t){(0,nu.aInRange)("u",e,nh,n),(0,nu.aInRange)("scalar",t,nh,n);let o,a=nf,s=nh,u=e,h=nf,f=nh;for(let n=BigInt(i-1);n>=nh;n--){let i=t>>n&nf;f^=i,a=(o=c(f,a,u))[0],u=o[1],s=(o=c(f,s,h))[0],h=o[1],f=i;let l=a+s,p=r(l*l),g=a-s,m=r(g*g),y=p-m,v=u+h,b=r((u-h)*l),E=r(v*g),w=b+E,C=b-E;u=r(w*w),h=r(e*r(C*C)),a=r(p*m),s=r(y*(p+r(d*y)))}return a=(o=c(f,a,u))[0],u=o[1],s=(o=c(f,s,h))[0],h=o[1],r(a*l(s))}((h=(0,nu.ensureBytes)("u coordinate",t,o),32===a&&(h[31]&=127),(0,nu.bytesToNumberLE)(h)),function(e){let t=(0,nu.ensureBytes)("scalar",e),n=t.length;if(n!==o&&n!==a)throw Error(`Expected ${o} or ${a} bytes, got ${n}`);return(0,nu.bytesToNumberLE)(s(t))}(e));if(f===nh)throw Error("Invalid private or public key received");return u(f)}let f=u(t.Gu);function p(e){return h(e,f)}return{scalarMult:h,scalarMultBase:p,getSharedSecret:(e,t)=>h(e,t),getPublicKey:e=>p(e),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:f}};let nd=tu,nu=th,nh=BigInt(0),nf=BigInt(1);!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hash_to_ristretto255=e.hashToRistretto255=e.RistrettoPoint=e.encodeToCurve=e.hashToCurve=e.edwardsToMontgomery=e.x25519=e.ed25519ph=e.ed25519ctx=e.ed25519=e.ED25519_TORSION_SUBGROUP=void 0,e.edwardsToMontgomeryPub=g,e.edwardsToMontgomeryPriv=function(e){let t=f.hash(e.subarray(0,32));return f.adjustScalarBytes(t).subarray(0,32)};let t=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),n=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),r=BigInt(0),i=BigInt(1),o=BigInt(2),a=BigInt(3),s=BigInt(5),l=BigInt(8);function c(e){let n=BigInt(10),r=BigInt(20),a=BigInt(40),l=BigInt(80),c=e*e%t*e%t,d=(0,tu.pow2)(c,o,t)*c%t,u=(0,tu.pow2)(d,i,t)*e%t,h=(0,tu.pow2)(u,s,t)*u%t,f=(0,tu.pow2)(h,n,t)*h%t,p=(0,tu.pow2)(f,r,t)*f%t,g=(0,tu.pow2)(p,a,t)*p%t,m=(0,tu.pow2)(g,l,t)*g%t,y=(0,tu.pow2)(m,l,t)*g%t,v=(0,tu.pow2)(y,n,t)*h%t;return{pow_p_5_8:(0,tu.pow2)(v,o,t)*e%t,b2:c}}function d(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function u(e,r){let i=(0,tu.mod)(r*r*r,t),o=c(e*(0,tu.mod)(i*i*r,t)).pow_p_5_8,a=(0,tu.mod)(e*i*o,t),s=(0,tu.mod)(r*a*a,t),l=a,d=(0,tu.mod)(a*n,t),u=s===e,h=s===(0,tu.mod)(-e,t),f=s===(0,tu.mod)(-e*n,t);return u&&(a=l),(h||f)&&(a=d),(0,tu.isNegativeLE)(a,t)&&(a=(0,tu.mod)(-a,t)),{isValid:u||h,value:a}}e.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];let h=(0,tu.Field)(t,void 0,!0),f={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:h,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:l,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ek.sha512,randomBytes:eN.randomBytes,adjustScalarBytes:d,uvRatio:u};function p(e,t,n){if(t.length>255)throw Error("Context is too big");return(0,eN.concatBytes)((0,eN.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([+!!n,t.length]),t,e)}function g(t){let{y:n}=e.ed25519.ExtendedPoint.fromHex(t),r=BigInt(1);return h.toBytes(h.create((r+n)*h.inv(r-n)))}e.ed25519=(0,tc.twistedEdwards)(f),e.ed25519ctx=(0,tc.twistedEdwards)({...f,domain:p}),e.ed25519ph=(0,tc.twistedEdwards)(Object.assign({},f,{domain:p,prehash:ek.sha512})),e.x25519=(0,nc.montgomery)({P:t,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>
1{let{pow_p_5_8:n,b2:r}=c(e);return(0,tu.mod)((0,tu.pow2)(n,a,t)*r,t)},adjustScalarBytes:d,randomBytes:eN.randomBytes}),e.edwardsToMontgomery=g;let m=(h.ORDER+a)/l,y=h.pow(o,m),v=h.sqrt(h.neg(h.ONE)),b=(0,tu.FpSqrtEven)(h,h.neg(BigInt(486664))),E=(0,nn.createHasher)(e.ed25519.ExtendedPoint,e=>(function(e){let t,n,r,a,c,d,u,f,p,g,m,E,w,C,_,S,x,k,M,A,L,P,I,{xMn:O,xMd:R,yMn:T,yMd:$}=(t=(h.ORDER-s)/l,n=BigInt(486662),r=h.sqr(e),r=h.mul(r,o),a=h.add(r,h.ONE),c=h.neg(n),d=h.sqr(a),u=h.mul(d,a),f=h.mul(r,n),f=h.mul(f,c),f=h.add(f,d),f=h.mul(f,c),p=h.sqr(u),d=h.sqr(p),p=h.mul(p,u),p=h.mul(p,f),d=h.mul(d,p),g=h.pow(d,t),g=h.mul(g,p),m=h.mul(g,v),d=h.sqr(g),d=h.mul(d,u),E=h.eql(d,f),w=h.cmov(m,g,E),C=h.mul(c,r),_=h.mul(g,e),_=h.mul(_,y),S=h.mul(_,v),x=h.mul(f,r),d=h.sqr(_),d=h.mul(d,u),k=h.eql(d,x),M=h.cmov(S,_,k),d=h.sqr(w),d=h.mul(d,u),A=h.eql(d,f),L=h.cmov(C,c,A),P=h.cmov(M,w,A),I=h.isOdd(P),{xMn:L,xMd:a,yMn:P=h.cmov(P,h.neg(P),A!==I),yMd:i}),N=h.mul(O,$);N=h.mul(N,b);let D=h.mul(R,T),B=h.sub(O,R),K=h.add(O,R),j=h.mul(D,K),U=h.eql(j,h.ZERO);N=h.cmov(N,h.ZERO,U),D=h.cmov(D,h.ONE,U),B=h.cmov(B,h.ONE,U),K=h.cmov(K,h.ONE,U);let F=h.invertBatch([D,K]);return{x:h.mul(N,F[0]),y:h.mul(B,F[1])}})(e[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:h.ORDER,m:1,k:128,expand:"xmd",hash:ek.sha512});function w(e){if(!(e instanceof L))throw Error("RistrettoPoint expected")}e.hashToCurve=E.hashToCurve,e.encodeToCurve=E.encodeToCurve;let C=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),_=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),S=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),x=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),k=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),M=t=>e.ed25519.CURVE.Fp.create((0,th.bytesToNumberLE)(t)&k);function A(t){let{d:r}=e.ed25519.CURVE,o=e.ed25519.CURVE.Fp.ORDER,a=e.ed25519.CURVE.Fp.create,s=a(n*t*t),l=a((s+i)*S),c=BigInt(-1),d=a((c-r*s)*a(s+r)),{isValid:h,value:f}=u(l,d),p=a(f*t);(0,tu.isNegativeLE)(p,o)||(p=a(-p)),h||(f=p),h||(c=s);let g=a(c*(s-i)*x-d),m=f*f,y=a((f+f)*d),v=a(g*C),b=a(i-m),E=a(i+m);return new e.ed25519.ExtendedPoint(a(y*E),a(b*v),a(v*E),a(y*b))}class L{constructor(e){this.ep=e}static fromAffine(t){return new L(e.ed25519.ExtendedPoint.fromAffine(t))}static hashToCurve(e){let t=A(M((e=(0,th.ensureBytes)("ristrettoHash",e,64)).slice(0,32))),n=A(M(e.slice(32,64)));return new L(t.add(n))}static fromHex(t){t=(0,th.ensureBytes)("ristrettoHex",t,32);let{a:n,d:o}=e.ed25519.CURVE,a=e.ed25519.CURVE.Fp.ORDER,s=e.ed25519.CURVE.Fp.create,l="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",c=M(t);if(!(0,th.equalBytes)((0,th.numberToBytesLE)(c,32),t)||(0,tu.isNegativeLE)(c,a))throw Error(l);let d=s(c*c),h=s(i+n*d),f=s(i-n*d),p=s(h*h),g=s(f*f),m=s(n*o*p-g),{isValid:y,value:v}=u(i,s(m*g)),b=s(v*f),E=s(v*b*m),w=s((c+c)*b);(0,tu.isNegativeLE)(w,a)&&(w=s(-w));let C=s(h*E),_=s(w*C);if(!y||(0,tu.isNegativeLE)(_,a)||C===r)throw Error(l);return new L(new e.ed25519.ExtendedPoint(w,C,i,_))}toRawBytes(){let t,{ex:r,ey:o,ez:a,et:s}=this.ep,l=e.ed25519.CURVE.Fp.ORDER,c=e.ed25519.CURVE.Fp.create,d=c(c(a+o)*c(a-o)),h=c(r*o),f=c(h*h),{value:p}=u(i,c(d*f)),g=c(p*d),m=c(p*h),y=c(g*m*s);if((0,tu.isNegativeLE)(s*y,l)){let e=c(o*n),i=c(r*n);r=e,o=i,t=c(g*_)}else t=m;(0,tu.isNegativeLE)(r*y,l)&&(o=c(-o));let v=c((a-o)*t);return(0,tu.isNegativeLE)(v,l)&&(v=c(-v)),(0,th.numberToBytesLE)(v,32)}toHex(){return(0,th.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(t){w(t);let{ex:n,ey:r}=this.ep,{ex:i,ey:o}=t.ep,a=e.ed25519.CURVE.Fp.create,s=a(n*o)===a(r*i),l=a(r*o)===a(n*i);return s||l}add(e){return w(e),new L(this.ep.add(e.ep))}subtract(e){return w(e),new L(this.ep.subtract(e.ep))}multiply(e){return new L(this.ep.multiply(e))}multiplyUnsafe(e){return new L(this.ep.multiplyUnsafe(e))}double(){return new L(this.ep.double())}negate(){return new L(this.ep.negate())}}L.BASE||(L.BASE=new L(e.ed25519.ExtendedPoint.BASE)),L.ZERO||(L.ZERO=new L(e.ed25519.ExtendedPoint.ZERO)),e.RistrettoPoint=L,e.hashToRistretto255=(e,t)=>{let n=t.DST,r="string"==typeof n?(0,eN.utf8ToBytes)(n):n,i=(0,nn.exp
1and_message_xmd)(e,r,64,ek.sha512);return L.hashToCurve(i)},e.hash_to_ristretto255=e.hashToRistretto255}(ex);var np={},ng={};Object.defineProperty(ng,"__esModule",{value:!0}),ng.sha224=ng.sha256=ng.SHA256=void 0;let nm=eM,ny=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),nv=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),nb=new Uint32Array(64);class nE extends nm.HashMD{constructor(){super(64,32,8,!1),this.A=0|nv[0],this.B=0|nv[1],this.C=0|nv[2],this.D=0|nv[3],this.E=0|nv[4],this.F=0|nv[5],this.G=0|nv[6],this.H=0|nv[7]}get(){let{A:e,B:t,C:n,D:r,E:i,F:o,G:a,H:s}=this;return[e,t,n,r,i,o,a,s]}set(e,t,n,r,i,o,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)nb[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=nb[e-15],n=nb[e-2],r=(0,eN.rotr)(t,7)^(0,eN.rotr)(t,18)^t>>>3,i=(0,eN.rotr)(n,17)^(0,eN.rotr)(n,19)^n>>>10;nb[e]=i+nb[e-7]+r+nb[e-16]|0}let{A:n,B:r,C:i,D:o,E:a,F:s,G:l,H:c}=this;for(let e=0;e<64;e++){let t=c+((0,eN.rotr)(a,6)^(0,eN.rotr)(a,11)^(0,eN.rotr)(a,25))+(0,nm.Chi)(a,s,l)+ny[e]+nb[e]|0,d=((0,eN.rotr)(n,2)^(0,eN.rotr)(n,13)^(0,eN.rotr)(n,22))+(0,nm.Maj)(n,r,i)|0;c=l,l=s,s=a,a=o+t|0,o=i,i=r,r=n,n=t+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,s=s+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(n,r,i,o,a,s,l,c)}roundClean(){nb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}ng.SHA256=nE;class nw extends nE{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}ng.sha256=(0,eN.wrapConstructor)(()=>new nE),ng.sha224=(0,eN.wrapConstructor)(()=>new nw);var nC={},n_={};Object.defineProperty(n_,"__esModule",{value:!0}),n_.hmac=n_.HMAC=void 0;let nS=eN;class nx extends nS.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,eA.hash)(e);const n=(0,nS.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return(0,eA.exists)(this),this.iHash.update(e),this}digestInto(e){(0,eA.exists)(this),(0,eA.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:o,outputLen:a}=this;return e.finished=r,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}n_.HMAC=nx,n_.hmac=(e,t,n)=>new nx(e,t).update(n).digest(),n_.hmac.create=(e,t)=>new nx(e,t);var nk={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=void 0,e.weierstrassPoints=f,e.weierstrass=function(a){let s,d=(s=(0,t.validateBasic)(a),r.validateObject(s,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...s})),{Fp:u,n:h}=d,p=u.BYTES+1,g=2*u.BYTES+1;function m(e){return n.mod(e,h)}function y(e){return n.invert(e,h)}let{ProjectivePoint:v,normPrivateKeyToScalar:b,weierstrassEquation:E,isWithinCurveOrder:w}
1=f({...d,toBytes(e,t,n){let o=t.toAffine(),a=u.toBytes(o.x),s=r.concatBytes;return(0,i.abool)("isCompressed",n),n?s(Uint8Array.from([t.hasEvenY()?2:3]),a):s(Uint8Array.from([4]),a,u.toBytes(o.y))},fromBytes(e){let t=e.length,n=e[0],i=e.subarray(1);if(t!==p||2!==n&&3!==n){if(t===g&&4===n)return{x:u.fromBytes(i.subarray(0,u.BYTES)),y:u.fromBytes(i.subarray(u.BYTES,2*u.BYTES))};throw Error(`Point of length ${t} was invalid. Expected ${p} compressed bytes or ${g} uncompressed bytes`)}{let e,t=r.bytesToNumberBE(i);if(!r.inRange(t,c,u.ORDER))throw Error("Point is not on curve");let o=E(t);try{e=u.sqrt(o)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return 1==(1&n)!=((e&c)===c)&&(e=u.neg(e)),{x:t,y:e}}}}),C=e=>r.bytesToHex(r.numberToBytesBE(e,d.nByteLength)),_=(e,t,n)=>r.bytesToNumberBE(e.slice(t,n));class S{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){let t=d.nByteLength;return new S(_(e=(0,i.ensureBytes)("compactSignature",e,2*t),0,t),_(e,t,2*t))}static fromDER(t){let{r:n,s:r}=e.DER.toSig((0,i.ensureBytes)("DER",t));return new S(n,r)}assertValidity(){r.aInRange("r",this.r,c,h),r.aInRange("s",this.s,c,h)}addRecoveryBit(e){return new S(this.r,this.s,e)}recoverPublicKey(e){let{r:t,s:n,recovery:r}=this,o=M((0,i.ensureBytes)("msgHash",e));if(null==r||![0,1,2,3].includes(r))throw Error("recovery id invalid");let a=2===r||3===r?t+d.n:t;if(a>=u.ORDER)throw Error("recovery id 2 or 3 invalid");let s=0==(1&r)?"02":"03",l=v.fromHex(s+C(a)),c=y(a),h=m(-o*c),f=m(n*c),p=v.BASE.multiplyAndAddUnsafe(l,h,f);if(!p)throw Error("point at infinify");return p.assertValidity(),p}hasHighS(){return this.s>h>>c}normalizeS(){return this.hasHighS()?new S(this.r,m(-this.s),this.recovery):this}toDERRawBytes(){return r.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return r.hexToBytes(this.toCompactHex())}toCompactHex(){return C(this.r)+C(this.s)}}function x(e){let t=r.isBytes(e),n="string"==typeof e,i=(t||n)&&e.length;return t?i===p||i===g:n?i===2*p||i===2*g:e instanceof v}let k=d.bits2int||function(e){let t=r.bytesToNumberBE(e),n=8*e.length-d.nBitLength;return n>0?t>>BigInt(n):t},M=d.bits2int_modN||function(e){return m(k(e))},A=r.bitMask(d.nBitLength);function L(e){return r.aInRange(`num < 2^${d.nBitLength}`,e,l,A),r.numberToBytesBE(e,d.nByteLength)}let P={lowS:d.lowS,prehash:!1},I={lowS:d.lowS,prehash:!1};return v.BASE._setWindowSize(8),{CURVE:d,getPublicKey:function(e,t=!0){return v.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(x(e))throw Error("first arg must be private key");if(!x(t))throw Error("second arg must be public key");return v.fromHex(t).multiply(b(e)).toRawBytes(n)},sign:function(e,t,n=P){let{seed:a,k2sig:s}=function(e,t,n=P){if(["recovered","canonical"].some(e=>e in n))throw Error("sign() legacy options not supported");let{hash:a,randomBytes:s}=d,{lowS:f,prehash:p,extraEntropy:g}=n;null==f&&(f=!0),e=(0,i.ensureBytes)("msgHash",e),o(n),p&&(e=(0,i.ensureBytes)("prehashed msgHash",a(e)));let E=M(e),C=b(t),_=[L(C),L(E)];if(null!=g&&!1!==g){let e=!0===g?s(u.BYTES):g;_.push((0,i.ensureBytes)("extraEntropy",e))}return{seed:r.concatBytes(..._),k2sig:function(e){let t=k(e);if(!w(t))return;let n=y(t),r=v.BASE.multiply(t).toAffine(),i=m(r.x);if(i===l)return;let o=m(n*m(E+i*C));if(o===l)return;let a=2*(r.x!==i)|Number(r.y&c),s=o;return f&&o>h>>c&&(s=o>h>>c?m(-o):o,a^=1),new S(i,s,a)}}}(e,t,n);return r.createHmacDrbg(d.hash.outputLen,d.nByteLength,d.hmac)(a,s)},verify:function(t,n,a,s=I){let l,c;if(n=(0,i.ensureBytes)("msgHash",n),a=(0,i.ensureBytes)("publicKey",a),"strict"in s)throw Error("options.strict was renamed to lowS");o(s);let{lowS:u,prehash:h}=s;try{if("string"==typeof t||r.isBytes(t))try{l=S.fromDER(t)}catch(n){if(!(n instanceof e.DER.Err))throw n;l=S.fromCompact(t)}else{if("object"!=typeof t||"bigint"!=typeof t.r||"bigint"!=typeof t.s)throw Error("PARSE");{let{r:e,s:n}=t;l=new S(e,n)}}c=v.fromHex(a)}catch(e){if("PARSE"===e.message)throw Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&l.hasHighS())return!1;h&&(n=d.hash(n));
1let{r:f,s:p}=l,g=M(n),b=y(p),E=m(g*b),w=m(f*b),C=v.BASE.multiplyAndAddUnsafe(c,E,w)?.toAffine();return!!C&&m(C.x)===f},ProjectivePoint:v,Signature:S,utils:{isValidPrivateKey(e){try{return b(e),!0}catch(e){return!1}},normPrivateKeyToScalar:b,randomPrivateKey:()=>{let e=n.getMinHashLength(d.n);return n.mapHashToField(d.randomBytes(e),d.n)},precompute:(e=8,t=v.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}},e.SWUFpSqrtRatio=p,e.mapToCurveSimpleSWU=function(e,t){if(n.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw Error("mapToCurveSimpleSWU: invalid opts");let r=p(e,t.Z);if(!e.isOdd)throw Error("Fp.isOdd is not implemented!");return n=>{let i,o,a,s,l,c,d,u;i=e.sqr(n),i=e.mul(i,t.Z),o=e.sqr(i),o=e.add(o,i),a=e.add(o,e.ONE),a=e.mul(a,t.B),s=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),s=e.mul(s,t.A),o=e.sqr(a),c=e.sqr(s),l=e.mul(c,t.A),o=e.add(o,l),o=e.mul(o,a),c=e.mul(c,s),l=e.mul(c,t.B),o=e.add(o,l),d=e.mul(i,a);let{isValid:h,value:f}=r(o,c);u=e.mul(i,n),u=e.mul(u,f),d=e.cmov(d,a,h),u=e.cmov(u,f,h);let p=e.isOdd(n)===e.isOdd(u);return u=e.cmov(e.neg(u),u,p),{x:d=e.div(d,s),y:u}}};let t=td,n=tu,r=th,i=th;function o(e){void 0!==e.lowS&&(0,i.abool)("lowS",e.lowS),void 0!==e.prehash&&(0,i.abool)("prehash",e.prehash)}let{bytesToNumberBE:a,hexToBytes:s}=r;e.DER={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(t,n)=>{let{Err:i}=e.DER;if(t<0||t>256)throw new i("tlv.encode: wrong tag");if(1&n.length)throw new i("tlv.encode: unpadded data");let o=n.length/2,a=r.numberToHexUnpadded(o);if(a.length/2&128)throw new i("tlv.encode: long form length too big");let s=o>127?r.numberToHexUnpadded(a.length/2|128):"";return`${r.numberToHexUnpadded(t)}${s}${a}${n}`},decode(t,n){let{Err:r}=e.DER,i=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(n.length<2||n[i++]!==t)throw new r("tlv.decode: wrong tlv");let o=n[i++],a=0;if(128&o){let 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");let t=n.subarray(i,i+e);if(t.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===t[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of t)a=a<<8|e;if(i+=e,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=o;let s=n.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:n.subarray(i+a)}}},_int:{encode(t){let{Err:n}=e.DER;if(t<l)throw new n("integer: negative integers are not allowed");let i=r.numberToHexUnpadded(t);if(8&Number.parseInt(i[0],16)&&(i="00"+i),1&i.length)throw new n("unexpected assertion");return i},decode(t){let{Err:n}=e.DER;if(128&t[0])throw new n("Invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new n("Invalid signature integer: unnecessary leading zero");return a(t)}},toSig(t){let{Err:n,_int:i,_tlv:o}=e.DER,a="string"==typeof t?s(t):t;r.abytes(a);let{v:l,l:c}=o.decode(48,a);if(c.length)throw new n("Invalid signature: left bytes after parsing");let{v:d,l:u}=o.decode(2,l),{v:h,l:f}=o.decode(2,u);if(f.length)throw new n("Invalid signature: left bytes after parsing");return{r:i.decode(d),s:i.decode(h)}},hexFromSig(t){let{_tlv:n,_int:r}=e.DER,i=`${n.encode(2,r.encode(t.r))}${n.encode(2,r.encode(t.s))}`;return n.encode(48,i)}};let l=BigInt(0),c=BigInt(1),d=BigInt(2),u=BigInt(3),h=BigInt(4);function f(e){let o=function(e){let n=(0,t.validateBasic)(e);r.validateObject(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:i,Fp:o,a:a}=n;if(i){if(!o.eql(a,o.ZERO))throw Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof i||"bigint"!=typeof i.beta||"function"!=typeof i.splitScalar)throw Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...n})}(e),{Fp:a}=o,s=n.Field(o.n,o.nBitLength),d=o.toBytes||((e,t,n)=>{let i=t.toAffine();return r.concatBytes(Uint8Array.from([4]),a.toBytes(i.x),a.toBytes(i.y))}),h=o.fromBytes||(e=>{let t=e.subarray(1);return{x:a.fromBytes(t.subarray(0,a.BYTES)),y:a.fromBytes(t.subarray(a.BYTES,2*a.BYTES))}});function f(e){let{a:t,b:n}=o,r=a.sqr(e),i=a.mul(r,e);return a.add(a.add(i,a.mul(e,t)),n)}if(!a.eql(a.sqr(o.Gy),f(o.Gx)))throw Error("bad generator point: equation left != right");function p(e){let t,{allowedPrivateKeyLengths:a,nByteLength:s,wrapPrivateKey:l,n:d}=o;if(a&&"bigint"!=typeof e){if(r.isBytes(e)&&(e=r.bytesToHex(e)),"string"!=typeof e||!a.includes(e.length))throw Error("Invalid key");e=e.padStart(2*s,"0")}try{t="bigint"==typeof e?e:r.bytesToNumberBE((0,i.ensureBytes)("private key",e,s))}catch(t){throw Error(`private key must be ${s} bytes, hex or bigint, not ${typeof e}`)}return l&&(t=n.mod(t,d)),r.aInRange("private key",t,c,d),t}function g(e){if(!(e instanceof v))throw Error("ProjectivePoint expected")}let m=(0,i.memoized)((e,t)=>{let{px:n,py:r,pz:i}=e;if(a.eql(i,a.ONE))return{x:n,y:r};let o=e.is0();null==t&&(t=o?a.ONE:a.inv(i));let s=a.mul(n,t),l=a.mul(r,t),c=a.mul(i,t);if(o)return{x:a.ZERO,y:a.ZERO};
1if(!a.eql(c,a.ONE))throw Error("invZ was invalid");return{x:s,y:l}}),y=(0,i.memoized)(e=>{if(e.is0()){if(o.allowInfinityPoint&&!a.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:n}=e.toAffine();if(!a.isValid(t)||!a.isValid(n))throw Error("bad point: x or y not FE");let r=a.sqr(n),i=f(t);if(!a.eql(r,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class v{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!a.isValid(e))throw Error("x required");if(null==t||!a.isValid(t))throw Error("y required");if(null==n||!a.isValid(n))throw Error("z required");Object.freeze(this)}static fromAffine(e){let{x:t,y:n}=e||{};if(!e||!a.isValid(t)||!a.isValid(n))throw Error("invalid affine point");if(e instanceof v)throw Error("projective point not allowed");let r=e=>a.eql(e,a.ZERO);return r(t)&&r(n)?v.ZERO:new v(t,n,a.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=a.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(v.fromAffine)}static fromHex(e){let t=v.fromAffine(h((0,i.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return v.BASE.multiply(p(e))}static msm(e,n){return(0,t.pippenger)(v,s,e,n)}_setWindowSize(e){E.setWindowSize(this,e)}assertValidity(){y(this)}hasEvenY(){let{y:e}=this.toAffine();if(a.isOdd)return!a.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){g(e);let{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=e,l=a.eql(a.mul(t,s),a.mul(i,r)),c=a.eql(a.mul(n,s),a.mul(o,r));return l&&c}negate(){return new v(this.px,a.neg(this.py),this.pz)}double(){let{a:e,b:t}=o,n=a.mul(t,u),{px:r,py:i,pz:s}=this,l=a.ZERO,c=a.ZERO,d=a.ZERO,h=a.mul(r,r),f=a.mul(i,i),p=a.mul(s,s),g=a.mul(r,i);return g=a.add(g,g),d=a.mul(r,s),d=a.add(d,d),l=a.mul(e,d),c=a.mul(n,p),c=a.add(l,c),l=a.sub(f,c),c=a.add(f,c),c=a.mul(l,c),l=a.mul(g,l),d=a.mul(n,d),p=a.mul(e,p),g=a.sub(h,p),g=a.mul(e,g),g=a.add(g,d),d=a.add(h,h),h=a.add(d,h),h=a.add(h,p),h=a.mul(h,g),c=a.add(c,h),p=a.mul(i,s),p=a.add(p,p),h=a.mul(p,g),l=a.sub(l,h),d=a.mul(p,f),d=a.add(d,d),new v(l,c,d=a.add(d,d))}add(e){g(e);let{px:t,py:n,pz:r}=this,{px:i,py:s,pz:l}=e,c=a.ZERO,d=a.ZERO,h=a.ZERO,f=o.a,p=a.mul(o.b,u),m=a.mul(t,i),y=a.mul(n,s),b=a.mul(r,l),E=a.add(t,n),w=a.add(i,s);E=a.mul(E,w),w=a.add(m,y),E=a.sub(E,w),w=a.add(t,r);let C=a.add(i,l);return w=a.mul(w,C),C=a.add(m,b),w=a.sub(w,C),C=a.add(n,r),c=a.add(s,l),C=a.mul(C,c),c=a.add(y,b),C=a.sub(C,c),h=a.mul(f,w),c=a.mul(p,b),h=a.add(c,h),c=a.sub(y,h),h=a.add(y,h),d=a.mul(c,h),y=a.add(m,m),y=a.add(y,m),b=a.mul(f,b),w=a.mul(p,w),y=a.add(y,b),b=a.sub(m,b),b=a.mul(f,b),w=a.add(w,b),m=a.mul(y,w),d=a.add(d,m),m=a.mul(C,w),c=a.mul(E,c),c=a.sub(c,m),m=a.mul(E,y),h=a.mul(C,h),new v(c,d,h=a.add(h,m))}subtract(e){return this.add(e.negate())}is0(){return this.equals(v.ZERO)}wNAF(e){return E.wNAFCached(this,e,v.normalizeZ)}multiplyUnsafe(e){r.aInRange("scalar",e,l,o.n);let t=v.ZERO;if(e===l)return t;if(e===c)return this;let{endo:n}=o;if(!n)return E.unsafeLadder(this,e);let{k1neg:i,k1:s,k2neg:d,k2:u}=n.splitScalar(e),h=t,f=t,p=this;for(;s>l||u>l;)s&c&&(h=h.add(p)),u&c&&(f=f.add(p)),p=p.double(),s>>=c,u>>=c;return i&&(h=h.negate()),d&&(f=f.negate()),f=new v(a.mul(f.px,n.beta),f.py,f.pz),h.add(f)}multiply(e){let t,n,{endo:i,n:s}=o;if(r.aInRange("scalar",e,c,s),i){let{k1neg:r,k1:o,k2neg:s,k2:l}=i.splitScalar(e),{p:c,f:d}=this.wNAF(o),{p:u,f:h}=this.wNAF(l);c=E.constTimeNegate(r,c),u=E.constTimeNegate(s,u),u=new v(a.mul(u.px,i.beta),u.py,u.pz),t=c.add(u),n=d.add(h)}else{let{p:r,f:i}=this.wNAF(e);t=r,n=i}return v.normalizeZ([t,n])[0]}multiplyAndAddUnsafe(e,t,n){let r=v.BASE,i=(e,t)=>t!==l&&t!==c&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,n));return o.is0()?void 0:o}toAffine(e){return m(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=o;if(e===c)return!0;if(t)return t(v,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=o;return e===c?this:t?t(v,this):this.multiplyUnsafe(o.h)}toRawBytes(e=!0){return(0,i.abool)("isCompressed",e),this.assertValidity(),d(v,this,e)}toHex(e=!0){return(0,i.abool)("isCompressed",e),r.bytesToHex(this.toRawBytes(e))}}v.BASE=new v(o.Gx,o.Gy,a.ONE),v.ZERO=new v(a.ZERO,a.ONE,a.ZERO);
1let b=o.nBitLength,E=(0,t.wNAF)(v,o.endo?Math.ceil(b/2):b);return{CURVE:o,ProjectivePoint:v,normPrivateKeyToScalar:p,weierstrassEquation:f,isWithinCurveOrder:function(e){return r.inRange(e,c,o.n)}}}function p(e,t){let n=e.ORDER,r=l;for(let e=n-c;e%d===l;e/=d)r+=c;let i=r,o=d<<i-c-c,a=o*d,s=(n-c)/a,f=(s-c)/d,p=a-c,g=e.pow(t,s),m=e.pow(t,(s+c)/d),y=(t,n)=>{let r=g,a=e.pow(n,p),s=e.sqr(a);s=e.mul(s,n);let l=e.mul(t,s);l=e.pow(l,f),l=e.mul(l,a),a=e.mul(l,n),s=e.mul(l,t);let u=e.mul(s,a);l=e.pow(u,o);let h=e.eql(l,e.ONE);a=e.mul(s,m),l=e.mul(u,r),s=e.cmov(a,s,h),u=e.cmov(l,u,h);for(let t=i;t>c;t--){let n=t-d;n=d<<n-c;let i=e.pow(u,n),o=e.eql(i,e.ONE);a=e.mul(s,r),r=e.mul(r,r),i=e.mul(u,r),s=e.cmov(a,s,o),u=e.cmov(i,u,o)}return{isValid:h,value:s}};if(e.ORDER%h===u){let n=(e.ORDER-u)/h,r=e.sqrt(e.neg(t));y=(t,i)=>{let o=e.sqr(i),a=e.mul(t,i);o=e.mul(o,a);let s=e.pow(o,n);s=e.mul(s,a);let l=e.mul(s,r),c=e.mul(e.sqr(s),i),d=e.eql(c,t);return{isValid:d,value:e.cmov(l,s,d)}}}return y}}(nk),Object.defineProperty(nC,"__esModule",{value:!0}),nC.getHash=nA,nC.createCurve=function(e,t){let n=t=>(0,nM.weierstrass)({...e,...nA(t)});return Object.freeze({...n(t),create:n})};let nM=nk;function nA(e){return{hash:e,hmac:(t,...n)=>(0,n_.hmac)(e,t,(0,eN.concatBytes)(...n)),randomBytes:eN.randomBytes}}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;let t=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),r=BigInt(1),i=BigInt(2),o=(e,t)=>(e+t/i)/t;function a(e){let n=BigInt(3),r=BigInt(6),o=BigInt(11),a=BigInt(22),l=BigInt(23),c=BigInt(44),d=BigInt(88),u=e*e*e%t,h=u*u*e%t,f=(0,tu.pow2)(h,n,t)*h%t,p=(0,tu.pow2)(f,n,t)*h%t,g=(0,tu.pow2)(p,i,t)*u%t,m=(0,tu.pow2)(g,o,t)*g%t,y=(0,tu.pow2)(m,a,t)*m%t,v=(0,tu.pow2)(y,c,t)*y%t,b=(0,tu.pow2)(v,d,t)*v%t,E=(0,tu.pow2)(b,c,t)*y%t,w=(0,tu.pow2)(E,n,t)*h%t,C=(0,tu.pow2)(w,l,t)*m%t,_=(0,tu.pow2)(C,r,t)*u%t,S=(0,tu.pow2)(_,i,t);if(!s.eql(s.sqr(S),e))throw Error("Cannot find square root");return S}let s=(0,tu.Field)(t,void 0,void 0,{sqrt:a});e.secp256k1=(0,nC.createCurve)({a:BigInt(0),b:BigInt(7),Fp:s,n:n,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-r*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=BigInt("0x100000000000000000000000000000000"),l=o(t*e,n),c=o(-i*e,n),d=(0,tu.mod)(e-l*t-c*a,n),u=(0,tu.mod)(-l*i-c*t,n),h=d>s,f=u>s;if(h&&(d=n-d),f&&(u=n-u),d>s||u>s)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:h,k1:d,k2neg:f,k2:u}}}},ng.sha256);let l=BigInt(0),c={};function d(e,...t){let n=c[e];if(void 0===n){let t=(0,ng.sha256)(Uint8Array.from(e,e=>e.charCodeAt(0)));n=(0,th.concatBytes)(t,t),c[e]=n}return(0,ng.sha256)((0,th.concatBytes)(n,...t))}let u=e=>e.toRawBytes(!0).slice(1),h=e=>(0,th.numberToBytesBE)(e,32),f=e=>(0,tu.mod)(e,t),p=e=>(0,tu.mod)(e,n),g=e.secp256k1.ProjectivePoint;function m(t){let n=e.secp256k1.utils.normPrivateKeyToScalar(t),r=g.fromPrivateKey(n);return{scalar:r.hasEvenY()?n:p(-n),bytes:u(r)}}function y(e){(0,th.aInRange)("x",e,r,t);let n=f(e*e),o=a(f(n*e+BigInt(7)));o%i!==l&&(o=f(-o));let s=new g(e,o,r);return s.assertValidity(),s}let v=th.bytesToNumberBE;function b(...e){return p(v(d("BIP0340/challenge",...e)))}function E(e,i,o){let a=(0,th.ensureBytes)("signature",e,64),s=(0,th.ensureBytes)("message",i),l=(0,th.ensureBytes)("publicKey",o,32);try{let e,i=y(v(l)),o=v(a.subarray(0,32));if(!(0,th.inRange)(o,r,t))return!1;let c=v(a.subarray(32,64));if(!(0,th.inRange)(c,r,n))return!1;let d=b(h(o),u(i),s),f=(e=p(-d),g.BASE.multiplyAndAddUnsafe(i,c,e));return!(!f||!f.hasEvenY()||f.toAffine().x!==o)}catch(e){return!1}}e.schnorr={getPublicKey:function(e){return m(e).bytes},sign:function(e,t,n=(0,eN.randomBytes)(32)){let r=(0,th.ensureBytes)("message",e),{bytes:i,scalar:o}=m(t),a=h(o^v(d("BIP0340/aux",(0,th.ensureBytes)("auxRand",n,32)))),s=p(v(d("BIP0340/nonce",a,i,r)));if(s===l)throw Error("sign failed: k is zero");let{bytes:c,scalar:u}=m(s),f=b(c,i,r),g=new Uint8Array(64);if(g.set(c,0),g.set(h(p(u+f*o)),32),!E(g,r,i))throw Error("sign: Invalid signature produced");return g},verify:E,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:y,pointToBytes:u,numberToBytesBE:th.numberToBytesBE,bytesToNumberBE:th.bytesToNumberBE,taggedHash:d,mod:tu.mod}};let w=(0,nn.isogenyMap)(s,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a4
113deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(e=>BigInt(e)))),C=(0,nk.mapToCurveSimpleSWU)(s,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:s.create(BigInt("-11"))}),_=(0,nn.createHasher)(e.secp256k1.ProjectivePoint,e=>{let{x:t,y:n}=C(s.create(e[0]));return w(t,n)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:s.ORDER,m:1,k:128,expand:"xmd",hash:ng.sha256});e.hashToCurve=_.hashToCurve,e.encodeToCurve=_.encodeToCurve}(np);var nL={};Object.defineProperty(nL,"__esModule",{value:!0}),nL.decodeHex=nL.remove0x=void 0,nL.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.slice(2):e},nL.decodeHex=function(e){return(0,el.hexToBytes)((0,nL.remove0x)(e))},function(e){function t(e,t,n,r){if("secp256k1"===e)return t(np.secp256k1);if("x25519"===e)return n(ex.x25519);if("ed25519"===e)return r(ex.ed25519);throw Error("Not implemented")}Object.defineProperty(e,"__esModule",{value:!0}),e.hexToPublicKey=e.convertPublicKeyFormat=e.getSharedPoint=e.getPublicKey=e.isValidPrivateKey=e.getValidSecret=void 0,e.getValidSecret=function(){var t;do t=(0,e_.randomBytes)(ev.SECRET_KEY_LENGTH);while(!(0,e.isValidPrivateKey)(t));return t},e.isValidPrivateKey=function(e){return t((0,ey.ellipticCurve)(),function(t){return t.utils.isValidPrivateKey(e)},function(){return!0},function(){return!0})},e.getPublicKey=function(e){return t((0,ey.ellipticCurve)(),function(t){return t.getPublicKey(e)},function(t){return t.getPublicKey(e)},function(t){return t.getPublicKey(e)})},e.getSharedPoint=function(e,n,i){return t((0,ey.ellipticCurve)(),function(t){return t.getSharedSecret(e,n,i)},function(t){return t.getSharedSecret(e,n)},function(t){return r(t,e,n)})},e.convertPublicKeyFormat=function(e,n){return t((0,ey.ellipticCurve)(),function(t){return t.getSharedSecret(BigInt(1),e,n)},function(){return e},function(){return e})},e.hexToPublicKey=function(e){var r=(0,nL.decodeHex)(e);return t((0,ey.ellipticCurve)(),function(){return n(r)},function(){return r},function(){return r})};var n=function(e){if(e.length===ev.ETH_PUBLIC_KEY_SIZE){var t=new Uint8Array(1+e.length);return t.set([4]),t.set(e,1),t}return e},r=function(e,t,n){var r=e.utils.getExtendedPublicKey(t).scalar;return e.ExtendedPoint.fromHex(n).multiply(r).toRawBytes()}}(eC);var nP={},nI={};function nO(e,t,n){return(0,eA.hash)(e),void 0===n&&(n=new Uint8Array(e.outputLen)),(0,n_.hmac)(e,(0,eN.toBytes)(n),(0,eN.toBytes)(t))}Object.defineProperty(nI,"__esModule",{value:!0}),nI.hkdf=void 0,nI.extract=nO,nI.expand=n$;let nR=new Uint8Array([0]),nT=new Uint8Array;function n$(e,t,n,r=32){if((0,eA.hash)(e),(0,eA.number)(r),r>255*e.outputLen)throw Error("Length should be <= 255*HashLen");let i=Math.ceil(r/e.outputLen);void 0===n&&(n=nT);let o=new Uint8Array(i*e.outputLen),a=n_.hmac.create(e,t),s=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let t=0;t<i;t++)nR[0]=t+1,s.update(0===t?nT:l).update(n).update(nR).digestInto(l),o.set(l,e.outputLen*t),a._cloneInto(s);return a.destroy(),s.destroy(),l.fill(0),nR.fill(0),o.slice(0,r)}nI.hkdf=(e,t,n,r,i)=>n$(e,nO(e,t,n),r,i),Object.defineProperty(nP,"__esModule",{value:!0}),nP.getSharedKey=nP.deriveKey=void 0,nP.deriveKey=function(e,t,n){return(0,nI.hkdf)(ng.sha256,e,t,n,32)},nP.getSharedKey=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,nP.deriveKey)(el.concatBytes.apply(void 0,e))};var nN={},nD={},nB={},nK={};Object.defineProperty(nK,"__esModule",{value:!0}),nK.polyval=nK.ghash=void 0,nK._toGHASHKey=nH;let nj=new Uint8Array(16),nU=(0,el.u32)(nj),nF=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255;function nH(e){e.reverse();let t=1&e[15],n=0;for(let t=0;t<e.length;t++){let r=e[t];e[t]=r>>>1|n,n=(1&r)<<7}return e[0]^=225&-t,e}class nz{constructor(e,t){var n,r,i,o;this.blockLen=16,this.outputLen=16,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,e=(0,el.toBytes)(e),(0,ec.b
1ytes)(e,16);const a=(0,el.createView)(e);let s=a.getUint32(0,!1),l=a.getUint32(4,!1),c=a.getUint32(8,!1),d=a.getUint32(12,!1);const u=[];for(let e=0;e<128;e++)u.push({s0:nF(s),s1:nF(l),s2:nF(c),s3:nF(d)}),{s0:s,s1:l,s2:c,s3:d}={s3:(i=c)<<31|(o=d)>>>1,s2:(r=l)<<31|i>>>1,s1:(n=s)<<31|r>>>1,s0:n>>>1^-0x1f000000&-(1&o)};const h=(e=>e>65536?8:e>1024?4:2)(t||1024);if(![1,2,4,8].includes(h))throw Error(`ghash: wrong window size=${h}, should be 2, 4 or 8`);this.W=h;const f=128/h,p=this.windowSize=2**h,g=[];for(let e=0;e<f;e++)for(let t=0;t<p;t++){let n=0,r=0,i=0,o=0;for(let a=0;a<h;a++){if(!(t>>>h-a-1&1))continue;const{s0:s,s1:l,s2:c,s3:d}=u[h*e+a];n^=s,r^=l,i^=c,o^=d}g.push({s0:n,s1:r,s2:i,s3:o})}this.t=g}_updateBlock(e,t,n,r){e^=this.s0,t^=this.s1,n^=this.s2,r^=this.s3;let{W:i,t:o,windowSize:a}=this,s=0,l=0,c=0,d=0,u=(1<<i)-1,h=0;for(let f of[e,t,n,r])for(let e=0;e<4;e++){let t=f>>>8*e&255;for(let e=8/i-1;e>=0;e--){let{s0:n,s1:r,s2:f,s3:p}=o[h*a+(t>>>i*e&u)];s^=n,l^=r,c^=f,d^=p,h+=1}}this.s0=s,this.s1=l,this.s2=c,this.s3=d}update(e){e=(0,el.toBytes)(e),(0,ec.exists)(this);let t=(0,el.u32)(e),n=Math.floor(e.length/16),r=e.length%16;for(let e=0;e<n;e++)this._updateBlock(t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]);return r&&(nj.set(e.subarray(16*n)),this._updateBlock(nU[0],nU[1],nU[2],nU[3]),(0,el.clean)(nU)),this}destroy(){let{t:e}=this;for(let t of e)t.s0=0,t.s1=0,t.s2=0,t.s3=0}digestInto(e){(0,ec.exists)(this),(0,ec.output)(e,this),this.finished=!0;let{s0:t,s1:n,s2:r,s3:i}=this,o=(0,el.u32)(e);return o[0]=t,o[1]=n,o[2]=r,o[3]=i,e}digest(){let e=new Uint8Array(16);return this.digestInto(e),this.destroy(),e}}class nq extends nz{constructor(e,t){e=(0,el.toBytes)(e);const n=nH((0,el.copyBytes)(e));super(n,t),(0,el.clean)(n)}update(e){e=(0,el.toBytes)(e),(0,ec.exists)(this);let t=(0,el.u32)(e),n=e.length%16,r=Math.floor(e.length/16);for(let e=0;e<r;e++)this._updateBlock(nF(t[4*e+3]),nF(t[4*e+2]),nF(t[4*e+1]),nF(t[4*e+0]));return n&&(nj.set(e.subarray(16*r)),this._updateBlock(nF(nU[3]),nF(nU[2]),nF(nU[1]),nF(nU[0])),(0,el.clean)(nU)),this}digestInto(e){(0,ec.exists)(this),(0,ec.output)(e,this),this.finished=!0;let{s0:t,s1:n,s2:r,s3:i}=this,o=(0,el.u32)(e);return o[0]=t,o[1]=n,o[2]=r,o[3]=i,e.reverse()}}function nV(e){let t=(t,n)=>e(n,t.length).update((0,el.toBytes)(t)).digest(),n=e(new Uint8Array(16),0);return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=(t,n)=>e(t,n),t}nK.ghash=nV((e,t)=>new nz(e,t)),nK.polyval=nV((e,t)=>new nq(e,t)),Object.defineProperty(nB,"__esModule",{value:!0}),nB.unsafe=nB.aeskwp=nB.aeskw=nB.siv=nB.gcm=nB.cfb=nB.cbc=nB.ecb=nB.ctr=void 0,nB.expandKeyLE=n8,nB.expandKeyDecLE=n4;let nW=new Uint8Array(16);function nG(e){return e<<1^283&-(e>>7)}function nZ(e,t){let n=0;for(;t>0;t>>=1)n^=e&-(1&t),e=nG(e);return n}let nY=(()=>{let e=new Uint8Array(256);for(let t=0,n=1;t<256;t++,n^=nG(n))e[t]=n;let t=new Uint8Array(256);t[0]=99;for(let n=0;n<255;n++){let r=e[255-n];r|=r<<8,t[e[n]]=255&(r^r>>4^r>>5^r>>6^r>>7^99)}return(0,el.clean)(e),t})(),nJ=nY.map((e,t)=>nY.indexOf(t)),nX=e=>e<<24|e>>>8,nQ=e=>e<<8|e>>>24,n0=e=>e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255;function n1(e,t){if(256!==e.length)throw Error("Wrong sbox length");let n=new Uint32Array(256).map((n,r)=>t(e[r])),r=n.map(nQ),i=r.map(nQ),o=i.map(nQ),a=new Uint32Array(65536),s=new Uint32Array(65536),l=new Uint16Array(65536);for(let t=0;t<256;t++)for(let c=0;c<256;c++){let d=256*t+c;a[d]=n[t]^r[c],s[d]=i[t]^o[c],l[d]=e[t]<<8|e[c]}return{sbox:e,sbox2:l,T0:n,T1:r,T2:i,T3:o,T01:a,T23:s}}let n2=n1(nY,e=>nZ(e,3)<<24|e<<16|e<<8|nZ(e,2)),n3=n1(nJ,e=>nZ(e,11)<<24|nZ(e,13)<<16|nZ(e,9)<<8|nZ(e,14)),n5=(()=>{let e=new Uint8Array(16);for(let t=0,n=1;t<16;t++,n=nG(n))e[t]=n;return e})();function n8(e){(0,ec.bytes)(e);let t=e.length;if(![16,24,32].includes(t))throw Error(`aes: wrong key size: should be 16, 24 or 32, got: ${t}`);let{sbox2:n}=n2,r=[];(0,el.isAligned32)(e)||r.push(e=(0,el.copyBytes)(e));let i=(0,el.u32)(e),o=i.length,a=e=>n7(n,e,e,e,e),s=new Uint32Array(t+28);s.set(i);for(let e=o;e<s.length;e++){let t=s[e-1];e%o==0?t=a(nX(t))^n5[e/o-1]:o>6&&e%o==4&&(t=a(t)),s[e]=s[e-o]^t}return(0,el.clean)(...r),s}function n4(e){let t=n8(e),n=t.slice(),r=t.length,{sbox2:i}=n2,{T0:o,T1:a,T2:s,T3:l}=n3;for(let e=0;e<r;e+=4)for(let i=0;i<4;i++)n[e+i]=t[r-e-4+i];(0,el.clean)(t);for(let e=4;e<r-4;e++){let t=n[e],r=n7(i,t,t,t,t);n[e]=o[255&r]^a[r>>>8&255]^s[r>>>16&255]^l[r>>>24]}return n}function n6(e,t,n,r,i,o){return e[n<<8&65280|r>>>8&255]^t[i>>>8&65280|o>>>24&255]}function n7(e,t,n,r,i){return e[255&t|65280&n]|e[r>>>16&255|i>>>16&65280]<<16}
1function n9(e,t,n,r,i){let{sbox2:o,T01:a,T23:s}=n2,l=0;t^=e[l++],n^=e[l++],r^=e[l++],i^=e[l++];let c=e.length/4-2;for(let o=0;o<c;o++){let o=e[l++]^n6(a,s,t,n,r,i),c=e[l++]^n6(a,s,n,r,i,t),d=e[l++]^n6(a,s,r,i,t,n),u=e[l++]^n6(a,s,i,t,n,r);t=o,n=c,r=d,i=u}return{s0:e[l++]^n7(o,t,n,r,i),s1:e[l++]^n7(o,n,r,i,t),s2:e[l++]^n7(o,r,i,t,n),s3:e[l++]^n7(o,i,t,n,r)}}function re(e,t,n,r,i){let{sbox2:o,T01:a,T23:s}=n3,l=0;t^=e[l++],n^=e[l++],r^=e[l++],i^=e[l++];let c=e.length/4-2;for(let o=0;o<c;o++){let o=e[l++]^n6(a,s,t,i,r,n),c=e[l++]^n6(a,s,n,t,i,r),d=e[l++]^n6(a,s,r,n,t,i),u=e[l++]^n6(a,s,i,r,n,t);t=o,n=c,r=d,i=u}return{s0:e[l++]^n7(o,t,i,r,n),s1:e[l++]^n7(o,n,t,i,r),s2:e[l++]^n7(o,r,n,t,i),s3:e[l++]^n7(o,i,r,n,t)}}function rt(e,t){if(void 0===t)return new Uint8Array(e);if((0,ec.bytes)(t),t.length<e)throw Error(`aes: wrong destination length, expected at least ${e}, got: ${t.length}`);if(!(0,el.isAligned32)(t))throw Error("unaligned dst");return t}function rn(e,t,n,r){(0,ec.bytes)(t,16),(0,ec.bytes)(n);let i=n.length;r=rt(i,r);let o=(0,el.u32)(t),{s0:a,s1:s,s2:l,s3:c}=n9(e,o[0],o[1],o[2],o[3]),d=(0,el.u32)(n),u=(0,el.u32)(r);for(let n=0;n+4<=d.length;n+=4){u[n+0]=d[n+0]^a,u[n+1]=d[n+1]^s,u[n+2]=d[n+2]^l,u[n+3]=d[n+3]^c;let r=1;for(let e=t.length-1;e>=0;e--)r=r+(255&t[e])|0,t[e]=255&r,r>>>=8;({s0:a,s1:s,s2:l,s3:c}=n9(e,o[0],o[1],o[2],o[3]))}let h=16*Math.floor(d.length/4);if(h<i){let e=new Uint32Array([a,s,l,c]),t=(0,el.u8)(e);for(let e=h,o=0;e<i;e++,o++)r[e]=n[e]^t[o];(0,el.clean)(e)}return r}function rr(e,t,n,r,i){(0,ec.bytes)(n,16),(0,ec.bytes)(r),i=rt(r.length,i);let o=(0,el.u32)(n),a=(0,el.createView)(n),s=(0,el.u32)(r),l=(0,el.u32)(i),c=12*!t,d=r.length,u=a.getUint32(c,t),{s0:h,s1:f,s2:p,s3:g}=n9(e,o[0],o[1],o[2],o[3]);for(let n=0;n+4<=s.length;n+=4)l[n+0]=s[n+0]^h,l[n+1]=s[n+1]^f,l[n+2]=s[n+2]^p,l[n+3]=s[n+3]^g,u=u+1>>>0,a.setUint32(c,u,t),{s0:h,s1:f,s2:p,s3:g}=n9(e,o[0],o[1],o[2],o[3]);let m=16*Math.floor(s.length/4);if(m<d){let e=new Uint32Array([h,f,p,g]),t=(0,el.u8)(e);for(let e=m,n=0;e<d;e++,n++)i[e]=r[e]^t[n];(0,el.clean)(e)}return i}function ri(e){if((0,ec.bytes)(e),e.length%16!=0)throw Error("aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size 16")}function ro(e,t,n){(0,ec.bytes)(e);let r=e.length,i=r%16;if(!t&&0!==i)throw Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");(0,el.isAligned32)(e)||(e=(0,el.copyBytes)(e));let o=(0,el.u32)(e);if(t){let e=16-i;e||(e=16),r+=e}let a=rt(r,n);return{b:o,o:(0,el.u32)(a),out:a}}function ra(e,t){if(!t)return e;let n=e.length;if(!n)throw Error("aes/pcks5: empty ciphertext not allowed");let r=e[n-1];if(r<=0||r>16)throw Error("aes/pcks5: wrong padding");let i=e.subarray(0,-r);for(let t=0;t<r;t++)if(e[n-t-1]!==r)throw Error("aes/pcks5: wrong padding");return i}function rs(e){let t=new Uint8Array(16),n=(0,el.u32)(t);t.set(e);let r=16-e.length;for(let e=16-r;e<16;e++)t[e]=r;return n}function rl(e,t,n,r,i){let o=null==i?0:i.length,a=e.create(n,r.length+o);i&&a.update(i),a.update(r);let s=new Uint8Array(16),l=(0,el.createView)(s);i&&(0,el.setBigUint64)(l,0,BigInt(8*o),t),(0,el.setBigUint64)(l,8,BigInt(8*r.length),t),a.update(s);let c=a.digest();return(0,el.clean)(s),c}nB.ctr=(0,el.wrapCipher)({blockSize:16,nonceLength:16},function(e,t){function n(n,r){if((0,ec.bytes)(n),void 0!==r&&((0,ec.bytes)(r),!(0,el.isAligned32)(r)))throw Error("unaligned destination");let i=n8(e),o=(0,el.copyBytes)(t),a=[i,o];(0,el.isAligned32)(n)||a.push(n=(0,el.copyBytes)(n));let s=rn(i,o,n,r);return(0,el.clean)(...a),s}return(0,ec.bytes)(e),(0,ec.bytes)(t,16),{encrypt:(e,t)=>n(e,t),decrypt:(e,t)=>n(e,t)}}),nB.ecb=(0,el.wrapCipher)({blockSize:16},function(e,t={}){(0,ec.bytes)(e);let n=!t.disablePadding;return{encrypt(t,r){let{b:i,o:o,out:a}=ro(t,n,r),s=n8(e),l=0;for(;l+4<=i.length;){let{s0:e,s1:t,s2:n,s3:r}=n9(s,i[l+0],i[l+1],i[l+2],i[l+3]);o[l++]=e,o[l++]=t,o[l++]=n,o[l++]=r}if(n){let e=rs(t.subarray(4*l)),{s0:n,s1:r,s2:i,s3:a}=n9(s,e[0],e[1],e[2],e[3]);o[l++]=n,o[l++]=r,o[l++]=i,o[l++]=a}return(0,el.clean)(s),a},decrypt(t,r){ri(t);let i=n4(e),o=rt(t.length,r),a=[i];(0,el.isAligned32)(t)||a.push(t=(0,el.copyBytes)(t));let s=(0,el.u32)(t),l=(0,el.u32)(o);for(let e=0;e+4<=s.length;){let{s0:t,s1:n,s2:r,s3:o}=re(i,s[e+0],s[e+1],s[e+2],s[e+3]);
1l[e++]=t,l[e++]=n,l[e++]=r,l[e++]=o}return(0,el.clean)(...a),ra(o,n)}}}),nB.cbc=(0,el.wrapCipher)({blockSize:16,nonceLength:16},function(e,t,n={}){(0,ec.bytes)(e),(0,ec.bytes)(t,16);let r=!n.disablePadding;return{encrypt(n,i){let o=n8(e),{b:a,o:s,out:l}=ro(n,r,i),c=t,d=[o];(0,el.isAligned32)(c)||d.push(c=(0,el.copyBytes)(c));let u=(0,el.u32)(c),h=u[0],f=u[1],p=u[2],g=u[3],m=0;for(;m+4<=a.length;)h^=a[m+0],f^=a[m+1],p^=a[m+2],g^=a[m+3],({s0:h,s1:f,s2:p,s3:g}=n9(o,h,f,p,g)),s[m++]=h,s[m++]=f,s[m++]=p,s[m++]=g;if(r){let e=rs(n.subarray(4*m));h^=e[0],f^=e[1],p^=e[2],g^=e[3],({s0:h,s1:f,s2:p,s3:g}=n9(o,h,f,p,g)),s[m++]=h,s[m++]=f,s[m++]=p,s[m++]=g}return(0,el.clean)(...d),l},decrypt(n,i){ri(n);let o=n4(e),a=t,s=[o];(0,el.isAligned32)(a)||s.push(a=(0,el.copyBytes)(a));let l=(0,el.u32)(a),c=rt(n.length,i);(0,el.isAligned32)(n)||s.push(n=(0,el.copyBytes)(n));let d=(0,el.u32)(n),u=(0,el.u32)(c),h=l[0],f=l[1],p=l[2],g=l[3];for(let e=0;e+4<=d.length;){let t=h,n=f,r=p,i=g;h=d[e+0],f=d[e+1];let{s0:a,s1:s,s2:l,s3:c}=re(o,h,f,p=d[e+2],g=d[e+3]);u[e++]=a^t,u[e++]=s^n,u[e++]=l^r,u[e++]=c^i}return(0,el.clean)(...s),ra(c,r)}}}),nB.cfb=(0,el.wrapCipher)({blockSize:16,nonceLength:16},function(e,t){function n(n,r,i){(0,ec.bytes)(n);let o=n.length;i=rt(o,i);let a=n8(e),s=t,l=[a];(0,el.isAligned32)(s)||l.push(s=(0,el.copyBytes)(s)),(0,el.isAligned32)(n)||l.push(n=(0,el.copyBytes)(n));let c=(0,el.u32)(n),d=(0,el.u32)(i),u=r?d:c,h=(0,el.u32)(s),f=h[0],p=h[1],g=h[2],m=h[3];for(let e=0;e+4<=c.length;){let{s0:t,s1:n,s2:r,s3:i}=n9(a,f,p,g,m);d[e+0]=c[e+0]^t,d[e+1]=c[e+1]^n,d[e+2]=c[e+2]^r,d[e+3]=c[e+3]^i,f=u[e++],p=u[e++],g=u[e++],m=u[e++]}let y=16*Math.floor(c.length/4);if(y<o){({s0:f,s1:p,s2:g,s3:m}=n9(a,f,p,g,m));let e=(0,el.u8)(new Uint32Array([f,p,g,m]));for(let t=y,r=0;t<o;t++,r++)i[t]=n[t]^e[r];(0,el.clean)(e)}return(0,el.clean)(...l),i}return(0,ec.bytes)(e),(0,ec.bytes)(t,16),{encrypt:(e,t)=>n(e,!0,t),decrypt:(e,t)=>n(e,!1,t)}}),nB.gcm=(0,el.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16},function(e,t,n){if((0,ec.bytes)(e),(0,ec.bytes)(t),void 0!==n&&(0,ec.bytes)(n),t.length<8)throw Error("aes/gcm: invalid nonce length");function r(e,t,r){let i=rl(nK.ghash,!1,e,r,n);for(let e=0;e<t.length;e++)i[e]^=t[e];return i}function i(){let n=n8(e),r=nW.slice(),i=nW.slice();if(rr(n,!1,i,i,r),12===t.length)i.set(t);else{let e=nW.slice(),n=(0,el.createView)(e);(0,el.setBigUint64)(n,8,BigInt(8*t.length),!1);let o=nK.ghash.create(r).update(t).update(e);o.digestInto(i),o.destroy()}return{xk:n,authKey:r,counter:i,tagMask:rr(n,!1,i,nW)}}return{encrypt(e){(0,ec.bytes)(e);let{xk:t,authKey:n,counter:o,tagMask:a}=i(),s=new Uint8Array(e.length+16),l=[t,n,o,a];(0,el.isAligned32)(e)||l.push(e=(0,el.copyBytes)(e)),rr(t,!1,o,e,s);let c=r(n,a,s.subarray(0,s.length-16));return l.push(c),s.set(c,e.length),(0,el.clean)(...l),s},decrypt(e){if((0,ec.bytes)(e),e.length<16)throw Error("aes/gcm: ciphertext less than tagLen (16)");let{xk:t,authKey:n,counter:o,tagMask:a}=i(),s=[t,n,a,o];(0,el.isAligned32)(e)||s.push(e=(0,el.copyBytes)(e));let l=e.subarray(0,-16),c=e.subarray(-16),d=r(n,a,l);if(s.push(d),!(0,el.equalBytes)(d,c))throw Error("aes/gcm: invalid ghash tag");let u=rr(t,!1,o,l);return(0,el.clean)(...s),u}}});let rc=(e,t,n)=>r=>{if(!Number.isSafeInteger(r)||t>r||r>n)throw Error(`${e}: invalid value=${r}, must be [${t}..${n}]`)};function rd(e){return null!=e&&"object"==typeof e&&(e instanceof Uint32Array||"Uint32Array"===e.constructor.name)}function ru(e,t){if((0,ec.bytes)(t,16),!rd(e))throw Error("_encryptBlock accepts result of expandKeyLE");let n=(0,el.u32)(t),{s0:r,s1:i,s2:o,s3:a}=n9(e,n[0],n[1],n[2],n[3]);return n[0]=r,n[1]=i,n[2]=o,n[3]=a,t}function rh(e,t){if((0,ec.bytes)(t,16),!rd(e))throw Error("_decryptBlock accepts result of expandKeyLE");let n=(0,el.u32)(t),{s0:r,s1:i,s2:o,s3:a}=re(e,n[0],n[1],n[2],n[3]);return n[0]=r,n[1]=i,n[2]=o,n[3]=a,t}nB.siv=(0,el.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16},function(e,t,n){let r=rc("AAD",0,0x1000000000),i=rc("plaintext",0,0x1000000000),o=rc("nonce",12,12),a=rc("ciphertext",16,0x1000000000+16);function s(){let n=n8(e),r=new Uint8Array(e.length),i=new Uint8Array(16),o=[n,r],a=t;(0,el.isAligned32)(a)||o.push(a=(0,el.copyBytes)(a));let s=(0,el.u32)(a),l=0,c=s[0],d=s[1],u=s[2],h=0;for(let e of[i,r].map(el.u32)){let t=(0,el.u32)(e);for(let e=0;e<t.length;e+=2){let{s0:r,s1:i}=n9(n,l,c,d,u);t[e+0]=r,t[e+1]=i,l=++h}}let f={authKey:i,encKey:n8(r)};return(0,el.clean)(...o),f}function l(e,r,i){let o=rl(nK.polyval,!0,r,i,n);for(let e=0;e<12;e++)o[e]^=t[e];o[15]&=127;let a=(0,el.u32)(o),s=a[0],l=a[1],c=a[2],d=a[3];return{s0:s,s1:l,s2:c,s3:d}=n9(e,s,l,c,d),a[0]=s,a[1]=l,a[2]=c,a[3]=d,o}
1function c(e,t,n){let r=(0,el.copyBytes)(t);r[15]|=128;let i=rr(e,!0,r,n);return(0,el.clean)(r),i}return(0,ec.bytes)(e,16,24,32),(0,ec.bytes)(t),o(t.length),void 0!==n&&((0,ec.bytes)(n),r(n.length)),{encrypt(e){(0,ec.bytes)(e),i(e.length);let{encKey:t,authKey:n}=s(),r=l(t,n,e),o=[t,n,r];(0,el.isAligned32)(e)||o.push(e=(0,el.copyBytes)(e));let a=new Uint8Array(e.length+16);return a.set(r,e.length),a.set(c(t,r,e)),(0,el.clean)(...o),a},decrypt(e){(0,ec.bytes)(e),a(e.length);let t=e.subarray(-16),{encKey:n,authKey:r}=s(),i=[n,r];(0,el.isAligned32)(e)||i.push(e=(0,el.copyBytes)(e));let o=c(n,t,e.subarray(0,-16)),d=l(n,r,o);if(i.push(d),!(0,el.equalBytes)(t,d))throw(0,el.clean)(...i),Error("invalid polyval tag");return(0,el.clean)(...i),o}}});let rf={encrypt(e,t){if(t.length>=0x100000000)throw Error("plaintext should be less than 4gb");let n=n8(e);if(16===t.length)ru(n,t);else{let e=(0,el.u32)(t),r=e[0],i=e[1];for(let t=0,o=1;t<6;t++)for(let t=2;t<e.length;t+=2,o++){let{s0:a,s1:s,s2:l,s3:c}=n9(n,r,i,e[t],e[t+1]);r=a,i=s^n0(o),e[t]=l,e[t+1]=c}e[0]=r,e[1]=i}n.fill(0)},decrypt(e,t){if(t.length-8>=0x100000000)throw Error("ciphertext should be less than 4gb");let n=n4(e),r=t.length/8-1;if(1===r)rh(n,t);else{let e=(0,el.u32)(t),i=e[0],o=e[1];for(let t=0,a=6*r;t<6;t++)for(let t=2*r;t>=1;t-=2,a--){let{s0:r,s1:s,s2:l,s3:c}=re(n,i,o^=n0(a),e[t],e[t+1]);i=r,o=s,e[t]=l,e[t+1]=c}e[0]=i,e[1]=o}n.fill(0)}},rp=new Uint8Array(8).fill(166);nB.aeskw=(0,el.wrapCipher)({blockSize:8},e=>({encrypt(t){if((0,ec.bytes)(t),!t.length||t.length%8!=0)throw Error("invalid plaintext length");if(8===t.length)throw Error("8-byte keys not allowed in AESKW, use AESKWP instead");let n=(0,el.concatBytes)(rp,t);return rf.encrypt(e,n),n},decrypt(t){if((0,ec.bytes)(t),t.length%8!=0||t.length<24)throw Error("invalid ciphertext length");let n=(0,el.copyBytes)(t);if(rf.decrypt(e,n),!(0,el.equalBytes)(n.subarray(0,8),rp))throw Error("integrity check failed");return n.subarray(0,8).fill(0),n.subarray(8)}})),nB.aeskwp=(0,el.wrapCipher)({blockSize:8},e=>({encrypt(t){if((0,ec.bytes)(t),!t.length)throw Error("invalid plaintext length");let n=new Uint8Array(8+8*Math.ceil(t.length/8));n.set(t,8);let r=(0,el.u32)(n);return r[0]=0xa65959a6,r[1]=n0(t.length),rf.encrypt(e,n),n},decrypt(t){if((0,ec.bytes)(t),t.length<16)throw Error("invalid ciphertext length");let n=(0,el.copyBytes)(t),r=(0,el.u32)(n);rf.decrypt(e,n);let i=n0(r[1])>>>0,o=8*Math.ceil(i/8);if(0xa65959a6!==r[0]||n.length-8!==o)throw Error("integrity check failed");for(let e=i;e<o;e++)if(0!==n[8+e])throw Error("integrity check failed");return n.subarray(0,8).fill(0),n.subarray(8,8+i)}})),nB.unsafe={expandKeyLE:n8,expandKeyDecLE:n4,encrypt:n9,decrypt:re,encryptBlock:ru,decryptBlock:rh,ctrCounter:rn,ctr32:rr},Object.defineProperty(nD,"__esModule",{value:!0}),nD.aes256cbc=nD.aes256gcm=void 0,nD.aes256gcm=function(e,t,n){return(0,nB.gcm)(e,t,n)},nD.aes256cbc=function(e,t,n){return(0,nB.cbc)(e,t)};var rg={},rm={},ry={};Object.defineProperty(ry,"__esModule",{value:!0}),ry.sigma=void 0,ry.rotl=function(e,t){return e<<t|e>>>32-t},ry.createCipher=function(e,t){let{allowShortKeys:n,extendNonceFn:r,counterLength:i,counterRight:o,rounds:a}=(0,rb.checkOpts)({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw Error("core must be a function");return(0,rv.number)(i),(0,rv.number)(a),(0,rv.bool)(o),(0,rv.bool)(n),(t,s,l,c,d=0)=>{(0,rv.bytes)(t),(0,rv.bytes)(s),(0,rv.bytes)(l);let u=l.length;if(void 0===c&&(c=new Uint8Array(u)),(0,rv.bytes)(c),(0,rv.number)(d),d<0||d>=rA)throw Error("arx: counter overflow");if(c.length<u)throw Error(`arx: output (${c.length}) is shorter than data (${u})`);let h=[],f,p,g=t.length;if(32===g)h.push(f=(0,rb.copyBytes)(t)),p=rS;else{if(16!==g||!n)throw Error(`arx: invalid 32-byte key, got length=${g}`);(f=new Uint8Array(32)).set(t),f.set(t,16),p=r_,h.push(f)}rx(s)||h.push(s=(0,rb.copyBytes)(s));let m=(0,rb.u32)(f);if(r){if(24!==s.length)throw Error("arx: extended nonce must be 24 bytes");r(p,m,(0,rb.u32)(s.subarray(0,16)),m),s=s.subarray(16)}let y=16-i;if(y!==s.length)throw Error(`arx: nonce must be ${y} or 16 bytes`);if(12!==y){let e=new Uint8Array(12);e.set(s,o?0:12-s.length),s=e,h.push(s)}return function(e,t,n,r,i,o,a,s){let l=i.length,c=new Uint8Array(rk),d=(0,rb.u32)(c),u=rx(i)&&rx(o),h=u?(0,rb.u32)(i):rL,f=u?(0,rb.u32)(o):rL;for(let p=0;p<l;a++){if(e(t,n,r,d,a,s),a>=rA)throw Error("arx: counter overflow");let g=Math.min(rk,l-p);if(u&&g===rk){let e=p/4;
1if(p%4!=0)throw Error("arx: invalid block position");for(let t,n=0;n<rM;n++)f[t=e+n]=h[t]^d[n];p+=rk}else{for(let e,t=0;t<g;t++)o[e=p+t]=i[e]^c[t];p+=g}}}(e,p,m,(0,rb.u32)(s),l,c,d,a),(0,rb.clean)(...h),c}};let rv=ec,rb=el,rE=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),rw=rE("expand 16-byte k"),rC=rE("expand 32-byte k"),r_=(0,rb.u32)(rw),rS=(0,rb.u32)(rC);function rx(e){return e.byteOffset%4==0}ry.sigma=rS.slice();let rk=64,rM=16,rA=0x100000000-1,rL=new Uint32Array;var rP={};Object.defineProperty(rP,"__esModule",{value:!0}),rP.poly1305=void 0,rP.wrapConstructorWithKey=rR;let rI=(e,t)=>255&e[t++]|(255&e[t++])<<8;class rO{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,e=(0,el.toBytes)(e),(0,ec.bytes)(e,32);const t=rI(e,0),n=rI(e,2),r=rI(e,4),i=rI(e,6),o=rI(e,8),a=rI(e,10),s=rI(e,12),l=rI(e,14);this.r[0]=8191&t,this.r[1]=8191&(t>>>13|n<<3),this.r[2]=7939&(n>>>10|r<<6),this.r[3]=8191&(r>>>7|i<<9),this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,this.r[6]=8191&(o>>>14|a<<2),this.r[7]=8065&(a>>>11|s<<5),this.r[8]=8191&(s>>>8|l<<8),this.r[9]=l>>>5&127;for(let t=0;t<8;t++)this.pad[t]=rI(e,16+2*t)}process(e,t,n=!1){let{h:r,r:i}=this,o=i[0],a=i[1],s=i[2],l=i[3],c=i[4],d=i[5],u=i[6],h=i[7],f=i[8],p=i[9],g=rI(e,t+0),m=rI(e,t+2),y=rI(e,t+4),v=rI(e,t+6),b=rI(e,t+8),E=rI(e,t+10),w=rI(e,t+12),C=rI(e,t+14),_=r[0]+(8191&g),S=r[1]+(8191&(g>>>13|m<<3)),x=r[2]+(8191&(m>>>10|y<<6)),k=r[3]+(8191&(y>>>7|v<<9)),M=r[4]+(8191&(v>>>4|b<<12)),A=r[5]+(b>>>1&8191),L=r[6]+(8191&(b>>>14|E<<2)),P=r[7]+(8191&(E>>>11|w<<5)),I=r[8]+(8191&(w>>>8|C<<8)),O=r[9]+(C>>>5|2048*!n),R=0,T=0+_*o+5*p*S+5*f*x+5*h*k+5*u*M;R=T>>>13,T&=8191,T+=5*d*A+5*c*L+5*l*P+5*s*I+5*a*O,R+=T>>>13,T&=8191;let $=R+_*a+S*o+5*p*x+5*f*k+5*h*M;R=$>>>13,$&=8191,$+=5*u*A+5*d*L+5*c*P+5*l*I+5*s*O,R+=$>>>13,$&=8191;let N=R+_*s+S*a+x*o+5*p*k+5*f*M;R=N>>>13,N&=8191,N+=5*h*A+5*u*L+5*d*P+5*c*I+5*l*O,R+=N>>>13,N&=8191;let D=R+_*l+S*s+x*a+k*o+5*p*M;R=D>>>13,D&=8191,D+=5*f*A+5*h*L+5*u*P+5*d*I+5*c*O,R+=D>>>13,D&=8191;let B=R+_*c+S*l+x*s+k*a+M*o;R=B>>>13,B&=8191,B+=5*p*A+5*f*L+5*h*P+5*u*I+5*d*O,R+=B>>>13,B&=8191;let K=R+_*d+S*c+x*l+k*s+M*a;R=K>>>13,K&=8191,K+=A*o+5*p*L+5*f*P+5*h*I+5*u*O,R+=K>>>13,K&=8191;let j=R+_*u+S*d+x*c+k*l+M*s;R=j>>>13,j&=8191,j+=A*a+L*o+5*p*P+5*f*I+5*h*O,R+=j>>>13,j&=8191;let U=R+_*h+S*u+x*d+k*c+M*l;R=U>>>13,U&=8191,U+=A*s+L*a+P*o+5*p*I+5*f*O,R+=U>>>13,U&=8191;let F=R+_*f+S*h+x*u+k*d+M*c;R=F>>>13,F&=8191,F+=A*l+L*s+P*a+I*o+5*p*O,R+=F>>>13,F&=8191;let H=R+_*p+S*f+x*h+k*u+M*d;R=H>>>13,H&=8191,H+=A*c+L*l+P*s+I*a+O*o,R+=H>>>13,H&=8191,T=8191&(R=(R=(R<<2)+R|0)+T|0),R>>>=13,$+=R,r[0]=T,r[1]=$,r[2]=N,r[3]=D,r[4]=B,r[5]=K,r[6]=j,r[7]=U,r[8]=F,r[9]=H}finalize(){let{h:e,pad:t}=this,n=new Uint16Array(10),r=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=r,r=e[t]>>>13,e[t]&=8191;e[0]+=5*r,r=e[0]>>>13,e[0]&=8191,e[1]+=r,r=e[1]>>>13,e[1]&=8191,e[2]+=r,n[0]=e[0]+5,r=n[0]>>>13,n[0]&=8191;for(let t=1;t<10;t++)n[t]=e[t]+r,r=n[t]>>>13,n[t]&=8191;n[9]-=8192;let i=(1^r)-1;for(let e=0;e<10;e++)n[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|n[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 o=e[0]+t[0];e[0]=65535&o;for(let n=1;n<8;n++)o=(e[n]+t[n]|0)+(o>>>16)|0,e[n]=65535&o;(0,el.clean)(n)}update(e){(0,ec.exists)(this);let{buffer:t,blockLen:n}=this,r=(e=(0,el.toBytes)(e)).length;for(let i=0;i<r;){let o=Math.min(n-this.pos,r-i);if(o!==n)t.set(e.subarray(i,i+o),this.pos),this.pos+=o,i+=o,this.pos===n&&(this.process(t,0,!1),this.pos=0);else for(;n<=r-i;i+=n)this.process(e,i)}return this}destroy(){(0,el.clean)(this.h,this.r,this.buffer,this.pad)}digestInto(e){(0,ec.exists)(this),(0,ec.output)(e,this),this.finished=!0;let{buffer:t,h:n}=this,{pos:r}=this;if(r){for(t[r++]=1;r<16;r++)t[r]=0;this.process(t,0,!0)}this.finalize();let i=0;for(let t=0;t<8;t++)e[i++]=n[t]>>>0,e[i++]=n[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}}function rR(e){let t=(t,n)=>e(n).update((0,el.toBytes)(t)).digest(),n=e(new Uint8Array(32));return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}rP.poly1305=rR(e=>
1new rO(e)),function(e){function t(e,n,r,i,o,a=20){let s=e[0],l=e[1],c=e[2],d=e[3],u=n[0],h=n[1],f=n[2],p=n[3],g=n[4],m=n[5],y=n[6],v=n[7],b=r[0],E=r[1],w=r[2],C=s,_=l,S=c,x=d,k=u,M=h,A=f,L=p,P=g,I=m,O=y,R=v,T=o,$=b,N=E,D=w;for(let e=0;e<a;e+=2)C=C+k|0,P=P+(T=(0,ry.rotl)(T^C,16))|0,C=C+(k=(0,ry.rotl)(k^P,12))|0,P=P+(T=(0,ry.rotl)(T^C,8))|0,k=(0,ry.rotl)(k^P,7),_=_+M|0,I=I+($=(0,ry.rotl)($^_,16))|0,_=_+(M=(0,ry.rotl)(M^I,12))|0,I=I+($=(0,ry.rotl)($^_,8))|0,M=(0,ry.rotl)(M^I,7),S=S+A|0,O=O+(N=(0,ry.rotl)(N^S,16))|0,S=S+(A=(0,ry.rotl)(A^O,12))|0,O=O+(N=(0,ry.rotl)(N^S,8))|0,A=(0,ry.rotl)(A^O,7),x=x+L|0,R=R+(D=(0,ry.rotl)(D^x,16))|0,x=x+(L=(0,ry.rotl)(L^R,12))|0,R=R+(D=(0,ry.rotl)(D^x,8))|0,L=(0,ry.rotl)(L^R,7),C=C+M|0,O=O+(D=(0,ry.rotl)(D^C,16))|0,C=C+(M=(0,ry.rotl)(M^O,12))|0,O=O+(D=(0,ry.rotl)(D^C,8))|0,M=(0,ry.rotl)(M^O,7),_=_+A|0,R=R+(T=(0,ry.rotl)(T^_,16))|0,_=_+(A=(0,ry.rotl)(A^R,12))|0,R=R+(T=(0,ry.rotl)(T^_,8))|0,A=(0,ry.rotl)(A^R,7),S=S+L|0,P=P+($=(0,ry.rotl)($^S,16))|0,S=S+(L=(0,ry.rotl)(L^P,12))|0,P=P+($=(0,ry.rotl)($^S,8))|0,L=(0,ry.rotl)(L^P,7),x=x+k|0,I=I+(N=(0,ry.rotl)(N^x,16))|0,x=x+(k=(0,ry.rotl)(k^I,12))|0,I=I+(N=(0,ry.rotl)(N^x,8))|0,k=(0,ry.rotl)(k^I,7);let B=0;i[B++]=s+C|0,i[B++]=l+_|0,i[B++]=c+S|0,i[B++]=d+x|0,i[B++]=u+k|0,i[B++]=h+M|0,i[B++]=f+A|0,i[B++]=p+L|0,i[B++]=g+P|0,i[B++]=m+I|0,i[B++]=y+O|0,i[B++]=v+R|0,i[B++]=o+T|0,i[B++]=b+$|0,i[B++]=E+N|0,i[B++]=w+D|0}function n(e,t,n,r){let i=e[0],o=e[1],a=e[2],s=e[3],l=t[0],c=t[1],d=t[2],u=t[3],h=t[4],f=t[5],p=t[6],g=t[7],m=n[0],y=n[1],v=n[2],b=n[3];for(let e=0;e<20;e+=2)i=i+l|0,h=h+(m=(0,ry.rotl)(m^i,16))|0,i=i+(l=(0,ry.rotl)(l^h,12))|0,h=h+(m=(0,ry.rotl)(m^i,8))|0,l=(0,ry.rotl)(l^h,7),o=o+c|0,f=f+(y=(0,ry.rotl)(y^o,16))|0,o=o+(c=(0,ry.rotl)(c^f,12))|0,f=f+(y=(0,ry.rotl)(y^o,8))|0,c=(0,ry.rotl)(c^f,7),a=a+d|0,p=p+(v=(0,ry.rotl)(v^a,16))|0,a=a+(d=(0,ry.rotl)(d^p,12))|0,p=p+(v=(0,ry.rotl)(v^a,8))|0,d=(0,ry.rotl)(d^p,7),s=s+u|0,g=g+(b=(0,ry.rotl)(b^s,16))|0,s=s+(u=(0,ry.rotl)(u^g,12))|0,g=g+(b=(0,ry.rotl)(b^s,8))|0,u=(0,ry.rotl)(u^g,7),i=i+c|0,p=p+(b=(0,ry.rotl)(b^i,16))|0,i=i+(c=(0,ry.rotl)(c^p,12))|0,p=p+(b=(0,ry.rotl)(b^i,8))|0,c=(0,ry.rotl)(c^p,7),o=o+d|0,g=g+(m=(0,ry.rotl)(m^o,16))|0,o=o+(d=(0,ry.rotl)(d^g,12))|0,g=g+(m=(0,ry.rotl)(m^o,8))|0,d=(0,ry.rotl)(d^g,7),a=a+u|0,h=h+(y=(0,ry.rotl)(y^a,16))|0,a=a+(u=(0,ry.rotl)(u^h,12))|0,h=h+(y=(0,ry.rotl)(y^a,8))|0,u=(0,ry.rotl)(u^h,7),s=s+l|0,f=f+(v=(0,ry.rotl)(v^s,16))|0,s=s+(l=(0,ry.rotl)(l^f,12))|0,f=f+(v=(0,ry.rotl)(v^s,8))|0,l=(0,ry.rotl)(l^f,7);let E=0;r[E++]=i,r[E++]=o,r[E++]=a,r[E++]=s,r[E++]=m,r[E++]=y,r[E++]=v,r[E++]=b}Object.defineProperty(e,"__esModule",{value:!0}),e.xchacha20poly1305=e.chacha20poly1305=e._poly1305_aead=e.chacha12=e.chacha8=e.xchacha20=e.chacha20=e.chacha20orig=void 0,e.hchacha=n,e.chacha20orig=(0,ry.createCipher)(t,{counterRight:!1,counterLength:8,allowShortKeys:!0}),e.chacha20=(0,ry.createCipher)(t,{counterRight:!1,counterLength:4,allowShortKeys:!1}),e.xchacha20=(0,ry.createCipher)(t,{counterRight:!1,counterLength:8,extendNonceFn:n,allowShortKeys:!1}),e.chacha8=(0,ry.createCipher)(t,{counterRight:!1,counterLength:4,rounds:8}),e.chacha12=(0,ry.createCipher)(t,{counterRight:!1,counterLength:4,rounds:12});let r=new Uint8Array(16),i=(e,t)=>{e.update(t);let n=t.length%16;n&&e.update(r.subarray(n))},o=new Uint8Array(32);function a(e,t,n,r,a){let s=e(t,n,o),l=rP.poly1305.create(s);a&&i(l,a),i(l,r);let c=new Uint8Array(16),d=(0,el.createView)(c);(0,el.setBigUint64)(d,0,BigInt(a?a.length:0),!0),(0,el.setBigUint64)(d,8,BigInt(r.length),!0),l.update(c);let u=l.digest();return(0,el.clean)(s,c),u}e._poly1305_aead=e=>(t,n,r)=>((0,ec.bytes)(t,32),(0,ec.bytes)(n),{encrypt(i,o){let s=i.length,l=s+16;o?(0,ec.bytes)(o,l):o=new Uint8Array(l),e(t,n,i,o,1);let c=a(e,t,n,o.subarray(0,-16),r);return o.set(c,s),(0,el.clean)(c),o},decrypt(i,o){let s=i.length,l=s-16;if(s<16)throw Error("encrypted data must be at least 16 bytes");o?(0,ec.bytes)(o,l):o=new Uint8Array(l);let c=i.subarray(0,-16),d=i.subarray(-16),u=a(e,t,n,c,r);if(!(0,el.equalBytes)(d,u))throw Error("invalid tag");return e(t,n,c,o,1),(0,el.clean)(u),o}}),e.chacha20poly1305=(0,el.wrapCipher)({blockSize:64,nonceLength:12,tagLength:16},(0,e._poly1305_aead)(e.chacha20)),e.xchacha20poly1305=(0,el.wrapCipher)({blockSize:64,nonceLength:24,tagLength:16},(0,e._poly1305_aead)(e.xchacha20))}
1(rm),Object.defineProperty(rg,"__esModule",{value:!0}),rg.xchacha20=void 0,rg.xchacha20=function(e,t,n){return(0,rm.xchacha20poly1305)(e,t,n)},function(e){function t(e,t,n,r){var i=(0,ey.symmetricAlgorithm)();if("aes-256-gcm"===i)return e(nD.aes256gcm,t,n,(0,ey.symmetricNonceLength)(),ev.AEAD_TAG_LENGTH,r);if("xchacha20"===i)return e(rg.xchacha20,t,n,ev.XCHACHA20_NONCE_LENGTH,ev.AEAD_TAG_LENGTH,r);if("aes-256-cbc"===i)return e(nD.aes256cbc,t,n,16,0);throw Error("Not implemented")}function n(e,t,n,r,i,o){var a=(0,e_.randomBytes)(r),s=e(t,a,o).encrypt(n);if(0===i)return(0,el.concatBytes)(a,s);var l=s.length-i,c=s.subarray(0,l),d=s.subarray(l);return(0,el.concatBytes)(a,d,c)}function r(e,t,n,r,i,o){var a=n.subarray(0,r),s=e(t,Uint8Array.from(a),o),l=n.subarray(r);if(0===i)return s.decrypt(l);var c=l.subarray(0,i),d=l.subarray(i);return s.decrypt((0,el.concatBytes)(d,c))}Object.defineProperty(e,"__esModule",{value:!0}),e.aesDecrypt=e.aesEncrypt=e.symDecrypt=e.symEncrypt=void 0,e.symEncrypt=function(e,r,i){return t(n,e,r,i)},e.symDecrypt=function(e,n,i){return t(r,e,n,i)},e.aesEncrypt=e.symEncrypt,e.aesDecrypt=e.symDecrypt}(nN),iQ=ei&&ei.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i0=ei&&ei.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||iQ(t,e,n)},Object.defineProperty(ew,"__esModule",{value:!0}),i0(eC,ew),i0(nP,ew),i0(nL,ew),i0(nN,ew);var rT={};Object.defineProperty(rT,"__esModule",{value:!0}),rT.PublicKey=void 0,rT.PublicKey=function(){function e(e){this.data=(0,ew.convertPublicKeyFormat)(e,!0)}return e.fromHex=function(t){return new e((0,ew.hexToPublicKey)(t))},Object.defineProperty(e.prototype,"uncompressed",{get:function(){return L.from((0,ew.convertPublicKeyFormat)(this.data,!1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"compressed",{get:function(){return L.from(this.data)},enumerable:!1,configurable:!0}),e.prototype.toHex=function(e){return void 0===e&&(e=!0),(0,el.bytesToHex)(e?this.data:this.uncompressed)},e.prototype.decapsulate=function(e,t){void 0===t&&(t=!1);var n=t?this.data:this.uncompressed,r=e.multiply(this,t);return(0,ew.getSharedKey)(n,r)},e.prototype.equals=function(e){return(0,el.equalBytes)(this.data,e.data)},e}(),Object.defineProperty(eE,"__esModule",{value:!0}),eE.PrivateKey=void 0,eE.PrivateKey=function(){function e(e){if(void 0===e)this.data=(0,ew.getValidSecret)();else{if(!(0,ew.isValidPrivateKey)(e))throw Error("Invalid private key");this.data=e}this.publicKey=new rT.PublicKey((0,ew.getPublicKey)(this.data))}return e.fromHex=function(t){return new e((0,ew.decodeHex)(t))},Object.defineProperty(e.prototype,"secret",{get:function(){return L.from(this.data)},enumerable:!1,configurable:!0}),e.prototype.toHex=function(){return(0,el.bytesToHex)(this.data)},e.prototype.encapsulate=function(e,t){void 0===t&&(t=!1);var n=t?this.publicKey.compressed:this.publicKey.uncompressed,r=this.multiply(e,t);return(0,ew.getSharedKey)(n,r)},e.prototype.multiply=function(e,t){return void 0===t&&(t=!1),(0,ew.getSharedPoint)(this.data,e.compressed,t)},e.prototype.equals=function(e){return(0,el.equalBytes)(this.data,e.data)},e}(),Object.defineProperty(eb,"__esModule",{value:!0}),eb.PublicKey=eb.PrivateKey=void 0,Object.defineProperty(eb,"PrivateKey",{enumerable:!0,get:function(){return eE.PrivateKey}}),Object.defineProperty(eb,"PublicKey",{enumerable:!0,get:function(){return rT.PublicKey}}),Object.defineProperty(es,"__esModule",{value:!0}),es.utils=es.PublicKey=es.PrivateKey=es.ECIES_CONFIG=void 0,es.encrypt=function(e,t){var n=new i3.PrivateKey,r=e instanceof Uint8Array?new i3.PublicKey(e):i3.PublicKey.fromHex(e),i=n.encapsulate(r,(0,i2.isHkdfKeyCompressed)()),o=(0,i2.isEphemeralKeyCompressed)()?n.publicKey.compressed:n.publicKey.uncompressed,a=(0,i5.symEncrypt)(i,t);return L.from((0,i1.concatBytes)(o,a))},es.decrypt=function(e,t){var n=e instanceof Uint8Array?new i3.PrivateKey(e):i3.PrivateKey.fromHex(e),r=(0,i2.ephemeralKeySize)(),i=new i3.PublicKey(t.subarray(0,r)),o=t.subarray(r),a=i.decapsulate(n,(0,i2.isHkdfKeyCompressed)());return L.from((0,i5.symDecrypt)(a,o))},i1=el,i2=ey,i3=eb,i5=ew,Object.defineProperty(es,"ECIES_CONFIG",{enumerable:!0,get:function(){return ey.ECIES_CONFIG}}),Object.defineProperty(es,"PrivateKey",{enumerable:!0,get:function(){return eb.PrivateKey}}),Object.defineProperty(es,"PublicKey",{enumerable:!0,get:function(){return eb.PublicKey}}),es.utils={aesEncrypt:i5.aesEncrypt,aesDecrypt:i5.aesDecrypt,symEncrypt:i5.symEncrypt,symDecrypt:i5.symDecrypt,decodeHex:i5.decodeHex,getValidSecret:i5.getValidSecret,remove0x:i5.remove0x};let r$=l()("KeyExchange:Layer"),rN=l()("SocketService:Layer"),rD=l()("Ecies:Layer"),rB=l()("RemoteCommunication:Layer");r$.color="##95c44e",rN.color="#f638d7",rD.color="#465b9c",rB.color="#47a2be";let rK,rj=[],rU=[],rF=(e,t)=>p(void 0,void 0,void 0,function*(){rK=t,rU.push(e),(function(e){return p(this,void 0,void 0,function*(){let t;if(!rK||!e)return;t=rU,rU=rj,rj=t;let n=rK.endsWith("/")?`${rK}evt`:`${rK}/evt`,r=Object.assign({},e);if(delete r.params,e.params)for(let[t,n]of Object.entries(e.params))r[t]=n;let i=JSON.stringify(r);rB(`[sendBufferedEvents] Sending ${rj.length} analytics events to ${n}`);try{let e=yield a()(n,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:i}),t=yield e.text();rB(`[sendBufferedEvents] Response: ${t}`),rj.length=0}catch(e){}})})(e).catch(()=>{})});class rH{constructor(e){this.enabled=!0,(null==e?void 0:e.debug)&&l().enable("Ecies:Layer"),this.ecies=(null==e?void 0:e.privateKey)?es.PrivateKey.fromHex(e.privateKey):new es.PrivateKey,rD("[ECIES constructor()] initialized secret: ",this.ecies.toHex()),rD("[ECIES constructor()] initialized public: ",this.ecies.publicKey.toHex()),rD("[ECIES constructor()] init with",this)}generateECIES(){this.ecies=new es.PrivateKey}getPublicKey(){return this.ecies.publicKey.toHex()}encrypt(e,t){let n=e;if(this.enabled)try{rD("[ECIES: encrypt()] using otherPublicKey",t);
1let r=L.from(e),i=es.encrypt(t,r);n=L.from(i).toString("base64")}catch(n){throw rD("[ECIES: encrypt()] error encrypt:",n),rD("[ECIES: encrypt()] private: ",this.ecies.toHex()),rD("[ECIES: encrypt()] data: ",e),rD("[ECIES: encrypt()] otherkey: ",t),n}return n}decrypt(e){let t=e;if(this.enabled)try{rD("[ECIES: decrypt()] using privateKey",this.ecies.toHex());let n=L.from(e.toString(),"base64");t=es.decrypt(this.ecies.toHex(),n).toString()}catch(t){throw rD("[ECIES: decrypt()] error decrypt",t),rD("[ECIES: decrypt()] private: ",this.ecies.toHex()),rD("[ECIES: decrypt()] encryptedData: ",e),t}return t}getKeyInfo(){return{private:this.ecies.toHex(),public:this.ecies.publicKey.toHex()}}toString(){rD("[ECIES: toString()]",this.getKeyInfo())}}var rz="0.32.0";let rq="https://metamask-sdk.api.cx.metamask.io/",rV=["websocket"];function rW(e){let{context:t}=e;rB(`[RemoteCommunication: clean()] context=${t}`),e.channelConfig=void 0,e.ready=!1,e.originatorConnectStarted=!1}(ol=on||(on={})).DISCONNECTED="disconnected",ol.WAITING="waiting",ol.TIMEOUT="timeout",ol.LINKED="linked",ol.PAUSED="paused",ol.TERMINATED="terminated",(i8=or||(or={})).KEY_INFO="key_info",i8.SERVICE_STATUS="service_status",i8.PROVIDER_UPDATE="provider_update",i8.RPC_UPDATE="rpc_update",i8.KEYS_EXCHANGED="keys_exchanged",i8.JOIN_CHANNEL="join_channel",i8.PUBLIC_KEY="public_key",i8.CHANNEL_CREATED="channel_created",i8.CLIENTS_CONNECTED="clients_connected",i8.CLIENTS_DISCONNECTED="clients_disconnected",i8.CLIENTS_WAITING="clients_w
1aiting",i8.CLIENTS_READY="clients_ready",i8.REJECTED="rejected",i8.WALLET_INIT="wallet_init",i8.CHANNEL_PERSISTENCE="channel_persistence",i8.CONFIG="config",i8.MESSAGE_ACK="ack",i8.SOCKET_DISCONNECTED="socket_disconnected",i8.SOCKET_RECONNECT="socket_reconnect",i8.OTP="otp",i8.SDK_RPC_CALL="sdk_rpc_call",i8.AUTHORIZED="authorized",i8.CONNECTION_STATUS="connection_status",i8.MESSAGE="message",i8.TERMINATE="terminate",(oi||(oi={})).KEY_EXCHANGE="key_exchange",(i4=oo||(oo={})).KEY_HANDSHAKE_START="key_handshake_start",i4.KEY_HANDSHAKE_CHECK="key_handshake_check",i4.KEY_HANDSHAKE_SYN="key_handshake_SYN",i4.KEY_HANDSHAKE_SYNACK="key_handshake_SYNACK",i4.KEY_HANDSHAKE_ACK="key_handshake_ACK",i4.KEY_HANDSHAKE_WALLET="key_handshake_wallet",i4.KEY_HANDSHAKE_NONE="none";class rG extends c.EventEmitter2{constructor({communicationLayer:e,otherPublicKey:t,context:n,ecies:r,logging:i}){super(),this.keysExchanged=!1,this.step=oo.KEY_HANDSHAKE_NONE,this.debug=!1,this.context=n,this.communicationLayer=e,(null==r?void 0:r.privateKey)&&t&&(r$(`[KeyExchange: constructor()] otherPubKey=${t} set keysExchanged to true!`,r),this.keysExchanged=!0),this.myECIES=new rH(Object.assign(Object.assign({},r),{debug:null==i?void 0:i.eciesLayer})),this.communicationLayer.state.eciesInstance=this.myECIES,this.myPublicKey=this.myECIES.getPublicKey(),this.debug=!0===(null==i?void 0:i.keyExchangeLayer),t&&this.setOtherPublicKey(t),this.communicationLayer.on(oi.KEY_EXCHANGE,this.onKeyExchangeMessage.bind(this))}onKeyExchangeMessage(e){let{relayPersistence:t}=this.communicationLayer.remote.state;if(r$(`[KeyExchange: onKeyExchangeMessage()] context=${this.context} keysExchanged=${this.keysExchanged} relayPersistence=${t}`,e),t)return void r$("[KeyExchange: onKeyExchangeMessage()] Ignoring key exchange message because relay persistence is activated");let{message:n}=e;this.keysExchanged&&r$(`[KeyExchange: onKeyExchangeMessage()] context=${this.context} received handshake while already exchanged. step=${this.step} otherPubKey=${this.otherPublicKey}`),this.emit(or.KEY_INFO,n.type),n.type===oo.KEY_HANDSHAKE_SYN?(this.checkStep([oo.KEY_HANDSHAKE_NONE,oo.KEY_HANDSHAKE_ACK]),r$("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_SYN",n),n.pubkey&&this.setOtherPublicKey(n.pubkey),this.communicationLayer.sendMessage({type:oo.KEY_HANDSHAKE_SYNACK,pubkey:this.myPublicKey}).catch(e=>{r$("[KeyExchange: onKeyExchangeMessage()] Error sending KEY_HANDSHAKE_SYNACK",e)}),this.setStep(oo.KEY_HANDSHAKE_ACK)):n.type===oo.KEY_HANDSHAKE_SYNACK?(this.checkStep([oo.KEY_HANDSHAKE_SYNACK,oo.KEY_HANDSHAKE_ACK,oo.KEY_HANDSHAKE_NONE]),r$("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_SYNACK"),n.pubkey&&this.setOtherPublicKey(n.pubkey),this.communicationLayer.sendMessage({type:oo.KEY_HANDSHAKE_ACK}).catch(e=>{r$("[KeyExchange: onKeyExchangeMessage()] Error sending KEY_HANDSHAKE_ACK",e)}),this.keysExchanged=!0,this.setStep(oo.KEY_HANDSHAKE_ACK),this.emit(or.KEYS_EXCHANGED)):n.type===oo.KEY_HANDSHAKE_ACK&&(r$("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_ACK set keysExchanged to true!"),this.checkStep([oo.KEY_HANDSHAKE_ACK,oo.KEY_HANDSHAKE_NONE]),this.keysExchanged=!0,this.setStep(oo.KEY_HANDSHAKE_ACK),this.emit(or.KEYS_EXCHANGED))}resetKeys(e){this.clean(),this.myECIES=new rH(e)}clean(){r$(`[KeyExchange: clean()] context=${this.context} reset handshake state`),this.setStep(oo.KEY_HANDSHAKE_NONE),this.emit(or.KEY_INFO,this.step),this.keysExchanged=!1}start({isOriginator:e,force:t}){let{relayPersistence:n,protocolVersion:r}=this.communicationLayer.remote.state;n?r$("[KeyExchange: start()] Ignoring key exchange message because relay persistence is activated"):(r$(`[KeyExchange: start()] context=${this.context} protocolVersion=${r} isOriginator=${e} step=${this.step} force=${t} relayPersistence=${n} keysExchanged=${this.keysExchanged}`),e?!(this.keysExchanged||this.step!==oo.KEY_HANDSHAKE_NONE&&this.step!==oo.KEY_HANDSHAKE_SYNACK)||t?(r$(`[KeyExchange: start()] context=${this.context} -- start key exchange (force=${t}) -- step=${this.step}`,this.step),this.clean(),this.setStep(oo.KEY_HANDSHAKE_SYNACK),this.communicationLayer.sendMessage({type:oo.KEY_HANDSHAKE_SYN,pubkey:this.myPublicKey,v:2}).catch(e=>{r$("[KeyExchange: start()] Error sending KEY_HANDSHAKE_SYN",e)})):r$(`[KeyExchange: start()] context=${this.context} -- key exchange already ${this.keysExchanged?"done":"in progress"} -- aborted.`,this.step):this.keysExchanged&&!0!==t?r$("[KeyExchange: start()] don't send KEY_HANDSHAKE_START -- exchange already done."):r>=2?this.communicationLayer.sendMessage({type:oo.KEY_HANDSHAKE_SYNACK,pubkey:this.myPublicKey,v:2}).catch(e=>{r$("[KeyExchange: start()] Error sending KEY_HANDSHAKE_SYNACK",e)}):(this.communicationLayer.sendMessage({type:oo.KEY_HANDSHAKE_START}).catch(e=>{r$("[KeyExchange: start()] Error sending KEY_HANDSHAKE_START",e)}),this.clean()))}
1setStep(e){this.step=e,this.emit(or.KEY_INFO,e)}checkStep(e){e.length>0&&e.indexOf(this.step.toString())}setRelayPersistence({localKey:e,otherKey:t}){this.otherPublicKey=t,this.myECIES=new rH({privateKey:e,debug:this.debug}),this.keysExchanged=!0}setKeysExchanged(e){this.keysExchanged=e}areKeysExchanged(){return this.keysExchanged}getMyPublicKey(){return this.myPublicKey}getOtherPublicKey(){return this.otherPublicKey}setOtherPublicKey(e){r$("[KeyExchange: setOtherPubKey()]",e),this.otherPublicKey=e}encryptMessage(e){if(!this.otherPublicKey)throw Error("encryptMessage: Keys not exchanged - missing otherPubKey");return this.myECIES.encrypt(e,this.otherPublicKey)}decryptMessage(e){if(!this.otherPublicKey)throw Error("decryptMessage: Keys not exchanged - missing otherPubKey");return this.myECIES.decrypt(e)}getKeyInfo(){return{ecies:Object.assign(Object.assign({},this.myECIES.getKeyInfo()),{otherPubKey:this.otherPublicKey}),step:this.step,keysExchanged:this.areKeysExchanged()}}toString(){return JSON.stringify({keyInfo:this.getKeyInfo(),keysExchanged:this.keysExchanged,step:this.step})}}(i6=oa||(oa={})).TERMINATE="terminate",i6.ANSWER="answer",i6.OFFER="offer",i6.CANDIDATE="candidate",i6.JSONRPC="jsonrpc",i6.WALLET_INFO="wallet_info",i6.WALLET_INIT="wallet_init",i6.ORIGINATOR_INFO="originator_info",i6.PAUSE="pause",i6.OTP="otp",i6.AUTHORIZED="authorized",i6.PING="ping",i6.READY="ready",(i7=os||(os={})).REQUEST="sdk_connect_request_started",i7.REQUEST_MOBILE="sdk_connect_request_started_mobile",i7.RECONNECT="sdk_reconnect_request_started",i7.CONNECTED="sdk_connection_established",i7.CONNECTED_MOBILE="sdk_connection_established_mobile",i7.AUTHORIZED="sdk_connection_authorized",i7.REJECTED="sdk_connection_rejected",i7.TERMINATED="sdk_connection_terminated",i7.DISCONNECTED="sdk_disconnected",i7.SDK_USE_EXTENSION="sdk_use_extension",i7.SDK_RPC_REQUEST="sdk_rpc_request",i7.SDK_RPC_REQUEST_RECEIVED="sdk_rpc_request_received",i7.SDK_RPC_REQUEST_DONE="sdk_rpc_request_done",i7.SDK_EXTENSION_UTILIZED="sdk_extension_utilized",i7.SDK_USE_INAPP_BROWSER="sdk_use_inapp_browser";let rZ=(e,t,n)=>p(void 0,void 0,void 0,function*(){var r,i,o,a,s,l;let{remote:c,state:d}=e,{channelId:u,isOriginator:h}=d;if("error_terminated"===t)return rN(`handleJoinChannelResults: Channel ${u} terminated`),void e.emit(or.TERMINATE);if(!n)return void rN(`handleJoinChannelResults: No result for channel ${u}`);let{persistence:f,walletKey:p,rejected:g}=n;if(rN(`handleJoinChannelResults: Channel ${u} persistence=${f} walletKey=${p} rejected=${g}`),g)return rN(`handleJoinChannelResults: Channel ${u} rejected`),yield e.remote.disconnect({terminate:!0}),e.remote.emit(or.REJECTED,{channelId:u}),void e.remote.emitServiceStatusEvent();if(p&&!(null==(r=c.state.channelConfig)?void 0:r.otherKey)){e.getKeyExchange().setOtherPublicKey(p),null==(i=e.state.keyExchange)||i.setKeysExchanged(!0),c.state.ready=!0,c.state.authorized=!0,c.emit(or.AUTHORIZED);let{communicationLayer:t,storageManager:n}=c.state,r=Object.assign(Object.assign({},c.state.channelConfig),{channelId:null!=(o=c.state.channelId)?o:"",validUntil:Date.now()+6048e5,localKey:null==t?void 0:t.getKeyInfo().ecies.private,otherKey:p});e.sendMessage({type:oo.KEY_HANDSHAKE_ACK}).catch(e=>{}),null==(a=e.state.socket)||a.emit(oa.PING,{id:u,clientType:h?"dapp":"wallet",context:"on_channel_reconnect",message:""}),yield null==n?void 0:n.persistChannelConfig(r),c.emitServiceStatusEvent(),c.setConnectionStatus(on.LINKED)}f&&(e.emit(or.CHANNEL_PERSISTENCE),null==(s=e.state.keyExchange)||s.setKeysExchanged(!0),c.state.ready=!0,c.state.authorized=!0,c.emit(or.AUTHORIZED),rF(Object.assign(Object.assign({id:null!=u?u:"",event:h?os.CONNECTED:os.CONNECTED_MOBILE},e.remote.state.originatorInfo),{sdkVersion:e.remote.state.sdkVersion,commLayer:e.state.communicationLayerPreference,commLayerVersion:rz,walletVersion:null==(l=e.remote.state.walletInfo)?void 0:l.version}),d.communicationServerUrl).catch(e=>{}))}),rY=e=>new Promise(t=>{setTimeout(t,e)}),rJ=(e,t,...n)=>p(void 0,[e,t,...n],void 0,function*(e,t,n=200){let r,i=Date.now(),o=!1;for(;!o;){if(o=Date.now()-i>3e5,void 0!==(r=t[e]).elapsedTime)return r;yield rY(n)}throw Error(`RPC ${e} timed out`)}),rX=e=>p(void 0,void 0,void 0,function*(){let{state:t}=e,{socket:n,channelId:r,context:i,isOriginator:o,isReconnecting:a}=t;if(a)return rN("[SocketService: reconnectSocket()] Reconnection already in progress, skipping",e),!1;if(!n)return rN("[SocketService: reconnectSocket()] socket is not defined",e),!1;if(!r)return!1;let{connected:s}=n;t.isReconnecting=!0,t.reconnectionAttempts=0,rN(`[SocketService: reconnectSocket()] connected=${s}
1 trying to reconnect after socketio disconnection`,e);try{for(;3>t.reconnectionAttempts;){if(rN(`[SocketService: reconnectSocket()] Attempt ${t.reconnectionAttempts+1} of 3`,e),yield rY(200),n.connected)return rN("Socket already connected --- ping to retrieve messages"),n.emit(oa.PING,{id:r,clientType:o?"dapp":"wallet",context:"on_channel_config",message:""}),!0;t.resumed=!0,n.connect(),e.emit(or.SOCKET_RECONNECT);try{if(yield new Promise((t,a)=>{n.emit(or.JOIN_CHANNEL,{channelId:r,context:`${i}connect_again`,clientType:o?"dapp":"wallet"},(n,r)=>p(void 0,void 0,void 0,function*(){try{yield rZ(e,n,r),t()}catch(e){a(e)}}))}),yield rY(100),n.connected)return rN(`Reconnection successful on attempt ${t.reconnectionAttempts+1}`),!0}catch(e){rN(`Error during reconnection attempt ${t.reconnectionAttempts+1}:`,e)}t.reconnectionAttempts+=1,3>t.reconnectionAttempts&&(yield rY(200))}return rN("Failed to reconnect after 3 attempts"),!1}finally{t.isReconnecting=!1,t.reconnectionAttempts=0}});function rQ(e,t){return p(this,void 0,void 0,function*(){var n;let r=null==(n=e.state.keyExchange)?void 0:n.encryptMessage(JSON.stringify(t)),i={id:e.state.channelId,context:e.state.context,clientType:e.state.isOriginator?"dapp":"wallet",message:r,plaintext:e.state.hasPlaintext?JSON.stringify(t):void 0};return rN(`[SocketService: encryptAndSendMessage()] context=${e.state.context}`,i),t.type===oa.TERMINATE&&(e.state.manualDisconnect=!0),new Promise((t,n)=>{var r;null==(r=e.state.socket)||r.emit(or.MESSAGE,i,(e,r)=>{var i;e&&(rN(`[SocketService: encryptAndSendMessage()] error=${e}`),n(e)),rN("[encryptAndSendMessage] response",r),t(null!=(i=null==r?void 0:r.success)&&i)})})})}(i9=oc||(oc={})).RPC_CHECK="rpcCheck",i9.SKIPPED_RPC="skippedRpc";let r0=["eth_sendTransaction","eth_signTypedData","eth_signTransaction","personal_sign","wallet_requestPermissions","wallet_switchEthereumChain","eth_signTypedData_v3","eth_signTypedData_v4","metamask_connectSign","metamask_connectWith","metamask_batch"].map(e=>e.toLowerCase()),r1=[{event:or.CLIENTS_CONNECTED,handler:function(e,t){return n=>p(this,void 0,void 0,function*(){var n,r,i,o,a,s,l,c,d,u,h;let f=null!=(r=null==(n=e.remote.state.channelConfig)?void 0:n.relayPersistence)&&r;if(rN(`[SocketService: handleClientsConnected()] context=${e.state.context} on 'clients_connected-${t}' relayPersistence=${f} resumed=${e.state.resumed}  clientsPaused=${e.state.clientsPaused} keysExchanged=${null==(i=e.state.keyExchange)?void 0:i.areKeysExchanged()} isOriginator=${e.state.isOriginator}`),e.emit(or.CLIENTS_CONNECTED,{isOriginator:e.state.isOriginator,keysExchanged:null==(o=e.state.keyExchange)?void 0:o.areKeysExchanged(),context:e.state.context}),e.state.resumed)e.state.isOriginator||(rN(`[SocketService: handleClientsConnected()] context=${e.state.context} 'clients_connected' / keysExchanged=${null==(a=e.state.keyExchange)?void 0:a.areKeysExchanged()} -- backward compatibility`),null==(s=e.state.keyExchange)||s.start({isOriginator:null!=(l=e.state.isOriginator)&&l})),e.state.resumed=!1;else if(e.state.clientsPaused)rN("[SocketService: handleClientsConnected()] 'clients_connected' skip sending originatorInfo on pause");else if(!e.state.isOriginator){let t=!f;rN(`[SocketService: handleClientsConnected()] context=${e.state.context} on 'clients_connected' / keysExchanged=${null==(c=e.state.keyExchange)?void 0:c.areKeysExchanged()} -- force=${t} -- backward compatibility`),rN(`[SocketService: handleClientsConnected()] context=${e.state.context} on 'clients_connected' / keysExchanged=${null==(d=e.state.keyExchange)?void 0:d.areKeysExchanged()} -- force=${t} -- backward compatibility`),null==(u=e.state.keyExchange)||u.start({isOriginator:null!=(h=e.state.isOriginator)&&h,force:t})}e.state.clientsConnected=!0,e.state.clientsPaused=!1})}},{event:or.CHANNEL_CREATED,handler:function(e,t){return n=>{rN(`[SocketService: handleChannelCreated()] context=${e.state.context} on 'channel_created-${t}'`,n),e.emit(or.CHANNEL_CREATED,n)}}},{event:or.CLIENTS_DISCONNECTED,handler:function(e,t){return()=>{var n;e.state.clientsConnected=!1,rN(`[SocketService: handlesClientsDisconnected()] context=${e.state.context} on 'clients_disconnected-${t}'`),e.remote.state.relayPersistence?rN(`[SocketService: handlesClientsDisconnected()] context=${e.state.context} on 'clients_disconnected-${t}' - relayPersistence enabled, skipping key exchange cleanup.`):(e.state.isOriginator&&!e.state.clientsPaused&&(null==(n=e.state.keyExchange)||n.clean()),e.emit(or.CLIENTS_DISCONNECTED,t))}}},{event:or.CONFIG,handler:function(e,t){return n=>p(this,void 0,void 0,function*(){var r,i,o;rN(`[SocketService: handleChannelConfig()] update relayPersistence on 'config-${t}'`,n);let{persistence:a,walletKey:s}=n;e.state.isOriginator&&e.remote.state.channelConfig?(n.walletKey&&!e.remote.state.channelConfig.otherKey&&(rN(`Setting wallet key ${s}`),e.remote.state.channelConfig.otherKey=s,e.getKeyExchange().setOtherPublicKey(n.walletKey),null==(r=e.state.keyExchange)||r.setKeysExchanged(!0),yield e.remote.sendMessage({type:oo.KEY_HANDSHAKE_ACK}),yield e.remote.sendMessage({type:oa.PING}),yield null==(i=e.remote.state.storageManager)?void 0:i.persist
1ChannelConfig(e.remote.state.channelConfig)),!0!==a||e.remote.state.channelConfig.relayPersistence||(rN(`Setting relay persistence ${a}`),e.remote.state.channelConfig.relayPersistence=a,e.remote.state.relayPersistence=!0,e.remote.emit(or.CHANNEL_PERSISTENCE),e.remote.state.authorized=!0,e.remote.state.ready=!0,e.remote.emit(or.AUTHORIZED),yield null==(o=e.remote.state.storageManager)?void 0:o.persistChannelConfig(e.remote.state.channelConfig))):e.state.isOriginator||n.persistence&&(e.remote.state.relayPersistence=!0,e.remote.emit(or.CHANNEL_PERSISTENCE))})}},{event:or.MESSAGE,handler:function(e,t){return n=>{var r,i,o,a,s,l,c,d,u,h,f,p,g,m,y,v,b,E;let{ackId:w,message:C,error:_}=n,S=null!=(r=e.remote.state.relayPersistence)&&r;if(rN(`[SocketService handleMessage()]  relayPersistence=${S}  context=${e.state.context} on 'message' ${t} keysExchanged=${null==(i=e.state.keyExchange)?void 0:i.areKeysExchanged()}`,n),_)throw rN(`
2      [SocketService handleMessage()] context=${e.state.context}::on 'message' error=${_}`),Error(_);let x="string"==typeof C;if(!x&&(null==C?void 0:C.type)===oo.KEY_HANDSHAKE_START){if(S)return;return rN(`[SocketService handleMessage()] context=${e.state.context}::on 'message' received HANDSHAKE_START isOriginator=${e.state.isOriginator}`,C),void(null==(o=e.state.keyExchange)||o.start({isOriginator:null!=(a=e.state.isOriginator)&&a,force:!0}))}if(!x&&(null==(s=null==C?void 0:C.type)?void 0:s.startsWith("key_handshake"))){if(S)return;return rN(`[SocketService handleMessage()] context=${e.state.context}::on 'message' emit KEY_EXCHANGE`,C),void e.emit(oi.KEY_EXCHANGE,{message:C,context:e.state.context})}if(!x||(null==(l=e.state.keyExchange)?void 0:l.areKeysExchanged())){if(!x&&(null==C?void 0:C.type))return void e.emit(or.MESSAGE,C)}else{let t=!1;try{rN(`[SocketService handleMessage()] context=${e.state.context}::on 'message' trying to decrypt message`),null==(c=e.state.keyExchange)||c.decryptMessage(C),t=!0}catch(t){rN(`[SocketService handleMessage()] context=${e.state.context}::on 'message' error`,t)}if(!t)return e.state.isOriginator?null==(u=e.state.keyExchange)||u.start({isOriginator:null!=(h=e.state.isOriginator)&&h}):e.sendMessage({type:oo.KEY_HANDSHAKE_START}).catch(e=>{}),void rN(`Message ignored because invalid key exchange status. step=${null==(f=e.state.keyExchange)?void 0:f.getKeyInfo().step}`,null==(p=e.state.keyExchange)?void 0:p.getKeyInfo(),C);rN("Invalid key exchange status detected --- updating it."),null==(d=e.state.keyExchange)||d.setKeysExchanged(!0)}if(!x)return void e.emit(or.MESSAGE,C);let k=null==(g=e.state.keyExchange)?void 0:g.decryptMessage(C),M=JSON.parse(null!=k?k:"{}");if(w&&(null==w?void 0:w.length)>0&&(rN(`[SocketService handleMessage()] context=${e.state.context}::on 'message' ackid=${w} channelId=${t}`),null==(m=e.state.socket)||m.emit(or.MESSAGE_ACK,{ackId:w,channelId:t,clientType:e.state.isOriginator?"dapp":"wallet"})),e.state.clientsPaused=(null==M?void 0:M.type)===oa.PAUSE,e.state.isOriginator&&M.data){let t=M.data,n=e.state.rpcMethodTracker[t.id];if(n){let r=Date.now()-n.timestamp;rN(`[SocketService handleMessage()] context=${e.state.context}::on 'message' received answer for id=${t.id} method=${n.method} responseTime=${r}`,M),e.remote.state.analytics&&r0.includes(n.method.toLowerCase())&&rF(Object.assign(Object.assign({id:null!=(y=e.remote.state.channelId)?y:"",event:os.SDK_RPC_REQUEST_DONE,sdkVersion:e.remote.state.sdkVersion,commLayerVersion:rz},e.remote.state.originatorInfo),{walletVersion:null==(v=e.remote.state.walletInfo)?void 0:v.version,params:{method:n.method,from:"mobile"}}),e.remote.state.communicationServerUrl).catch(e=>{});let i=Object.assign(Object.assign({},n),{result:t.result,error:t.error?{code:null==(b=t.error)?void 0:b.code,message:null==(E=t.error)?void 0:E.message}:void 0,elapsedTime:r});e.state.rpcMethodTracker[t.id]=i,e.emit(or.RPC_UPDATE,i)}}e.emit(or.MESSAGE,{message:M})}}},{event:or.REJECTED,handler:function(e,t){return n=>p(this,void 0,void 0,function*(){var n;e.state.isOriginator&&!e.remote.state.ready?(rN(`[SocketService: handleChannelRejected()] context=${e.state.context} channelId=${t} isOriginator=${e.state.isOriginator} ready=${e.remote.state.ready}`,e.remote.state.originatorInfo),rF(Object.assign(Object.assign({id:t,event:os.REJECTED},e.remote.state.originatorInfo),{sdkVersion:e.remote.state.sdkVersion,commLayer:e.state.communicationLayerPreference,commLayerVersion:rz,walletVersion:null==(n=e.remote.state.walletInfo)?void 0:n.version}),e.remote.state.communicationServerUrl).catch(e=>{}),yield e.remote.disconnect({terminate:!0}
2),e.remote.emit(or.REJECTED,{channelId:t}),e.remote.setConnectionStatus(on.DISCONNECTED)):rN(`[SocketService: handleChannelRejected()] SKIP -- channelId=${t} isOriginator=${e.state.isOriginator} ready=${e.remote.state.ready}`)})}},{event:"clients_waiting_to_join",handler:function(e,t){return n=>{rN(`[SocketService: handleClientsWaitingToJoin()] context=${e.state.context} on 'clients_waiting_to_join-${t}'`,n),e.emit(or.CLIENTS_WAITING,n)}}}],r2=[{event:or.KEY_INFO,handler:function(e){return t=>{rN("[SocketService: handleKeyInfo()] on 'KEY_INFO'",t),e.emit(or.KEY_INFO,t)}}},{event:or.KEYS_EXCHANGED,handler:function(e){return()=>{var t,n,r;rN(`[SocketService: handleKeysExchanged()] on 'keys_exchanged' keyschanged=${null==(t=e.state.keyExchange)?void 0:t.areKeysExchanged()}`);let{channelConfig:i}=e.remote.state;if(i){let t=e.getKeyExchange().getKeyInfo().ecies;i.localKey=t.private,i.otherKey=t.otherPubKey,e.remote.state.channelConfig=i,null==(n=e.remote.state.storageManager)||n.persistChannelConfig(i).catch(e=>{})}e.emit(or.KEYS_EXCHANGED,{keysExchanged:null==(r=e.state.keyExchange)?void 0:r.areKeysExchanged(),isOriginator:e.state.isOriginator});let o={keyInfo:e.getKeyInfo()};e.emit(or.SERVICE_STATUS,o)}}}];function r3(e,t){rN(`[SocketService: setupChannelListener()] context=${e.state.context} setting socket listeners for channel ${t}...`);let{socket:n}=e.state,{keyExchange:r}=e.state;n&&e.state.isOriginator&&(e.state.debug&&(null==n||n.io.on("error",t=>{rN(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=error`,t)}),null==n||n.io.on("reconnect",t=>{rN(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=reconnect`,t),rX(e).catch(e=>{})}),null==n||n.io.on("reconnect_error",t=>{rN(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=reconnect_error`,t)}),null==n||n.io.on("reconnect_failed",()=>{rN(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=reconnect_failed`)})),null==n||n.on("disconnect",t=>(rN(`[SocketService: setupChannelListener()] on 'disconnect' -- MetaMaskSDK socket disconnected '${t}' begin recovery...`),(t=>{rN(`[SocketService: handleDisconnect()] on 'disconnect' manualDisconnect=${e.state.manualDisconnect}`,t),e.state.manualDisconnect||(e.emit(or.SOCKET_DISCONNECTED),rX(e).catch(e=>{}))})(t)))),r1.forEach(({event:r,handler:i})=>{null==n||n.on(`${r}-${t}`,i(e,t))}),r2.forEach(({event:t,handler:n})=>{null==r||r.on(t,n(e))}),e.state.setupChannelListeners=!0}class r5 extends c.EventEmitter2{constructor(e){super(),this.state={clientsConnected:!1,clientsPaused:!1,manualDisconnect:!1,lastRpcId:void 0,rpcMethodTracker:{},hasPlaintext:!1,communicationServerUrl:"",focusListenerAdded:!1,removeFocusListener:void 0,isReconnecting:!1,reconnectionAttempts:0},this.options=e;const{reconnect:t,communicationLayerPreference:n,communicationServerUrl:r,context:i,remote:o,logging:a}=e;this.state.resumed=t,this.state.context=i,this.state.isOriginator=o.state.isOriginator,this.state.communicationLayerPreference=n,this.state.debug=!0===(null==a?void 0:a.serviceLayer),this.remote=o,!0===(null==a?void 0:a.serviceLayer)&&l().enable("SocketService:Layer"),this.state.communicationServerUrl=r,this.state.hasPlaintext=this.state.communicationServerUrl!==rq&&!0===(null==a?void 0:a.plaintext),rN(`[SocketService: constructor()] Socket IO url: ${this.state.communicationServerUrl}`),this.initSocket()}initSocket(){var e;let{otherPublicKey:t,ecies:n,logging:r}=this.options,i=this.state.communicationServerUrl;rN(`[SocketService: initSocket()] Socket IO url: ${i}`),this.state.socket=(0,f.io)(i,{autoConnect:!1,transports:rV,withCredentials:!0}),function(e){if("u">typeof window&&"u">typeof document&&(rN(`[SocketService: setupSocketFocusListener()] hasFocus=${document.hasFocus()}`,e),!e.state.focusListenerAdded)){let t=()=>{rN("Document has focus --- reconnecting socket"),rX(e).catch(e=>{})};window.addEventListener("focus",t),e.state.focusListenerAdded=!0,e.state.removeFocusListener=()=>{window.removeEventListener("focus",t),e.state.focusListenerAdded=!1}}}(this);let o={communicationLayer:this,otherPublicKey:t,sendPublicKey:!1,context:null!=(e=this.state.context)?e:"",ecies:n,logging:r};this.state.keyExchange=new rG(o)}resetKeys(){var e;return rN("[SocketService: resetKeys()] Resetting keys."),void(null==(e=this.state.keyExchange)||e.resetKeys())}createChannel(){return p(this,void 0,void 0,function*(){return function(e){return p(this,void 0,void 0,function*(){var t,n,r;if(rN(`[SocketService: createChannel()] context=${e.state.context}`),e.state.socket||e.initSocket(),null==(t=e.state.socket)?void 0:t.connected)throw Error("socket already connected");null==(n=e.state.socket)||n.connect(),e.state.manualDisconnect=!1,e.state.isOriginator=!0;let i=(0,u.A)();e.state.channelId=i,r3(e,i),yield new Promise((t,n)=>{var r;null==(r=e.state.socket)||r.emit(or.JOIN_CHANNEL,{channelId:i,context:`${e.state.context}createChannel`,clientType:"dapp"},(r,i)=>p(this,void 0,void 0,function*(){try{yield rZ(e,r,i),t()}catch(e){n(e)}}))});let o=null==(r=e.state.keyExchange)?void 0:r.getKeyInfo();return{channelId:i,pubKey:(null==o?void 0:o.ecies.public)||"",privKey:(null==o?void 0:o.ecies.private)||""}})}(this)})}
2connectToChannel({channelId:e,withKeyExchange:t=!1,authorized:n}){return function(e){return p(this,arguments,void 0,function*({options:e,instance:t}){let{channelId:n,authorized:r,withKeyExchange:i}=e,{state:o,remote:a}=t,{isOriginator:s=!1,socket:l,keyExchange:c}=o,{channelConfig:d}=a.state;if(null==l?void 0:l.connected)throw Error("socket already connected");if(s&&(null==d?void 0:d.relayPersistence)){let{localKey:e,otherKey:t}=d;e&&t&&(null==c||c.setRelayPersistence({localKey:e,otherKey:t}))}return Object.assign(o,{manualDisconnect:!1,withKeyExchange:i,isOriginator:s,channelId:n}),null==l||l.connect(),r3(t,n),!s&&r&&(null==c||c.setKeysExchanged(!0),Object.assign(a.state,{ready:!0,authorized:!0})),new Promise(e=>{var i;let a=null==(i=null==c?void 0:c.getKeyInfo())?void 0:i.ecies.public;null==l||l.emit(or.JOIN_CHANNEL,{channelId:n,context:`${o.context}_connectToChannel`,clientType:s?"dapp":"wallet",publicKey:r&&!s?a:void 0},(n,r)=>p(this,void 0,void 0,function*(){yield rZ(t,n,r),e()}))})})}({options:{channelId:e,withKeyExchange:t,authorized:n},instance:this})}getKeyInfo(){return this.state.keyExchange.getKeyInfo()}keyCheck(){var e;null==(e=this.state.socket)||e.emit(or.MESSAGE,{id:this.state.channelId,context:this.state.context,message:{type:oo.KEY_HANDSHAKE_CHECK,pubkey:this.getKeyInfo().ecies.otherPubKey}})}getKeyExchange(){return this.state.keyExchange}sendMessage(e){return p(this,void 0,void 0,function*(){return function(e,t){return p(this,void 0,void 0,function*(){var n,r,i,o,a;let s,l;if(!e.state.channelId)throw rN("handleSendMessage: no channelId - Create a channel first"),Error("Create a channel first");
2if(rN(`[SocketService: handleSendMessage()] context=${e.state.context} areKeysExchanged=${null==(n=e.state.keyExchange)?void 0:n.areKeysExchanged()}`,t),null==(r=null==t?void 0:t.type)?void 0:r.startsWith("key_handshake"))return rN(`[SocketService: handleKeyHandshake()] context=${e.state.context}`,t),null==(o=e.state.socket)||o.emit(or.MESSAGE,{id:e.state.channelId,context:e.state.context,clientType:e.state.isOriginator?"dapp":"wallet",message:t}),!0;!function(e,t){var n;if(!(null==(n=e.state.keyExchange)?void 0:n.areKeysExchanged())&&!e.remote.state.relayPersistence)throw rN(`[SocketService: validateKeyExchange()] context=${e.state.context} ERROR keys not exchanged`,t),Error("Keys not exchanged BBB")}(e,t),s=null!=(a=null==t?void 0:t.method)?a:"",l=null==t?void 0:t.id,e.state.isOriginator&&l&&(e.state.rpcMethodTracker[l]={id:l,timestamp:Date.now(),method:s},e.emit(or.RPC_UPDATE,e.state.rpcMethodTracker[l]));let c=yield rQ(e,t);return e.remote.state.analytics&&e.remote.state.isOriginator&&t.method&&r0.includes(t.method.toLowerCase())&&rF({id:null!=(i=e.remote.state.channelId)?i:"",event:os.SDK_RPC_REQUEST,params:{method:t.method,from:"mobile"}},e.remote.state.communicationServerUrl).catch(e=>{}),(function(e,t){return p(this,void 0,void 0,function*(){var n;let r=null==t?void 0:t.id,i=null!=(n=null==t?void 0:t.method)?n:"";if(e.state.isOriginator&&r)try{let n=rJ(r,e.state.rpcMethodTracker,200).then(e=>({type:oc.RPC_CHECK,result:e})),o=p(this,void 0,void 0,function*(){let t,n=yield(t={instance:e,rpcId:r},p(void 0,[t],void 0,function*({rpcId:e,instance:t}){for(;t.state.lastRpcId===e||void 0===t.state.lastRpcId;)yield rY(200);return t.state.lastRpcId})),i=yield rJ(n,e.state.rpcMethodTracker,200);return{type:oc.SKIPPED_RPC,result:i}}),a=yield Promise.race([n,o]);if(a.type===oc.RPC_CHECK){let e=a.result;rN(`[SocketService:handleRpcReplies()] id=${t.id} ${i} ( ${e.elapsedTime} ms)`,e.result)}else{if(a.type!==oc.SKIPPED_RPC)throw Error(`Error handling RPC replies for ${r}`);{let t=Object.assign(Object.assign({},e.state.rpcMethodTracker[r]),{error:Error("SDK_CONNECTION_ISSUE")});e.emit(or.RPC_UPDATE,t);let n={data:Object.assign(Object.assign({},t),{jsonrpc:"2.0"}),name:"metamask-provider"};e.emit(or.MESSAGE,{message:n})}}}catch(e){throw e}})})(e,t).catch(e=>{}),c})}(this,e)})}ping(){return function(e){return p(this,void 0,void 0,function*(){var t,n;rN(`[SocketService: ping()] context=${e.state.context} originator=${e.state.isOriginator} keysExchanged=${null==(t=e.state.keyExchange)?void 0:t.areKeysExchanged()}`),null==(n=e.state.socket)||n.emit(oa.PING,{id:e.state.channelId,context:"ping",clientType:e.remote.state.isOriginator?"dapp":"wallet",message:""})})}(this)}pause(){return function(e){return p(this,void 0,void 0,function*(){var t,n;rN(`[SocketService: pause()] context=${e.state.context}`),e.state.manualDisconnect=!0,(null==(t=e.state.keyExchange)?void 0:t.areKeysExchanged())&&(yield e.sendMessage({type:oa.PAUSE})),null==(n=e.state.socket)||n.disconnect()})}(this)}isConnected(){var e;return null==(e=this.state.socket)?void 0:e.connected}resume(){return function(e){return p(this,void 0,void 0,function*(){let{state:t,remote:n}=e,{socket:r,channelId:i,context:o,keyExchange:a,isOriginator:s}=t,{isOriginator:l}=n.state;if(rN(`[SocketService: resume()] channelId=${i} context=${o} connected=${null==r?void 0:r.connected} manualDisconnect=${t.manualDisconnect} resumed=${t.resumed} keysExchanged=${null==a?void 0:a.areKeysExchanged()}`),!i)throw rN("[SocketService: resume()] channelId is not defined"),Error("ChannelId is not defined");(null==r?void 0:r.connected)?(rN("[SocketService: resume()] already connected."),r.emit(oa.PING,{id:i,clientType:l?"dapp":"wallet",context:"on_channel_config",message:""}),n.hasRelayPersistence()||(null==a?void 0:a.areKeysExchanged())||(s?yield e.sendMessage({type:oa.READY}):null==a||a.start({isOriginator:!1}))):(null==r||r.connect(),rN(`[SocketService: resume()] after connecting socket --> connected=${null==r?void 0:r.connected}`),null==r||r.emit(or.JOIN_CHANNEL,{channelId:i,context:`${o}_resume`,clientType:l?"dapp":"wallet"},(t,n)=>p(this,void 0,void 0,function*(){try{yield rZ(e,t,n)}catch(e){}}))),t.manualDisconnect=!1,t.resumed=!0})}(this)}getRPCMethodTracker(){return this.state.rpcMethodTracker}disconnect(e){var t,n,r,i,o;rN(`[SocketService: disconnect()] context=${this.state.context}`,e),(null==e?void 0:e.terminate)&&(null==(n=(t=this.state).removeFocusListener)||n.call(t),this.state.channelId=e.channelId,null==(r=this.state.socket)||r.removeAllListeners(),null==(i=this.state.keyExchange)||i.clean(),this.remote.state.ready=!1,this.state.socket=void 0,this.state.rpcMethodTracker={}),this.state.manualDisconnect=!0,null==(o=this.state.socket)||o.disconnect()}}
2function r8({communicationLayerPreference:e,otherPublicKey:t,reconnect:n,ecies:r,communicationServerUrl:i=rq,instance:o}){var a,s,l,c,d,u,h,f,g,m,y;let{state:v}=o;if(rB("[initCommunicationLayer()] ",JSON.stringify(v,null,2)),e!==od.SOCKET)throw Error("Invalid communication protocol");v.communicationLayer=new r5({communicationLayerPreference:e,otherPublicKey:t,reconnect:n,transports:v.transports,communicationServerUrl:i,context:v.context,ecies:r,logging:v.logging,remote:o});let b="u">typeof document&&document.URL||"",E="u">typeof document&&document.title||"";(null==(a=v.dappMetadata)?void 0:a.url)&&(b=v.dappMetadata.url),(null==(s=v.dappMetadata)?void 0:s.name)&&(E=v.dappMetadata.name);let w=null!=(u=null!=(c=null==(l=v.dappMetadata)?void 0:l.name)?c:null==(d=v.dappMetadata)?void 0:d.url)?u:"N/A",C="u">typeof window&&void 0!==window.location&&null!=(h=window.location.hostname)?h:w,_={url:b,title:E,source:null==(f=v.dappMetadata)?void 0:f.source,dappId:C,icon:(null==(g=v.dappMetadata)?void 0:g.iconUrl)||(null==(m=v.dappMetadata)?void 0:m.base64Icon),platform:v.platformType,apiVersion:rz,connector:null==(y=v.dappMetadata)?void 0:y.connector};for(let[t,n]of(v.originatorInfo=_,Object.entries({[or.AUTHORIZED]:function(e){return()=>p(this,void 0,void 0,function*(){var t,n,r;let{state:i}=e;if(i.authorized)return;yield p(this,void 0,void 0,function*(){for(;!i.walletInfo;)yield rY(500)});let o="7.3".localeCompare((null==(t=i.walletInfo)?void 0:t.version)||"");if(rB(`[RemoteCommunication: handleAuthorizedEvent()] HACK 'authorized' version=${null==(n=i.walletInfo)?void 0:n.version} compareValue=${o}`),1!==o)return;let a=i.platformType===ou.MobileWeb||i.platformType===ou.ReactNative||i.platformType===ou.MetaMaskMobileWebview;rB(`[RemoteCommunication: handleAuthorizedEvent()] HACK 'authorized' platform=${i.platformType} secure=${a} channel=${i.channelId} walletVersion=${null==(r=i.walletInfo)?void 0:r.version}`),a&&(i.authorized=!0,e.emit(or.AUTHORIZED))})}(o),[or.MESSAGE]:e=>{let t=e;e.message&&(t=t.message),function(e,t){let{state:n}=t;if(rB(`[RemoteCommunication: onCommunicationLayerMessage()] context=${n.context} on 'message' typeof=${typeof e}`,e),t.state.ready=!0,n.isOriginator||e.type!==oa.ORIGINATOR_INFO)if(n.isOriginator&&e.type===oa.WALLET_INFO)!function(e,t){let{state:n}=e;n.walletInfo=t.walletInfo,n.paused=!1}(t,e);else{if(n.isOriginator&&e.type===oa.WALLET_INIT)(function(e,t){return p(this,void 0,void 0,function*(){var n,r,i;let{state:o}=e;if(o.isOriginator){let o=t.data||{};if("object"==typeof o&&"accounts"in o&&"chainId"in o&&"walletKey"in o)try{let{channelConfig:t}=e.state;if(rB("WALLET_INIT: channelConfig",JSON.stringify(t,null,2)),t){let a=o.accounts,s=o.chainId,l=o.walletKey,c,d=!1;"deeplinkProtocol"in o&&(d=!!o.deeplinkProtocol,e.state.deeplinkProtocolAvailable=d),"walletVersion"in o&&(c=o.walletVersion),yield null==(n=e.state.storageManager)?void 0:n.persistChannelConfig(Object.assign(Object.assign({},t),{otherKey:l,walletVersion:c,deeplinkProtocolAvailable:d,relayPersistence:!0})),yield null==(r=e.state.storageManager)?void 0:r.persistAccounts(a),yield null==(i=e.state.storageManager)?void 0:i.persistChainId(s)}e.emit(or.WALLET_INIT,{accounts:o.accounts,chainId:o.chainId})}catch(e){}}})})(t,e).catch(e=>{rB(`[RemoteCommunication: onCommunicationLayerMessage()] error=${e}`)});else if(e.type===oa.TERMINATE)(function(e){return p(this,void 0,void 0,function*(){let{state:t}=e;t.isOriginator&&(yield r4({options:{terminate:!0,sendMessage:!1},instance:e}),e.emit(or.TERMINATE))})})(t).catch(e=>{rB(`[RemoteCommunication: onCommunicationLayerMessage()] error=${e}`)});else if(e.type===oa.PAUSE)!function(e){let{state:t}=e;t.paused=!0,e.setConnectionStatus(on.PAUSED)}(t);else if(e.type===oa.READY&&n.isOriginator)!function(e){let{state:t}=e;e.setConnectionStatus(on.LINKED);let n=t.paused;t.paused=!1,e.emit(or.CLIENTS_READY,{isOriginator:t.isOriginator,walletInfo:t.walletInfo}),n&&(t.authorized=!0,e.emit(or.AUTHORIZED))}(t);else{if(e.type===oa.OTP&&n.isOriginator)return function(e,t){var n;let{state:r}=e;e.emit(or.OTP,t.otpAnswer),1==="6.6".localeCompare((null==(n=r.walletInfo)?void 0:n.version)||"")&&e.emit(or.SDK_RPC_CALL,{method:"eth_requestAccounts",params:[]})}(t,e);e.type===oa.AUTHORIZED&&n.isOriginator&&function(e){let{state:t}=e;t.authorized=!0,e.emit(or.AUTHORIZED)}(t)}t.emit(or.MESSAGE,e)}else!function(e,t){var n;let{state:r}=e;null==(n=r.communicationLayer)||n.sendMessage({type:oa.WALLET_INFO,walletInfo:r.walletInfo}),r.originatorInfo=t.originatorInfo||t.originator,e.emit(or.CLIENTS_READY,{isOriginator:r.isOriginator,originatorInfo:r.originatorInfo}),r.paused=!1}(t,e)}(t,o)},[or.CHANNEL_PERSISTENCE]:function(e){return()=>p(this,void 0,void 0,function*(){var t,n,r,i,o,a,s;let{state:l}=e;rB(`[RemoteCommunication: handleFullPersistenceEvent()] context=${l.context}`),e.state.ready=!0,e.state.clientsConnected=!0,e.state.authorized=!0,e.state.relayPersistence=!0,null==(t=e.state.communicationLayer)||t.getKeyExchange().setKeysExchanged(!0),e.emit(or.KEYS_EXCHANGED,{keysExchanged:!0,isOriginator:!0}),e.emit(or.AUTHORIZED),e.emit(or.CLIENTS_READY),e.emit(or.CHANNEL_PERSISTENCE);try{l.channelConfig=Object.assign(Object.assign({},l.channelConfig),{localKey:null==(n=l.communicationLayer)?void 0:n.getKeyExchange().getKeyInfo().ecies.private,otherKey:null==(r=l.communicationLayer)?void 0:r.getKeyExchange().getOtherPublicKey(),channelId:null!=(i=l.channelId)?i:"",validUntil:null!=(a=null==(o=l.channelConfig)?void 0:o.validUntil)?a:6048e5,relayPersistence:!0}
2),yield null==(s=l.storageManager)?void 0:s.persistChannelConfig(l.channelConfig)}catch(e){}})}(o),[or.CLIENTS_CONNECTED]:()=>{var t,n,r,i;let{state:a}=o;rB(`[RemoteCommunication: handleClientsConnectedEvent()] on 'clients_connected' channel=${a.channelId} keysExchanged=${null==(n=null==(t=a.communicationLayer)?void 0:t.getKeyInfo())?void 0:n.keysExchanged}`),a.analytics&&rF(Object.assign(Object.assign({id:null!=(r=a.channelId)?r:"",event:a.reconnection?os.RECONNECT:a.isOriginator?os.REQUEST:os.REQUEST_MOBILE},a.originatorInfo),{commLayer:e,sdkVersion:a.sdkVersion,walletVersion:null==(i=a.walletInfo)?void 0:i.version,commLayerVersion:rz}),a.communicationServerUrl).catch(e=>{}),a.clientsConnected=!0,a.originatorInfoSent=!1,o.emit(or.CLIENTS_CONNECTED)},[or.KEYS_EXCHANGED]:t=>{var n,r,i,a,s,l,c,d;let{state:u}=o;if(rB(`[RemoteCommunication: handleKeysExchangedEvent()] context=${u.context} on commLayer.'keys_exchanged' channel=${u.channelId}`,t),null==(r=null==(n=u.communicationLayer)?void 0:n.getKeyInfo())?void 0:r.keysExchanged){let e=Object.assign(Object.assign({},u.channelConfig),{channelId:null!=(i=u.channelId)?i:"",validUntil:(null==(a=u.channelConfig)?void 0:a.validUntil)||6048e5,localKey:u.communicationLayer.getKeyInfo().ecies.private,otherKey:u.communicationLayer.getKeyInfo().ecies.otherPubKey});null==(s=u.storageManager)||s.persistChannelConfig(e).catch(e=>{}),o.setConnectionStatus(on.LINKED)}!function(e,t){var n,r,i,o,a,s,l,c;let{state:d}=e;rB(`[RemoteCommunication: setLastActiveDate()] channel=${d.channelId}`,t);let u=Object.assign(Object.assign({},d.channelConfig),{channelId:null!=(n=d.channelId)?n:"",validUntil:null!=(i=null==(r=d.channelConfig)?void 0:r.validUntil)?i:0,relayPersistence:d.relayPersistence,localKey:null==(a=null==(o=d.communicationLayer)?void 0:o.state.keyExchange)?void 0:a.getKeyInfo().ecies.private,otherKey:null==(l=null==(s=d.communicationLayer)?void 0:s.state.keyExchange)?void 0:l.getKeyInfo().ecies.otherPubKey,lastActive:t.getTime()});null==(c=d.storageManager)||c.persistChannelConfig(u)}(o,new Date),u.analytics&&u.channelId&&rF(Object.assign(Object.assign({id:u.channelId,event:t.isOriginator?os.CONNECTED:os.CONNECTED_MOBILE},u.originatorInfo),{sdkVersion:u.sdkVersion,commLayer:e,commLayerVersion:rz,walletVersion:null==(l=u.walletInfo)?void 0:l.version}),u.communicationServerUrl).catch(e=>{}),u.isOriginator=t.isOriginator,t.isOriginator||(null==(c=u.communicationLayer)||c.sendMessage({type:oa.READY}),u.ready=!0,u.paused=!1),t.isOriginator&&!u.originatorInfoSent&&(null==(d=u.communicationLayer)||d.sendMessage({type:oa.ORIGINATOR_INFO,originatorInfo:u.originatorInfo,originator:u.originatorInfo}),u.originatorInfoSent=!0)},[or.SOCKET_DISCONNECTED]:()=>{let{state:e}=o;rB("[RemoteCommunication: handleSocketDisconnectedEvent()] on 'socket_Disconnected' set ready to false"),e.ready=!1},[or.SOCKET_RECONNECT]:()=>{let{state:e}=o;rB("[RemoteCommunication: handleSocketReconnectEvent()] on 'socket_reconnect' -- reset key exchange status / set ready to false"),e.ready=!1,e.authorized=!1,rW(e),o.emitServiceStatusEvent({context:"socket_reconnect"})},[or.CLIENTS_DISCONNECTED]:e=>{let{state:t}=o;rB(`[RemoteCommunication: handleClientsDisconnectedEvent()] context=${t.context} on 'clients_disconnected' channelId=${e}`),t.relayPersistence||(t.clientsConnected=!1,t.ready=!1,t.authorized=!1),o.emit(or.CLIENTS_DISCONNECTED,t.channelId),o.setConnectionStatus(on.DISCONNECTED)},[or.KEY_INFO]:()=>{},[or.CHANNEL_CREATED]:e=>{let{state:t}=o;rB(`[RemoteCommunication: handleChannelCreatedEvent()] context=${t.context} on 'channel_created' channelId=${e}`),o.emit(or.CHANNEL_CREATED,e)},[or.CLIENTS_WAITING]:e=>{var t;let{state:n}=o;if(rB(`[RemoteCommunication: handleClientsWaitingEvent()] context=${n.context} on 'clients_waiting' numberUsers=${e} ready=${n.ready} autoStarted=${n.originatorConnectStarted}`),o.setConnectionStatus(on.WAITING),o.emit(or.CLIENTS_WAITING,e),n.originatorConnectStarted){rB(`[RemoteCommunication: handleClientsWaitingEvent()] on 'clients_waiting' watch autoStarted=${n.originatorConnectStarted} timeout`,n.autoConnectOptions);
2let e=(null==(t=n.autoConnectOptions)?void 0:t.timeout)||3e3,r=setTimeout(()=>{rB(`[RemoteCommunication: handleClientsWaitingEvent()] setTimeout(${e}) terminate channelConfig`,n.autoConnectOptions),n.originatorConnectStarted=!1,n.ready||o.setConnectionStatus(on.TIMEOUT),clearTimeout(r)},e)}},[or.RPC_UPDATE]:e=>{o.emit(or.RPC_UPDATE,e)}})))try{v.communicationLayer.on(t,n)}catch(e){}}function r4(e){return p(this,arguments,void 0,function*({options:e,instance:t}){let{state:n}=t;return rB(`[RemoteCommunication: disconnect()] channel=${n.channelId}`,e),new Promise((r,i)=>{var o,a,s,l,c,d;(null==e?void 0:e.terminate)?(t.state.ready&&rF({id:null!=(o=t.state.channelId)?o:"",event:os.TERMINATED},t.state.communicationServerUrl).catch(e=>{}),n.ready=!1,n.paused=!1,null==(a=n.storageManager)||a.terminate(null!=(s=n.channelId)?s:""),t.state.terminated=!0,e.sendMessage?(null==(l=n.communicationLayer)?void 0:l.getKeyInfo().keysExchanged)&&t.state.communicationLayer&&rQ(t.state.communicationLayer,{type:oa.TERMINATE}).then(()=>{r(!0)}).catch(e=>{i(e)}):r(!0),n.authorized=!1,n.relayPersistence=!1,n.channelId=(0,u.A)(),e.channelId=n.channelId,n.channelConfig=void 0,n.originatorConnectStarted=!1,null==(c=n.communicationLayer)||c.disconnect(e),t.setConnectionStatus(on.TERMINATED)):(null==(d=n.communicationLayer)||d.disconnect(e),t.setConnectionStatus(on.DISCONNECTED),r(!0))})})}(od||(od={})).SOCKET="socket",(oe=ou||(ou={})).NonBrowser="nodejs",oe.MetaMaskMobileWebview="in-app-browser",oe.DesktopWeb="web-desktop",oe.MobileWeb="web-mobile",oe.ReactNative="react-native";class r6 extends c.EventEmitter2{constructor(e){super(),this.state={ready:!1,authorized:!1,isOriginator:!1,terminated:!1,protocolVersion:1,paused:!1,deeplinkProtocolAvailable:!1,platformType:"metamask-mobile",analytics:!1,reconnection:!1,originatorInfoSent:!1,communicationServerUrl:rq,context:"",persist:!1,clientsConnected:!1,sessionDuration:6048e5,originatorConnectStarted:!1,debug:!1,_connectionStatus:on.DISCONNECTED},this._options=e;const{platformType:t,communicationLayerPreference:n,otherPublicKey:r,reconnect:i,walletInfo:o,dappMetadata:a,protocolVersion:s,transports:c,context:d,relayPersistence:u,ecies:h,analytics:f=!1,storage:p,sdkVersion:g,communicationServerUrl:m=rq,logging:y,autoConnect:v={timeout:3e3}}=e;this.state.otherPublicKey=r,this.state.dappMetadata=a,this.state.walletInfo=o,this.state.transports=c,this.state.platformType=t,this.state.analytics=f,this.state.protocolVersion=null!=s?s:1,this.state.isOriginator=!r,this.state.relayPersistence=u,this.state.communicationServerUrl=m,this.state.context=d,this.state.terminated=!1,this.state.sdkVersion=g,this.setMaxListeners(50),this.setConnectionStatus(on.DISCONNECTED),(null==p?void 0:p.duration)&&(this.state.sessionDuration=6048e5),this.state.storageOptions=p,this.state.autoConnectOptions=v,this.state.debug=!0===(null==y?void 0:y.remoteLayer),!0===(null==y?void 0:y.remoteLayer)&&l().enable("RemoteCommunication:Layer"),!0===(null==y?void 0:y.serviceLayer)&&l().enable("SocketService:Layer"),!0===(null==y?void 0:y.eciesLayer)&&l().enable("ECIES:Layer"),!0===(null==y?void 0:y.keyExchangeLayer)&&l().enable("KeyExchange:Layer"),this.state.logging=y,(null==p?void 0:p.storageManager)&&(this.state.storageManager=p.storageManager),rB(`[RemoteCommunication: constructor()] protocolVersion=${s} relayPersistence=${u} isOriginator=${this.state.isOriginator} communicationLayerPreference=${n} otherPublicKey=${r} reconnect=${i}`),this.state.isOriginator||r8({communicationLayerPreference:n,otherPublicKey:r,reconnect:i,ecies:h,communicationServerUrl:m,instance:this}),this.emitServiceStatusEvent({context:"constructor"})}initFromDappStorage(){return p(this,void 0,void 0,function*(){var e;if(this.state.storageManager){let t=yield this.state.storageManager.getPersistedChannelConfig({});t&&(this.state.channelConfig=t,this.state.channelId=t.channelId,this.state.deeplinkProtocolAvailable=null!=(e=t.deeplinkProtocolAvailable)&&e,t.relayPersistence&&(this.state.authorized=!0,this.state.ready=!0,this.setConnectionStatus(on.LINKED),yield this.connectToChannel
2({channelId:t.channelId})))}r8({communicationLayerPreference:od.SOCKET,otherPublicKey:this.state.otherPublicKey,reconnect:this._options.reconnect,ecies:this._options.ecies,communicationServerUrl:this.state.communicationServerUrl,instance:this})})}originatorSessionConnect(){return p(this,void 0,void 0,function*(){return yield function(e){return p(this,void 0,void 0,function*(){var t;let{state:n}=e;if(!n.storageManager)return void rB("[RemoteCommunication: originatorSessionConnect()] no storage manager defined - skip");let r=yield n.storageManager.getPersistedChannelConfig({});if(rB(`[RemoteCommunication: originatorSessionConnect()] autoStarted=${n.originatorConnectStarted} channelConfig`,r),null==(t=n.communicationLayer)?void 0:t.isConnected())return rB("[RemoteCommunication: originatorSessionConnect()] socket already connected - skip"),r;if(r){if(r.validUntil>Date.now())return n.channelConfig=r,n.originatorConnectStarted=!0,n.channelId=null==r?void 0:r.channelId,n.reconnection=!0,r;rB("[RemoteCommunication: autoConnect()] Session has expired")}n.originatorConnectStarted=!1})}(this)})}generateChannelIdConnect(){return p(this,void 0,void 0,function*(){return function(e){return p(this,void 0,void 0,function*(){var t,n,r,i,o,a;if(!e.communicationLayer)throw Error("communication layer not initialized");if(e.ready)throw Error("Channel already connected");if(e.channelId&&(null==(t=e.communicationLayer)?void 0:t.isConnected()))return e.channelConfig=Object.assign(Object.assign({},e.channelConfig),{channelId:e.channelId,validUntil:Date.now()+e.sessionDuration}),null==(n=e.storageManager)||n.persistChannelConfig(e.channelConfig),{channelId:e.channelId,privKey:null==(i=null==(r=e.communicationLayer)?void 0:r.getKeyInfo())?void 0:i.ecies.private,pubKey:null==(a=null==(o=e.communicationLayer)?void 0:o.getKeyInfo())?void 0:a.ecies.public};rB("[RemoteCommunication: generateChannelId()]");let s=yield e.communicationLayer.createChannel();rB("[RemoteCommunication: generateChannelId()] channel created",s);let l=Object.assign(Object.assign({},e.channelConfig),{channelId:s.channelId,localKey:s.privKey,validUntil:Date.now()+e.sessionDuration});return e.channelId=s.channelId,e.channelConfig=l,{channelId:e.channelId,pubKey:s.pubKey,privKey:s.privKey}})}(this.state)})}clean(){return rW(this.state)}connectToChannel({channelId:e,withKeyExchange:t,authorized:n}){return function(e){return p(this,arguments,void 0,function*({channelId:e,withKeyExchange:t,authorized:n,state:r}){var i,o,a;if(!(0,h.A)(e))throw rB(`[RemoteCommunication: connectToChannel()] context=${r.context} invalid channel channelId=${e}`),Error(`Invalid channel ${e}`);if(rB(`[RemoteCommunication: connectToChannel()] context=${r.context} channelId=${e} withKeyExchange=${t}`),null==(i=r.communicationLayer)?void 0:i.isConnected())return void rB(`[RemoteCommunication: connectToChannel()] context=${r.context} already connected - interrupt connection.`);r.channelId=e,yield null==(o=r.communicationLayer)?void 0:o.connectToChannel({channelId:e,authorized:n,withKeyExchange:t});let s=Object.assign(Object.assign({},r.channelConfig),{channelId:e,validUntil:Date.now()+r.sessionDuration});
2r.channelConfig=s,null==(a=r.storageManager)||a.persistChannelConfig(s)})}({channelId:e,authorized:n,withKeyExchange:t,state:this.state})}sendMessage(e){return function(e,t){return p(this,void 0,void 0,function*(){var n,r;let{state:i}=e;rB(`[RemoteCommunication: sendMessage()] context=${i.context} paused=${i.paused} ready=${i.ready} relayPersistence=${i.relayPersistence} authorized=${i.authorized} socket=${null==(n=i.communicationLayer)?void 0:n.isConnected()} clientsConnected=${i.clientsConnected} status=${i._connectionStatus}`,t),i.relayPersistence||i.ready&&(null==(r=i.communicationLayer)?void 0:r.isConnected())&&i.clientsConnected||(rB(`[RemoteCommunication: sendMessage()] context=${i.context}  SKIP message waiting for MM mobile readiness.`),yield new Promise(t=>{e.once(or.CLIENTS_READY,t)}),rB(`[RemoteCommunication: sendMessage()] context=${i.context}  AFTER SKIP / READY -- sending pending message`));try{return yield function(e,t){return p(this,void 0,void 0,function*(){return new Promise(n=>{var r;let{state:i}=e;rB(`[RemoteCommunication: handleAuthorization()] context=${i.context} ready=${i.ready} authorized=${i.authorized} method=${t.method}`),!i.isOriginator||i.authorized||i.relayPersistence?null==(r=i.communicationLayer)||r.sendMessage(t).then(e=>{n(e)}).catch(e=>{n(!1)}):e.once(or.AUTHORIZED,()=>{var e;rB(`[RemoteCommunication: handleAuthorization()] context=${i.context}  AFTER SKIP / AUTHORIZED -- sending pending message`),null==(e=i.communicationLayer)||e.sendMessage(t).then(e=>{n(e)}).catch(e=>{n(!1)})})})})}(e,t)}catch(e){throw e}})}(this,e)}testStorage(){return p(this,void 0,void 0,function*(){return function(e){return p(this,void 0,void 0,function*(){var t;rB("[RemoteCommunication: testStorage()] res",(yield null==(t=e.storageManager)?void 0:t.getPersistedChannelConfig()))})}(this.state)})}hasDeeplinkProtocol(){return this.state.deeplinkProtocolAvailable}getChannelConfig(){return this.state.channelConfig}isReady(){return this.state.ready}isConnected(){var e;return null==(e=this.state.communicationLayer)?void 0:e.isConnected()}isAuthorized(){return this.state.authorized}isPaused(){return this.state.paused}getCommunicationLayer(){return this.state.communicationLayer}ping(){return p(this,void 0,void 0,function*(){var e;rB(`[RemoteCommunication: ping()] channel=${this.state.channelId}`),yield null==(e=this.state.communicationLayer)?void 0:e.ping()})}testLogger(){rB(`testLogger() channel=${this.state.channelId}`),rN(`testLogger() channel=${this.state.channelId}`),rD(`testLogger() channel=${this.state.channelId}`),r$(`testLogger() channel=${this.state.channelId}`)}keyCheck(){var e;rB(`[RemoteCommunication: keyCheck()] channel=${this.state.channelId}`),null==(e=this.state.communicationLayer)||e.keyCheck()}setConnectionStatus(e){this.state._connectionStatus!==e&&(this.state._connectionStatus=e,this.emit(or.CONNECTION_STATUS,e),this.emitServiceStatusEvent({context:"setConnectionStatus"}))}emitServiceStatusEvent(e={}){this.emit(or.SERVICE_STATUS,this.getServiceStatus())}getConnectionStatus(){return this.state._connectionStatus}getServiceStatus(){return{originatorInfo:this.state.originatorInfo,keyInfo:this.getKeyInfo(),connectionStatus:this.state._connectionStatus,channelConfig:this.state.channelConfig,channelId:this.state.channelId}}getKeyInfo(){var e;return null==(e=this.state.communicationLayer)?void 0:e.getKeyInfo()}resetKeys(){var e;null==(e=this.state.communicationLayer)||e.resetKeys()}setOtherPublicKey(e){var t;let n=null==(t=this.state.communicationLayer)?void 0:t.getKeyExchange();if(!n)throw Error("KeyExchange is not initialized.");n.getOtherPublicKey()!==e&&n.setOtherPublicKey(e)}pause(){return p(this,void 0,void 0,function*(){var e;rB(`[RemoteCommunication: pause()] channel=${this.state.channelId}`),yield null==(e=this.state.communicationLayer)?void 0:e.pause(),this.setConnectionStatus(on.PAUSED)})}getVersion(){return rz}hasRelayPersistence(){var e;return null!=(e=this.state.relayPersistence)&&e}resume(){return p(this,void 0,void 0,function*(){return function(e){return p(this,void 0,void 0,function*(){var t;let{state:n}=e;rB(`[RemoteCommunication: resume()] channel=${n.channelId}`),yield null==(t=n.communicationLayer)?void 0:t.resume(),e.setConnectionStatus(on.LINKED)})}(this)})}encrypt(e){var t,n,r;let i=null==(t=this.state.communicationLayer)?void 0:t.getKeyExchange(),o=null==i?void 0:i.getOtherPublicKey();
2if(!o)throw Error("KeyExchange not completed");return null==(r=null==(n=this.state.communicationLayer)?void 0:n.state.eciesInstance)?void 0:r.encrypt(e,o)}decrypt(e){var t,n,r;if(!(null==(t=this.state.communicationLayer)?void 0:t.state.eciesInstance))throw Error("ECIES instance is not initialized");return null==(r=null==(n=this.state.communicationLayer)?void 0:n.state.eciesInstance)?void 0:r.decrypt(e)}getChannelId(){return this.state.channelId}getRPCMethodTracker(){var e;return null==(e=this.state.communicationLayer)?void 0:e.getRPCMethodTracker()}reject({channelId:e}){return function(e){return p(this,arguments,void 0,function*({channelId:e,state:t}){var n,r,i;if(!(0,h.A)(e))throw rB(`[RemoteCommunication: connectToChannel()] context=${t.context} invalid channel channelId=${e}`),Error(`Invalid channel ${e}`);if(t.isOriginator)return void rB(`[RemoteCommunication: reject()] context=${t.context} isOriginator=${t.isOriginator} channelId=${e}`);let{socket:o}=null!=(r=null==(n=t.communicationLayer)?void 0:n.state)?r:{};(null==o?void 0:o.connected)||(rB(`[RemoteCommunication: reject()] context=${t.context} socket already connected`),null==o||o.connect()),rF(Object.assign(Object.assign({id:e,event:os.REJECTED},t.originatorInfo),{sdkVersion:t.sdkVersion,commLayerVersion:rz,walletVersion:null==(i=t.walletInfo)?void 0:i.version}),t.communicationServerUrl).catch(e=>{}),yield new Promise((n,r)=>{null==o||o.emit(or.REJECTED,{channelId:e},(e,i)=>{rB(`[RemoteCommunication: reject()] context=${t.context} socket=${null==o?void 0:o.id}`,{error:e,response:i}),e?r(e):n(i)})})})}({channelId:e,state:this.state})}disconnect(e){return p(this,void 0,void 0,function*(){return r4({options:e,instance:this})})}}(ot=oh||(oh={})).RENEW="renew",ot.LINK="link";var r7=()=>"MetaMask: Disconnected from chain. Attempting to connect.",r9=()=>"MetaMask: Disconnected from MetaMask background. Page reload required.",ie=()=>"MetaMask: Failed to send site metadata. This is an internal error, please report this bug.",it=e=>`MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,ir=()=>"Must provide a Node.js-style duplex stream.",ii=()=>"MetaMask: Received invalid network parameters. Please report this bug.",io=()=>"Expected a single, non-array, object argument.",ia=()=>"'args.method' must be a non-empty string.",is=()=>"'args.params' must be an object or array if provided.",il=e=>`MetaMask: Connected to chain with ID "${e}".`,ic="MetaMask: 'ethereum.chainId' is deprecated and may be removed in the future. Please use the 'eth_chainId' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23",id="MetaMask: 'ethereum.networkVersion' is deprecated and may be removed in the future. Please use the 'net_version' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23",iu="MetaMask: 'ethereum.selectedAddress' is deprecated and may be removed in the future. Please use the 'eth_accounts' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23",ih="MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",ip="MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",ig={close:"MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"},im={ethDecryptDeprecation:"MetaMask: The RPC method 'eth_decrypt' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686",ethGetEncryptionPublicKeyDeprecation:"MetaMask: The RPC method 'eth_getEncryptionPublicKey' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686",walletWatchAssetNFTExperimental:"MetaMask: The RPC method 'wallet_watchAsset' is experimental for ERC721/ERC1155 assets and may change in the future.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md and https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle"},iy="MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning.",iv=Math.floor(0xffffffff*Math.random()),ib=(e,t,n
2)=>{if(!t.has(e))throw TypeError("Cannot "+n)},iE=(e,t,n)=>(ib(e,t,"read from private field"),n?n.call(e):t.get(e)),iw=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},iC=(e,t,n,r)=>(ib(e,t,"write to private field"),t.set(e,n),n),i_=(e,t,n)=>(ib(e,t,"access private method"),n),iS={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};function ix(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}var ik=(e,t)=>Object.hasOwnProperty.call(e,t);class iM extends TypeError{constructor(e,t){let n;const{message:r,explanation:i,...o}=e,{path:a}=e,s=0===a.length?r:`At path: ${a.join(".")} -- ${r}`;super(i??s),null!=i&&(this.cause=s),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...t()])}}function iA(e){return"object"==typeof e&&null!=e}function iL(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function*iP(e,t,n,r){var i;for(let o of(iA(i=e)&&"function"==typeof i[Symbol.iterator]||(e=[e]),e)){let e=function(e,t,n,r){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});let{path:i,branch:o}=t,{type:a}=n,{refinement:s,message:l=`Expected a value of type \`${a}\`${s?` with refinement \`${s}\``:""}, but received: \`${iL(r)}\``}=e;return{value:r,type:a,refinement:s,key:i[i.length-1],path:i,branch:o,...e,message:l}}(o,t,n,r);e&&(yield e)}}function*iI(e,t,n={}){let{path:r=[],branch:i=[e],coerce:o=!1,mask:a=!1}=n,s={path:r,branch:i};if(o&&(e=t.coercer(e,s),a&&"type"!==t.type&&iA(t.schema)&&iA(e)&&!Array.isArray(e)))for(let n in e)void 0===t.schema[n]&&delete e[n];let l="valid";for(let r of t.validator(e,s))r.explanation=n.message,l="not_valid",yield[r,void 0];for(let[c,d,u]of t.entries(e,s))for(let t of iI(d,u,{path:void 0===c?r:[...r,c],branch:void 0===c?i:[...i,d],c
2oerce:o,mask:a,message:n.message}))t[0]?(l=null!=t[0].refinement?"not_refined":"not_valid",yield[t[0],void 0]):o&&(d=t[1],void 0===c?e=d:e instanceof Map?e.set(c,d):e instanceof Set?e.add(d):iA(e)&&(void 0!==d||c in e)&&(e[c]=d));if("not_valid"!==l)for(let r of t.refiner(e,s))r.explanation=n.message,l="not_refined",yield[r,void 0];"valid"===l&&(yield[void 0,e])}class iO{constructor(e){const{type:t,schema:n,validator:r,refiner:i,coercer:o=e=>e,entries:a=function*(){}}=e;this.type=t,this.schema=n,this.entries=a,this.coercer=o,this.validator=r?(e,t)=>iP(r(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>iP(i(e,t),t,this,e):()=>[]}assert(e,t){return iR(e,this,t)}create(e,t){return iT(e,this,t)}is(e){return i$(e,this)}mask(e,t){let n=iN(e,this,{coerce:!0,mask:!0,message:t});if(n[0])throw n[0];return n[1]}validate(e,t={}){return iN(e,this,t)}}function iR(e,t,n){let r=iN(e,t,{message:n});if(r[0])throw r[0]}function iT(e,t,n){let r=iN(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function i$(e,t){return!iN(e,t)[0]}function iN(e,t,n={}){let r=iI(e,t,n),i=function(e){let{done:t,value:n}=e.next();return t?void 0:n}(r);return i[0]?[new iM(i[0],function*(){for(let e of r)e[0]&&(yield e[0])}),void 0]:[void 0,i[1]]}function iD(e,t){return new iO({type:e,schema:null,validator:t})}function iB(e){let t;return new iO({type:"lazy",schema:null,*entries(n,r){t??(t=e()),yield*t.entries(n,r)},validator:(n,r)=>(t??(t=e()),t.validator(n,r)),coercer:(n,r)=>(t??(t=e()),t.coercer(n,r)),refiner:(n,r)=>(t??(t=e()),t.refiner(n,r))})}function iK(e){return new iO({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(let[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${iL(e)}`})}function ij(e){let t=iL(e),n=typeof e;return new iO({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:n=>n===e||`Expected the literal \`${t}\`, but received: ${iL(n)}`})}function iU(){return iD("number",e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${iL(e)}`)}function iF(e){let t=e?Object.keys(e):[],n=iD("never",()=>!1);return new iO({type:"object",schema:e||null,*entries(r){if(e&&iA(r)){let i=new Set(Object.keys(r));for(let n of t)i.delete(n),yield[n,r[n],e[n]];for(let e of i)yield[e,r[e],n]}},validator:e=>iA(e)||`Expected an object, but received: ${iL(e)}`,coercer:e=>iA(e)?{...e}:e})}function iH(e){return new iO({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function iz(e,t){return new iO({type:"record",schema:null,*entries(n){if(iA(n))for(let r in n){let i=n[r];yield[r,r,e],yield[r,i,t]}},validator:e=>iA(e)||`Expected an object, but received: ${iL(e)}`})}function iq(){return iD("string",e=>"string"==typeof e||`Expected a string, but received: ${iL(e)}`)}function iV(e){let t=e.map(e=>e.type).join(" | ");return new iO({type:"union",schema:null,coercer(t){for(let n of e){let[e,r]=n.validate(t,{coerce:!0});if(!e)return r}return t},validator(n,r){let i=[];for(let t of e){let[...e]=iI(n,t,r),[o]=e;if(!o[0])return[];for(let[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${iL(n)}`,...i]}})}var iW=class extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}};function iG(){throw Error("setTimeout has not been defined")}function iZ(){throw Error("clearTimeout has not been defined")}var iY=iG,iJ=iZ;function iX(e){if(iY===setTimeout)return setTimeout(e,0);if((iY===iG||!iY)&&setTimeout)return iY=setTimeout,setTimeout(e,0);try{return iY(e,0)}catch(t){try{return iY.call(null,e,0)}catch(t){return iY.call(this,e,0)}}}"function"==typeof g.setTimeout&&(iY=setTimeout),"function"==typeof g.clearTimeout&&(iJ=clearTimeout);var iQ,i0,i1,i2,i3,i5,i8,i4,i6,i7,i9,oe,ot,on,or,oi,oo,oa,os,ol,oc,od,ou,oh,of,op=[],og=!1,om=-1;function oy(){og&&of&&(og=!1,of.length?op=of.concat(op):om=-1,op.length&&ov())}function ov(){if(!og){var e=iX(oy);og=!0;for(var t=op.length;t;){for(of=op,op=[];++om<t;)of&&of[om].run();om=-1,t=op.length}of=null,og=!1,function(e){if(iJ===clearTimeout)return clearTimeout(e);if((iJ===iZ||!iJ)&&clearTimeout)return iJ=clearTimeout,clearTimeout(e);try{iJ(e)}catch(t){try{return iJ.call(null,e)}catch(t){return iJ.call(this,e)}}}(e)}}function ob(e,t){this.fun=e,this.array=t}function oE(){}ob.prototype.run=function(){this.fun.apply(null,this.array)};var ow=g.performance||{},oC=ow.now||ow.mozNow||ow.msNow||ow.oNow||ow.webkitNow||function(){return(new Date).getTime()},o_=new Date,oS={nextTick:function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];op.push(new ob(e,t)),1!==op.length||og||iX(ov)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:oE,addListener:oE,once:oE,off:oE,removeListener:oE,removeAllListeners:oE,emit:oE,binding:function(e){throw Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*oC.call(ow),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-o_)/1e3}};function ox({path:e,branch:t}){let n=e[e.length-1];return ik(t[t.length-2],n)}function ok(e){return new iO({...e,type:`optional ${e.type}`,validator:(t,n)=>!ox(n)||e.validator(t,n),refiner:(t,n)=>!ox(n)||e.refiner(t,n)})}var oM,oA,oL=iV([ij(null),iD("boolean",e=>"boolean"==typeof e),iD("finite number",e=>i$(e,iU())&&Number.isFinite(e)),iq(),iK(iB(()=>oL)),iz(iq(),iB(()=>oL))]),oP=(oM=iD("any",()=>!0),oA=e=>((function(e,t,n="Assertion failed",r=iW){try{iR(e,t)}catch(e){var i,o;throw i=r,o=`${n}: ${("object"==typeof e&&null!==e&&"message"in e&&"string"==typeof e.message?e.message:null==e?"":String(e)).replace(/\.$/u,"")}.`,"string"==typeof i?.prototype?.constructor?.name?new i({message:o}):i({message:o})}})(e,oL),JSON.parse(JSON.stringify(e,(e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))),new iO({...oL,coercer:(e,t)=>i$(e,oM)?oL.coercer(oA(e,t),t):oL.coercer(e,t)}));function oI(e){try{return iT(e,oP),!0}catch{return!1}}var oO=ij("2.0"),oR=new iO({...ai=iV([iU(),iq()]),validator:(e,t)=>
2null===e||ai.validator(e,t),refiner:(e,t)=>null===e||ai.refiner(e,t)}),oT=iF({code:iD("integer",e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${iL(e)}`),message:iq(),data:ok(oP),stack:ok(iq())}),o$=iV([iz(iq(),oP),iK(oP)]),oN=iF({id:oR,jsonrpc:oO,method:iq(),params:ok(o$)}),oD=iF({jsonrpc:oO,method:iq(),params:ok(o$)});iF({id:oR,jsonrpc:oO,result:iH(iD("unknown",()=>!0)),error:iH(oT)}),iV([iF({id:oR,jsonrpc:oO,result:oP}),iF({id:oR,jsonrpc:oO,error:oT})]);var oB={code:-32603,message:oK(-32603)};function oK(e,t="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){let t=e.toString();if(ik(iS,t))return iS[t].message;if(e>=-32099&&e<=-32e3)return"Unspecified server error."}return t}function oj(e,{fallbackError:t=oB,shouldIncludeStack:n=!0}={}){if(!i$(t,oT))throw Error("Must provide fallback error with integer number code and string message.");let r=function(e,t){if(e&&"object"==typeof e&&"serialize"in e&&"function"==typeof e.serialize)return e.serialize();if(i$(e,oT))return e;let n=oU(e);return{...t,data:{cause:n}}}(e,t);return n||delete r.stack,r}function oU(e){return Array.isArray(e)?e.map(e=>oI(e)?e:ix(e)?oF(e):null):ix(e)?oF(e):oI(e)?e:null}function oF(e){return Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return oI(r)&&(t[n]=r),t},{})}oG.default=oG,oG.stable=oJ,oG.stableStringify=oJ;var oH="[...]",oz="[Circular]",oq=[],oV=[];function oW(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function oG(e,t,n,r){var i;void 0===r&&(r=oW()),function e(t,n,r,i,o,a,s){var l;if(a+=1,"object"==typeof t&&null!==t){for(l=0;l<i.length;l++)if(i[l]===t)return void oZ(oz,t,n,o);if(void 0!==s.depthLimit&&a>s.depthLimit||void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void oZ(oH,t,n,o);if(i.push(t),Array.isArray(t))for(l=0;l<t.length;l++)e(t[l],l,l,i,t,a,s);else{var c=Object.keys(t);for(l=0;l<c.length;l++){var d=c[l];e(t[d],d,l,i,t,a,s)}}i.pop()}}(e,"",0,[],void 0,0,r);try{i=0===oV.length?JSON.stringify(e,t,n):JSON.stringify(e,oX(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==oq.length;){var o=oq.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function oZ(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);void 0!==i.get?i.configurable?(Object.defineProperty(r,n,{value:e}),oq.push([r,n,t,i])):oV.push([t,n,e]):(r[n]=e,oq.push([r,n,t]))}function oY(e,t){return e<t?-1:+(e>t)}function oJ(e,t,n,r){void 0===r&&(r=oW());var i,o=function e(t,n,r,i,o,a,s){var l;if(a+=1,"object"==typeof t&&null!==t){for(l=0;l<i.length;l++)if(i[l]===t)return void oZ(oz,t,n,o);try{if("function"==typeof t.toJSON)return}catch(e){return}if(void 0!==s.depthLimit&&a>s.depthLimit||void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void oZ(oH,t,n,o);if(i.push(t),Array.isArray(t))for(l=0;l<t.length;l++)e(t[l],l,l,i,t,a,s);else{var c={},d=Object.keys(t).sort(oY);for(l=0;l<d.length;l++){var u=d[l];e(t[u],u,l,i,t,a,s),c[u]=t[u]}if(void 0===o)return c;oq.push([o,n,t]),o[n]=c}i.pop()}}(e,"",0,[],void 0,0,r)||e;try{i=0===oV.length?JSON.stringify(o,t,n):JSON.stringify(o,oX(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==oq.length;){var a=oq.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return i}function oX(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(oV.length>0)for(var r=0;r<oV.length;r++){var i=oV[r];if(i[1]===t&&i[0]===n){n=i[2],oV.splice(r,1);break}}return e.call(this,t,n)}}var oQ=eo(oG),o0=class extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a non-empty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}serialize(){let e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}(this.data)&&(e.data.cause=oU(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return oQ(this.serialize(),o1,2)}};function o1(e,t){if("[Circular]"!==t)return t}function o2(e,t){let[n,r]=function(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:n}=e;
2if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t??void 0,n]}}return[]}(t);return new o0(e,n??oK(e),r)}var o3={};function o5(){}function o8(){o8.init.call(this)}function o4(e){return void 0===e._maxListeners?o8.defaultMaxListeners:e._maxListeners}function o6(e,t,n,r){var i,o,a;if("function"!=typeof n)throw TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]):(o=e._events=new o5,e._eventsCount=0),a){if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),!a.warned&&(i=o4(e))&&i>0&&a.length>i){a.warned=!0;var s=Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=n,++e._eventsCount;return e}function o7(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function o9(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function ae(e,t){for(var n=Array(t);t--;)n[t]=e[t];return n}o5.prototype=Object.create(null),o8.EventEmitter=o8,o8.usingDomains=!1,o8.prototype.domain=void 0,o8.prototype._events=void 0,o8.prototype._maxListeners=void 0,o8.defaultMaxListeners=10,o8.init=function(){this.domain=null,o8.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new o5,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o8.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},o8.prototype.getMaxListeners=function(){return o4(this)},o8.prototype.emit=function(e){var t,n,r,i,o,a,s,l="error"===e;if(a=this._events)l=l&&null==a.error;else if(!l)return!1;if(s=this.domain,l){if(t=arguments[1],!s){if(t instanceof Error)throw t;var c=Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=a[e]))return!1;var d="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,i=ae(e,r),o=0;o<r;++o)i[o].call(n)}(n,d,this);break;case 2:!function(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,o=ae(e,i),a=0;a<i;++a)o[a].call(n,r)}(n,d,this,arguments[1]);break;case 3:!function(e,t,n,r,i){if(t)e.call(n,r,i);else for(var o=e.length,a=ae(e,o),s=0;s<o;++s)a[s].call(n,r,i)}(n,d,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,r,i,o){if(t)e.call(n,r,i,o);else for(var a=e.length,s=ae(e,a),l=0;l<a;++l)s[l].call(n,r,i,o)}(n,d,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];!function(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,o=ae(e,i),a=0;a<i;++a)o[a].apply(n,r)}(n,d,this,i)}return!0},o8.prototype.addListener=function(e,t){return o6(this,e,t,!1)},o8.prototype.on=o8.prototype.addListener,o8.prototype.prependListener=function(e,t){return o6(this,e,t,!0)},o8.prototype.once=function(e,t){if("function"!=typeof t)throw TypeError('"listener" argument must be a function');return this.on(e,o7(this,e,t)),this},o8.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw TypeError('"listener" argument must be a function');return this.prependListener(e,o7(this,e,t)),this},o8.prototype.removeListener=function(e,t){var n,r,i,o,a;if("function"!=typeof t)throw TypeError('"listener" argument must be a function');if(!(r=this._events)||!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new o5:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new o5,this;delete r[e]}else{for(var s=n,l=i,c=l,d=c+1,u=s.length;d<u;c+=1,d+=1)s[c]=s[d];s.pop()}
2r.removeListener&&this.emit("removeListener",e,a||t)}return this},o8.prototype.off=function(e,t){return this.removeListener(e,t)},o8.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0==arguments.length?(this._events=new o5,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new o5:delete n[e]),this;if(0==arguments.length){for(var r,i=Object.keys(n),o=0;o<i.length;++o)"removeListener"!==(r=i[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new o5,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do this.removeListener(e,t[t.length-1]);while(t[0]);return this},o8.prototype.listeners=function(e){var t,n=this._events;return n&&(t=n[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[]},o8.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):o9.call(e,t)},o8.prototype.listenerCount=o9,o8.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var at=ea(Object.freeze({__proto__:null,EventEmitter:o8,default:o8}));Object.defineProperty(o3,"__esModule",{value:!0});let an=at;function ar(e,t,n){try{Reflect.apply(e,t,n)}catch(e){setTimeout(()=>{throw e})}}var ai,ao,aa,as,al,ac,ad,au,ah,af,ap,ag,am,ay,av,ab,aE,aw,aC,a_,aS=o3.default=class extends an.EventEmitter{emit(e,...t){let n="error"===e,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;let n=Error("Unhandled error."+(e?` (${e.message})`:""));throw n.context=e,n}let i=r[e];if(void 0===i)return!1;if("function"==typeof i)ar(i,this,t);else{let e=i.length,n=function(e){let t=e.length,n=Array(t);for(let r=0;r<t;r+=1)n[r]=e[r];return n}(i);for(let r=0;r<e;r+=1)ar(n[r],this,t)}return!0}},ax=class e extends aS{constructor({notificationHandler:e}={}){super(),iw(this,al),iw(this,ad),iw(this,ah),iw(this,ao,!1),iw(this,aa,void 0),iw(this,as,void 0),iC(this,aa,[]),iC(this,as,e)}destroy(){iE(this,aa).forEach(e=>{"destroy"in e&&"function"==typeof e.destroy&&e.destroy()}),iC(this,aa,[]),iC(this,ao,!0)}push(e){i_(this,al,ac).call(this),iE(this,aa).push(e)}handle(e,t){if(i_(this,al,ac).call(this),t&&"function"!=typeof t)throw Error('"callback" must be a function if provided.');return Array.isArray(e)?t?i_(this,ad,au).call(this,e,t):i_(this,ad,au).call(this,e):t?i_(this,ah,af).call(this,e,t):this._promiseHandle(e)}asMiddleware(){return i_(this,al,ac).call(this),async(t,n,r,i)=>{try{let[o,a,s]=await i_(e,am,ay).call(e,t,n,iE(this,aa));return a?(await i_(e,aE,aw).call(e,s),i(o)):r(async t=>{try{await i_(e,aE,aw).call(e,s)}catch(e){return t(e)}return t()})}catch(e){return i(e)}}}async _promiseHandle(e){return new Promise((t,n)=>{i_(this,ah,af).call(this,e,(e,r)=>{e&&void 0===r?n(e):t(r)}).catch(n)})}};function ak(e){return JSON.stringify(e,null,2)}ao=new WeakMap,aa=new WeakMap,as=new WeakMap,al=new WeakSet,ac=function(){if(iE(this,ao))throw Error("This engine is destroyed and can no longer be used.")},ad=new WeakSet,au=async function(e,t){try{if(0===e.length){let e=[{id:null,jsonrpc:"2.0",error:new o0(-32600,"Request batch must contain plain objects. Received an empty array")}];return t?t(null,e):e}let n=(await Promise.all(e.map(this._promiseHandle.bind(this)))).filter(e=>void 0!==e);return t?t(null,n):n}catch(e){if(t)return t(e);throw e}},ah=new WeakSet,af=async function(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){let n=new o0(-32600,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(n,{id:null,jsonrpc:"2.0",error:n})}if("string"!=typeof e.method){let n=new o0(-32600,"Must specify a string method. Received: "+typeof e.method,{request:e});return iE(this,as)&&!i$(e,oN)?t(null):t(n,{id:e.id??null,jsonrpc:"2.0",error:n})}if(iE(this,as)&&i$(e,oD)&&!i$(e,oN)){try{await iE(this,as).call(this,e)}catch(e){return t(e)}return t(null)}let n=null,r={...e},i={id:r.id,jsonrpc:r.jsonrpc};try{await i_(ax,ap,ag).call(ax,r,i,iE(this,aa))}catch(e){n=e}return n&&(delete i.result,i.error||(i.error=oj(n))),t(n,i)},ap=new WeakSet,ag=async function(e,t,n){let[r,i,o]=await i_(ax,am,ay).call(ax,e,t,n);if(i_(ax,aC,a_).call(ax,e,t,i),await i_(ax,aE,aw).call(ax,o),r)throw r},am=new WeakSet,ay=async function(e,t,n){let r=[],i=null,o=!1;for(let a of n)if([i,o]=await i_(ax,av,ab).call(ax,e,t,a,r),o)break;return[i,o,r.reverse()]},av=new WeakSet,ab=async function(e,t,n,r){return new Promise(i=>{let o=e=>{let n=e||t.error;n&&(t.error=oj(n)),i([n,!0])};try{n(e,t,n=>{t.error?o(t.error):(n&&("function"!=typeof n&&o(new o0(-32603,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof n}" for request:
3${ak(e)}`,{request:e})),r.push(n)),i([null,!1]))},o)}catch(e){o(e)}})},aE=new WeakSet,aw=async function(e){for(let t of e)await new Promise((e,n
3)=>{t(t=>t?n(t):e())})},aC=new WeakSet,a_=function(e,t,n){if(!ik(t,"result")&&!ik(t,"error"))throw new o0(-32603,`JsonRpcEngine: Response has no error or result for request:
4${ak(e)}`,{request:e});if(!n)throw new o0(-32603,`JsonRpcEngine: Nothing ended request:
5${ak(e)}`,{request:e})},iw(ax,ap),iw(ax,am),iw(ax,av),iw(ax,aE),iw(ax,aC);var aM=Object.freeze(["eth_subscription"]),aA=(e,t,n=!0)=>(r,i)=>{r||i.error?t(r||i.error):!n||Array.isArray(i)?e(i):e(i.result)},aL=e=>!!e&&"string"==typeof e&&e.startsWith("0x"),aP=()=>{};async function aI(e,t){try{let t=await async function(){return{name:function(e){let{document:t}=e,n=t.querySelector('head > meta[property="og:site_name"]');if(n)return n.content;let r=t.querySelector('head > meta[name="title"]');return r?r.content:t.title&&t.title.length>0?t.title:window.location.hostname}(window),icon:await aO(window)}}();e.handle({jsonrpc:"2.0",id:1,method:"metamask_sendDomainMetadata",params:t},aP)}catch(e){t.error({message:ie(),originalError:e})}}async function aO(e){let{document:t}=e;for(let e of Array.from(t.querySelectorAll('head > link[rel~="icon"]')))if(e&&await aR(e.href))return e.href;return null}async function aR(e){return new Promise((t,n)=>{try{let n=document.createElement("img");n.onload=()=>t(!0),n.onerror=()=>t(!1),n.src=e}catch(e){n(e)}})}var aT=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},a$=(e,t,n)=>(aT(e,t,"read from private field"),n?n.call(e):t.get(e)),aN=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},aD=(e,t,n,r)=>(aT(e,t,"write to private field"),t.set(e,n),n);
5function aB(e,t,n){try{Reflect.apply(e,t,n)}catch(e){setTimeout(()=>{throw e})}}class aK extends o8{emit(e,...t){let n="error"===e,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;let n=Error("Unhandled error."+(e?` (${e.message})`:""));throw n.context=e,n}let i=r[e];if(void 0===i)return!1;if("function"==typeof i)aB(i,this,t);else{let e=i.length,n=function(e){let t=e.length,n=Array(t);for(let r=0;r<t;r+=1)n[r]=e[r];return n}(i);for(let r=0;r<e;r+=1)aB(n[r],this,t)}return!0}}var aj,aU,aF=eo(function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var r,i,o,a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}),aH=class e extends aK{constructor({logger:t=console,maxEventListeners:n=100,rpcMiddleware:r=[]}={}){super(),aN(this,aj,void 0),aN(this,aU,void 0),this._log=t,this.setMaxListeners(n),this._state={...e._defaultState},aD(this,aU,null),aD(this,aj,null),this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this);const i=new ax;r.forEach(e=>i.push(e)),this._rpcEngine=i}get chainId(){return a$(this,aj)}get selectedAddress(){return a$(this,aU)}isConnected(){return this._state.isConnected}async request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw o2(-32600,{message:io(),data:e});let{method:t,params:n}=e;if("string"!=typeof t||0===t.length)throw o2(-32600,{message:ia(),data:e});if(void 0!==n&&!Array.isArray(n)&&("object"!=typeof n||null===n))throw o2(-32600,{message:is(),data:e});let r=null==n?{method:t}:{method:t,params:n};return new Promise((e,t)=>{this._rpcRequest(r,aA(e,t))})}_initializeState(e){if(this._state.initialized)throw Error("Provider already initialized.");if(e){let{accounts:t,chainId:n,isUnlocked:r,networkVersion:i}=e;this._handleConnect(n),this._handleChainChanged({chainId:n,networkVersion:i}),this._handleUnlockStateChanged({accounts:t,isUnlocked:r}),this._handleAccountsChanged(t)}this._state.initialized=!0,this.emit("_initialized")}_rpcRequest(e,t){let n=t;return Array.isArray(e)||(e.jsonrpc||(e.jsonrpc="2.0"),"eth_accounts"!==e.method&&"eth_requestAccounts"!==e.method||(n=(n,r)=>{this._handleAccountsChanged(r.result??[],"eth_accounts"===e.method),t(n,r)})),this._rpcEngine.handle(e,n)}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),this._log.debug(il(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let n;this._state.isConnected=!1,e?(n=new o0(1013,t??r7()),this._log.debug(n)):(n=new o0(1011,t??r9()),this._log.error(n),aD(this,aj,null),this._state.accounts=null,aD(this,aU,null),this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",n)}}_handleChainChanged({chainId:e}={}){aL(e)?(this._handleConnect(e),e!==a$(this,aj)&&(aD(this,aj,e),this._state.initialized&&this.emit("chainChanged",a$(this,aj)))):this._log.error(ii(),{chainId:e})}_handleAccountsChanged(e,t=!1){let n=e;for(let t of(Array.isArray(e)||(this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.",e),n=[]),e))if("string"!=typeof t){this._log.error("MetaMask: Received non-string account. Please report this bug.",e),n=[];break}if(!aF(this._state.accounts,n)&&(t&&null!==this._state.accounts&&this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.",n),this._state.accounts=n,a$(this,aU)!==n[0]&&aD(this,aU,n[0]||null),this._state.initialized)){let e=[...n];
5this.emit("accountsChanged",e)}}_handleUnlockStateChanged({accounts:e,isUnlocked:t}={}){"boolean"==typeof t?t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e??[])):this._log.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.")}};aj=new WeakMap,aU=new WeakMap,aH._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1};var az,aq,aV=aH,aW={exports:{}};function aG(){return aq?az:(aq=1,az=at.EventEmitter)}var aZ,aY=ea(er);aZ="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var aJ=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},aX=/%[sdj%]/g;function aQ(e){if(!so(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(a5(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(e).replace(aX,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),a=r[n];n<i;a=r[++n])sn(a)||!sc(a)?o+=" "+a:o+=" "+a5(a);return o}function a0(e,t){if(ss(g.process))return function(){return a0(e,t).apply(this,arguments)};if(!0===oS.noDeprecation)return e;var n=!1;return function(){if(!n){if(oS.throwDeprecation)throw Error(t);oS.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}}var a1,a2={};function a3(e){return ss(a1)&&(a1=oS.env.NODE_DEBUG||""),a2[e=e.toUpperCase()]||(RegExp("\\b"+e+"\\b","i").test(a1)?a2[e]=function(){var t=aQ.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:a2[e]=function(){}),a2[e]}function a5(e,t){var n={seen:[],stylize:a4};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),st(t)?n.showHidden=t:t&&sb(n,t),ss(n.showHidden)&&(n.showHidden=!1),ss(n.depth)&&(n.depth=2),ss(n.colors)&&(n.colors=!1),ss(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a8),a6(n,e,n.depth)}function a8(e,t){var n=a5.styles[t];return n?"\x1b["+a5.colors[n][0]+"m"+e+"\x1b["+a5.colors[n][1]+"m":e}function a4(e,t){return e}function a6(e,t,n){if(e.customInspect&&t&&sh(t.inspect)&&t.inspect!==a5&&(!t.constructor||t.constructor.prototype!==t)){var r,i,o=t.inspect(n,e);return so(o)||(o=a6(e,o,n)),o}var a=function(e,t){if(ss(t))return e.stylize("undefined","undefined");if(so(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return si(t)?e.stylize(""+t,"number"):st(t)?e.stylize(""+t,"boolean"):sn(t)?e.stylize("null","null"):void 0}(e,t);if(a)return a;var s=Object.keys(t),l=(d={},s.forEach(function(e,t){d[e]=!0}),d);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),su(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return a7(t);if(0===s.length){if(sh(t)){var c=t.name?": "+t.name:"";return e.stylize("[Function"+c+"]","special")}if(sl(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(sd(t))return e.stylize(Date.prototype.toString.call(t),"date");if(su(t))return a7(t)}var d,u,h="",f=!1,p=["{","}"];return se(t)&&(f=!0,p=["[","]"]),sh(t)&&(h=" [Function"+(t.name?": "+t.name:"")+"]"),sl(t)&&(h=" "+RegExp.prototype.toString.call(t)),sd(t)&&(h=" "+Date.prototype.toUTCString.call(t)),su(t)&&(h=" "+a7(t)),0!==s.length||f&&0!=t.length?n<0?sl(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=f?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a<s;++a)sE(t,String(a))?o.push(a9(e,t,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(a9(e,t,n,r,i,!0))}),o}(e,t,n,l,s):s.map(function(r){return a9(e,t,n,l,r,f)}),e.seen.pop(),r=h,i=p,u.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?i[0]+(""===r?"":r+"\n ")+" "+u.join(",\n  ")+" "+i[1]:i[0]+r+" "+u.join(", ")+" "+i[1]):p[0]+h+p[1]}function a7(e){return"["+Error.prototype.toString.call(e)+"]"}function a9(e,t,n,r,i,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[
5Setter]","special")),sE(r,i)||(a="["+i+"]"),s||(0>e.seen.indexOf(l.value)?(s=sn(n)?a6(e,l.value,null):a6(e,l.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return"  "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return"   "+e}).join("\n")):s=e.stylize("[Circular]","special")),ss(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function se(e){return Array.isArray(e)}function st(e){return"boolean"==typeof e}function sn(e){return null===e}function sr(e){return null==e}function si(e){return"number"==typeof e}function so(e){return"string"==typeof e}function sa(e){return"symbol"==typeof e}function ss(e){return void 0===e}function sl(e){return sc(e)&&"[object RegExp]"===sg(e)}function sc(e){return"object"==typeof e&&null!==e}function sd(e){return sc(e)&&"[object Date]"===sg(e)}function su(e){return sc(e)&&("[object Error]"===sg(e)||e instanceof Error)}function sh(e){return"function"==typeof e}function sf(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function sp(e){return L.isBuffer(e)}function sg(e){return Object.prototype.toString.call(e)}function sm(e){return e<10?"0"+e.toString(10):e.toString(10)}a5.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a5.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var sy=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function sv(){var e,t;console.log("%s - %s",(t=[sm((e=new Date).getHours()),sm(e.getMinutes()),sm(e.getSeconds())].join(":"),[e.getDate(),sy[e.getMonth()],t].join(" ")),aQ.apply(null,arguments))}function sb(e,t){if(!t||!sc(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function sE(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var sw="u">typeof Symbol?Symbol("util.promisify.custom"):void 0;function sC(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(sw&&e[sw]){var t;if("function"!=typeof(t=e[sw]))throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,sw,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(e,r){e?n(e):t(r)});try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),sw&&Object.defineProperty(t,sw,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,aJ(e))}function s_(e,t){if(!e){var n=Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}function sS(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var r=t.pop();if("function"!=typeof r)throw TypeError("The last argument must be of type Function");var i=this,o=function(){return r.apply(i,arguments)};e.apply(this,t).then(function(e){oS.nextTick(o.bind(null,null,e))},function(e){oS.nextTick(s_.bind(null,e,o))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,aJ(e)),t}sC.custom=sw;var sx,sk,sM,sA,sL=ea(Object.freeze({__proto__:null,_extend:sb,callbackify:sS,debuglog:a3,default:{inherits:aZ,_extend:sb,log:sv,isBuffer:sp,isPrimitive:sf,isFunction:sh,isError:su,isDate:sd,isObject:sc,isRegExp:sl,isUndefined:ss,isSymbol:sa,isString:so,isNumber:si,isNullOrUndefined:sr,isNull:sn,isBoolean:st,isArray:se,inspect:a5,deprecate:a0,format:aQ,debuglog:a3,promisify:sC,callbackify:sS},deprecate:a0,format:aQ,inherits:aZ,inspect:a5,isArray:se,isBoolean:st,isBuffer:sp,isDate:sd,isError:su,isFunction:sh,isNull:sn,isNullOrUndefined:sr,isNumber:si,isObject:sc,isPrimitive:sf,isRegExp:sl,isString:so,isSymbol:sa,isUndefined:ss,log:sv,promisify:sC}));function sP(){if(sA)return sM;function e(e,r){n(e,r),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}return sA=1,sM={destroy:function(r,i){var o=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?i?i(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,oS.nextTick(n,this,r)):oS.nextTick(n,this,r)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(n){!i&&n?o._writableState?o._writableState.errorEmitted?oS.nextTick(t,o):(o._writableState.errorEmitted=!0,oS.nextTick(e,o,n)):oS.nextTick(e,o,n):i?(oS.nextTick(t,o),i(n)):oS.nextTick(t,o)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}}var sI,sO,sR={},sT={};function s$(e,t,n){n||(n=Error);var r=function(e){function n(n,r,i){return e.call(this,"string"==typeof t?t:t(n,r,i))||this}return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e,n}(n);r.prototype.name=n.name,r.prototype.code=e,sT[e]=r}function sN(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function sD(){if(sO)return sI;sO=1;
5var e=sR.codes.ERR_INVALID_OPT_VALUE;return sI={getHighWaterMark:function(t,n,r,i){var o=null!=n.highWaterMark?n.highWaterMark:i?n[r]:null;if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new e(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}}s$("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),s$("ERR_INVALID_ARG_TYPE",function(e,t,n){if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(r="must not be",t=t.replace(/^not /,"")):r="must be",a=" argument",(void 0===s||s>e.length)&&(s=e.length),e.substring(s-a.length,s)===a)o="The ".concat(e," ").concat(r," ").concat(sN(t,"type"));else{var r,i,o,a,s,l,c=("number"!=typeof l&&(l=0),l+1>e.length||-1===e.indexOf(".",l))?"argument":"property";o='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(sN(t,"type"))}return o+". Received type ".concat(typeof n)},TypeError),s$("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),s$("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),s$("ERR_STREAM_PREMATURE_CLOSE","Premature close"),s$("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),s$("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),s$("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),s$("ERR_STREAM_WRITE_AFTER_END","write after end"),s$("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),s$("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),s$("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),sR.codes=sT;var sB,sK,sj,sU,sF,sH,sz=ea(Object.freeze({__proto__:null,default:"function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}));function sq(){if(sU)return sj;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){var n=t.entry;for(t.entry=null;n;){var r=n.callback;e.pendingcb--,r(void 0),n=n.next}e.corkedRequestsFree.next=t}}sU=1,sj=w,w.WritableState=E;var t,n,r={deprecate:function(){if(sK)return sB;function e(e){try{if(!ei.localStorage)return!1}catch(e){return!1}var t=ei.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}return sK=1,sB=function(t,n){if(e("noDeprecation"))return t;var r=!1;return function(){if(!r){if(e("throwDeprecation"))throw Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),r=!0}return t.apply(this,arguments)}}}()},i=aG(),o=aY.Buffer,a=(void 0!==ei?ei:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},s=sP(),l=sD().getHighWaterMark,c=sR.codes,d=c.ERR_INVALID_ARG_TYPE,u=c.ERR_METHOD_NOT_IMPLEMENTED,h=c.ERR_MULTIPLE_CALLBACK,f=c.ERR_STREAM_CANNOT_PIPE,p=c.ERR_STREAM_DESTROYED,g=c.ERR_STREAM_NULL_VALUES,m=c.ERR_STREAM_WRITE_AFTER_END,y=c.ERR_UNKNOWN_ENCODING,v=s.errorOrDestroy;function b(){}function E(n,r,i){t=t||sV(),n=n||{},"boolean"!=typeof i&&(i=r instanceof t),this.objectMode=!!n.objectMode,i&&(this.objectMode=this.objectMode||!!n.writableObjectMode),this.highWaterMark=l(this,n,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===n.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new h;if(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t)--n.pendingcb,r?(oS.nextTick(i,t),oS.nextTick(M,e,n),e._writableState.errorEmitted=!0,v(e,t)):(i(t),e._writableState.errorEmitted=!0,v(e,t),M(e,n));else{var o=x(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||S(e,n),r?oS.nextTick(_,e,n,o,i):_(e,n,o,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==n.emitClose,this.autoDestroy=!!n.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function w(e){var r=this instanceof(t=t||sV());if(!r&&!n.call(w,this))return new w(e);this._writableState=new E(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),i.call(this)}function C(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new p("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,n,r){n||0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain")),t.pendingcb--,r(),M(e,t)}function S(t,n){n.bufferProcessing=!0;var r=n.bufferedRequest;if(t._writev&&r&&r.next){var i=Array(n.bufferedRequestCount),o=n.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)i[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;
5i.allBuffers=s,C(t,n,!0,n.length,i,"",o.finish),n.pendingcb++,n.lastBufferedRequest=null,o.next?(n.corkedRequestsFree=o.next,o.next=null):n.corkedRequestsFree=new e(n),n.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,d=r.callback;if(C(t,n,!1,n.objectMode?1:l.length,l,c,d),r=r.next,n.bufferedRequestCount--,n.writing)break}null===r&&(n.lastBufferedRequest=null)}n.bufferedRequest=r,n.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(n){t.pendingcb--,n&&v(e,n),t.prefinished=!0,e.emit("prefinish"),M(e,t)})}function M(e,t){var n=x(t);if(n&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,oS.nextTick(k,e,t))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}return sz(w,i),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(n=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(e){return!!n.call(this,e)||this===w&&e&&e._writableState instanceof E}})):n=function(e){return e instanceof this},w.prototype.pipe=function(){v(this,new f)},w.prototype.write=function(e,t,n){var r,i,s,l,c,u,h,f=this._writableState,p=!1,y=!f.objectMode&&(h=e,o.isBuffer(h)||h instanceof a);return y&&!o.isBuffer(e)&&(r=e,e=o.from(r)),"function"==typeof t&&(n=t,t=null),y?t="buffer":t||(t=f.defaultEncoding),"function"!=typeof n&&(n=b),f.ending?(i=n,v(this,s=new m),oS.nextTick(i,s)):(y||(l=e,c=n,null===l?u=new g:"string"==typeof l||f.objectMode||(u=new d("chunk",["string","Buffer"],l)),!u||(v(this,u),oS.nextTick(c,u),0)))&&(f.pendingcb++,p=function(e,t,n,r,i,a){if(!n){var s,l,c=(s=r,l=i,t.objectMode||!1===t.decodeStrings||"string"!=typeof s||(s=o.from(s,l)),s);r!==c&&(n=!0,i="buffer",r=c)}var d=t.objectMode?1:r.length;t.length+=d;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var h=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},h?h.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,d,r,i,a);return u}(this,f,y,e,t,n)),p},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||S(this,e))},w.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new y(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(e,t,n){n(new u("_write()"))},w.prototype._writev=null,w.prototype.end=function(e,t,n){var r,i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||(r=n,i.ending=!0,M(this,i),r&&(i.finished?oS.nextTick(r):this.once("finish",r)),i.ended=!0,this.writable=!1),this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),w.prototype.destroy=s.destroy,w.prototype._undestroy=s.undestroy,w.prototype._destroy=function(e,t){t(e)},sj}function sV(){if(sH)return sF;sH=1;var e=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};sF=a;var t=s7(),n=sq();sz(a,t);for(var r=e(n.prototype),i=0;i<r.length;i++){var o=r[i];a.prototype[o]||(a.prototype[o]=n.prototype[o])}function a(e){if(!(this instanceof a))return new a(e);t.call(this,e),n.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||oS.nextTick(l,this)}function l(e){e.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),sF}var sW=L.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function sG(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!sW(e))throw Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=sY;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=sJ;break;default:return void(this.write=sZ)}this.charBuffer=new L(6),this.charReceived=0,this.charLength=0}function sZ(e){return e.toString(this.encoding)}function sY(e){this.charReceived=e.length%2,this.charLength=2*!!this.charReceived}function sJ(e){this.charReceived=e.length%3,this.charLength=3*!!this.charReceived}sG.prototype.write=function(e){for(var t,n="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!((t=(n=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCo
5deAt(n.length-1))>=55296&&t<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return n;break}this.charLength+=this.surrogateSize,n=""}this.detectIncompleteChar(e);var i=e.length;if(this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),i=(n+=e.toString(this.encoding,0,i)).length-1,(t=n.charCodeAt(i))>=55296&&t<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),n.substring(0,i)}return n},sG.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},sG.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t};var sX=ea(Object.freeze({__proto__:null,StringDecoder:sG})),sQ=sR.codes.ERR_STREAM_PREMATURE_CLOSE;function s0(){}var s1,s2,s3,s5,s8,s4,s6=function e(t,n,r){if("function"==typeof n)return e(t,null,n);n||(n={}),i=r||s0,o=!1,r=function(){if(!o){o=!0;for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];i.apply(this,t)}};var i,o,a=n.readable||!1!==n.readable&&t.readable,s=n.writable||!1!==n.writable&&t.writable,l=function(){t.writable||d()},c=t._writableState&&t._writableState.finished,d=function(){s=!1,c=!0,a||r.call(t)},u=t._readableState&&t._readableState.endEmitted,h=function(){a=!1,u=!0,s||r.call(t)},f=function(e){r.call(t,e)},p=function(){var e;return a&&!u?(t._readableState&&t._readableState.ended||(e=new sQ),r.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new sQ),r.call(t,e)):void 0},g=function(){t.req.on("finish",d)};return t.setHeader&&"function"==typeof t.abort?(t.on("complete",d),t.on("abort",p),t.req?g():t.on("request",g)):s&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",h),t.on("finish",d),!1!==n.error&&t.on("error",f),t.on("close",p),function(){t.removeListener("complete",d),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",d),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",d),t.removeListener("end",h),t.removeListener("error",f),t.removeListener("close",p)}};function s7(){if(s4)return s8;s4=1,s8=E,E.ReadableState=b,at.EventEmitter;var e=function(e,t){return e.listeners(t).length},t=aG(),n=aY.Buffer,r=(void 0!==ei?ei:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},i,o,a,s,l=sL&&sL.debuglog?sL.debuglog("stream"):function(){},c=function(){if(sk)return sx;function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach(function(e){var r,o,a;r=t,o=e,a=i[e],(o=n(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function n(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}sk=1;var r=aY.Buffer,i=sL.inspect,o=i&&i.custom||"inspect";return sx=function(){var e;function a(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),this.head=null,this.tail=null,this.length=0}return e=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return r.alloc(0);for(var t,n,i=r.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,n=a,r.prototype.copy.call(t,i,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=r.allocUnsafe(e),n=this.head,i=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0==(e-=a)){a===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++i}return this.length-=i,t}},{key:o,value:function(e,n){return i(this,t(t({},n),{},{depth:0,customInspect:!1}))}}],function(e,t){for(var r=0;r<t.length;r++){var i=t[r];
5i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}(a.prototype,e),Object.defineProperty(a,"prototype",{writable:!1}),a}()}(),d=sP(),u=sD().getHighWaterMark,h=sR.codes,f=h.ERR_INVALID_ARG_TYPE,p=h.ERR_STREAM_PUSH_AFTER_EOF,g=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;sz(E,t);var y=d.errorOrDestroy,v=["error","close","destroy","pause","resume"];function b(e,t,n){i=i||sV(),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=u(this,e,"readableHighWaterMark",n),this.buffer=new c,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=sX.StringDecoder),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function E(e){if(i=i||sV(),!(this instanceof E))return new E(e);var n=this instanceof i;this._readableState=new b(e,this,n),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),t.call(this)}function w(e,t,i,o,a){l("readableAddChunk",t);var s,c,d,u,h,g=e._readableState;if(null===t)g.reading=!1,function(e,t){if(l("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?S(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,x(e)))}}(e,g);else{if(a||(s=g,c=t,n.isBuffer(c)||c instanceof r||"string"==typeof c||void 0===c||s.objectMode||(d=new f("chunk",["string","Buffer","Uint8Array"],c)),h=d),h)y(e,h);else if(g.objectMode||t&&t.length>0)if("string"==typeof t||g.objectMode||Object.getPrototypeOf(t)===n.prototype||(u=t,t=n.from(u)),o)g.endEmitted?y(e,new m):C(e,g,t,!0);else if(g.ended)y(e,new p);else{if(g.destroyed)return!1;g.reading=!1,g.decoder&&!i?(t=g.decoder.write(t),g.objectMode||0!==t.length?C(e,g,t,!1):k(e,g)):C(e,g,t,!1)}else o||(g.reading=!1,k(e,g))}return!g.ended&&(g.length<g.highWaterMark||0===g.length)}function C(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&S(e)),k(e,t)}function _(e,t){var n;return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&((n=e)>=0x40000000?n=0x40000000:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),t.highWaterMark=n),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;l("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,oS.nextTick(x,e))}function x(e){var t=e._readableState;l("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,I(e)}function k(e,t){t.readingMore||(t.readingMore=!0,oS.nextTick(M,e,t))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(l("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function A(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){l("readable nexttick read 0"),e.read(0)}function P(e,t){l("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),I(e),t.flowing&&!t.reading&&e.read(0)}function I(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){var n;return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n)}function R(e){var t=e._readableState;l("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,oS.nextTick(T,t,e))}function T(e,t){if(l("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function $(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return -1}return Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=d.destroy,E.prototype._undestroy=d.undestroy,E.prototype._destroy=function(e,t){t(e)},E.prototype.push=function(e,t){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=n.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},E.prototype.unshift=function(e){return w(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(e){o||(o=sX.StringDecoder);var t=new o(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;
vendor: 2,616 bytes, line 5
5for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},E.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):S(this),null;if(0===(e=_(e,t))&&t.ended)return 0===t.length&&R(this),null;var r,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=_(n,t))),null===(r=e>0?O(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&R(this)),null!==r&&this.emit("data",r),r},E.prototype._read=function(e){y(this,new g("_read()"))},E.prototype.pipe=function(t,n){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,l("pipe count=%d opts=%j",i.pipesCount,n);var o=n&&!1===n.end||t===oS.stdout||t===oS.stderr?p:a;function a(){l("onend"),t.end()}i.endEmitted?oS.nextTick(o):r.once("end",o),t.on("unpipe",function e(n,o){l("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,l("cleanup"),t.removeListener("close",h),t.removeListener("finish",f),t.removeListener("drain",s),t.removeListener("error",u),t.removeListener("unpipe",e),r.removeListener("end",a),r.removeListener("end",p),r.removeListener("data",d),c=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&s())});var s=function(){var t=r._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e(r,"data")&&(t.flowing=!0,I(r))};t.on("drain",s);var c=!1;function d(e){l("ondata");var n=t.write(e);l("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==$(i.pipes,t))&&!c&&(l("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function u(n){l("onerror",n),p(),t.removeListener("error",u),0===e(t,"error")&&y(t,n)}function h(){t.removeListener("finish",f),p()}function f(){l("onfinish"),t.removeListener("close",h),p()}function p(){l("unpipe"),r.unpipe(t)}return r.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prepe
vendor: 4,554 bytes, line 5
5ndListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(t,"error",u),t.once("close",h),t.once("finish",f),t.emit("pipe",r),i.flowing||(l("pipe resume"),r.resume()),t},E.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=$(t.pipes,e);return -1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},E.prototype.on=function(e,n){var r=t.prototype.on.call(this,e,n),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,l("on readable",i.length,i.reading),i.length?S(this):i.reading||oS.nextTick(L,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,n){var r=t.prototype.removeListener.call(this,e,n);return"readable"===e&&oS.nextTick(A,this),r},E.prototype.removeAllListeners=function(e){var n=t.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||oS.nextTick(A,this),n},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!e.readableListening,e.resumeScheduled||(e.resumeScheduled=!0,oS.nextTick(P,this,e))),e.paused=!1,this},E.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(l("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){l("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<v.length;o++)e.on(v[o],this.emit.bind(this,v[o]));return this._read=function(t){l("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return void 0===a&&(a=function(){if(s2)return s1;function e(e,t,n){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}s2=1;var t,n=Symbol("lastResolve"),r=Symbol("lastReject"),i=Symbol("error"),o=Symbol("ended"),a=Symbol("lastPromise"),s=Symbol("handlePromise"),l=Symbol("stream");function c(e,t){return{value:e,done:t}}function d(e){var t=e[n];if(null!==t){var i=e[l].read();null!==i&&(e[a]=null,e[n]=null,e[r]=null,t(c(i,!1)))}}function u(e){oS.nextTick(d,e)}var h=Object.getPrototypeOf(function(){}),f=Object.setPrototypeOf((e(t={get stream(){return this[l]},next:function(){var e,t=this,n=this[i];if(null!==n)return Promise.reject(n);if(this[o])return Promise.resolve(c(void 0,!0));if(this[l].destroyed)return new Promise(function(e,n){oS.nextTick(function(){t[i]?n(t[i]):e(c(void 0,!0))})});var r,d=this[a];if(d)r=new Promise((e=this,function(t,n){d.then(function(){e[o]?t(c(void 0,!0)):e[s](t,n)},n)}));else{var u=this[l].read();if(null!==u)return Promise.resolve(c(u,!1));r=new Promise(this[s])}return this[a]=r,r}},Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var e=this;return new Promise(function(t,n){e[l].destroy(null,function(e){e?n(e):t(c(void 0,!0))})})}),t),h);return s1=function(t){var d,h=Object.create(f,(e(d={},l,{value:t,writable:!0}),e(d,n,{value:null,writable:!0}),e(d,r,{value:null,writable:!0}),e(d,i,{value:null,writable:!0}),e(d,o,{value:t._readableState.endEmitted,writable:!0}),e(d,s,{value:function(e,t){var i=h[l].read();i?(h[a]=null,h[n]=null,h[r]=null,e(c(i,!1))):(h[n]=e,h[r]=t)},writable:!0}),d));
5return h[a]=null,s6(t,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=h[r];return null!==t&&(h[a]=null,h[n]=null,h[r]=null,t(e)),void(h[i]=e)}var s=h[n];null!==s&&(h[a]=null,h[n]=null,h[r]=null,s(c(void 0,!0))),h[o]=!0}),t.on("readable",u.bind(null,h)),h}}()),a(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=O,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(E.from=function(e,t){return void 0===s&&(s=s5?s3:(s5=1,s3=function(){throw Error("Readable.from is not available in the browser")})),s(E,e,t)}),s8}var s9=sR.codes,le=s9.ERR_METHOD_NOT_IMPLEMENTED,lt=s9.ERR_MULTIPLE_CALLBACK,ln=s9.ERR_TRANSFORM_ALREADY_TRANSFORMING,lr=s9.ERR_TRANSFORM_WITH_LENGTH_0,li=sV();function lo(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new lt);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function la(e){if(!(this instanceof la))return new la(e);li.call(this,e),this._transformState={afterTransform:lo.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",ls)}function ls(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?ll(this,null,null):this._flush(function(t,n){ll(e,t,n)})}function ll(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new lr;if(e._transformState.transforming)throw new ln;return e.push(null)}function lc(e){if(!(this instanceof lc))return new lc(e);la.call(this,e)}sz(la,li),la.prototype.push=function(e,t){return this._transformState.needTransform=!1,li.prototype.push.call(this,e,t)},la.prototype._transform=function(e,t,n){n(new le("_transform()"))},la.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},la.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},la.prototype._destroy=function(e,t){li.prototype._destroy.call(this,e,function(e){t(e)})},sz(lc,la),lc.prototype._transform=function(e,t,n){n(null,e)};var ld=sR.codes,lu=ld.ERR_MISSING_ARGS,lh=ld.ERR_STREAM_DESTROYED;function lf(e){if(e)throw e}function lp(e){e()}function lg(e,t){return e.pipe(t)}lR=aW.exports,(lR=aW.exports=s7()).Stream=lR,lR.Readable=lR,lR.Writable=sq(),lR.Duplex=sV(),lR.Transform=la,lR.PassThrough=lc,lR.finished=s6,lR.pipeline=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i,o=(r=t).length?"function"!=typeof r[r.length-1]?lf:r.pop():lf;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new lu("streams");var a=t.map(function(e,n){var r,s,l,c,d,u,h=n<t.length-1;return r=n>0,l=s=function(e){i||(i=e),e&&a.forEach(lp),h||(a.forEach(lp),o(i))},c=!1,s=function(){c||(c=!0,l.apply(void 0,arguments))},d=!1,e.on("close",function(){d=!0}),void 0===lO&&(lO=s6),lO(e,{readable:h,writable:r},function(e){if(e)return s(e);d=!0,s()}),u=!1,function(t){if(!d&&!u)return u=!0,e.setHeader&&"function"==typeof e.abort?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new lh("pipe"))}});return t.reduce(lg)};var lm=aW.exports,ly={},lv={exports:{}},lb=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw TypeError("need wrapper function");return Object.keys(t).forEach(function(e){r[e]=t[e]}),r;function r(){for(var e=Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];var r=t.apply(this,e),i=e[e.length-1];
5return"function"==typeof r&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}};function lE(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function lw(e){var t=function(){if(t.called)throw Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)};return t.onceError=(e.name||"Function wrapped with `once`")+" shouldn't be called more than once",t.called=!1,t}lv.exports=lb(lE),lv.exports.strict=lb(lw),lE.proto=lE(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return lE(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return lw(this)},configurable:!0})});var lC=lv.exports,l_={};Object.defineProperty(l_,"__esModule",{value:!0}),l_.Substream=void 0;let lS=lm;class lx extends lS.Duplex{constructor({parent:e,name:t}){super({objectMode:!0}),this._parent=e,this._name=t}_read(){}_write(e,t,n){this._parent.push({name:this._name,data:e}),n()}}l_.Substream=lx;var lk=ei&&ei.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ly,"__esModule",{value:!0}),ly.ObjectMultiplex=void 0;let lM=lm,lA=lk(lC),lL=Symbol("IGNORE_SUBSTREAM");ly.ObjectMultiplex=class extends lM.Duplex{constructor(e={}){super(Object.assign(Object.assign({},e),{objectMode:!0})),this._substreams={}}createStream(e){var t;let n;if(this.destroyed)throw Error(`ObjectMultiplex - parent stream for name "${e}" already destroyed`);if(this._readableState.ended||this._writableState.ended)throw Error(`ObjectMultiplex - parent stream for name "${e}" already ended`);if(!e)throw Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw Error(`ObjectMultiplex - Substream for name "${e}" already exists`);let r=new l_.Substream({parent:this,name:e});return this._substreams[e]=r,t=e=>r.destroy(e||void 0),n=(0,lA.default)(t),(0,lM.finished)(this,{readable:!1},n),(0,lM.finished)(this,{writable:!1},n),r}ignoreStream(e){if(!e)throw Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw Error(`ObjectMultiplex - Substream for name "${e}" already exists`);this._substreams[e]=lL}_read(){}_write(e,t,n){let{name:r,data:i}=e;if(!r)return console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),n();let o=this._substreams[r];return o?o!==lL&&o.push(i):console.warn(`ObjectMultiplex - orphaned data for stream "${r}"`),n()}};var lP=eo(ly.ObjectMultiplex);let lI=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;lI.writable=e=>lI(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState,lI.readable=e=>lI(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState,lI.duplex=e=>lI.writable(e)&&lI.readable(e),lI.transform=e=>lI.duplex(e)&&"function"==typeof e._transform;var lO,lR,lT,l$=class extends aV{constructor(e,{jsonRpcStreamName:t,logger:n=console,maxEventListeners:r=100,rpcMiddleware:i=[]}){if(super({logger:n,maxEventListeners:r,rpcMiddleware:i}),!lI.duplex(e))throw Error(ir());this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this);const o=new lP;lm.pipeline(e,o,e,this._handleStreamDisconnect.bind(this,"MetaMask")),this._jsonRpcConnection=function(e={}){let t={},n=new lm.Duplex({objectMode:!0,read:()=>{},write:function(i,o,a){let s=null;try{i.id?function(e){let{id:n}=e;if(null===n)return;let r=t[n];if(!r)return console.warn(`StreamMiddleware - Unknown response id "${n}"`);delete t[n],Object.assign(r.res,e),setTimeout(r.end)}(i):(e?.retryOnMessage&&i.method===e.retryOnMessage&&Object.values(t).forEach(({req:e,retryCount:r=0})=>{var i;if(!e.id)return;if(r>=3)throw Error(`StreamMiddleware - Retry limit exceeded for request id "${e.id}"`);let o=t[e.id];o&&(o.retryCount=r+1),i=e,n.push(i)}),r.emit("notification",i))}catch(e){s=e}a(s)}}),r=new aS;return{events:r,middleware:(e,r,i,o)=>{var a;t[e.id]={req:e,res:r,next:i,end:o},a=e,n.push(a)},stream:n}}({retryOnMessage:"METAMASK_EXTENSION_CONNECT_CAN_RETRY"}),lm.pipeline(this._jsonRpcConnection.stream,o.createStream(t),this._jsonRpcConnection.stream,this._handleStreamDisconnect.bind(this,"MetaMask RpcProvider")),this._rpcEngine.push(this._jsonRpcConnection.middleware),this._jsonRpcConnection.events.on("notification",t=>{let{method:n,params:r}=t;"metamask_accountsChanged"===n?this._handleAccountsChanged(r):"metamask_unlockStateChanged"===n?this._handleUnlockStateChanged(r):"metamask_chainChanged"===n?this._handleChainChanged(r):aM.includes(n)?this.emit
5("message",{type:n,data:r}):"METAMASK_STREAM_FAILURE"===n&&e.destroy(Error(r9()))})}async _initializeStateAsync(){let e;try{e=await this.request({method:"metamask_getProviderState"})}catch(e){this._log.error("MetaMask: Failed to get initial state. Please report this bug.",e)}this._initializeState(e)}_handleStreamDisconnect(e,t){let n=`MetaMask: Lost connection to "${e}".`;t?.stack&&(n+=`
6${t.stack}`),this._log.warn(n),this.listenerCount("error")>0&&this.emit("error",n),this._handleDisconnect(!1,t?t.message:void 0)}_handleChainChanged({chainId:e,networkVersion:t}={}){aL(e)&&t&&"string"==typeof t?"loading"===t?this._handleDisconnect(!0):super._handleChainChanged({chainId:e}):this._log.error(ii(),{chainId:e,networkVersion:t})}},lN=class extends l${constructor(e,{jsonRpcStreamName:t="metamask-provider",logger:n=console,maxEventListeners:r=100,shouldSendMetadata:i}={}){if(super(e,{jsonRpcStreamName:t,logger:n,maxEventListeners:r,rpcMiddleware:((e=console)=>{var t;let n;return[(e,t,n,r)=>{let i=e.id,o=iv=(iv+1)%0xffffffff;e.id=o,t.id=o,n(n=>{e.id=i,t.id=i,n()})},(t=e,(e,n,r)=>{"string"==typeof e.method&&e.method||(n.error=o2(-32600,{message:"The request 'method' must be a non-empty string.",data:e})),r(e=>{let{error:r}=n;return r&&t.error(`MetaMask - RPC Error: ${r.message}`,r),e()})}),(n={ethDecryptDeprecation:!1,ethGetEncryptionPublicKeyDeprecation:!1,walletWatchAssetNFTExperimental:!1},(t,r,i)=>{n.ethDecryptDeprecation||"eth_decrypt"!==t.method?n.ethGetEncryptionPublicKeyDeprecation||"eth_getEncryptionPublicKey"!==t.method?!n.walletWatchAssetNFTExperimental&&"wallet_watchAsset"===t.method&&["ERC721","ERC1155"].includes(t.params?.type||"")&&(e.warn(im.walletWatchAssetNFTExperimental),n.walletWatchAssetNFTExperimental=!0):(e.warn(im.ethGetEncryptionPublicKeyDeprecation),n.ethGetEncryptionPublicKeyDeprecation=!0):(e.warn(im.ethDecryptDeprecation),n.ethDecryptDeprecation=!0),i()})]})(n)}),this._sentWarnings={chainId:!1,networkVersion:!1,selectedAddress:!1,enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},aN(this,lT,void 0),this._initializeStateAsync(),aD(this,lT,null),this.isMetaMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._metamask=this._getExperimentalApi(),this._jsonRpcConnection.events.on("notification",e=>{let{method:t}=e;aM.includes(t)&&(this.emit("data",e),this.emit("notification",e.params.result))}),i)if("complete"===document.readyState)aI(this._rpcEngine,this._log);else{const e=()=>{aI(this._rpcEngine,this._log),window.removeEventListener("DOMContentLoaded",e)};window.addEventListener("DOMContentLoaded",e)}}get chainId(){return this._sentWarnings.chainId||(this._log.warn(ic),this._sentWarnings.chainId=!0),super.chainId}get networkVersion(){return this._sentWarnings.networkVersion||(this._log.warn(id),this._sentWarnings.networkVersion=!0),a$(this,lT)}get selectedAddress(){return this._sentWarnings.selectedAddress||(this._log.warn(iu),this._sentWarnings.selectedAddress=!0),super.selectedAddress}sendAsync(e,t){this._rpcRequest(e,t)}addListener(e,t){return this._warnOfDeprecation(e),super.addListener(e,t)}on(e,t){return this._warnOfDeprecation(e),super.on(e,t)}once(e,t){return this._warnOfDeprecation(e),super.once(e,t)}prependListener(e,t){return this._warnOfDeprecation(e),super.prependListener(e,t)}prependOnceListener(e,t){return this._warnOfDeprecation(e),super.prependOnceListener(e,t)}_handleDisconnect(e,t){super._handleDisconnect(e,t),a$(this,lT)&&!e&&aD(this,lT,null)}_warnOfDeprecation(e){!1===this._sentWarnings?.events[e]&&(this._log.warn(ig[e]),this._sentWarnings.events[e]=!0)}async enable(){return this._sentWarnings.enable||(this._log.warn(ih),this._sentWarnings.enable=!0),new Promise((e,t)=>{try{this._rpcRequest({method:"eth_requestAccounts",params:[]},aA(e,t))}catch(e){t(e)}})}send(e,t){return this._sentWarnings.send||(this._log.warn(ip),this._sentWarnings.send=!0),"string"!=typeof e||t&&!Array.isArray(t)?e&&"object"==typeof e&&"function"==typeof t?this._rpcRequest(e,t):this._sendSync(e):new Promise((n,r)=>{try{this._rpcRequest({method:e,params:t},aA(n,r,!1))}catch(e){r(e)}})}_sendSync(e){let t;switch(e.method){case"eth_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":t=this.selectedAddress??null;break;case"eth_uninstallFilter":this._rpcRequest(e,aP),t=!0;break;case"net_version":t=a$(this,lT)??null;break;default:throw Error(it(e.method))}return{id:e.id,jsonrpc:e.jsonrpc,result:t}}_getExperimentalApi(){return new Proxy({isUnlocked:async()=>(this._state.initialized||await new Promise(e=>{this.on("_initialized",()=>e())}),this._state.isUnlocked),requestBatch:async e=>{if(!Array.isArray(e))throw o2(-32600,{message:"Batch requests must be made with an array of request objects.",data:e});return new Promise((t,n)=>{this._rpcRequest(e,aA(t,n))})}},{get:(e,t,...n)=>(this._sentWarnings.experimentalMethods||(this._log.warn(iy),this._sentWarnings.experimentalMethods=!0),Reflect.get(e,t,...n))})}_handleChainChanged({chainId:e,networkVersion:t}={}){super._handleChainChanged({chainId:e,networkVersion:t}
6),this._state.isConnected&&t!==a$(this,lT)&&(aD(this,lT,t),this._state.initialized&&this.emit("networkChanged",a$(this,lT)))}};lT=new WeakMap;let lD=l()("MM_SDK");lD.color="#FFAC1C";var lB={},lK={};Object.defineProperty(lK,"__esModule",{value:!0}),lK.EthereumProviderError=lK.EthereumRpcError=void 0;class lj extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}serialize(){let e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return oG.default(this.serialize(),lU,2)}}function lU(e,t){if("[Circular]"!==t)return t}lK.EthereumRpcError=lj,lK.EthereumProviderError=class extends lj{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}};var lF={},lH={};Object.defineProperty(lH,"__esModule",{value:!0}),lH.errorValues=lH.errorCodes=void 0,lH.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},lH.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;let t=lH.errorCodes.rpc.internal,n={code:t,message:r(t)};function r(t,n="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(t)){var i;let n=t.toString();if(a(lH.errorValues,n))return lH.errorValues[n].message;if((i=t)>=-32099&&i<=-32e3)return e.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function i(e){var t;if(!Number.isInteger(e))return!1;let n=e.toString();return!!lH.errorValues[n]||!!((t=e)>=-32099&&t<=-32e3)}function o(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=r,e.isValidCode=i,e.serializeError=function(e,{fallbackError:t=n,shouldIncludeStack:s=!1}={}){if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw Error("Must provide fallback error with integer number code and string message.");if(e instanceof lK.EthereumRpcError)return e.serialize();let l={};if(e&&"object"==typeof e&&!Array.isArray(e)&&a(e,"code")&&i(e.code))l.code=e.code,e.message&&"string"==typeof e.message?(l.message=e.message,a(e,"data")&&(l.data=e.data)):(l.message=r(l.code),l.data={originalError:o(e)});else{l.code=t.code;let n=null==e?void 0:e.message;l.message=n&&"string"==typeof n?n:t.message,l.data={originalError:o(e)}}let c=null==e?void 0:e.stack;return s&&e&&c&&"string"==typeof c&&(l.stack=c),l}}(lF);var lz={};function lq(e,t){let[n,r]=lW(t);return new lK.EthereumRpcError(e,n||lF.getMessageFromCode(e),r)}function lV(e,t){let[n,r]=lW(t);return new lK.EthereumProviderError(e,n||lF.getMessageFromCode(e),r)}function lW(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:n}=e;
6if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t||void 0,n]}}return[]}Object.defineProperty(lz,"__esModule",{value:!0}),lz.ethErrors=void 0,lz.ethErrors={rpc:{parse:e=>lq(lH.errorCodes.rpc.parse,e),invalidRequest:e=>lq(lH.errorCodes.rpc.invalidRequest,e),invalidParams:e=>lq(lH.errorCodes.rpc.invalidParams,e),methodNotFound:e=>lq(lH.errorCodes.rpc.methodNotFound,e),internal:e=>lq(lH.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code <= -32005');return lq(t,e)},invalidInput:e=>lq(lH.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>lq(lH.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>lq(lH.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>lq(lH.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>lq(lH.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>lq(lH.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>lV(lH.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>lV(lH.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>lV(lH.errorCodes.provider.unsupportedMethod,e),disconnected:e=>lV(lH.errorCodes.provider.disconnected,e),chainDisconnected:e=>lV(lH.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:n,data:r}=e;if(!n||"string"!=typeof n)throw Error('"message" must be a nonempty string');return new lK.EthereumProviderError(t,n,r)}}},Object.defineProperty(lB,"__esModule",{value:!0}),lB.getMessageFromCode=lB.serializeError=lB.EthereumProviderError=lB.EthereumRpcError=lB.ethErrors=lB.errorCodes=void 0,Object.defineProperty(lB,"EthereumRpcError",{enumerable:!0,get:function(){return lK.EthereumRpcError}}),Object.defineProperty(lB,"EthereumProviderError",{enumerable:!0,get:function(){return lK.EthereumProviderError}}),Object.defineProperty(lB,"serializeError",{enumerable:!0,get:function(){return lF.serializeError}}),Object.defineProperty(lB,"getMessageFromCode",{enumerable:!0,get:function(){return lF.getMessageFromCode}}),Object.defineProperty(lB,"ethErrors",{enumerable:!0,get:function(){return lz.ethErrors}}),Object.defineProperty(lB,"errorCodes",{enumerable:!0,get:function(){return lH.errorCodes}});var lG={exports:{}};lG.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18);t.default=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";
6case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),a=Math.max(i,o),s=0,l=e.map([t,n],function(t){var n=a-e.getVersionPrecision(t),r=t+Array(n+1).join(".0");return e.map(r.split("."),function(e){return Array(20-e.length).join("0")+e}).reverse()});for(r&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===s)return 0;a-=1}else if(l[0][a]<l[1][a])return -1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(i));for(t=0,n=i.length;t<n;t+=1)!function(){var n=i[t];"object"==typeof n&&null!==n&&Object.keys(n).forEach(function(t){e[t]=n[t]})}();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}(),e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},o=n(18);t.default=function(){function e(){}return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}]),e}(),e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=l(n(92)),i=l(n(93)),o=l(n(94)),a=l(n(95)),s=l(n(17));
vendor: 14,751 bytes, line 6
6function l(e){return e&&e.__esModule?e:{default:e}}t.default=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(r.default,function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some(function(t){return e.test(t)});throw Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some(function(t){return e.test(t)});throw Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(o.default,function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some(function(t){return e.test(t)});throw Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(a.default,function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some(function(t){return e.test(t)});throw Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},o=0;if(Object.keys(e).forEach(function(t){var a=e[t];"string"==typeof a?(i[t]=a,o+=1):"object"==typeof a&&(n[t]=a,r+=1)}),r>0){var a=Object.keys(n),l=s.default.find(a,function(e){return t.isOS(e)});if(l){var c=this.satisfies(n[l]);if(void 0!==c)return c}var d=s.default.find(a,function(e){return t.isPlatform(e)});if(d){var u=this.satisfies(n[d]);if(void 0!==u)return u}}if(o>0){var h=Object.keys(i),f=s.default.find(h,function(e){return t.isBrowser(e,!0)});if(void 0!==f)return this.compareVersion(i[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some(function(e){return t.is(e)})},e}(),e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i;t.default=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}],e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18);t.default=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);
6return{name:o.OS_MAP.PlayStation4,version:t}}}],e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18);t.default=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}],e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18);t.default=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}],e.exports=t.default}});var lZ=eo(lG.exports);let lY="provider_update",lJ="connectWithResponse",lX="connection_status",lQ="service_status";class l0{constructor({shouldSetOnWindow:e,connectionStream:t,shouldSe
6ndMetadata:n=!1,shouldShimWeb3:r,sdkInstance:i}){const o=new l3({connectionStream:t,shouldSendMetadata:n,shouldSetOnWindow:e,shouldShimWeb3:r,autoRequestAccounts:!1}),a=new Proxy(o,{deleteProperty:()=>!0});if(this.provider=a,this.sdkInstance=i,e&&"u">typeof window)try{window.ethereum=o,window.dispatchEvent(new Event("ethereum#initialized"))}catch(e){lD("[Ethereum] Unable to set global provider - window.ethereum may be read-only",e)}if(r&&"u">typeof window)try{!function(e,t=console){let n=!1,r=!1;if(!window.web3){let i="__isMetaMaskShim__",o={currentProvider:e};Object.defineProperty(o,i,{value:!0,enumerable:!0,configurable:!1,writable:!1}),o=new Proxy(o,{get:(o,a,...s)=>("currentProvider"!==a||n?"currentProvider"===a||a===i||r||(r=!0,t.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),e.request({method:"metamask_logWeb3ShimUsage"}).catch(e=>{t.debug("MetaMask: Failed to log web3 shim usage.",e)})):(n=!0,t.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")),Reflect.get(o,a,...s)),set:(...e)=>(t.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),Reflect.set(...e))}),Object.defineProperty(window,"web3",{value:o,enumerable:!1,configurable:!0,writable:!0})}}(this.provider)}catch(e){lD("[Ethereum] Unable to shim web3 - window.web3 may be read-only",e)}this.provider.on("display_uri",e=>{this.sdkInstance.emit("display_uri",e)}),this.provider.on("_initialized",()=>{let e={chainId:this.provider.getChainId(),isConnected:this.provider.isConnected(),isMetaMask:this.provider.isMetaMask,selectedAddress:this.provider.getSelectedAddress(),networkVersion:this.provider.getNetworkVersion()};this.sdkInstance.emit("initialized",e),lD("[Ethereum: constructor()] provider initialized",e)})}static init(e){var t;return lD("[Ethereum: init()] Initializing Ethereum service"),this.instance=new l0(e),null==(t=this.instance)?void 0:t.provider}static destroy(){}static getInstance(){var e;if(!(null==(e=this.instance)?void 0:e.provider))throw Error("Ethereum instance not intiialized - call Ethereum.factory first.");return this.instance}static getProvider(){var e;if(!(null==(e=this.instance)?void 0:e.provider))throw Error("Ethereum instance not intiialized - call Ethereum.factory first.");return this.instance.provider}}class l1{constructor({useDeepLink:e,preferredOpenLink:t,debug:n=!1}){this.state={platformType:void 0,useDeeplink:!1,preferredOpenLink:void 0,debug:!1},this.state.platformType=this.getPlatformType(),this.state.useDeeplink=e,this.state.preferredOpenLink=t,this.state.debug=n}openDeeplink(e,t,n){return function(e,t,n,r){let{state:i}=e;lD(`[PlatfformManager: openDeeplink()] universalLink --> ${t}`),lD(`[PlatfformManager: openDeeplink()] deepLink --> ${n}`);try{if(i.preferredOpenLink)return void i.preferredOpenLink(i.useDeeplink?n:t,r);if(lD(`[PlatfformManager: openDeeplink()] open link now useDeepLink=${i.useDeeplink} link=${i.useDeeplink?n:t}`),i.useDeeplink)"u">typeof window&&(window.location.href=n);else if("u">typeof document){let e=document.createElement("a");e.href=t,e.target="_self",e.rel="noreferrer noopener",e.click()}}catch(e){console.log("[PlatfformManager: openDeeplink()] can't open link",e)}}(this,e,t,n)}isReactNative(){var e;return this.isNotBrowser()&&"u">typeof window&&(null==window?void 0:window.navigator)&&"ReactNative"===(null==(e=window.navigator)?void 0:e.product)}isMetaMaskInstalled(){let e;return e=l0.getProvider()||(null==window?void 0:window.ethereum),lD(`[PlatfformManager: isMetaMaskInstalled()] isMetaMask=${null==e?void 0:e.isMetaMask} isConnected=${null==e?void 0:e.isConnected()}`),(null==e?void 0:e.isMetaMask)&&(null==e?void 0:e.isConnected())}isDesktopWeb(){return this.isBrowser()&&!this.isMobileWeb()}isMobile(){var e,t;let n=lZ.parse(window.navigator.userAgent);return"mobile"===(null==(e=null==n?void 0:n.platform)?void 0:e.type)||"tablet"===(null==(t=null==n?void 0:n.platform)?void 0:t.type)}isSecure(){return this.isReactNative()||this.isMobileWeb()}isMetaMaskMobileWebView(){return"u">typeof window&&!!window.ReactNativeWebView&&!!navigator.userAgent.endsWith("MetaMaskMobile")}isMobileWeb(){return this.state.platformType===ou.MobileWeb}static isNotBrowser(){var e;return"u"<typeof window||!(null==window?void 0:window.navigator)||void 0!==g&&"ReactNative"===(null==(e=null==g?void 0:g.navigator)?void 0:e.product)||"ReactNative"===(null==navigator?void 0:navigator.product)}isNotBrowser(){return l1.isNotBrowser()}static isBrowser(){return!this.isNotBrowser()}isBrowser(){return l1.isBrowser()}isNodeJS(){return this.isNotBrowser()&&!this.isReactNative()}isUseDeepLink(){return this.state.useDeeplink}getPlatformType(){return function(e){let{state:t}=e;return t.platformType?t.platformType:e.isReactNative()?ou.ReactNative:e.isNotBrowser()?ou.NonBrowser:e.isMetaMaskMobileWebView()?ou.MetaMaskMobileWebview:e.isMobile()?ou.MobileWeb:ou.DesktopWeb}(this)}}let l2=e=>p(void 0,void 0,void 0,function*(){if(l1.isBrowser()){let{StorageManagerWeb:t}=yield Promise.resolve().then(function(){return cJ});return new t(e)}return Promise.resolve({persistChannelConfig:()=>p(void 0,void 0,void 0,function*(){}),getPersistedChannelConfig:()=>p(void 0,void 0,void 0,function*(){}),persistAccounts:()=>p(void 0,void 0,void 0,function*(){}),getCachedAccounts:()=>p(void 0,void 0,void 0,function*(){return[]}
6),persistChainId:()=>p(void 0,void 0,void 0,function*(){}),getCachedChainId:()=>p(void 0,void 0,void 0,function*(){}),terminate:()=>p(void 0,void 0,void 0,function*(){})})});class l3 extends lN{constructor({connectionStream:e,shouldSendMetadata:t,autoRequestAccounts:n=!1}){super(e,{logger:console,maxEventListeners:100,shouldSendMetadata:t}),this.state={accounts:null,autoRequestAccounts:!1,providerStateRequested:!1,chainId:"",networkVersion:""},lD(`[SDKProvider: constructor()] autoRequestAccounts=${n}`),this.state.autoRequestAccounts=n}forceInitializeState(){return p(this,void 0,void 0,function*(){return lD(`[SDKProvider: forceInitializeState()] autoRequestAccounts=${this.state.autoRequestAccounts}`),this._initializeStateAsync()})}_setConnected(){lD("[SDKProvider: _setConnected()] Setting connected state"),this._state.isConnected=!0}getState(){return this._state}getSDKProviderState(){return this.state}getSelectedAddress(){var e;let{accounts:t}=this._state;return t&&0!==t.length?(null==(e=t[0])?void 0:e.toLowerCase())||"":(lD("[SDKProvider: getSelectedAddress] No accounts found"),null)}getChainId(){return this.state.chainId}getNetworkVersion(){return this.state.networkVersion}setSDKProviderState(e){this.state=Object.assign(Object.assign({},this.state),e)}handleAccountsChanged(e,t){return this._handleAccountsChanged(e,t)}handleDisconnect({terminate:e=!1}){!function({terminate:e=!1,instance:t}){let{state:n}=t;lD(`[SDKProvider: handleDisconnect()] cleaning up provider state terminate=${e}`,t),e&&(t._state.accounts=null,t._state.isUnlocked=!1,t._state.isPermanentlyDisconnected=!0,t._state.initialized=!1),t._handleAccountsChanged([]),t._state.isConnected=!1,t.emit("disconnect",lB.ethErrors.provider.disconnected()),n.providerStateRequested=!1}({terminate:e,instance:this})}_initializeStateAsync(){return p(this,void 0,void 0,function*(){return function(e){var t,n;return p(this,void 0,void 0,function*(){let r;void 0===e.state&&(e.state={accounts:null,autoRequestAccounts:!1,providerStateRequested:!1,chainId:""});let{state:i}=e;if(i.providerStateRequested)lD("[SDKProvider: initializeStateAsync()] initialization already in progress");else{let o;i.providerStateRequested=!0;let a=null,s=!1,l=!1,c=yield l2({enabled:!0});if(c){let e=yield c.getPersistedChannelConfig({});s=null!=(t=null==e?void 0:e.relayPersistence)&&t,o=yield c.getCachedChainId();let n=yield c.getCachedAccounts();n.length>0&&(a=n[0])}if(lD(`[SDKProvider: initializeStateAsync()] relayPersistence=${s}`,{relayPersistence:s,cachedChainId:o,cachedSelectedAddress:a}),s)if(o&&a)r={accounts:[a],chainId:o,isUnlocked:!1},l=!0;else try{r=yield e.request({method:"metamask_getProviderState"})}catch(t){return e._log.error("MetaMask: Failed to get initial state. Please report this bug.",t),void(i.providerStateRequested=!1)}if(0===(null==(n=null==r?void 0:r.accounts)?void 0:n.length))if(e.getSelectedAddress())r.accounts=[e.getSelectedAddress()];else{lD("[SDKProvider: initializeStateAsync()] Fetch accounts remotely.");let t=yield e.request({method:"eth_requestAccounts",params:[]});r.accounts=t}e._initializeState(r),i.providerStateRequested=!1,l&&(e._state.isConnected=!0,e.emit("connect",{chainId:null==r?void 0:r.chainId}))}})}(this)})}_initializeState(e){var t;return lD("[SDKProvider: _initializeState()]",e),t=super._initializeState.bind(this),lD("[SDKProvider: initializeState()] set state._initialized to false"),this._state.initialized=!1,t(e)}_handleChainChanged({chainId:e,networkVersion:t}={}){this.state.chainId=e,this.state.networkVersion=t,function({instance:e,chainId:t,networkVersion:n,superHandleChainChanged:r}){lD(`[SDKProvider: handleChainChanged()] chainId=${t} networkVersion=${n}`);let i=n;n||(lD("[SDKProvider: handleChainChanged()] forced network version to prevent provider error"),i="1"),e._state.isConnected=!0,e.emit("connect",{chainId:t}),r({chainId:t,networkVersion:i})}({instance:this,chainId:e,networkVersion:t,superHandleChainChanged:super._handleChainChanged.bind(this)})}}var l5,l8="0.32.0";(dm=l5||(l5={})).INPAGE="metamask-inpage",dm.CONTENT_SCRIPT="metamask-contentscript",dm.PROVIDER="metamask-provider";let l4="direct",l6="https://metamask.app.link/connect",l7="metamask://connect",l9=["io.metamask","io.metamask.flask"],ce=/(?:^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}$)|(?:^0{8}-0{4}-0{4}-0{4}-0{12}$)/u,ct="metamask_getProviderState",cn="metamask_connectSign",cr="metamask_connectWith",ci="metamask_batch",co="personal_sign",ca="wallet_requestPermissions",cs="wallet_getPermissions",cl="eth_requestAccounts",cc="eth_accounts",cd="eth_chainId",cu="eth_sendTransaction",ch={[cl]:!0,[cu]:!0,eth_signTransaction:!0,eth_sign:!0,[co]:!0,[cc
6]:!1,[cd]:!1,[co]:!0,eth_signTypedData:!0,eth_signTypedData_v3:!0,eth_signTypedData_v4:!0,[ca]:!0,[cs]:!0,wallet_watchAsset:!0,wallet_addEthereumChain:!0,wallet_switchEthereumChain:!0,[cn]:!0,[cr]:!0,personal_ecRecover:!0,[ci]:!0,metamask_open:!0},cf=Object.keys(ch).map(e=>e.toLowerCase()),cp=["eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sign"].map(e=>e.toLowerCase()),cg=".sdk-comm",cm="providerType",cy=".MMSDK_cached_address",cv=".MMSDK_cached_chainId",cb="chainChanged",cE="accountsChanged",cw="disconnect",cC="connect",c_="connected";(dy=db||(db={})).TERMINATE="terminate",dy.EXTENSION="extension",dy.INITIALIZED="initialized";let cS="u">typeof window&&window.localStorage;function cx(e){var t,n;return p(this,void 0,void 0,function*(){lD("[MetaMaskSDK: connectWithExtensionProvider()] ",e),e.sdkProvider=e.activeProvider,e.activeProvider=window.extension,window.ethereum=window.extension;try{let e=yield null==(t=window.extension)?void 0:t.request({method:"eth_requestAccounts"});lD(`[MetaMaskSDK: connectWithExtensionProvider()] accounts=${e}`)}catch(e){return void console.warn("[MetaMaskSDK: connectWithExtensionProvider()] can't request accounts error",e)}localStorage.setItem(cm,"extension"),e.extensionActive=!0,e.emit(lY,db.EXTENSION),e.options.enableAnalytics&&(null==(n=e.analytics)||n.send({event:os.SDK_USE_EXTENSION}))})}function ck(e){let t;if(void 0!==L)t=L.from(e,"utf8").toString("base64");else if("function"==typeof btoa)t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/gu,(e,t)=>String.fromCharCode(parseInt(t,16))));else{if("object"!=typeof g||!("Buffer"in g))throw Error("Unable to base64 encode: No available method.");t=g.Buffer.from(e,"utf8").toString("base64")}return t}class cM extends lm.Duplex{constructor({name:e,remote:t,deeplinkProtocol:n,platformManager:r}){super({objectMode:!0}),this.state={_name:null,remote:null,deeplinkProtocol:!1,platformManager:null},this.state._name=e,this.state.remote=t,this.state.deeplinkProtocol=n,this.state.platformManager=r,this._onMessage=this._onMessage.bind(this),this.state.remote.on(or.MESSAGE,this._onMessage)}_write(e,t,n){return p(this,void 0,void 0,function*(){return function(e,t,n,r){var i,o,a,s,l,c,d,u,h,f,g,m,y,v,b,E,w,C,_,S;return p(this,void 0,void 0,function*(){var n,p,x,k;let M,A,P,I=null==(i=e.state.remote)?void 0:i.isReady(),O=null==(o=e.state.remote)?void 0:o.isConnected(),R=null==(a=e.state.remote)?void 0:a.isPaused(),T=l0.getProvider(),$=null==(s=e.state.remote)?void 0:s.getChannelId(),N=null==(l=e.state.remote)?void 0:l.isAuthorized(),{deeplinkProtocol:D}=e.state,{method:B,data:K,triggeredInstaller:j}=(L.isBuffer(t)?(M=t.toJSON())._isBuffer=!0:M=t,A=null==(n=null==M?void 0:M.data)?void 0:n.method,P=!1,"object"==typeof(null==(p=null==M?void 0:M.data)?void 0:p.params)&&!0===(null==(k=null==(x=null==M?void 0:M.data)?void 0:x.params)?void 0:k.__triggeredInstaller)&&(P=!0,M.data.params=M.data.params.wrappedParams),{method:A,data:M,triggeredInstaller:P});if(lD(`[RCPMS: write()] method='${B}' isRemoteReady=${I} channelId=${$} isSocketConnected=${O} isRemotePaused=${R} providerConnected=${T.isConnected()}`,t),!$)return B!==ct&&lD(`[RCPMS: write()] ${B} --> channelId is undefined`),r(Error("disconnected"));lD(`[RCPMS: write()] remote.isPaused()=${null==(c=e.state.remote)?void 0:c.isPaused()} authorized=${N} ready=${I} socketConnected=${O}`,t);let U=null==(d=e.state.platformManager)?void 0:d.isSecure(),F=null!=(h=null==(u=e.state.platformManager)?void 0:u.isMobileWeb())&&h,H=null!=(g=null==(f=e.state.remote)?void 0:f.hasDeeplinkProtocol())&&g&&F&&N;try{if(!j){let t=JSON.stringify(null==K?void 0:K.data);if(t.length>1e6)return r(Error(`Message size ${t.length} exceeds maximum allowed size of 1000000 bytes`));null==(m=e.state.remote)||m.sendMessage(null==K?void 0:K.data).then(()=>{lD(`[RCPMS: _write()] ${B} sent successfully`)}).catch(e=>{lD("[RCPMS: _write()] error sending message",e)})}if(!U)return lD(`[RCPMS: _write()] unsecure platform for method ${B} -- return callback`),r();if(j)return lD("[RCPMS: _write()] prevent deeplink -- installation completed separately."),r();let t=null!=(b=null==(v=null==(y=e.state.remote)?void 0:y.getKeyInfo())?void 0:v.ecies.public)?b:"",n=encodeURI(`channelId=${$}&pubkey=${t}&comm=socket&t=d&v=2`);if(H){let t=JSON.stringify(null==K?void 0:K.data),i=null==(E=e.state.remote)?void 0:E.encrypt
6(t);if(!i)return lD("[RCPMS: _write()] error encrypting message"),r(Error("RemoteCommunicationPostMessageStream - disconnected"));n+=`&scheme=${D}&rpc=${ck(i)}`}if(!(null==(w=e.state.platformManager)?void 0:w.isMetaMaskInstalled()))return lD("[RCPMS: _write()] prevent deeplink until installation is completed."),r();ch[B]?(lD(`[RCPMS: _write()] redirect link for '${B}' socketConnected=${O} connect?${n}`),null==(C=e.state.platformManager)||C.openDeeplink(`${l6}?${n}`,`${l7}?${n}`,"_self")):(null==(_=e.state.remote)?void 0:_.isPaused())?(lD(`[RCPMS: _write()] MM is PAUSED! deeplink with connect! targetMethod=${B}`),null==(S=e.state.platformManager)||S.openDeeplink(`${l6}?redirect=true&${n}`,`${l7}?redirect=true&${n}`,"_self")):lD(`[RCPMS: _write()] method ${B} doesn't need redirect.`)}catch(e){return lD("[RCPMS: _write()] error sending message",e),r(Error("RemoteCommunicationPostMessageStream - disconnected"))}return r()})}(this,e,0,n)})}_read(){}_onMessage(e){try{if(lD("[RCPMS: onMessage()] message",e),!e||"object"!=typeof e||"object"!=typeof(null==e?void 0:e.data))return;if(!(null==e?void 0:e.name))return void lD("[RCPMS: onMessage()] ignore message without name",e);if((null==e?void 0:e.name)!==l5.PROVIDER)return void lD(`[RCPMS: onMessage()] ignore message with wrong name message=${e}`);if(L.isBuffer(e)){let t=L.from(e);this.push(t)}else this.push(e)}catch(e){lD(`[RCPMS: onMessage()] ignore message error err=${e}`)}}start(){}}let cA=1,cL=e=>new Promise(t=>{setTimeout(()=>{t(!0)},e)});class cP{constructor({serverUrl:e,enabled:t,originatorInfo:n}){this.serverURL=rq,this.serverURL=e,this.originatorInfo=n,this.enabled=null==t||t}send({event:e,params:t}){if(!this.enabled)return;let n=Object.assign(Object.assign({id:"sdk",event:e,sdkVersion:l8},this.originatorInfo),{params:t});lD(`[Analytics: send()] event: ${e}`,n),rF(n,this.serverURL).catch(e=>{lD(`[Analytics: send()] error: ${e}`)})}}function cI(e){var t,n,r;let{dappMetadata:i}=e,o=function({url:e,name:t}){var n;let r=ck(e+t);if(!localStorage)return"";let i=null!=(n=localStorage.getItem(r))?n:"";if(!i){i=(0,u.A)();try{localStorage.setItem(r,i)}catch(e){return""}}return i}({url:null!=(t=null==i?void 0:i.url)?t:"no_url",name:null!=(n=null==i?void 0:i.name)?n:"no_name"}),a=null==(r=e.platformManager)?void 0:r.getPlatformType(),s=a===ou.DesktopWeb,l=a===ou.MetaMaskMobileWebview,c="N/A";return s?c="extension":l&&(c="mobile"),{id:o,from:c}}let cO=({provider:e,sdkInstance:t})=>{if("state"in e)throw Error("INVALID EXTENSION PROVIDER");return new Proxy(e,{get:(n,r)=>"request"===r?function(e){var r,i;return p(this,void 0,void 0,function*(){lD("[wrapExtensionProvider()] Overwriting request method",e);let{method:o,params:a}=e,s=cf.includes(o.toLowerCase()),{id:l,from:c}=cI(t);if(s&&(null==(r=t.analytics)||r.send({event:os.SDK_RPC_REQUEST,params:{method:o,from:c,id:l}})),o===ci&&Array.isArray(a))return(({target:e,args:t,trackEvent:n,sdkInstance:r})=>p(void 0,void 0,void 0,function*(){var i,o;if("metamask_batch"!==t.method)throw Error("Invalid usage");let a=[];for(let n of null!=(i=null==t?void 0:t.params)?i:[]){let t=yield null==e?void 0:e.request({method:n.method,params:n.params});a.push(t)}let{id:s,from:l}=cI(r);return n&&(null==(o=r.analytics)||o.send({event:os.SDK_RPC_REQUEST_DONE,params:{method:t.method,from:l,id:s}})),a}))({target:n,args:e,trackEvent:s,sdkInstance:t});if(o.toLowerCase()===cn.toLowerCase()&&Array.isArray(a))return(({target:e,params:t})=>p(void 0,void 0,void 0,function*(){let n=yield e.request({method:cl,params:[]});if(!n.length)throw Error("SDK state invalid -- undefined accounts");return yield e.request({method:co,params:[t[0],n[0]]})}))({target:n,params:a});if(o.toLowerCase()===cr.toLowerCase()&&Array.isArray(a))return(({target:e,params:t})=>p(void 0,void 0,void 0,function*(){let[n]=t,r=n.method,i=n.params,o=yield e.request({method:cl,params:[]});if(!o.length)throw Error("SDK state invalid -- undefined accounts");return(null==r?void 0:r.toLowerCase())===co.toLowerCase()?yield e.request({method:r,params:[i[0],o[0]]}):(null==r?void 0:r.toLowerCase())===cu.toLowerCase()?yield e.request({method:r,params:[Object.assign(Object.assign({},i[0]),{from:o[0]})]}):cp.includes(r.toLowerCase())?(console.warn(`MetaMaskSDK connectWith method=${r} -- not handled by the extension -- call separately`),o):yield e.request({method:r,params:i})}))({target:n,params:a});try{return yield n.request(e)}
6finally{s&&(null==(i=t.analytics)||i.send({event:os.SDK_RPC_REQUEST_DONE,params:{method:o,from:c,id:l}}))}})}:"getChainId"===r?function(){return e.chainId}:"getNetworkVersion"===r?function(){return e.networkVersion}:"getSelectedAddress"===r?function(){return e.selectedAddress}:"isConnected"===r?function(){return e._state.isConnected}:n[r]})};(dv=dE||(dE={})).Announce="eip6963:announceProvider",dv.Request="eip6963:requestProvider";var cR="INSTALLED",cT="NOT_INSTALLED",c$="REGISTERED",cN="REGISTERING",cD="RELOADING",cB={CHROME:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",FIREFOX:"https://addons.mozilla.org/firefox/addon/ether-metamask/",DEFAULT:"https://metamask.io"},cK="REGISTRATION_IN_PROGRESS",cj="FORWARDER_ID",cU=function(){function e(t){var n=void 0===t?{}:t,r=n.forwarderOrigin,i=n.forwarderMode,o=void 0===i?e.FORWARDER_MODE.INJECT:i;this.forwarderOrigin=void 0===r?"https://fwd.metamask.io":r,this.forwarderMode=o,this.state=e.isMetaMaskInstalled()?cR:cT;var a=e._detectBrowser();this.downloadUrl=a?cB[a]:cB.DEFAULT,this._onMessage=this._onMessage.bind(this),this._onMessageFromForwarder=this._onMessageFromForwarder.bind(this),this._openForwarder=this._openForwarder.bind(this),this._openDownloadPage=this._openDownloadPage.bind(this),this.startOnboarding=this.startOnboarding.bind(this),this.stopOnboarding=this.stopOnboarding.bind(this),window.addEventListener("message",this._onMessage),o===e.FORWARDER_MODE.INJECT&&"true"===sessionStorage.getItem(cK)&&e._injectForwarder(this.forwarderOrigin)}return e.prototype._onMessage=function(e){if(e.origin===this.forwarderOrigin)return"metamask:reload"===e.data.type?this._onMessageFromForwarder(e):void console.debug("Unknown message from '"+e.origin+"' with data "+JSON.stringify(e.data))},e.prototype._onMessageUnknownStateError=function(e){throw Error("Unknown state: '"+e+"'")},e.prototype._onMessageFromForwarder=function(t){var n,r,i;return n=this,r=void 0,i=function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){var l=[o,s];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){a.label=l[1];break}if(6===l[0]&&a.label<i[1]){a.label=i[1],i=l;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(l);break}i[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:switch(this.state){case cD:return[3,1];case cT:return[3,2];case cR:return[3,3];case cN:return[3,5];case c$:return[3,6]}return[3,7];case 1:return console.debug("Ignoring message while reloading"),[3,8];case 2:return console.debug("Reloading now to register with MetaMask"),this.state=cD,location.reload(),[3,8];case 3:return console.debug("Registering with MetaMask"),this.state=cN,[4,e._register()];case 4:return n.sent(),this.state=c$,t.source.postMessage({type:"metamask:registrationCompleted"},t.origin),this.stopOnboarding(),[3,8];case 5:return console.debug("Already registering - ignoring reload message"),[3,8];case 6:return console.debug("Already registered - ignoring reload message"),[3,8];case 7:this._onMessageUnknownStateError(this.state),n.label=8;case 8:return[2]}})},new(r||(r=Promise))(function(e,t){function o(e){try{s(i.next(e))}catch(e){t(e)}}function a(e){try{s(i.throw(e))}catch(e){t(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof r?n:new r(function(e){e(n)})).then(o,a)}s((i=i.apply(n,[])).next())})},e.prototype.startOnboarding=function(){sessionStorage.setItem(cK,"true"),this._openDownloadPage(),this._openForwarder()},e.prototype.stopOnboarding=function(){"true"===sessionStorage.getItem(cK)&&(this.forwarderMode===e.FORWARDER_MODE.INJECT&&(console.debug("Removing forwarder"),e._removeForwarder()),sessionStorage.setItem(cK,"false"))},e.prototype._openForwarder=function(){this.forwarderMode===e.FORWARDER_MODE.OPEN_TAB?window.open(this.forwarderOrigin,"_blank"):e._injectForwarder(this.forwarderOrigin)},e.prototype._openDownloadPage=function(){window.open(this.downloadUrl,"_blank")},e.isMetaMaskInstalled=function(){return!!(window.ethereum&&window.ethereum.isMetaMask)},e._register=function(){return window.ethereum.request({method:"wallet_registerOnboarding"})},e._injectForwarder=function(e){var t=document.body,n=document.createElement("iframe");n.setAttribute("height","0"),n.setAttribute("width","0"),n.setAttribute("style","display: none;"),n.setAttribute("src",e),n.setAttribute("id",cj),t.insertBefore(n,t.children[0])},e._removeForwarder=function(){var e;
6null==(e=document.getElementById(cj))||e.remove()},e._detectBrowser=function(){var e=lZ.parse(window.navigator.userAgent);return"Firefox"===e.browser.name?"FIREFOX":["Chrome","Chromium"].includes(e.browser.name||"")?"CHROME":null},e.FORWARDER_MODE={INJECT:"INJECT",OPEN_TAB:"OPEN_TAB"},e}();class cF{constructor({remote:e,preferDesktop:t,platformManager:n,debug:r=!1}){this.state={isInstalling:!1,hasInstalled:!1,resendRequest:null,preferDesktop:!1,platformManager:null,remote:null,debug:!1,connectWith:void 0},this.state.remote=e,this.state.preferDesktop=t,this.state.platformManager=n,this.state.debug=r}startDesktopOnboarding(){return function(){return p(this,void 0,void 0,function*(){lD("[MetamaskInstaller: startDesktopOnboarding() starting desktop onboarding"),window.ethereum&&(window.ethereum=void 0),(new cU).startOnboarding()})}()}redirectToProperInstall(){return p(this,void 0,void 0,function*(){return function(e){var t,n;return p(this,void 0,void 0,function*(){let{state:r}=e,i=null==(t=r.platformManager)?void 0:t.getPlatformType();if(lD(`[MetamaskInstaller: redirectToProperInstall()] platform=${i}`),i===ou.MetaMaskMobileWebview)return!1;r.isInstalling=!0;try{yield null==(n=r.remote)?void 0:n.startConnection({connectWith:r.connectWith}),r.isInstalling=!1,r.hasInstalled=!0}catch(e){throw r.isInstalling=!1,e}return!0})}(this)})}checkInstallation(){return p(this,void 0,void 0,function*(){return function(e){var t;return p(this,void 0,void 0,function*(){let{state:n}=e,r=null==(t=n.platformManager)?void 0:t.isMetaMaskInstalled();return lD(`[MetamaskInstaller: checkInstallation()] isInstalled=${r}`),!!r||(yield e.redirectToProperInstall())})}(this)})}start({wait:e=!1,connectWith:t}){return p(this,void 0,void 0,function*(){this.state.connectWith=t,lD(`[MetaMaskInstaller: start()] wait=${e}`,t),yield function(e,{wait:t=!1}){return p(this,void 0,void 0,function*(){return lD(`[MetamaskInstaller: startInstaller()] wait=${t}`),t&&(yield cL(1e3)),yield e.checkInstallation()})}(this,{wait:e})})}}class cH{constructor({debug:e,sdkVersion:t}){this.containers={install:void 0,pending:void 0,select:void 0},this.defined={install:!1,pending:!1,select:!1},this.debug=null!=e&&e,this.sdkVersion=t}loadComponent(e){return p(this,void 0,void 0,function*(){if(!this.defined[e]){this.defined[e]=!0;try{let e=yield Promise.resolve().then(function(){return ue});console.log("loader",e),e.defineCustomElements()}catch(t){console.error(`Failed to load ${e} modal:`,t)}}})}renderInstallModal(e){var t;return p(this,void 0,void 0,function*(){this.debug&&console.debug("ModalLoader: renderInstallModal",e),this.containers.install=e.parentElement,yield this.loadComponent("install");let n=document.createElement("mm-install-modal");n.link=e.link,n.preferDesktop=e.preferDesktop,n.sdkVersion=null!=(t=e.sdkVersion)?t:this.sdkVersion,n.addEventListener("close",({detail:{shouldTerminate:t}})=>e.onClose(t)),n.addEventListener("startDesktopOnboarding",e.metaMaskInstaller.startDesktopOnboarding),n.addEventListener("trackAnalytics",t=>{var n;return null==(n=e.onAnalyticsEvent)?void 0:n.call(e,t.detail)}),e.parentElement.appendChild(n)})}renderSelectModal(e){var t;return p(this,void 0,void 0,function*(){this.containers.select=e.parentElement,yield this.loadComponent("select");let n=document.createElement("mm-select-modal");n.link=e.link,n.sdkVersion=null!=(t=e.sdkVersion)?t:this.sdkVersion,n.preferDesktop=e.preferDesktop,n.addEventListener("close",({detail:{shouldTerminate:t}})=>e.onClose(t)),n.addEventListener("connectWithExtension",e.connectWithExtension),e.parentElement.appendChild(n),setTimeout(()=>this.updateQRCode(e.link),100)})}renderPendingModal(e){var t;return p(this,void 0,void 0,function*(){this.containers.pending=e.parentElement,yield this.loadComponent("pending");let n=document.createElement("mm-pending-modal");n.sdkVersion=null!=(t=e.sdkVersion)?t:this.sdkVersion,n.displayOTP=e.displayOTP,n.addEventListener("close",e.onClose),n.addEventListener("updateOTPValue",({detail:{otpValue:t}})=>e.updateOTPValue(t)),e.onDisconnect&&n.addEventListener("disconnect",e.onDisconnect),e.parentElement.appendChild(n)})}updateOTPValue(e){let t=()=>{var t;let n=null==(t=this.containers.pending)?void 0:t.querySelector("mm-pending-modal");return!!n&&(n.otpCode=e,!0)};setTimeout(()=>{t()},800)}updateQRCode(e){var t,n;let r=null==(t=this.containers.install)?void 0:t.querySelector("mm-install-modal");if(r)r.link=e;else{let t=null==(n=this.containers.select)?void 0:n.querySelector("mm-select-modal");t&&(t.link=e)}}
6unmount(){Object.entries(this.containers).forEach(([e,t])=>{var n;null==(n=null==t?void 0:t.parentNode)||n.removeChild(t),this.containers[e]=void 0})}}let cz=({link:e,debug:t,installer:n,terminate:r,connectWithExtension:i,preferDesktop:o,onAnalyticsEvent:a})=>{let s=null,l=null;lD("[UI: InstallModal-web: sdkWebInstallModal()] ################## Installing Modal #################"),lD(`[UI: InstallModal-web: sdkWebInstallModal()] link=${e}`),lD(`[UI: InstallModal-web: sdkWebInstallModal()] npx uri-scheme open "${e}" --ios`),lD(`[UI: InstallModal-web: sdkWebInstallModal()] npx uri-scheme open "${e}" --android`),lD(`[UI: InstallModal-web: sdkWebInstallModal()] adb shell am start -a android.intent.action.VIEW -d "${e}"`);let c=e=>{var t;lD("[UI: InstallModal-web: sdkWebInstallModal()] installModal-web unmounting install modal -- shouldTerminate:",e,l),(null==l?void 0:l.parentNode)&&(null==(t=l.parentNode)||t.removeChild(l)),l=null,s=null,!0===e&&(null==r||r())};return{mount:r=>{(lD("[UI: InstallModal-web: sdkWebInstallModal()] installModal-web mounting install modal",l),l)?(l.style.display="block",null==s||s.updateQRCode(r)):(s=new cH({debug:t,sdkVersion:l8}),l=document.createElement("div"),document.body.appendChild(l),window.extension?s.renderSelectModal({parentElement:l,connectWithExtension:()=>{c(),null==i||i()},onClose:c,link:e,preferDesktop:null!=o&&o}).catch(e=>{console.error(e)}):s.renderInstallModal({parentElement:l,preferDesktop:null!=o&&o,link:e,metaMaskInstaller:n,onClose:c,onAnalyticsEvent:a}).catch(e=>{console.error("[UI: InstallModal-web: sdkWebInstallModal()]",e)}))},unmount:c}},cq=({onDisconnect:e,debug:t})=>{let n=null,r=null,i=()=>{lD("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web unmount",n),(null==n?void 0:n.parentNode)&&n.parentNode.removeChild(n),n=null,r=null},o=e=>{lD("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web updateOTPValue",e),r&&r.updateOTPValue(e)},a=({displayOTP:a}={displayOTP:!0})=>{lD("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web mount",n),n?n.style.display="block":(r=new cH({debug:t,sdkVersion:l8}),n=document.createElement("div"),document.body.appendChild(n),r.renderPendingModal({parentElement:n,onClose:i,onDisconnect:e,updateOTPValue:o,displayOTP:a}).catch(e=>{console.error("[UI: pendingModal-web: sdkWebPendingModal()]",e)}))};return a(),{mount:a,unmount:i,updateOTPValue:o}};function cV(e,t){var n,r,i,o;e.connector||(lD("[RemoteConnection: initializeConnector()] initialize connector"),e.connector=new r6({platformType:t.platformManager.getPlatformType(),communicationLayerPreference:t.communicationLayerPreference,transports:t.transports,dappMetadata:Object.assign(Object.assign({},t.dappMetadata),{source:t._source}),analytics:t.enableAnalytics,communicationServerUrl:t.communicationServerUrl,sdkVersion:l8,context:"dapp",ecies:t.ecies,storage:t.storage,logging:t.logging}),t.timer&&(lD("[RemoteConnection: initializeConnector()] reset background timer",t.timer),null==(r=null==(n=t.timer)?void 0:n.stopBackgroundTimer)||r.call(n),null==(o=null==(i=t.timer)?void 0:i.runBackgroundTimer)||o.call(i,()=>!1,1e4)))}function cW(e){e.listeners.forEach(({event:t,handler:n})=>{var r;null==(r=e.connector)||r.off(t,n)}),e.listeners=[]}function cG(e,t){function n(t,n){var r;null==(r=e.connector)||r.on(t,n),e.listeners.push({event:t,handler:n})}e.connector&&(cW(e),n(or.WALLET_INIT,({accounts:e,chainId:t})=>p(this,void 0,void 0,function*(){lD(`[RemoteConnection: setupListeners() => EventType.WALLET_INIT] 'wallet_init' accounts=${e} chainId=${t}`);let n=l0.getProvider();n._setConnected(),n._initializeState({accounts:e,chainId:t,isUnlocked:!1}),n.emit("chainChanged",t),n.emit("accountsChanged",e)})),n(or.AUTHORIZED,()=>p(this,void 0,void 0,function*(){var t,n,r,i;try{lD("[RemoteConnection: setupListeners() => EventType.AUTHORIZED] 'authorized' closing modals",e.pendingModal,e.installModal);let o=l0.getProvider();o._setConnected(),null==(n=null==(t=e.pendingModal)?void 0:t.unmount)||n.call(t),null==(i=null==(r=e.installModal)?void 0:r.unmount)||i.call(r,!1),e.otpAnswer=void 0,e.authorized=!0,lD("[RemoteConnection: setupListeners() => EventType.AUTHORIZED] 'authorized' provider.state",o.getState()),yield o.forceInitializeState()}catch(e){}})),n(or.TERMINATE,()=>{var t,n,r,i,o;null==(n=null==(t=e.pendingModal)?void 0:t.unmount)||n.call(t),null==(i=null==(r=e.installModal)?void 0:r.unmount)||i.call(r,!0),e.pendingModal=void 0,e.installModal=void 0,e.otpAnswer=void 0,null==(o=e.connector)||o.disconnect({terminate:!0}),e.authorized=!1,l0.getProvider().handleDisconnect({terminate:!0}),cW(e),lD("[RemoteConnection: setupListeners()] All listeners cleaned up")}))}class cZ{constructor(e){var t,n,r;this.state={connector:void 0,qrcodeLink:void 0,analytics:void 0,developerMode:!1,authorized:!1,reconnection:!1,preferDesktop:!1,deeplinkProtocol:!1,listeners:[],communicationLayerPreference:void 0,platformManager:void 0,pendingModal:void 0,installModal:void 0,otpAnswer:void 0},this.options=e;const i=!0===(null==(t=e.logging)?void 0:t.developerMode)||!0===(null==(n=e.logging)?void 0:n.sdk);this.state.developerMode=i,this.state.analytics=e.analytics,this.state.preferDesktop=null!=(r=e.preferDesktop)&&r,this.state.useDeeplink=e.sdk.options.useDeeplink,this.state.communicationLayerPreference=e.communicationLayerPreference,this.state.platformManager=e.platformManager,e.modals.install||(e.modals.install=cz),e.modals.otp||(e.modals.otp=cq)}startConnection(e){return p(this,void 0,void 0,function*(){return function(e,t,{initialCheck:n,connectWith:r}={}){var i,o,a,s,l,c,d,u,h,f,g,m,y,v,b,E,w,C,_;return p(this,void 0,void 0,function*(){try{if(cV(e,t),!e.connector)throw Error("no connector defined");cG(e);let S=l0.getProvider();e.authorized=!1,S.emit("connecting");let x=yield null==(i=e.connector)?void 0:i.originatorSessionConnect();lD(`[RemoteConnection: startConnection()] after originatorSessionConnect initialCheck=${n}`,x);let k=null!=(o=null==x?void 0:x.channelId)?o:"",M=null!=(s=null==(a=e.connector.getKeyInfo())?void 0:a.ecies.public)?s:"",A=null!=(c=null==(l=e.connector.getKeyInfo())?void 0:l.ecies.private)?c:"";
6if(n&&!x)return Promise.resolve();if(!x&&!n){let t=yield e.connector.generateChannelIdConnect();k=null!=(d=t.channelId)?d:"",M=null!=(u=t.pubKey)?u:"",A=null!=(h=t.privKey)?h:"";let n=Date.now();null==(f=e.connector.state.storageManager)||f.persistChannelConfig({channelId:k,localKey:A,lastActive:n,validUntil:n+6048e5})}if(n&&(null==x?void 0:x.channelId))return(null==(g=e.connector)?void 0:g.isConnected())||(lD(`[RemoteConnection: startConnection()] reconnecting to channel initialCheck=${n}`,x),yield null==(m=e.connector)?void 0:m.connectToChannel({channelId:k})),Promise.resolve();!x||(null==(y=e.connector)?void 0:y.isConnected())||(lD("[RemoteConnection: startConnection()] reconnecting to channel",x),yield null==(v=e.connector)?void 0:v.connectToChannel({channelId:k}));let L=(null==(b=e.platformManager)?void 0:b.isSecure())?"":"&t=q",{iconUrl:P,name:I,url:O,scheme:R}=t.dappMetadata||{},T=null==(E=e.platformManager)?void 0:E.getPlatformType(),$="N/A";"u">typeof window&&window.location&&window.location.hostname?$=window.location.hostname:void 0!==I?$=I:void 0!==O&&($=O);let N={url:null!=O?O:"",title:null!=I?I:"",icon:P,scheme:null!=R?R:"",apiVersion:l8,dappId:$||O||"N/A",platform:null!=T?T:"",source:null!=(w=t._source)?w:""},D=ck(JSON.stringify(N)),B=`channelId=${k}&v=2&comm=${null!=(C=e.communicationLayerPreference)?C:""}&pubkey=${M}${L}&originatorInfo=${D}`;if(r){B+=`&rpc=${ck(JSON.stringify(r))}`;let t=e.connector.getRPCMethodTracker();t&&(t[`${r.id}`]=Object.assign(Object.assign({},r),{id:`${r.id}`,timestamp:Date.now()}))}let K=encodeURI(B),j=`${e.useDeeplink?l7:l6}?${B}`;return e.qrcodeLink=j,e.developerMode&&lD(`[RemoteConnection: startConnection()] qrcodeLink=${K}`),S.emit("display_uri",j),(null==(_=e.platformManager)?void 0:_.isSecure())?(yield function(e,t){var n,r;return p(this,void 0,void 0,function*(){let i=`${l6}?${t}`,o=`${l7}?${t}`;null==(r=null==(n=e.platformManager)?void 0:n.openDeeplink)||r.call(n,i,o,"_self")})}(e,K),new Promise((t,n)=>{var r,i,o;(null==(r=e.connector)?void 0:r.isAuthorized())?t():(null==(i=e.connector)||i.once(or.AUTHORIZED,()=>{t()}),null==(o=e.connector)||o.once(or.REJECTED,()=>{n(or.REJECTED)}))})):function(e,t,n){return p(this,void 0,void 0,function*(){return new Promise((r,i)=>{var o,a,s,l;if(!e.connector)return void i(Error("No connector available"));lD("[RemoteConnection: connectWithModalInstaller()]",{state:e,options:t,linkParams:n});let c=`${e.useDeeplink?l7:l6}?${n}`;e.installModal=null==(a=(o=t.modals).install)?void 0:a.call(o,{link:c,preferDesktop:e.preferDesktop,installer:t.getMetaMaskInstaller(),terminate:()=>{lD("[RemoteConnection: showInstallModal() => terminate()] terminate connection"),t.sdk.terminate().catch(e=>{console.warn("[MMSDK] failed to terminate connection",e)})},debug:e.developerMode,connectWithExtension:()=>{var e;return null==(e=t.connectWithExtensionProvider)||e.call(t),!1},onAnalyticsEvent:({event:n,params:r})=>{var i,o,a;let s=Object.assign(Object.assign({},r),{sdkVersion:t.sdk.getVersion(),dappId:null==(i=t.dappMetadata)?void 0:i.name,source:t._source,url:null==(o=t.dappMetadata)?void 0:o.url});null==(a=e.analytics)||a.send({event:n,params:s})}}),null==(l=null==(s=e.installModal)?void 0:s.mount)||l.call(s,c),t.sdk.once(or.PROVIDER_UPDATE,e=>p(this,void 0,void 0,function*(){(lD("[RemoteConnection: connectWithModalInstaller()] once provider_update -- resolving startConnection promise"),e!==db.TERMINATE)?i(e):i({code:4001,message:"User rejected the request."})})),e.connector.once(or.AUTHORIZED,()=>{r()}),e.connector.once(or.REJECTED,()=>{i(or.REJECTED)}),e.connector.once(or.CLIENTS_READY,()=>p(this,void 0,void 0,function*(){lD("[RemoteConnection: connectWithModalInstaller()] once clients_ready -- resolving startConnection promise"),r()}))})})}(e,t,K)}catch(e){throw console.error("[startConnection] error",e),e}})}(this.state,this.options,e)})}initRemoteCommunication({sdkInstance:e}){var t,n,r;return p(this,void 0,void 0,function*(){let i=yield null==(n=null==(t=e.options.storage)?void 0:t.storageManager)?void 0:n.getPersistedChannelConfig();if(!this.options.ecies){let e={privateKey:null==i?void 0:i.localKey};this.options.ecies=e}cV(this.state,this.options),yield null==(r=this.getConnector())?void 0:r.initFromDappStorage(),cG(this.state,this.options)})}showActiveModal(){var e,t,n,r,i;(e=this.state).authorized?lD("[RemoteConnection: showActiveModal()] already authorized"):e.pendingModal?null==(n=(t=e.pendingModal).mount)||n.call(t):e.installModal&&(null==(i=(r=e.installModal).mount)||i.call(r,e.qrcodeLink||""))}closeModal(){var e,t,n,r;null==(t=null==(e=this.state.pendingModal)?void 0:e.unmount)||t.call(e),null==(r=null==(n=this.state.installModal)?void 0:n.unmount)||r.call(n,!1)}getUniversalLink(){if(!this.state.qrcodeLink)throw Error("connection not started. run startConnection() first.");return this.state.qrcodeLink}getChannelConfig(){var e;return null==(e=this.state.connector)?void 0:e.getChannelConfig()}
6getKeyInfo(){var e;return null==(e=this.state.connector)?void 0:e.getKeyInfo()}getConnector(){if(!this.state.connector)throw Error("invalid remote connector");return this.state.connector}getPlatformManager(){if(!this.state.platformManager)throw Error("PlatformManager not available");return this.state.platformManager}isConnected(){var e;return(null==(e=this.state.connector)?void 0:e.isReady())||!1}isAuthorized(){var e;return(null==(e=this.state.connector)?void 0:e.isAuthorized())||!1}isPaused(){var e;return null==(e=this.state.connector)?void 0:e.isPaused()}disconnect(e){var t,n,r,i;lD("[RemoteConnection: disconnect()]",e),(null==e?void 0:e.terminate)&&(l0.getProvider().handleDisconnect({terminate:!0}),null==(n=null==(t=this.state.pendingModal)?void 0:t.unmount)||n.call(t),this.state.otpAnswer=void 0),null==(r=this.state.connector)||r.disconnect(e),i=this.state,lD("[RemoteConnection: cleanupConnector()] cleaning up connector"),i.connector&&(cW(i),i.connector.disconnect({terminate:!0}).catch(e=>{lD("[RemoteConnection: cleanupConnector()] error disconnecting connector",e)}))}}class cY extends d(){constructor(e={storage:{enabled:!0},injectProvider:!0,forceInjectProvider:!1,enableAnalytics:!0,shouldShimWeb3:!0,useDeeplink:!0,extensionOnly:!0,headless:!1,dappMetadata:{name:"",url:"",iconUrl:""},_source:l4,i18nOptions:{enabled:!1}}){var t,n,r;super(),this.extensionActive=!1,this._initialized=!1,this.sdkInitPromise=void 0,this.debug=!1,this.readonlyRPCCalls=!1,this.availableLanguages=["en"],l().disable();const i=!0===(null==(t=e.logging)?void 0:t.developerMode);if(((null==(n=e.logging)?void 0:n.sdk)||i)&&l().enable("MM_SDK"),lD("[MetaMaskSDK: constructor()]: begin."),this.setMaxListeners(50),!(null==(r=e.dappMetadata)?void 0:r.url)){if("u"<typeof window||"u"<typeof document)throw Error("You must provide dAppMetadata url");e.dappMetadata=Object.assign(Object.assign({},e.dappMetadata),{url:`${window.location.protocol}//${window.location.host}`})}this.options=e,this.options._source||(e._source=l4),this.init().then(()=>{lD("[MetaMaskSDK: constructor()]: initialized successfully."),"u">typeof window&&(window.mmsdk=this)}).catch(e=>{console.error("[MetaMaskSDK: constructor()] error during initialization",e)})}init(){return p(this,void 0,void 0,function*(){return function(e){var t;return p(this,void 0,void 0,function*(){if("u">typeof window&&(null==(t=window.mmsdk)?void 0:t.isInitialized()))return lD("[MetaMaskSDK: initializeMetaMaskSDK()] already initialized"),Promise.resolve(window.mmsdk);if(e._initialized)return lD("[MetaMaskSDK: initializeMetaMaskSDK()] already initialized"),e.sdkInitPromise;if(e.sdkInitPromise)return lD("[MetaMaskSDK: initializeMetaMaskSDK()] already initializing"),e.sdkInitPromise;try{e.sdkInitPromise=function(e){var t,n,r,i,o,s,c,d,u,h,f;return p(this,void 0,void 0,function*(){let{options:g}=e;if(g.logging=null!=(t=g.logging)?t:{},g.communicationLayerPreference=null!=(n=g.communicationLayerPreference)?n:od.SOCKET,void 0!==g.enableDebug&&(l().enable("MM_SDK"),console.warn("enableDebug is removed. Please use enableAnalytics instead.")),g.enableAnalytics=null==(r=g.enableAnalytics)||r,g.injectProvider=null==(i=g.injectProvider)||i,g.shouldShimWeb3=null==(o=g.shouldShimWeb3)||o,g.extensionOnly=null==(s=g.extensionOnly)||s,g.useDeeplink=null==(c=g.useDeeplink)||c,g.storage=null!=(d=g.storage)?d:{enabled:!0},g.headless){l()("[MetaMaskSDK: performSDKInitialization()] headless mode enabled");let e=()=>{};g.modals={install:()=>({mount:e,unmount:e})},g.ui={installer:e}}let m=!0===(null==(u=g.logging)?void 0:u.developerMode);e.debug=(null==(h=g.logging)?void 0:h.sdk)||m,lD("[MetaMaskSDK: performSDKInitialization()] options",e.options);let y=Object.assign({},g.logging);m&&(y.sdk=!0,y.eciesLayer=!0,y.keyExchangeLayer=!0,y.remoteLayer=!0,y.serviceLayer=!0,y.plaintext=!0),yield function(e){var t;return p(this,void 0,void 0,function*(){let{options:n}=e;e.platformManager=new l1({useDeepLink:null!=(t=n.useDeeplink)&&t,preferredOpenLink:n.openDeeplink,debug:e.debug})})}(e),yield function(e){var t,n,r,i,o,a,s,l,c;return p(this,void 0,void 0,function*(){let{options:d}=e,u=null==(t=e.platformManager)?void 0:t.getPlatformType();e.analytics=new cP({serverUrl:null!=(n=d.communicationServerUrl)?n:rq,enabled:d.enableAnalytics,originatorInfo:{url:null!=(r=d.dappMetadata.url)?r:"",title:null!=(i=d.dappMetadata.name)?i:"",dappId:"u"<typeof window||void 0===window.location?null!=(l=null!=(a=null==(o=d.dappMetadata)?void 0:o.name)?a:null==(s=d.dappMetadata)?void 0:s.url)?l:"N/A":window.location.hostname,platform:null!=u?u:"",source:null!=(c=d._source)?c:""}})})}(e),yield function(e){var t;return p(this,void 0,void 0,function*(){let{options:n}=e;!0!==(null==(t=n.storage)?void 0:t.enabled)||n.storage.storageManager||(n.storage.storageManager=yield l2(n.storage))})}(e),yield function(e){return p(this,void 0,void 0,function*(){let{options:t}=e,n=/^(http|https):\/\/[^\s]*$/;if(t.dappMetadata){t.dappMetadata.iconUrl&&!n.test(t.dappMetadata.iconUrl)&&(console.warn("Invalid dappMetadata.iconUrl: URL must start with http:// or https://"),t.dappMetadata.iconUrl=void 0),t.dappMetadata.base64Icon&&t.dappMetadata.base64Icon.length>163400&&(console.warn("Invalid dappMetadata.base64Icon: Base64-encoded icon string length must be less than 163400 characters"),t.dappMetadata.base64Icon=void 0),t.dappMetadata.url&&!n.test(t.dappMetadata.url)&&console.warn("Invalid dappMetadata.url: URL must start with http:// or https://");let e=(()=>{let e;if("u"<typeof document)return;let t=document.getElementsByTagName("link");for(let n=0;n<t.length;n++)"icon"!==t[n].getAttribute("rel")&&"shortcut icon"!==t[n].getAttribute("rel")||(e=t[n].getAttribute("href"));return e})();if(e&&!t.dappMetadata.iconUrl&&!t.dappMetadata.base64Icon){let n=`${window.location.protocol}//${window.location.host}${e}`;t.dappMetadata.iconUrl=n}}e.dappMetadata=t.dappMetadata})}(e),yield p(void 0,void 0,void 0,function*(){let{options:t}=e,{infuraAPIKey:n}=t;if(!n)return;let r={"0x1":`https://mainnet.infura.io/v3/${n}`,"0x5":`https://goerli.infura.io/v3/${n}`,"0xaa36a7":`https://sepolia.infura.io/v3/${n}`,"0xe708":`https://linea-mainnet.infura.io/v3/${n}`,"0xe704":`https://linea-goerli.infura.io/v3/${n}`,"0x89":`https://polygon-mainnet.infura.io/v3/${n}`,"0x13881":`https://polygon-mumbai.infura.io/v3/${n}`,"0x45":`https://optimism-mainnet.infura.io/v3/${n}`,"0x1a4":`https://optimism-goerli.infura.io/v3/${n}`,"0xa4b1":`https://arbitrum-mainnet.infura.io/v3/${n}`,"0x66eed":`https://arbitrum-goerli.infura.io/v3/${n}`,"0x2a15c308d":`https://palm-mainnet.infura.io/v3/${n}`,"0x2a15c3083":`https://palm-testnet.infura.io/v3/${n}`,"0xa86a":`https://avalanche-mainnet.infura.io/v3/${n}`,"0xa869":`https://avalanche-fuji.infura.io/v3/${n}`,"0x4e454152":`https://aurora-mainnet.infura.io/v3/${n}`,"0x4e454153":`https://aurora-testnet.infura.io/v3/${n}`,"0x534e5f4d41494e":`https://starknet-mainnet.infura.io/v3/${n}`,"0x534e5f474f45524c49":`https://starknet-goerli.infura.io/v3/${n}`,"0x534e5f474f45524c4932":`https://starknet-goerli2.infura.io/v3/${n}`,"0xa4ec":`https://celo-mainnet.infura.io/v3/${n}`,"0xaef3":`https://celo-alfajores.infura.io/v3/${n}`};e.options.readonlyRPCMap?e.options.readonlyRPCMap=Object.assign(Object.assign({},e.options.readonlyRPCMap),r):e.options.readonlyRPCMap=r}),yield p(void 0,void 0,void 0,function*(){let{options:t}=e,{readonlyRPCMap:n}=t;if(n)try{lD("[MetaMaskSDK: setupReadOnlyRPCProviders()] Setting up Readonly RPC Providers",n),e.setReadOnlyRPCCalls(!0)}catch(e){throw Error("Invalid Infura Settings")}});let{metamaskBrowserExtension:v,preferExtension:b,shouldReturn:E}=yield function(e){var t,n,r,i;return p(this,void 0,void 0,function*(){let{options:o}=e,a,s=!1,l=!1;if("u">typeof window&&window.ethereum&&!(null==(t=e.platformManager)?void 0:t.isMetaMaskMobileWebView())){s="extension"===localStorage.getItem(cm);try{a=yield function({mustBeMetaMask:e,sdkInstance:t}){return p(this,void 0,void 0,function*(){if("u"<typeof window)throw Error("window not available");try{let e=yield new Promise((e,t)=>
6{let n=setTimeout(()=>{t(Error("eip6963RequestProvider timed out"))},500);window.addEventListener(dE.Announce,t=>{let{detail:{info:r,provider:i}={}}=t,{name:o,rdns:a,uuid:s}=null!=r?r:{};ce.test(s)&&o.startsWith("MetaMask")&&l9.includes(a)&&(clearTimeout(n),e(i))}),window.dispatchEvent(new Event(dE.Request))});return cO({provider:e,sdkInstance:t})}catch(n){if(!e&&window.ethereum)return cO({provider:window.ethereum,sdkInstance:t});throw Error("Provider not found")}})}({mustBeMetaMask:!0,sdkInstance:e}),window.extension=a,a.on(cb,t=>{lD(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE chainChanged chainId=${t}`),e.sdkProvider&&e.getMobileProvider().emit(cb,t)}),a.on(cE,t=>p(this,void 0,void 0,function*(){var n;lD(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE accountsChanged accounts=${t}`);let r=!!e.sdkProvider,i=!!e.extensionActive;if(r&&e.getMobileProvider().emit(cE,t),i&&0===(null==t?void 0:t.length)&&0===(yield null==(n=e.getProvider())?void 0:n.request({method:cs,params:[]})).length)try{yield e.terminate()}catch(e){lD("[MetaMaskSDK: setupExtensionPreferences()] error terminating on permissions revoked",e)}})),a.on(cw,t=>{lD(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE disconnect error=${t}`),e.sdkProvider&&e.getMobileProvider().emit(cw,t)}),a.on(cC,t=>{lD(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE connect args=${t}`),e.sdkProvider&&e.getMobileProvider().emit(cC,t)}),a.on(c_,t=>{lD("[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE connected",t),e.sdkProvider&&e.getMobileProvider().emit(c_,t)})}catch(e){window.extension=void 0}}else(null==(n=e.platformManager)?void 0:n.isMetaMaskMobileWebView())&&(null==(r=e.analytics)||r.send({event:os.SDK_USE_INAPP_BROWSER}),e.activeProvider=cO({provider:window.ethereum,sdkInstance:e}),e._initialized=!0,l=!0);return a&&o.extensionOnly&&(lD("[MetaMaskSDK: setupExtensionPreferences()] EXTENSION ONLY --- prevent sdk initialization"),null==(i=e.analytics)||i.send({event:os.SDK_USE_EXTENSION}),e.activeProvider=a,e.extensionActive=!0,e.extension=a,e._initialized=!0,l=!0),{preferExtension:s,shouldReturn:l,metamaskBrowserExtension:a}})}(e);if(E)lD("[MetaMaskSDK: performSDKInitialization()] shouldReturn=true --- prevent sdk initialization");else{yield function(e,t){var n,r,i,o,a;return p(this,void 0,void 0,function*(){let{options:s}=e,l=Object.assign({},s.logging);e.remoteConnection=new cZ({preferDesktop:null!=(n=s.preferDesktop)&&n,communicationLayerPreference:null!=(r=s.communicationLayerPreference)?r:od.SOCKET,analytics:e.analytics,dappMetadata:s.dappMetadata,_source:s._source,enableAnalytics:null==(i=s.enableAnalytics)||i,timer:s.timer,sdk:e,platformManager:e.platformManager,transports:s.transports,communicationServerUrl:s.communicationServerUrl,storage:null!=(o=s.storage)?o:{enabled:!0},getMetaMaskInstaller:()=>{if(!e.installer)throw Error("Invalid SDK status -- installer not initialized");return e.installer},logging:l,connectWithExtensionProvider:void 0===t?void 0:()=>cx(e),modals:Object.assign(Object.assign({},s.modals),{onPendingModalDisconnect:e.terminate.bind(e)})}),yield e.remoteConnection.initRemoteCommunication({sdkInstance:e}),e.installer=new cF({remote:e.remoteConnection,preferDesktop:null!=(a=s.preferDesktop)&&a,platformManager:e.platformManager,debug:e.debug})})}(e,v),yield function(e){var t,n,r,i;return p(this,void 0,void 0,function*(){var o,s,l,c;let{options:d}=e,u={communicationLayerPreference:null!=(t=d.communicationLayerPreference)?t:od.SOCKET,platformManager:e.platformManager,sdk:e,checkInstallationOnAllCalls:d.checkInstallationOnAllCalls,injectProvider:null==(n=d.injectProvider)||n,shouldShimWeb3:null==(r=d.shouldShimWeb3)||r,extensionOnly:null==(i=d.extensionOnly)||i,installer:e.installer,remoteConnection:e.remoteConnection,debug:e.debug};e.activeProvider=yield(({checkInstallationOnAllCalls:e=!1,communicationLayerPreference:t,injectProvider:n,shouldShimWeb3:r,platformManager:i,installer:o,sdk:s,remoteConnection:l,debug:c})=>p(void 0,void 0,void 0,function*(){var d,u;let h=(({name:e,remoteConnection:t})=>{if(!t||!(null==t?void 0:t.getConnector()))throw Error("Missing remote connection parameter");return new cM({name:e,remote:null==t?void 0:t.getConnector(),deeplinkProtocol:null==t?void 0:t.state.deeplinkProtocol,platformManager:null==t?void 0:t.getPlatformManager()})})({name:l5.INPAGE,target:l5.CONTENT_SCRIPT,platformManager:i,communicationLayerPreference:t,remoteConnection:l}),f=i.getPlatformType(),g=s.options.dappMetadata,m=`Sdk/Javascript SdkVersion/${l8} Platform/${f} dApp/${null!=(d=g.url)?d:g.name} dAppTitle/${g.name}`,y=null,v=null,b=null==(u=s.options.storage)?void 0:u.storageManager;if(b){try{let e=yield b.getCachedAccounts();e.length>0&&(y=e[0])}catch(e){console.error(`[initializeMobileProvider] failed to get cached addresses: ${e}`)}try{let e=yield b.getCachedChainId();e&&(v=e)}catch(e){console.error(`[initializeMobileProvider] failed to parse cached chainId: ${e}`)}}lD(`[initializeMobileProvider] cachedAccountAddress: ${y}, cachedChainId: ${v}`);let E=!(!n||f===ou.NonBrowser||f===ou.ReactNative),w=l0.init({shouldSetOnWindow:E,connectionStream:h,shouldShimWeb3:r,sdkInstance:s}),C=!1,_=e=>{C=e},S=()=>C,x=(t,n,r,c)=>p(void 0,void 0,void 0,function*(){var d,u,h,f,g,E,w,x,k;let M=l0.getProvider();if(C){M.emit("display_uri",(null==l?void 0:l.state.qrcodeLink)||""),null==l||l.showActiveModal();let e=S();for(;e;){let t=S(),n=null==l?void 0:l.isAuthorized();e=t&&!n,lD(`[initializeMobileProvider: sendRequest()] waiting for initialization to complete - initializing: ${t} authorized: ${n}`),yield cL(1e3)}return lD("[initializeMobileProvider: sendRequest()] initial method completed -- prevent installation and call provider"),r(...n)}let A=i.isMetaMaskInstalled(),L=null==l?void 0:l.isConnected(),P=null,I=null,O=null;if(P=null!=(d=M.getSelectedAddress())?d:y,O=M.getChainId()||v,P&&b&&P!==y&&b.persistAccounts([P]).catch(e=>{console.error(`[initializeMobileProvider] failed to persist account: ${e}`)}),O&&(v=O,b&&b.persistChainId(O).catch(e=>{console.error(`[initializeMobileProvider] failed to persist chainId: ${e}`)})),lD("[initializeMobileProvider: sendRequest()]",{selectedAddress:P,chainId:O}),c&&lD(`[initializeMobileProvider: sendRequest()] method=${t} ongoing=${C} selectedAddress=${P} isInstalled=${A} checkInstallationOnAllCalls=${e} socketConnected=${L}`),P&&t.toLowerCase()===cc.toLowerCase())return[P];if(O&&t.toLowerCase()===cd.toLowerCase())return O;let R=!ch[t],T=null==(u=s.options.readonlyRPCMap)?void 0:u[O];if(T&&R)try{let e=null==(h=null==n?void 0:n[0])?void 0:h.params,r=yield(({rpcEndpoint:e,method:t,sdkInfo:n,params:r})=>p(void 0,void 0,void 0,function*(){let i,o=JSON.stringify({jsonrpc:"2.0",method:t,params:r,id:cA+=1}),s={Accept:"application/json","Content-Type":"application/json"};e.includes("infura")&&(s["Metamask-Sdk-Info"]=n);try{i=yield a()(e,{method:"POST",headers:s,body:o})}catch(e){throw e instanceof Error?Error(`Failed to fetch from RPC: ${e.message}`):Error(`Failed to fetch from RPC: ${e}`)}if(!i.ok)throw Error(`Server responded with a status of ${i.status}`);return(yield i.json()).result}))({rpcEndpoint:T,sdkInfo:m,method:t,params:e||[]});return c&&lD(`initializeProvider::ReadOnlyRPCResponse ${r}`),r}catch(e){console.warn(`[initializeMobileProvider: sendRequest()] method=${t} readOnlyRPCRequest failed:`,e)}if((!A||A&&!L)&&t!==ct){let a=(null==(f=null==n?void 0:n[0])?void 0:f.params)||[];if(-1!==[cl,ca,cn,cr].indexOf(t)||e){_(!0);let e=t===cr,i=`${Date.now()}`;try{yield o.start({wait:!1,connectWith:e?{method:t,id:i,params:a}:void 0}),yield new Promise((e,t)=>
6{(null==l?void 0:l.isAuthorized())&&(lD("[initializeMobileProvider: sendRequest()] already authorized"),e(!0)),null==l||l.getConnector().once(or.AUTHORIZED,()=>{e(!0)}),s.once(or.PROVIDER_UPDATE,e=>{lD(`[initializeMobileProvider: sendRequest()] PROVIDER_UPDATE --- remote provider request interupted type=${e}`),e===db.EXTENSION?t(or.PROVIDER_UPDATE):t(Error("Connection Terminated"))})})}catch(e){if(db.EXTENSION===e){if(lD(`[initializeMobileProvider: sendRequest()] extension provider detect: re-create ${t} on the active provider`),t.toLowerCase()===cn.toLowerCase()){let e=yield null==(g=s.getProvider())?void 0:g.request({method:cl,params:[]});if(!e.length)throw Error("SDK state invalid -- undefined accounts");let t=yield null==(E=s.getProvider())?void 0:E.request({method:co,params:[a[0],e[0]]});return s.emit(lJ,t),t}if(t.toLowerCase()===cr.toLowerCase()){let[e]=a,t=yield(({method:e,sdk:t,params:n})=>p(void 0,void 0,void 0,function*(){var r,i,o,a;if(!t.isExtensionActive())throw Error("SDK state invalid -- extension is not active");lD("[MetaMaskProvider: extensionConnectWithOverwrite()] Overwriting request method",e,n);let s=yield null==(r=t.getProvider())?void 0:r.request({method:cl,params:[]});if(!s.length)throw Error("SDK state invalid -- undefined accounts");if((null==e?void 0:e.toLowerCase())===co.toLowerCase()){let r={method:e,params:[n[0],s[0]]};return yield null==(i=t.getProvider())?void 0:i.request(r)}if((null==e?void 0:e.toLowerCase())===cu.toLowerCase()){let r={method:e,params:[Object.assign(Object.assign({},n[0]),{from:s[0]})]};return yield null==(o=t.getProvider())?void 0:o.request(r)}return cp.includes(e.toLowerCase())?(console.warn(`MetaMaskSDK connectWith method=${e} -- not handled by the extension -- call separately`),s):yield null==(a=t.getProvider())?void 0:a.request({method:e,params:n})}))({method:e.method,sdk:s,params:e.params});return s.emit(lJ,t),t}return lD(`[initializeMobileProvider: sendRequest()] sending '${t}' on active provider`,a),yield null==(w=s.getProvider())?void 0:w.request({method:t,params:a})}if(e===or.REJECTED)throw null==l||l.closeModal(),null==(x=s.getProvider())||x.handleDisconnect({terminate:!1}),Object.assign(Error("User rejected connection"),{code:4001});throw lD(`[initializeMobileProvider: sendRequest()] failed to start installer: ${e}`),e}finally{_(!1)}if(t===cl)return I=yield new Promise(e=>{let t=setInterval(()=>{let{accounts:n}=M.getState();n&&(clearInterval(t),e(n))},100)}),lD(`[initializeMobileProvider: sendRequest()] selectedAddress: ${P} --- SKIP rpc call`),I;if(t===cr)try{let e,t,n=0,r=yield new Promise((r,o)=>{let a=null==l?void 0:l.getConnector().getRPCMethodTracker();lD(`TRACKER: method ${i}`,a),(null==a?void 0:a[i].result)?(lD("[initializeMobileProvider: sendRequest()] found result",null==a?void 0:a[i].result),r(null==a?void 0:a[i].result)):(null==a?void 0:a[i].error)&&(lD("[initializeMobileProvider: sendRequest()] found error",null==a?void 0:a[i].error),o(null==a?void 0:a[i].error)),t=()=>(({resolve:e,reject:t})=>{n+=1;let r=null==l?void 0:l.getConnector().getRPCMethodTracker(),o=null==r?void 0:r[i];return lD(`TRACKER: update method ${i}`,o),(null==o?void 0:o.result)?(lD("[initializeMobileProvider: sendRequest()] found result",o.result),s.emit(lJ,o.result),void e(o.result)):(null==o?void 0:o.error)?(lD("[initializeMobileProvider: sendRequest()] found error",o.error),void t(o.error)):n>=5?(lD("[initializeMobileProvider: sendRequest()] max message count reached without result"),void t(Error("Max message count reached without result"))):void lD("[initializeMobileProvider: sendRequest()] not found yet, need to wait for next update")})({resolve:r,reject:o}),e=null==l?void 0:l.getConnector().on(or.RPC_UPDATE,t)});return t&&(null==e||e.off(or.RPC_UPDATE,t)),lD("TRACKER: result",r),r}catch(e){throw lD("[initializeMobileProvider: sendRequest()] error:",e),e}return n[0]&&"object"==typeof n[0]&&(n[0].params={__triggeredInstaller:!0,wrappedParams:n[0].params}),r(...n)}if(i.isSecure()&&ch[t])return r(...n);if(s.isExtensionActive())return lD(`[initializeMobileProvider: sendRequest()] EXTENSION active - redirect request '${t}' to it`,n,a),yield null==(k=s.getProvider())?void 0:k.request({method:t,params:a});throw lD(`[initializeMobileProvider: sendRequest()] method=${t} --- skip --- not connected/installed`),Error("MetaMask is not connected/installed, please call eth_requestAccounts to connect first.")}try{let e=yield r(...n);if(lD(`[initializeMobileProvider: sendRequest()] method=${t} rpcResponse`,e),t===ca){let t=e.reduce((e,t)=>
6{var n;if("eth_accounts"===t.parentCapability){let r=null==(n=t.caveats.find(e=>"restrictReturnedAccounts"===e.type))?void 0:n.value;r&&e.push(...r)}return e},[]);lD("[initializeMobileProvider: sendRequest()] accountsToPersist:",t),t.length>0&&(M.handleAccountsChanged(t,!1),null==b||b.persistAccounts(t))}return e}catch(e){throw console.error("[initializeMobileProvider: sendRequest()] error:",e),e}}),{request:k}=w;w.request=(...e)=>p(void 0,void 0,void 0,function*(){return x(null==e?void 0:e[0].method,e,k,c)});let{send:M}=w;return w.send=(...e)=>p(void 0,void 0,void 0,function*(){return x(null==e?void 0:e[0],e,M,c)}),lD("[initializeMobileProvider: sendRequest()] metamaskStream.start()"),h.start(),w}))(u),null==(s=null==(o=e.remoteConnection)?void 0:o.getConnector())||s.on(lX,t=>{e.emit(lX,t)}),null==(c=null==(l=e.remoteConnection)?void 0:l.getConnector())||c.on(lQ,t=>{e.emit(lQ,t)})})}(e),yield function(e,t){var n,r;return p(this,void 0,void 0,function*(){let{options:i}=e;t?(lD("[MetaMaskSDK: handleAutoAndExtensionConnections()] preferExtension is detected -- connect with it."),null==(n=e.analytics)||n.send({event:os.SDK_EXTENSION_UTILIZED}),cx(e).catch(e=>{console.warn("Can't connect with MetaMask extension...",e),localStorage.removeItem(cm)})):i.checkInstallationImmediately&&((null==(r=e.platformManager)?void 0:r.isDesktopWeb())?(lD("[MetaMaskSDK: handleAutoAndExtensionConnections()] checkInstallationImmediately"),e.connect().catch(e=>{lD(`[MetaMaskSDK: handleAutoAndExtensionConnections()] checkInstallationImmediately --- IGNORED --- error on autoconnect _err=${e}`)})):console.warn("[handleAutoAndExtensionConnections()] checkInstallationImmediately --- IGNORED --- only for web desktop")),e._initialized=!0})}(e,b);try{yield null==(f=e.remoteConnection)?void 0:f.startConnection({initialCheck:!0})}catch(e){console.error("[MetaMaskSDK: setupRemoteConnectionAndInstaller()] Error while checking installation",e)}e.emit(lY,db.INITIALIZED)}})}(e),yield e.sdkInitPromise}catch(e){throw console.error(e),e}return e.sdkInitPromise})}(this)})}isExtensionActive(){return this.extensionActive}checkExtensionAvailability(){var e;return"u">typeof window&&!!(null==(e=window.ethereum)?void 0:e.isMetaMask)}connect(){return p(this,void 0,void 0,function*(){return function(e){return p(this,void 0,void 0,function*(){if(e._initialized||(lD("[MetaMaskSDK: connect()] provider not ready -- wait for init()"),yield e.init()),lD(`[MetaMaskSDK: connect()] isExtensionActive=${e.isExtensionActive()} activeProvider`,e.activeProvider),!e.activeProvider)throw Error("SDK state invalid -- undefined provider");let t=e.activeProvider.getSelectedAddress();return t?[t]:e.activeProvider.request({method:cl,params:[]})})}(this)})}connectAndSign({msg:e}){return p(this,void 0,void 0,function*(){return function({instance:e,msg:t}){return p(this,void 0,void 0,function*(){if(e._initialized||(lD("[MetaMaskSDK: connectAndSign()] provider not ready -- wait for init()"),yield e.init()),lD(`[MetaMaskSDK: connectAndSign()] activeProvider=${e.activeProvider}`),!e.activeProvider)throw Error("SDK state invalid -- undefined provider");let n=/^0x([0-9A-Fa-f]{2})*$/u.test(t)?t:function(e){let t;if(void 0!==L)t=L.from(e,"utf8").toString("hex");else if("u">typeof TextEncoder)t=Array.from((new TextEncoder).encode(e)).map(e=>e.toString(16).padStart(2,"0")).join("");else{if("object"!=typeof g||!("Buffer"in g))throw Error("Unable to convert string to hex: No available method.");t=g.Buffer.from(e,"utf8").toString("hex")}return`0x${t}`}(t);return e.activeProvider.request({method:cr,params:[{method:co,params:[n]}]})})}({instance:this,msg:e})})}connectWith(e){return p(this,void 0,void 0,function*(){return function({instance:e,rpc:t}){return p(this,void 0,void 0,function*(){if(e._initialized||(lD("[MetaMaskSDK: connectWith()] provider not ready -- wait for init()"),yield e.init()),lD(`[MetaMaskSDK: connectWith()] method: ${t.method} rpc=${t}`),!e.activeProvider)throw Error("SDK state invalid -- undefined provider");return e.activeProvider.request({method:cr,params:[t]})})}({instance:this,rpc:e})})}resume(){return function(e){var t,n,r;return p(this,void 0,void 0,function*(){(null==(n=null==(t=e.remoteConnection)?void 0:t.getConnector())?void 0:n.isReady())?lD("[MetaMaskSDK: resume()] channel is ready"):(lD("[MetaMaskSDK: resume()] channel is not ready -- starting connection"),null==(r=e.remoteConnection)||r.startConnection())})}(this)}disconnect(){return console.warn("MetaMaskSDK.disconnect() is deprecated, use terminate()"),this.terminate()}isAuthorized(){var e;null==(e=this.remoteConnection)||e.isAuthorized()}terminate(){return function(e){var t,n,r;return p(this,void 0,void 0,function*(){if(!(null==(t=e.platformManager)?void 0:t.isMetaMaskMobileWebView())){if(cS&&(window.localStorage.removeItem(cm),window.localStorage.removeItem(cv),window.localStorage.removeItem(cy)),e.extensionActive){try{yield null==(n=e.activeProvider)?void 0:n.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]})}catch(e){lD("[MetaMaskSDK: terminate()] error revoking permissions",e)}return e.options.extensionOnly?(e.emit(lY,db.TERMINATE),void lD("[MetaMaskSDK: terminate()] extensionOnly --- prevent switching providers")):(e.activeProvider=e.sdkProvider,window.ethereum=e.activeProvider,e.extensionActive=!1,void e.emit(lY,db.TERMINATE))}e.emit(lY,db.TERMINATE),lD(`[MetaMaskSDK: terminate()] remoteConnection=${e.remoteConnection}`),null==(r=e.remoteConnection)||r.disconnect({terminate:!0,sendMessage:!0})}})}(this)}isInitialized(){return this._initialized}setReadOnlyRPCCalls(e){this.readonlyRPCCalls=e}hasReadOnlyRPCCalls(){return this.readonlyRPCCalls}
6getProvider(){if(this.activeProvider)return this.activeProvider;console.warn("MetaMaskSDK: No active provider found")}getMobileProvider(){if(!this.sdkProvider)throw Error("SDK state invalid -- undefined mobile provider");return this.sdkProvider}getUniversalLink(){var e;let t=null==(e=this.remoteConnection)?void 0:e.getUniversalLink();if(!t)throw Error("No Universal Link available, please call eth_requestAccounts first.");return t}getChannelId(){var e,t;return null==(t=null==(e=this.remoteConnection)?void 0:e.getChannelConfig())?void 0:t.channelId}getRPCHistory(){var e,t;return null==(t=null==(e=this.remoteConnection)?void 0:e.getConnector())?void 0:t.getRPCMethodTracker()}getVersion(){return l8}getWalletStatus(){var e,t;return null==(t=null==(e=this.remoteConnection)?void 0:e.getConnector())?void 0:t.getConnectionStatus()}_getChannelConfig(){var e;return null==(e=this.remoteConnection)?void 0:e.getChannelConfig()}_ping(){var e,t;null==(t=null==(e=this.remoteConnection)?void 0:e.getConnector())||t.ping()}_keyCheck(){var e,t;null==(t=null==(e=this.remoteConnection)?void 0:e.getConnector())||t.keyCheck()}_getServiceStatus(){var e,t;return null==(t=null==(e=this.remoteConnection)?void 0:e.getConnector())?void 0:t.getServiceStatus()}_getRemoteConnection(){return this.remoteConnection}_getDappMetadata(){return this.dappMetadata}_getKeyInfo(){var e;return null==(e=this.remoteConnection)?void 0:e.getKeyInfo()}_resetKeys(){var e,t;null==(t=null==(e=this.remoteConnection)?void 0:e.getConnector())||t.resetKeys()}_getConnection(){return this.remoteConnection}emit(e,t){return super.emit(e,t)}on(e,t){return super.on(e,t)}}var cJ=Object.freeze({__proto__:null,StorageManagerWeb:class{constructor({enabled:e}={enabled:!1}){this.enabled=!1,this.enabled=e}persistChannelConfig(e){return p(this,void 0,void 0,function*(){let t=JSON.stringify(e);lD(`[StorageManagerWeb: persistChannelConfig()] enabled=${this.enabled}`,e),localStorage.setItem(cg,t)})}getPersistedChannelConfig(){return p(this,void 0,void 0,function*(){let e;try{if(lD(`[StorageManagerWeb: getPersistedChannelConfig()] enabled=${this.enabled}`),e=localStorage.getItem(cg),lD("[StorageManagerWeb: getPersistedChannelConfig()]",e),!e)return;let t=JSON.parse(e);return lD("[StorageManagerWeb: getPersistedChannelConfig()] channelConfig",t),t}catch(e){return void console.error("[StorageManagerWeb: getPersistedChannelConfig()] Can't find existing channel config",e)}})}persistAccounts(e){return p(this,void 0,void 0,function*(){lD(`[StorageManagerWeb: persistAccounts()] enabled=${this.enabled}`,e);let t=JSON.stringify(e);localStorage.setItem(cy,t)})}getCachedAccounts(){return p(this,void 0,void 0,function*(){try{let e=localStorage.getItem(cy);return e?JSON.parse(e):[]}catch(e){throw console.error("[StorageManagerWeb: getCachedAccounts()] Error reading cached accounts",e),e}})}persistChainId(e){return p(this,void 0,void 0,function*(){lD(`[StorageManagerWeb: persistChainId()] enabled=${this.enabled}`,e),localStorage.setItem(cv,e)})}getCachedChainId(){return p(this,void 0,void 0,function*(){try{let e=localStorage.getItem(cv);return null!=e?e:void 0}catch(e){throw console.error("[StorageManagerWeb: getCachedChainId()] Error reading cached chainId",e),e}})}terminate(){return p(this,void 0,void 0,function*(){lD(`[StorageManagerWeb: terminate()] enabled=${this.enabled}`),localStorage.removeItem(cg)})}}}),cX=Object.defineProperty,cQ=new WeakMap,c0=(e,t)=>cQ.set(t.$lazyInstance$=e,t),c1=(e,t)=>(0,console.error)(e,t),c2=new Map,c3=new Map,c5="slot-fb{display:contents}slot-fb[hidden]{display:none}",c8="u">typeof window?window:{},c4=c8.document||{head:{}},c6={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,r)=>e.addEventListener(t,n,r),rel:(e,t,n,r)=>e.removeEventListener(t,n,r),ce:(e,t)=>new CustomEvent(e,t)},c7=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),c9=!1,de=[],dt=[],dn=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){c1(e)}e.length=0},dr=()=>{dn(de),dn(dt),(c9=de.length>0)&&c6.raf(dr)},di=e=>Promise.resolve(void 0).then(e),da=e=>
6{dt.push(e),c9||(c9=!0,4&c6.$flags$?di(dr):c6.raf(dr))},ds={},dl=e=>"object"==(e=typeof e)||"function"===e;function dc(e){var t,n,r;return null!=(r=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?r:void 0}var dd={},du={err:()=>dp,map:()=>dg,ok:()=>df,unwrap:()=>dC,unwrapErr:()=>d_};for(var dh in du)cX(dd,dh,{get:du[dh],enumerable:!0});var df=e=>({isOk:!0,isErr:!1,value:e}),dp=e=>({isOk:!1,isErr:!0,value:e});function dg(e,t){if(e.isOk){let n=t(e.value);return n instanceof Promise?n.then(e=>df(e)):df(n)}if(e.isErr)return dp(e.value);throw"should never get here"}var dm,dy,dv,db,dE,dw,dC=e=>{if(e.isOk)return e.value;throw e.value},d_=e=>{if(e.isErr)return e.value;throw e.value},dS=(e,t,...n)=>{let r=null,i=!1,o=!1,a=[],s=t=>{for(let n=0;n<t.length;n++)Array.isArray(r=t[n])?s(r):null!=r&&"boolean"!=typeof r&&((i="function"!=typeof e&&!dl(r))&&(r=String(r)),i&&o?a[a.length-1].$text$+=r:a.push(i?dx(null,r):r),o=i)};if(s(n),t){let e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter(t=>e[t]).join(" "))}if("function"==typeof e)return e(null===t?{}:t,a,dM);let l=dx(e,null);return l.$attrs$=t,a.length>0&&(l.$children$=a),l},dx=(e,t)=>({$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null}),dk={},dM={forEach:(e,t)=>e.map(dA).forEach(t),map:(e,t)=>e.map(dA).map(t).map(dL)},dA=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),dL=e=>{if("function"==typeof e.vtag){let t={...e.vattrs};return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),dS(e.vtag,t,...e.vchildren||[])}let t=dx(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},dP=e=>cQ.get(e).$hostElement$,dI=(e,t,n)=>{let r=dP(e);return{emit:e=>
6dO(r,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},dO=(e,t,n)=>{let r=c6.ce(t,n);return e.dispatchEvent(r),r},dR=new WeakMap,dT=(e,t,n,r,i,o)=>{if(n!==r){let a=t in e,s=t.toLowerCase();if("class"===t){let t=e.classList,i=dN(n),o=dN(r);t.remove(...i.filter(e=>e&&!o.includes(e))),t.add(...o.filter(e=>e&&!i.includes(e)))}else if("style"===t){for(let t in n)r&&null!=r[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(let t in r)n&&r[t]===n[t]||(t.includes("-")?e.style.setProperty(t,r[t]):e.style[t]=r[t])}else if(a||"o"!==t[0]||"n"!==t[1]){let s=dl(r);if((a||s&&null!==r)&&!i)try{if(e.tagName.includes("-"))e[t]=r;else{let i=null==r?"":r;"list"===t?a=!1:null!=n&&e[t]==i||("function"==typeof e.__lookupSetter__(t)?e[t]=i:e.setAttribute(t,i))}}catch(e){}null==r||!1===r?!1===r&&""!==e.getAttribute(t)||e.removeAttribute(t):(!a||4&o||i)&&!s&&(r=!0===r?"":r,e.setAttribute(t,r))}else if(t="-"===t[2]?t.slice(3):s in c8?s.slice(2):s[2]+t.slice(3),n||r){let i=t.endsWith(dD);t=t.replace(dB,""),n&&c6.rel(e,t,n,i),r&&c6.ael(e,t,r,i)}}},d$=/\s/,dN=e=>e?e.split(d$):[],dD="Capture",dB=RegExp(dD+"$"),dK=(e,t,n)=>{let r=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||ds,o=t.$attrs$||ds;for(let e of dj(Object.keys(i)))e in o||dT(r,e,i[e],void 0,n,t.$flags$);for(let e of dj(Object.keys(o)))dT(r,e,i[e],o[e],n,t.$flags$)};function dj(e){return e.includes("ref")?[...e.filter(e=>"ref"!==e),"ref"]:e}var dU=!1,dF=(e,t,n,r)=>{let i=t.$children$[n],o,a,s=0;if(null!==i.$text$)o=i.$elm$=c4.createTextNode(i.$text$);else{if(dU||(dU="svg"===i.$tag$),o=i.$elm$=c4.createElementNS(dU?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i.$tag$),dU&&"foreignObject"===i.$tag$&&(dU=!1),dK(null,i,dU),o.getRootNode().querySelector("body"),i.$children$)for(s=0;s<i.$children$.length;++s)(a=dF(e,i,s))&&o.appendChild(a);"svg"===i.$tag$?dU=!1:"foreignObject"===o.tagName&&(dU=!0)}return o["s-hn"]=dw,o},dH=(e,t,n,r,i,o)=>{let a,s=e;for(s.shadowRoot&&s.tagName===dw&&(s=s.shadowRoot);i<=o;++i)r[i]&&(a=dF(null,n,i))&&(r[i].$elm$=a,dW(s,a,t))},dz=(e,t,n)=>{for(let r=t;r<=n;++r){let t=e[r];if(t){let e=t.$elm$;e&&e.remove()}}},dq=(e,t,n=!1)=>e.$tag$===t.$tag$,dV=(e,t,n=!1)=>{let r=t.$elm$=e.$elm$,i=e.$children$,o=t.$children$,a=t.$tag$,s=t.$text$;null===s?(dK(e,t,dU="svg"===a||"foreignObject"!==a&&dU),null!==i&&null!==o?((e,t,n,r,i=!1)=>{let o,a=0,s=0,l=t.length-1,c=t[0],d=t[l],u=r.length-1,h=r[0],f=r[u];for(;a<=l&&s<=u;)null==c?c=t[++a]:null==d?d=t[--l]:null==h?h=r[++s]:null==f?f=r[--u]:dq(c,h,i)?(dV(c,h,i),c=t[++a],h=r[++s]):dq(d,f,i)?(dV(d,f,i),d=t[--l],f=r[--u]):dq(c,f,i)?(dV(c,f,i),dW(e,c.$elm$,d.$elm$.nextSibling),c=t[++a],f=r[--u]):dq(d,h,i)?(dV(d,h,i),dW(e,d.$elm$,c.$elm$),d=t[--l],h=r[++s]):(o=dF(t&&t[s],n,s),h=r[++s],o&&dW(c.$elm$.parentNode,o,c.$elm$));a>l?dH(e,null==r[u+1]?null:r[u+1].$elm$,n,r,s,u):s>u&&dz(t,a,l)})(r,i,t,o,n):null!==o?(null!==e.$text$&&(r.textContent=""),dH(r,null,t,o,0,o.length-1)):n||null===i||dz(i,0,i.length-1),dU&&"svg"===a&&(dU=!1)):e.$text$!==s&&(r.data=s)},dW=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),dG=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise(t=>e.$onRenderResolve$=t))},dZ=(e,t)=>(e.$flags$|=16,4&e.$flags$)?void(e.$flags$|=512):(dG(e,e.$ancestorComponent$),da(()=>dY(e,t))),dY=(e,t)=>{let n=e.$hostElement$,r=(e.$cmpMeta$.$tagName$,()=>{}),i=e.$lazyInstance$;if(!i)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);return r(),dJ(void 0,()=>dQ(e,i,t))},dJ=(e,t)=>dX(e)?e.then(t).catch(e=>{console.error(e),t()}):t(),dX=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,dQ=async(e,t,n)=>{var r;let i,o,a,s,l=e.$hostElement$,c=(e.$cmpMeta$.$tagName$,()=>{}),d=l["s-rc"];n&&(i=e.$cmpMeta$,o=e.$hostElement$,a=i.$flags$,i.$tagName$,s=((e,t,n)=>{var r;let i="sc-"+t.$tagName$,o=c3.get(i);if(e=11===e.nodeType?e:c4,o)if("string"==typeof o){e=e.head||e;let n,a=dR.get(e);if(a||dR.set(e,a=new Set),!a.has(i)){{(n=c4.createElement("style")).innerHTML=o;let i=null!=(r=c6.$nonce$)?r:dc(c4);if(null!=i&&n.setAttribute("nonce",i),!(1&t.$flags$))if("HEAD"===e.n
6odeName){let t=e.querySelectorAll("link[rel=preconnect]"),r=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(n,r)}else if("host"in e)if(c7){let t=new CSSStyleSheet;t.replaceSync(o),e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{let t=e.querySelector("style");t?t.innerHTML=o+t.innerHTML:e.prepend(n)}else e.append(n);1&t.$flags$&&"HEAD"!==e.nodeName&&e.insertBefore(n,null)}4&t.$flags$&&(n.innerHTML+=c5),a&&a.add(i)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return i})(o.shadowRoot?o.shadowRoot:o.getRootNode(),i),10&a&&2&a&&(o["s-sc"]=s,o.classList.add(s+"-h")),(()=>{})());let u=(e.$cmpMeta$.$tagName$,()=>{});d0(e,t,l,n),d&&(d.map(e=>e()),l["s-rc"]=void 0),u(),c();{let t=null!=(r=l["s-p"])?r:[],n=()=>d1(e);0===t.length?n():(Promise.all(t).then(n),e.$flags$|=4,t.length=0)}},d0=(e,t,n,r)=>{try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,((e,t,n=!1)=>{let r=e.$hostElement$,i=e.$cmpMeta$,o=e.$vnode$||dx(null,null),a=t&&t.$tag$===dk?t:dS(null,null,t);if(dw=r.tagName,n&&a.$attrs$)for(let e of Object.keys(a.$attrs$))r.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(a.$attrs$[e]=r[e]);a.$tag$=null,a.$flags$|=4,e.$vnode$=a,a.$elm$=o.$elm$=r.shadowRoot||r,r["s-sc"],i.$flags$,dV(o,a,n)})(e,t,r)}catch(t){c1(t,e.$hostElement$)}return null},d1=e=>{e.$cmpMeta$.$tagName$;let t=e.$hostElement$,n=()=>{},r=e.$lazyInstance$,i=e.$ancestorComponent$;64&e.$flags$?n():(e.$flags$|=64,d5(t),d3(r,"componentDidLoad"),n(),e.$onReadyResolve$(t),i||d2()),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&di(()=>dZ(e,!1)),e.$flags$&=-517},d2=e=>{d5(c4.documentElement),di(()=>dO(c8,"appload",{detail:{namespace:"sdk-install-modal-web"}}))},d3=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){c1(e)}},d5=e=>e.classList.add("hydrated"),d8=(e,t,n)=>{var r,i;let o=e.prototype;if(t.$members$||t.$watchers$||e.watchers){e.watchers&&!t.$watchers$&&(t.$watchers$=e.watchers);let a=Object.entries(null!=(r=t.$members$)?r:{});if(a.map(([e,[r]])=>{(31&r||2&n&&32&r)&&Object.defineProperty(o,e,{get(){return cQ.get(this).$instanceValues$.get(e)},set(n){((e,t,n,r)=>{var i,o;let a=cQ.get(e);if(!a)throw Error(`Couldn't find host element for "${r.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);let s=a.$hostElement$,l=a.$instanceValues$.get(t),c=a.$flags$,d=a.$lazyInstance$;i=n,o=r.$members$[t][0],n=null==i||dl(i)?i:4&o?"false"!==i&&(""===i||!!i):1&o?String(i):i;let u=Number.isNaN(l)&&Number.isNaN(n);if((!(8&c)||void 0===l)&&n!==l&&!u&&(a.$instanceValues$.set(t,n),d)){if(r.$watchers$&&128&c){let e=r.$watchers$[t];e&&e.map(e=>{try{d[e](n,l,t)}catch(e){c1(e,s)}})}2==(18&c)&&dZ(a,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})}),1&n){let n=new Map;o.attributeChangedCallback=function(e,r,i){c6.jmp(()=>{var a;let s=n.get(e);if(this.hasOwnProperty(s))i=this[s],delete this[s];else{if(o.hasOwnProperty(s)&&"number"==typeof this[s]&&this[s]==i)return;if(null==s){let n=cQ.get(this),o=null==n?void 0:n.$flags$;if(o&&!(8&o)&&128&o&&i!==r){let o=n.$lazyInstance$,s=null==(a=t.$watchers$)?void 0:a[e];null==s||s.forEach(t=>{null!=o[t]&&o[t].call(o,i,r,e)})}return}}this[s]=(null!==i||"boolean"!=typeof this[s])&&i})},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=t.$watchers$)?i:{}),...a.filter(([e,t])=>15&t[0]).map(([e,t])=>{let r=t[1]||e;return n.set(r,e),r})]))}}return e},d4=async(e,t,n,r)=>{let i;if(0==(32&t.$flags$)){if(t.$flags$|=32,n.$lazyBundleId$){let e=((e,t,n)=>{let r=e.$tagName$.replace(/-/g,"_"),i=e.$lazyBundleId$;if(!i)return;let o=c2.get(i);return o?o[r]:"mm-install-modal_3"===i?Promise.resolve().then(function(){return uN}).then(e=>(c2.set(i,e),e[r]),c1):import(`./${i}.entry.js`).then(e=>(c2.set(i,e),e[r]),c1)})(n);if(!(i=e&&"then"in e?await e:e))throw Error(`Constructor for "${n.$tagName$}#${t.$modeName$}" was not found`);i.isProxied||(n.$watchers$=i.watchers,d8(i,n,2),i.isProxied=!0);let r=(n.$tagName$,()=>{});t.$flags$|=8;try{new i(t)}catch(e){c1(e)}t.$flags$&=-9,t.$flags$|=128,r(),d6(t.$lazyInstance$)}else{i=e.constructor;let n=e.localName;customElements.whenDefined(n).then(()=>t.$flags$|=128)}if(i&&i.style){let e;"string"==typeof i.style&&(e=i.style);let t="sc-"+n.$tagName$;if(!c3.has(t)){var o,a;let r,i=(n.$tagName$,()=>{});o=e,a=!!(1&n.$flags$),r=c3.get(t),c7&&a?"string"==typeof(r=r||new CSSStyleSheet)?r=o:r.replaceSync(o):r=o,c3.set(t,r),i()}}}let s=t.$ancestorComponent$,l=()=>dZ(t,!0);s&&s["s-rc"]?s["s-rc"].push(l):l()},d6=e=>{d3(e,"connectedCallback")},d7=e=>{d3(e,"disconnectedCallback")};if("u">typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var d9=HTMLElement;window.HTMLElement=function(){return Reflect.construct(d9,[],this.constructor)},HTMLElement.prototype=d9.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,d9)}var ue=Object.freeze({__proto__:null,defineCustomElements:async(e,t)=>{if("u">typeof window)return await void 0,((e,t={})=>{var n;let r=[],i=t.exclude||[],o=c8.customElements,a=c4.head,s=a.querySelector("meta[charset]"),l=c4.createElement("style"),c=[],d,u=!0;Object.assign(c6,t),c6.$resourcesUrl$=new URL(t.resourcesUrl||"./",c4.baseURI).href;let h=!1;if(e.map(e=>{e[1].map(t=>{var n;let a={$flags$:t[0],$tagName$:t[1],$members$:t[2],$listeners$:t[3]};4&a.$flags$&&(h=!0),a.$members$=t[2],a.$watchers$=null!=(n=t[4])?n:{};let s=a.$tagName$,l=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,t)=>{let n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};n.$onReadyPromise$=new Promise(e=>
6n.$onReadyResolve$=e),e["s-p"]=[],e["s-rc"]=[],cQ.set(e,n)})(e=this,a),1&a.$flags$)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${a.$tagName$}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){cQ.get(this),this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),d&&(clearTimeout(d),d=null),u?c.push(this):c6.jmp(()=>(e=>{if(0==(1&c6.$flags$)){let t=cQ.get(e),n=t.$cmpMeta$,r=(n.$tagName$,()=>{});if(1&t.$flags$)(null==t?void 0:t.$lazyInstance$)?d6(t.$lazyInstance$):(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then(()=>d6(t.$lazyInstance$));else{t.$flags$|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){dG(t,t.$ancestorComponent$=n);break}}n.$members$&&Object.entries(n.$members$).map(([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){let n=e[t];delete e[t],e[t]=n}}),d4(e,t,n)}r()}})(this))}disconnectedCallback(){c6.jmp(()=>(async e=>{if(0==(1&c6.$flags$)){let t=cQ.get(e);(null==t?void 0:t.$lazyInstance$)?d7(t.$lazyInstance$):(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then(()=>d7(t.$lazyInstance$))}})(this))}componentOnReady(){return cQ.get(this).$onReadyPromise$}};a.$lazyBundleId$=e[0],i.includes(s)||o.get(s)||(r.push(s),o.define(s,d8(l,a,1)))})}),r.length>0&&(h&&(l.textContent+=c5),l.textContent+=r.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",l.innerHTML.length)){l.setAttribute("data-styles","");let e=null!=(n=c6.$nonce$)?n:dc(c4);null!=e&&l.setAttribute("nonce",e),a.insertBefore(l,s?s.nextSibling:a.firstChild)}u=!1,c.length?c.map(e=>e.connectedCallback()):c6.jmp(()=>d=setTimeout(d2,30))})([["mm-install-modal_3",[[1,"mm-install-modal",{link:[1],sdkVersion:[1,"sdk-version"],preferDesktop:[4,"prefer-desktop"],tab:[32],isDefaultTab:[32],translationsLoaded:[32]},null,{preferDesktop:["updatePreferDesktop"]}],[1,"mm-pending-modal",{displayOTP:[4,"display-o-t-p"],sdkVersion:[1,"sdk-version"],otpCode:[1,"otp-code"],translationsLoaded:[32]}],[1,"mm-select-modal",{link:[1],sdkVersion:[1,"sdk-version"],preferDesktop:[4,"prefer-desktop"],tab:[32],isDefaultTab:[32],translationsLoaded:[32]},null,{preferDesktop:["updatePreferDesktop"]}]]]],t)},setNonce:e=>c6.$nonce$=e});let ut={fontFamily:"Roboto, sans-serif"},un=({className:e},t)=>dS("div",{style:ut,class:e},t),ur=({Icon:e,text:t})=>dS("div",{class:"flexContainer",style:{padding:"6",flexDirection:"row"}},dS("div",{class:"flexItem1"},dS(e,null)),dS("div",{class:"flexItem11"},dS("span",{style:{lineHeight:"2",color:"black"}},t))),ui=()=>dS("svg",{width:"20",height:"18",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dS("path",{d:"M20.0002 7.9702V10.0302C20.0002 10.5802 19.5602 11.0302 19.0002 11.0502H17.0402C15.9602 11.0502 14.9702 10.2602 14.8802 9.1802C14.8202 8.5502 15.0602 7.9602 15.4802 7.5502C15.8502 7.1702 16.3602 6.9502 16.9202 6.9502H19.0002C19.5602 6.9702 20.0002 7.4202 20.0002 7.9702Z",fill:"#037DD6"}),dS("path",{d:"M18.47 12.55H17.04C15.14 12.55 13.54 11.12 13.38 9.3C13.29 8.26 13.67 7.22 14.43 6.48C15.07 5.82 15.96 5.45 16.92 5.45H18.47C18.76 5.45 19 5.21 18.97 4.92C18.75 2.49 17.14 0.83 14.75 0.55C14.51 0.51 14.26 0.5 14 0.5H5C4.72 0.5 4.45 0.52 4.19 0.56C1.64 0.88 0 2.78 0 5.5V12.5C0 15.26 2.24 17.5 5 17.5H14C16.8 17.5 18.73 15.75 18.97 13.08C19 12.79 18.76 12.55 18.47 12.55ZM11 6.75H5C4.59 6.75 4.25 6.41 4.25 6C4.25 5.59 4.59 5.25 5 5.25H11C11.41 5.25 11.75 5.59 11.75 6C11.75 6.41 11.41 6.75 11 6.75Z",fill:"#037DD6"})),uo=()=>dS("svg",{width:"20",height:"18",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dS("path",{d:"M14.44 0.0999756C12.63 0.0999756 11.01 0.979976 10 2.32998C8.99 0.979976 7.37 0.0999756 5.56 0.0999756C2.49 0.0999756 0 2.59998 0 5.68998C0 6.87998 0.19 7.97998 0.52 8.99998C2.1 14 6.97 16.99 9.38 17.81C9.72 17.93 10.28 17.93 10.62 17.81C13.03 16.99 17.9 14 19.48 8.99998C19.81 7.97998 20 6.87998 20 5.68998C20 2.59998 17.51 0.0999756 14.44 0.0999756Z",fill:"#037DD6"})),ua=()=>dS("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dS("path",{d:"M16.28 7.53V6.28C16.28 3.58 15.63 0 10 0C4.37 0 3.72 3.58 3.72 6.28V7.53C0.92 7.88 0 9.3 0 12.79V14.65C0 18.75 1.25 20 5.35 20H14.65C18.75 20 20 18.75 20 14.65V12.79C20 9.3 19.08 7.88 16.28 7.53ZM10 16.74C8.33 16.74 6.98 15.38 6.98 13.72C6.98 12.05 8.34 10.7 10 10.7C11.66 10.7 13.02 12.06 13.02 13.72C13.02 15.39 11.67 16.74 10 16.74ZM5.35 7.44C5.27 7.44 5.2 7.44 5.12 7.44V6.28C5.12 3.35 5.95 1.4 10 1.4C14.05 1.4 14.88 3.35 14.88 6.28V7.45C14.8 7.45 14.73 7.45 14.65 7.45H5.35V7.44Z",fill:"#037DD6"})),us=()=>dS("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dS("path",{d:"M16.4405 8.8999C20.0405 9.2099 21.5105 11.0599 21.5105 15.1099V15.2399C21.5105 19.7099 19.7205 21.4999 15.2505 21.4999H8.74047C4.27047 21.4999 2.48047 19.7099 2.48047 15.2399V15.1099C2.48047 11.0899 3.93047 9.2399 7.47047 8.9099",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M12 2V14.88",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M15.3504 12.6499L12.0004 15.9999L8.65039 12.6499",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));function ul({version:e}){return dS("div",{style:{textAlign:"center",color:"#BBC0C5",fontSize:"12"}},"SDK Version ",e?`v${e}`:"unknown")}let uc=()=>dS("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dS("rect",{width:"16",height:"16",fill:"white"}),dS("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.40554 2.40554C2.94627 1.86482 3.82296 1.86482 4.36369 2.40554L8 6.04186L11.6363 2.40554C12.177 1.86482 13.0537 1.86482 13.5945 2.40554
6C14.1352 2.94627 14.1352 3.82296 13.5945 4.36369L9.95814 8L13.5945 11.6363C14.1352 12.177 14.1352 13.0537 13.5945 13.5945C13.0537 14.1352 12.177 14.1352 11.6363 13.5945L8 9.95814L4.36369 13.5945C3.82296 14.1352 2.94627 14.1352 2.40554 13.5945C1.86482 13.0537 1.86482 12.177 2.40554 11.6363L6.04186 8L2.40554 4.36369C1.86482 3.82296 1.86482 2.94627 2.40554 2.40554Z",fill:"#BBC0C5"})),ud=()=>dS("svg",{width:"273",height:"51",viewBox:"0 0 273 51",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dS("path",{d:"M240.882 25.9263C239.472 24.997 237.916 24.3361 236.443 23.5101C235.489 22.9731 234.473 22.4982 233.643 21.8167C232.233 20.6602 232.524 18.3885 233.996 17.3973C236.112 15.993 239.617 16.7777 239.99 19.6483C239.99 19.7102 240.052 19.7515 240.114 19.7515H243.308C243.391 19.7515 243.454 19.6896 243.433 19.607C243.267 17.6244 242.5 15.9723 241.089 14.9191C239.741 13.9072 238.206 13.3702 236.568 13.3702C228.127 13.3702 227.359 22.271 231.901 25.0796C232.42 25.41 236.879 27.6404 238.455 28.611C240.032 29.5816 240.529 31.3576 239.845 32.7619C239.223 34.0423 237.605 34.9303 235.987 34.8271C234.224 34.7238 232.855 33.7738 232.378 32.2869C232.295 32.0185 232.254 31.5022 232.254 31.275C232.254 31.2131 232.192 31.1511 232.129 31.1511H228.666C228.604 31.1511 228.541 31.2131 228.541 31.275C228.541 33.7738 229.164 35.1575 230.864 36.4172C232.461 37.615 234.203 38.1106 236.008 38.1106C240.737 38.1106 243.184 35.4466 243.682 32.6793C244.117 29.974 243.308 27.5371 240.882 25.9263Z",fill:"#24292E"}),dS("path",{d:"M90.4943 13.8246H88.9595H87.2795C87.2173 13.8246 87.1758 13.8659 87.1551 13.9072L84.3137 23.2416C84.2722 23.3655 84.1063 23.3655 84.0648 23.2416L81.2234 13.9072C81.2026 13.8452 81.1612 13.8246 81.0989 13.8246H79.419H77.8842H75.8102C75.748 13.8246 75.6857 13.8865 75.6857 13.9485V37.7802C75.6857 37.8422 75.748 37.9041 75.8102 37.9041H79.2738C79.336 37.9041 79.3982 37.8422 79.3982 37.7802V19.6689C79.3982 19.5244 79.6056 19.5037 79.6471 19.6276L82.5093 29.024L82.7167 29.6849C82.7374 29.7468 82.7789 29.7675 82.8411 29.7675H85.4959C85.5581 29.7675 85.5996 29.7262 85.6203 29.6849L85.8277 29.024L88.6899 19.6276C88.7313 19.4831 88.9387 19.5244 88.9387 19.6689V37.7802C88.9387 37.8422 89.001 37.9041 89.0632 37.9041H92.5268C92.589 37.9041 92.6513 37.8422 92.6513 37.7802V13.9485C92.6513 13.8865 92.589 13.8246 92.5268 13.8246H90.4943Z",fill:"#24292E"}),dS("path",{d:"M187.849 13.8246C187.787 13.8246 187.745 13.8659 187.725 13.9072L184.883 23.2416C184.842 23.3655 184.676 23.3655 184.634 23.2416L181.793 13.9072C181.772 13.8452 181.731 13.8246 181.668 13.8246H176.4C176.338 13.8246 176.276 13.8865 176.276 13.9485V37.7802C176.276 37.8422 176.338 37.9041 176.4 37.9041H179.864C179.926 37.9041 179.988 37.8422 179.988 37.7802V19.6689C179.988 19.5244 180.196 19.5037 180.237 19.6276L183.099 29.024L183.307 29.6849C183.328 29.7468 183.369 29.7675 183.431 29.7675H186.086C186.148 29.7675 186.19 29.7262 186.211 29.6849L186.418 29.024L189.28 19.6276C189.322 19.4831 189.529 19.5244 189.529 19.6689V37.7802C189.529 37.8422 189.591 37.9041 189.653 37.9041H193.117C193.179 37.9041 193.241 37.8422 193.241 37.7802V13.9485C193.241 13.8865 193.179 13.8246 193.117 13.8246H187.849Z",fill:"#24292E"}),dS("path",{d:"M143.174 13.8246H136.724H133.261H126.81C126.748 13.8246 126.686 13.8865 126.686 13.9485V16.9223C126.686 16.9843 126.748 17.0462 126.81 17.0462H133.136V37.7802C133.136 37.8422 133.198 37.9041 133.261 37.9041H136.724C136.786 37.9041 136.849 37.8422 136.849 37.7802V17.0462H143.174C143.237 17.0462 143.299 16.9843 143.299 16.9223V13.9485C143.299 13.8865 143.257 13.8246 143.174 13.8246Z",fill:"#24292E"}),dS("path",{d:"M163.604 37.9041H166.756C166.839 37.9041 166.901 37.8215 166.881 37.7389L160.368 13.8245C160.347 13.7626 160.306 13.7419 160.244 13.7419H159.041H156.925H155.722C155.66 13.7419 155.619 13.7832 155.598 13.8245L149.085 37.7389C149.065 37.8215 149.127 37.9041 149.21 37.9041H152.362C152.425 37.9041 152.466 37.8628 152.487 37.8215L154.374 30.862C154.395 30.8 154.436 30.7794 154.499 30.7794H161.467C161.53 30.7794 161.571 30.8207 161.592 30.862L163.479 37.8215C163.5 37.8628 163.562 37.9041 163.604 37.9041ZM155.328 27.3719L157.859 
618.0581C157.9 17.9342 158.066 17.9342 158.107 18.0581L160.638 27.3719C160.659 27.4545 160.596 27.5371 160.513 27.5371H155.453C155.37 27.5371 155.308 27.4545 155.328 27.3719Z",fill:"#24292E"}),dS("path",{d:"M217.362 37.9041H220.515C220.598 37.9041 220.66 37.8215 220.639 37.7389L214.127 13.8245C214.106 13.7626 214.065 13.7419 214.002 13.7419H212.8H210.684H209.481C209.419 13.7419 209.377 13.7832 209.357 13.8245L202.844 37.7389C202.823 37.8215 202.886 37.9041 202.969 37.9041H206.121C206.183 37.9041 206.225 37.8628 206.246 37.8215L208.133 30.862C208.154 30.8 208.195 30.7794 208.257 30.7794H215.226C215.288 30.7794 215.33 30.8207 215.351 30.862L217.238 37.8215C217.259 37.8628 217.3 37.9041 217.362 37.9041ZM209.087 27.3719L211.617 18.0581C211.659 17.9342 211.825 17.9342 211.866 18.0581L214.397 27.3719C214.417 27.4545 214.355 27.5371 214.272 27.5371H209.211C209.129 27.5371 209.066 27.4545 209.087 27.3719Z",fill:"#24292E"}),dS("path",{d:"M106.713 34.3727V26.9795C106.713 26.9176 106.775 26.8556 106.837 26.8556H116.067C116.129 26.8556 116.191 26.7936 116.191 26.7317V23.7579C116.191 23.6959 116.129 23.634 116.067 23.634H106.837C106.775 23.634 106.713 23.572 106.713 23.5101V17.1907C106.713 17.1288 106.775 17.0668 106.837 17.0668H117.332C117.394 17.0668 117.457 17.0049 117.457 16.9429V13.9691C117.457 13.9072 117.394 13.8452 117.332 13.8452H106.713H103.125C103.063 13.8452 103.001 13.9072 103.001 13.9691V17.0668V23.6546V26.8763V34.5173V37.7802C103.001 37.8422 103.063 37.9041 103.125 37.9041H106.713H117.768C117.83 37.9041 117.892 37.8422 117.892 37.7802V34.6412C117.892 34.5792 117.83 34.5173 117.768 34.5173H106.817C106.755 34.4966 106.713 34.4553 106.713 34.3727Z",fill:"#24292E"}),dS("path",{d:"M272.532 37.6976L260.544 25.3687C260.502 25.3274 260.502 25.2448 260.544 25.2035L271.329 14.0517C271.412 13.9691 271.349 13.8452 271.246 13.8452H266.828C266.787 13.8452 266.766 13.8659 266.745 13.8865L257.599 23.3449C257.516 23.4275 257.391 23.3655 257.391 23.2623V13.9691C257.391 13.9072 257.329 13.8452 257.267 13.8452H253.803C253.741 13.8452 253.679 13.9072 253.679 13.9691V37.8009C253.679 37.8628 253.741 37.9248 253.803 37.9248H257.267C257.329 37.9248 257.391 37.8628 257.391 37.8009V27.3099C257.391 27.2067 257.536 27.1447 257.599 27.2273L267.969 37.8835C267.989 37.9041 268.031 37.9248 268.052 37.9248H272.469C272.552 37.9041 272.615 37.7596 272.532 37.6976Z",fill:"#24292E"}),dS("path",{d:"M52.021 1L31.0526 16.4886L34.9517 7.36063L52.021 1Z",fill:"#E17726",stroke:"#E17726","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M3.65491 1L24.4366 16.6331L20.7241 7.36063L3.65491 1Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M44.4716 36.9127L38.8925 45.4211L50.8389 48.7047L54.261 37.0986L44.4716 36.9127Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M1.43555 37.0986L4.83695 48.7047L16.7626 45.4211L11.2042 36.9127L1.43555 37.0986Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M16.1197 22.5395L12.8013 27.5371L24.6232 28.074L24.2292 15.3734L16.1197 22.5395Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M39.5561 22.5394L31.3222 15.2288L31.0526 28.0739L42.8746 27.537L39.5561 22.5394Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M16.7626 45.4212L23.918 41.9724L17.7582 37.1813L16.7626 45.4212Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M31.7578 41.9724L38.8925 45.4212L37.9177 37.1813L31.7578 41.9724Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M38.8923 45.4212L31.7577 41.9724L32.3384 46.5983L32.2762 48.5602L38.8923 45.4212Z",fill:"#D5BFB2",stroke:"#D5BFB2","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M16.7625 45.4212L23.3994 48.5602L23.3579 46.5983L23.9179 41.9724L16.7625 45.4212Z",fill:"#D5BF
6B2",stroke:"#D5BFB2","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M23.5239 34.1249L17.5922 32.3902L21.7818 30.4696L23.5239 34.1249Z",fill:"#233447",stroke:"#233447","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M32.1517 34.1249L33.8939 30.4696L38.1042 32.3902L32.1517 34.1249Z",fill:"#233447",stroke:"#233447","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M16.7626 45.4212L17.7996 36.9128L11.2042 37.0987L16.7626 45.4212Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M37.8761 36.9128L38.8924 45.4212L44.4715 37.0987L37.8761 36.9128Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M42.8745 27.5371L31.0526 28.074L32.1518 34.1249L33.894 30.4696L38.1042 32.3902L42.8745 27.5371Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M17.5922 32.3902L21.7817 30.4696L23.5239 34.1249L24.6232 28.074L12.8012 27.5371L17.5922 32.3902Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M12.8013 27.5371L17.7582 37.1813L17.5923 32.3902L12.8013 27.5371Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M38.1044 32.3902L37.9177 37.1813L42.8746 27.5371L38.1044 32.3902Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M24.6232 28.0741L23.524 34.125L24.9136 41.2703L25.2247 31.8533L24.6232 28.0741Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M31.0526 28.0741L30.4719 31.8327L30.7623 41.2703L32.1519 34.125L31.0526 28.0741Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M32.1519 34.1249L30.7623 41.2702L31.7578 41.9724L37.9177 37.1813L38.1043 32.3901L32.1519 34.1249Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M17.5922 32.3901L17.7581 37.1813L23.918 41.9724L24.9135 41.2702L23.5239 34.1249L17.5922 32.3901Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M32.2763 48.5602L32.3385 46.5983L31.7993 46.1439H23.8765L23.358 46.5983L23.3995 48.5602L16.7626 45.4211L19.0855 47.3211L23.7935 50.5633H31.8615L36.5903 47.3211L38.8924 45.4211L32.2763 48.5602Z",fill:"#C0AC9D",stroke:"#C0AC9D","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M31.7578 41.9724L30.7622 41.2703H24.9135L23.918 41.9724L23.358 46.5983L23.8765 46.144H31.7993L32.3385 46.5983L31.7578 41.9724Z",fill:"#24292E",stroke:"#24292E","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M52.9128 17.5005L54.6757 8.95079L52.021 1L31.7578 15.9723L39.5561 22.5394L50.5692 25.7404L52.9958 22.9111L51.938 22.147L53.618 20.6188L52.3321 19.6276L54.0121 18.3472L52.9128 17.5005Z",fill:"#763E1A",stroke:"#763E1A","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M1 8.95079L2.78366 17.5005L1.64295 18.3472L3.34365 19.6276L2.05775 20.6188L3.73771 22.147L2.67996 22.9111L5.10657 25.7404L16.1196 22.5394L23.918 15.9723L3.65475 1L1 8.95079Z",fill:"#763E1A",stroke:"#763E1A","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M50.5692 25.7404L39.5561 22.5394L42.8746 27.5371L37.9177 37.1813L44.4716 37.0987H54.261L50.5692 25.7404Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M16.1196 22.5394L5.10651 25.7404L1.43549 37.0987H11.2041L17.7581 37.1813L12.8011 27.5371L16.1196 22.5394Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}
6),dS("path",{d:"M31.0526 28.0741L31.7578 15.9724L34.9518 7.36072H20.7239L23.9179 15.9724L24.6231 28.0741L24.8927 31.8739L24.9135 41.2703H30.7622L30.783 31.8739L31.0526 28.0741Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round"}));function uu(e,t){return e.toString(2).padStart(t,"0")}function uh(e,t){let n=e%t;return n>=0?n:t+n}function uf(e,t){return Array(e).fill(t)}function up(...e){let t=0;for(let n of e)t=Math.max(t,n.length);let n=[];for(let r=0;r<t;r++)for(let t of e)r>=t.length||n.push(t[r]);return new Uint8Array(n)}function ug(e,t,n){if(n<0||n+t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[n+r])return!1;return!0}function um(e){return{has:t=>e.includes(t),decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw Error("alphabet.decode input should be array of strings");return t.map(t=>{if("string"!=typeof t)throw Error(`alphabet.decode: not string element=${t}`);let n=e.indexOf(t);if(-1===n)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return n})},encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw Error("alphabet.encode input should be an array of numbers");return t.map(t=>{if(function(e){if(!Number.isSafeInteger(e))throw Error(`Wrong integer: ${e}`)}(t),t<0||t>=e.length)throw Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]})}}}class uy{static size(e,t){if("number"==typeof e&&(e={height:e,width:e}),!Number.isSafeInteger(e.height)&&e.height!==1/0)throw Error(`Bitmap: wrong height=${e.height} (${typeof e.height})`);if(!Number.isSafeInteger(e.width)&&e.width!==1/0)throw Error(`Bitmap: wrong width=${e.width} (${typeof e.width})`);return void 0!==t&&(e={width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}),e}static fromString(e){let t,n=(e=e.replace(/^\n+/g,"").replace(/\n+$/g,"")).split("\n"),r=n.length,i=Array(r);for(let e of n){let n=e.split("").map(e=>{if("X"===e)return!0;if(" "===e)return!1;if("?"!==e)throw Error(`Bitmap.fromString: unknown symbol=${e}`)});if(t&&n.length!==t)throw Error(`Bitmap.fromString different row sizes: width=${t} cur=${n.length}`);t=n.length,i.push(n)}return t||(t=0),new uy({height:r,width:t},i)}constructor(e,t){const{height:n,width:r}=uy.size(e);this.data=t||Array.from({length:n},()=>uf(r,void 0)),this.height=n,this.width=r}point(e){return this.data[e.y][e.x]}isInside(e){return 0<=e.x&&e.x<this.width&&0<=e.y&&e.y<this.height}size(e){if(!e)return{height:this.height,width:this.width};let{x:t,y:n}=this.xy(e);return{height:this.height-n,width:this.width-t}}xy(e){if("number"==typeof e&&(e={x:e,y:e}),!Number.isSafeInteger(e.x))throw Error(`Bitmap: wrong x=${e.x}`);if(!Number.isSafeInteger(e.y))throw Error(`Bitmap: wrong y=${e.y}`);return e.x=uh(e.x,this.width),e.y=uh(e.y,this.height),e}rect(e,t,n){let{x:r,y:i}=this.xy(e),{height:o,width:a}=uy.size(t,this.size({x:r,y:i}));for(let e=0;e<o;e++)for(let t=0;t<a;t++)this.data[i+e][r+t]="function"==typeof n?n({x:t,y:e},this.data[i+e][r+t]):n;return this}rectRead(e,t,n){return this.rect(e,t,(e,t)=>(n(e,t),t))}hLine(e,t,n){return this.rect(e,{width:t,height:1},n)}vLine(e,t,n){return this.rect(e,{width:1,height:t},n)}border(e=2,t){let n=this.height+2*e,r=this.width+2*e,i=uf(e,t),o=Array.from({length:e},()=>uf(r,t));return new uy({height:n,width:r},[...o,...this.data.map(e=>[...i,...e,...i]),...o])}embed(e,t){return this.rect(e,t.size(),({x:e,y:n})=>t.data[n][e])}rectSlice(e,t=this.size()){let n=new uy(uy.size(t,this.size(this.xy(e))));return this.rect(e,t,({x:e,y:t},r)=>n.data[t][e]=r),n}inverse(){let{height:e,width:t}=this;return new uy({height:t,width:e}).rect({x:0,y:0},1/0,({x:e,y:t})=>this.data[e][t])}scale(e){if(!Number.isSafeInteger(e)||e>1024)throw Error(`Wrong scale factor: ${e}`);let{height:t,width:n}=this;return new uy({height:e*t,width:e*n}).rect({x:0,y:0},1/0,({x:t,y:n})=>this.data[Math.floor(n/e)][Math.floor(t/e)])}clone(){return new uy(this.size()).rect({x:0,y:0},this.size(),({x:e,y:t})=>this.data[t][e])}assertDrawn(){this.rectRead(0,1/0,(e,t)=>{if("boolean"!=typeof t)throw Error("Invalid color type="+typeof t)})}toString(){return this.data.map(e=>e.map(e=>void 0===e?"?":e?"X":" ").join("")).join("\n")}toASCII(){let{height:e,width:t,data:n}=this,r="";for(let i=0;i<e;i+=2){for(let o=0;o<t;o++){let t=n[i][o],a=i+1>=e||n[i+1][o];t||a?!t&&a?r+="▀":t&&!a?r+="▄":t&&a&&(r+=" "):r+="█"}r+="\n"}return r}toTerm(){let e="\x1b[0m",t=`�[1;47m  ${e}`,n=`�[40m  ${e}`;return this.data.map(e=>e.map(e=>e?n:t).join("")).join("\n")}toSVG(){let e=`<svg xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 ${this.width} ${this.height}" version="1.1" xmlns="http://www.w3.org/2000/svg">`;
6return this.rectRead(0,1/0,({x:t,y:n},r)=>{r&&(e+=`<rect x="${t}" y="${n}" width="1" height="1" />`)}),e+="</svg>"}toGIF(){let e=e=>[255&e,e>>>8&255],t=[...e(this.width),...e(this.height)],n=[];this.rectRead(0,1/0,(e,t)=>n.push(+(!0===t)));let r=[71,73,70,56,55,97,...t,246,0,0,255,255,255,...uf(381,0),44,0,0,0,0,...t,0,7],i=Math.floor(n.length/126);for(let e=0;e<i;e++)r.push(127,128,...n.slice(126*e,126*(e+1)).map(e=>+e));return r.push(n.length%126+1,128,...n.slice(126*i).map(e=>+e)),r.push(1,129,0,59),new Uint8Array(r)}toImage(e=!1){let{height:t,width:n}=this.size(),r=new Uint8Array(t*n*(e?3:4)),i=0;for(let o=0;o<t;o++)for(let t=0;t<n;t++){let n=255*!this.data[o][t];r[i++]=n,r[i++]=n,r[i++]=n,e||(r[i++]=255)}return{height:t,width:n,data:r}}}let uv=["low","medium","quartile","high"],ub=["numeric","alphanumeric","byte","kanji","eci"],uE=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],uw={low:[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],medium:[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],quartile:[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],high:[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]},uC={low:[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],medium:[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],quartile:[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],high:[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]},u_={size:{encode:e=>21+4*(e-1),decode:e=>(e-17)/4},sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(1===e)return[];let t=u_.size.encode(e)-6-1,n=t-6,r=Math.ceil(n/28),i=Math.floor(n/r);i%2?i+=1:n%r*2>=r&&(i+=2);let o=[6];for(let e=1;e<r;e++)o.push(t-(r-e)*i);return o.push(t),o},ECCode:{low:1,medium:0,quartile:3,high:2},formatMask:21522,formatBits(e,t){let n=u_.ECCode[e]<<3|t,r=n;for(let e=0;e<10;e++)r=r<<1^1335*(r>>9);return(n<<10|r)^u_.formatMask},versionBits(e){let t=e;for(let e=0;e<12;e++)t=t<<1^7973*(t>>11);return e<<12|t},alphabet:{numeric:um("0123456789"),alphanumerc:um("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")},lengthBits:(e,t)=>({numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]})[t][u_.sizeType(e)],modeBits:{numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"},capacity(e,t){let n=uE[e-1],r=uw[t][e-1],i=uC[t][e-1],o=Math.floor(n/i)-r,a=i-n%i;return{words:r,numBlocks:i,shortBlocks:a,blockLen:o,capacity:8*(n-r*i),total:(r+o)*i+i-a}}},uS=[(e,t)=>(e+t)%2==0,(e,t)=>t%2==0,(e,t)=>e%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0],ux={tables:(e=>{let t=uf(256,0),n=uf(256,0);for(let e=0,r=1;e<256;e++)t[e]=r,n[r]=e,256&(r<<=1)&&(r^=285);return{exp:t,log:n}})(),exp:e=>ux.tables.exp[e],log(e){if(0===e)throw Error(`GF.log: wrong arg=${e}`);return ux.tables.log[e]%255},mul:(e,t)=>
60===e||0===t?0:ux.tables.exp[(ux.tables.log[e]+ux.tables.log[t])%255],add:(e,t)=>e^t,pow:(e,t)=>ux.tables.exp[ux.tables.log[e]*t%255],inv(e){if(0===e)throw Error(`GF.inverse: wrong arg=${e}`);return ux.tables.exp[255-ux.tables.log[e]]},polynomial(e){if(0==e.length)throw Error("GF.polymomial: wrong length");if(0!==e[0])return e;let t=0;for(;t<e.length-1&&0==e[t];t++);return e.slice(t)},monomial(e,t){if(e<0)throw Error(`GF.monomial: wrong degree=${e}`);if(0==t)return[0];let n=uf(e+1,0);return n[0]=t,ux.polynomial(n)},degree:e=>e.length-1,coefficient:(e,t)=>e[ux.degree(e)-t],mulPoly(e,t){if(0===e[0]||0===t[0])return[0];let n=uf(e.length+t.length-1,0);for(let r=0;r<e.length;r++)for(let i=0;i<t.length;i++)n[r+i]=ux.add(n[r+i],ux.mul(e[r],t[i]));return ux.polynomial(n)},mulPolyScalar(e,t){if(0==t)return[0];if(1==t)return e;let n=uf(e.length,0);for(let r=0;r<e.length;r++)n[r]=ux.mul(e[r],t);return ux.polynomial(n)},mulPolyMonomial(e,t,n){if(t<0)throw Error("GF.mulPolyMonomial: wrong degree");if(0==n)return[0];let r=uf(e.length+t,0);for(let t=0;t<e.length;t++)r[t]=ux.mul(e[t],n);return ux.polynomial(r)},addPoly(e,t){if(0===e[0])return t;if(0===t[0])return e;let n=e,r=t;n.length>r.length&&([n,r]=[r,n]);let i=uf(r.length,0),o=r.length-n.length,a=r.slice(0,o);for(let e=0;e<a.length;e++)i[e]=a[e];for(let e=o;e<r.length;e++)i[e]=ux.add(n[e-o],r[e]);return ux.polynomial(i)},remainderPoly(e,t){let n=Array.from(e);for(let r=0;r<e.length-t.length+1;r++){let e=n[r];if(0!==e)for(let i=1;i<t.length;i++)0!==t[i]&&(n[r+i]=ux.add(n[r+i],ux.mul(t[i],e)))}return n.slice(e.length-t.length+1,n.length)},divisorPoly(e){let t=[1];for(let n=0;n<e;n++)t=ux.mulPoly(t,[1,ux.pow(2,n)]);return t},evalPoly(e,t){if(0==t)return ux.coefficient(e,0);let n=e[0];for(let r=1;r<e.length;r++)n=ux.add(ux.mul(t,n),e[r]);return n},euclidian(e,t,n){ux.degree(e)<ux.degree(t)&&([e,t]=[t,e]);let r=e,i=t,o=[0],a=[1];for(;2*ux.degree(i)>=n;){let e=r,t=o;if(r=i,o=a,0===r[0])throw Error("rLast[0] === 0");i=e;let n=[0],s=ux.inv(r[0]);for(;ux.degree(i)>=ux.degree(r)&&0!==i[0];){let e=ux.degree(i)-ux.degree(r),t=ux.mul(i[0],s);n=ux.addPoly(n,ux.monomial(e,t)),i=ux.addPoly(i,ux.mulPolyMonomial(r,e,t))}if(n=ux.mulPoly(n,o),a=ux.addPoly(n,t),ux.degree(i)>=ux.degree(r))throw Error(`Division failed r: ${i}, rLast: ${r}`)}let s=ux.coefficient(a,0);if(0==s)throw Error("sigmaTilde(0) was zero");let l=ux.inv(s);return[ux.mulPolyScalar(a,l),ux.mulPolyScalar(i,l)]}};function uk(e,t,n,r){let i="",o=n.length;if("numeric"===r){let e=u_.alphabet.numeric.decode(n.split("")),t=e.length;for(let n=0;n<t-2;n+=3)i+=uu(100*e[n]+10*e[n+1]+e[n+2],10);t%3==1?i+=uu(e[t-1],4):t%3==2&&(i+=uu(10*e[t-2]+e[t-1],7))}else if("alphanumeric"===r){let e=u_.alphabet.alphanumerc.decode(n.split("")),t=e.length;for(let n=0;n<t-1;n+=2)i+=uu(45*e[n]+e[n+1],11);t%2==1&&(i+=uu(e[t-1],6))}else{if("byte"!==r)throw Error("encode: unsupported type");{let e=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(n);o=e.length,i=Array.from(e).map(e=>uu(e,8)).join("")}}let{capacity:a}=u_.capacity(e,t),s=uu(o,u_.lengthBits(e,r)),l=u_.modeBits[r]+s+i;if(l.length>a)throw Error("Capacity overflow");(l+="0".repeat(Math.min(4,Math.max(0,a-l.length)))).length%8&&(l+="0".repeat(8-l.length%8));for(let e=0;l.length!==a;e++)l+="1110110000010001"[e%16];let c=Uint8Array.from(l.match(/(.{8})/g).map(e=>Number(`0b${e}`)));return(function(e,t){let{words:n,shortBlocks:r,numBlocks:i,blockLen:o,total:a}=u_.capacity(e,t),s={encode(e){let t=ux.divisorPoly(n),r=Array.from(e);return r.push(...t.slice(0,-1).fill(0)),Uint8Array.from(ux.remainderPoly(r,t))},decode(e){let t=e.slice(),r=ux.polynomial(Array.from(e)),i=uf(n,0),o=!1;for(let e=0;e<n;e++){let t=ux.evalPoly(r,ux.exp(e));i[i.length-1-e]=t,0!==t&&(o=!0)}if(!o)return t;i=ux.polynomial(i);let a=ux.monomial(n,1),[s,l]=ux.euclidian(a,i,n),c=uf(ux.degree(s),0),d=0;for(let e=1;e<256&&d<c.length;e++)0===ux.evalPoly(s,e)&&(c[d++]=ux.inv(e));if(d!==c.length)throw Error("RS.decode: wrong errors number");for(let e=0;e<c.length;e++){let n=t.length-1-ux.log(c[e]);if(n<0)throw Error("RS.decode: wrong error location");let r=ux.inv(c[e]),i=1;for(let t=0;t<c.length;t++)e!==t&&(i=ux.mul(i,ux.add(1,ux.mul(c[t],r))));t[n]=ux.add(t[n],ux.mul(ux.evalPoly(l,r),ux.inv(i)))}return t}};return{encode(e){let t=[],n=[];for(let a=0;a<i;a++){let i=o+(a<r?0:1);t.push(e.subarray(0,i)),n.push(s.encode(e.subarray(0,i))),e=e.subarray(i)}let a=up(...t),l=up(...n),c=new Uint8Array(a.length+l.length);return c.set(a),c.set(l,a.length),c},decode(e){if(e.length!==a)throw Error(`interleave.decode: len(data)=${e.length}, total=${a}`);let t=[];for(let e=0;e<i;e++){let i=e<r;t.push(new Uint8Array(n+o+ +!i))}let l=0;for(let n=0;n<o;n++)for(let r=0;r<i;r++)t[r][n]=e[l++];for(let n=r;n<i;n++)t[n][o]=e[l++];for(let a=o;a<o+n;a++)for(let n=0;n<i;n++){let i=n<r;t[n][a+ +!i]=e[l++]}let c=[];for(let e of t)c.push(...Array.from(s.decode(e)).slice(0,-n));return Uint8Array.from(c)}}})(e,t).encode(c)}function uM(e,t,n,r,i=!1){let o=function(e,t,n,r=!1){let i=u_.size.encode(e),o=new uy(i+2),a=new uy(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);o=(o=o.embed(0,a).embed({x:-a.width,y:0},a).embed({x:0,y:-a.height},a)).rectSlice(1,i);let s=new uy(1).rect(0,1,!0).border(1,!1).border(1,!0),l=u_.alignmentPatterns(e);for(let e of l)for(let t of l)void 0===o.data[e][t]&&o.embed({x:t-2,y:e-2},s);o=o.hLine({x:0,y:6},1/0,({x:e},t)=>void 0===t?e%2==0:t).vLine({x:6,y:0},1/0,({y:e},t)=>void 0===t?e%2==0:t);
6{let e=u_.formatBits(t,n),a=t=>!r&&1==(e>>t&1);for(let e=0;e<6;e++)o.data[e][8]=a(e);for(let e=6;e<8;e++)o.data[e+1][8]=a(e);for(let e=8;e<15;e++)o.data[i-15+e][8]=a(e);for(let e=0;e<8;e++)o.data[8][i-e-1]=a(e);for(let e=8;e<9;e++)o.data[8][15-e-1+1]=a(e);for(let e=9;e<15;e++)o.data[8][15-e-1]=a(e);o.data[i-8][8]=!r}if(e>=7){let t=u_.versionBits(e);for(let e=0;e<18;e+=1){let n=!r&&1==(t>>e&1),a=Math.floor(e/3),s=e%3+i-8-3;o.data[a][s]=n,o.data[s][a]=n}}return o}(e,t,r,i),a=0,s=8*n.length;if(function(e,t,n){let r=e.height,i=uS[t],o=-1,a=r-1;for(let t=r-1;t>0;t-=2){for(6==t&&(t=5);;a+=o){for(let r=0;r<2;r+=1){let o=t-r;void 0===e.data[a][o]&&n(o,a,i(o,a))}if(a+o<0||a+o>=r)break}o=-o}}(o,r,(e,t,r)=>{let i=!1;a<s&&(i=0!=(n[a>>>3]>>(7-a&7)&1),a++),o.data[t][e]=i!==r}),a!==s)throw Error("QR: bytes left after draw");return o}function uA(e,t="raw",n={}){let r=void 0!==n.ecc?n.ecc:"medium";if(!uv.includes(r))throw Error(`Invalid error correction mode=${r}. Expected: ${uv}`);let i=void 0!==n.encoding?n.encoding:function(e){let t="numeric";for(let n of e)if(!u_.alphabet.numeric.has(n)&&(t="alphanumeric",!u_.alphabet.alphanumerc.has(n)))return"byte";return t}(e);!function(e){if(!ub.includes(e))throw Error(`Encoding: invalid mode=${e}. Expected: ${ub}`);if("kanji"===e||"eci"===e)throw Error(`Encoding: ${e} is not supported (yet?).`)}(i),void 0!==n.mask&&function(e){if(![0,1,2,3,4,5,6,7].includes(e)||!uS[e])throw Error(`Invalid mask=${e}. Expected number [0..7]`)}(n.mask);let o,a=n.version,s=Error("Unknown error");if(void 0!==a)!function(e){if(!Number.isSafeInteger(e)||e<1||e>40)throw Error(`Invalid version=${e}. Expected number [1..40]`)}(a),o=uk(a,r,e,i);else for(let t=1;t<=40;t++)try{o=uk(t,r,e,i),a=t;break}catch(e){s=e}if(!a||!o)throw s;let l=function(e,t,n,r){if(void 0===r){let i,o,a=(o=1/0,{add(e,t){e>=o||(i=t,o=e)},get:()=>i,score:()=>o});for(let r=0;r<uS.length;r++)a.add(function(e){let t=e.inverse(),n=e=>{let t=0;for(let n,r=0,i=1;r<e.length;r++)n===e[r]&&(i++,r!==e.length-1)||(i>=5&&(t+=i-5+3),n=e[r],i=1);return t},r=0;e.data.forEach(e=>r+=n(e)),t.data.forEach(e=>r+=n(e));let i=0,o=e.data,a=e.width-1,s=e.height-1;for(let e=0;e<a;e++)for(let t=0;t<s;t++){let n=e+1,r=t+1;o[e][t]===o[n][t]&&o[n][t]===o[e][r]&&o[n][t]===o[n][r]&&(i+=3)}let l=e=>{let t=[!0,!1,!0,!0,!0,!1,!0],n=[!1,!1,!1,!1],r=[...t,...n],i=[...n,...t],o=0;for(let t=0;t<e.length;t++)ug(e,r,t)&&(o+=40),ug(e,i,t)&&(o+=40);return o},c=0;for(let t of e.data)c+=l(t);for(let e of t.data)c+=l(e);let d=0;e.rectRead(0,1/0,(e,t)=>d+=+!!t);let u=10*Math.floor(Math.abs(d/(e.height*e.width)*100-50)/5);return r+i+c+u}(uM(e,t,n,r,!0)),r);r=a.get()}if(void 0===r)throw Error("Cannot find mask");return uM(e,t,n,r)}(a,r,o,n.mask);l.assertDrawn();let c=void 0===n.border?2:n.border;if(!Number.isSafeInteger(c))throw Error("Wrong border type="+typeof c);if(l=l.border(c,!1),void 0!==n.scale&&(l=l.scale(n.scale)),"raw"===t)return l.data;if("ascii"===t)return l.toASCII();if("svg"===t)return l.toSVG();if("gif"===t)return l.toGIF();if("term"===t)return l.toTerm();throw Error(`Unknown output: ${t}`)}let uL={DESKTOP:"Desktop",MOBILE:"Mobile",META_MASK_MOBILE_APP:"MetaMask mobile app",SCAN_TO_CONNECT:"Scan to connect and sign with",CONNECT_WITH_EXTENSION:"Connect With MetaMask Extension",INSTALL_MODAL:{TRUSTED_BY_USERS:"Trusted by over 30 million users to buy, store, send and swap crypto securely",LEADING_CRYPTO_WALLET:"The leading crypto wallet & gateway to blockchain apps built on Ethereum Mainnet, Polygon, Optimism, and many other networks",CONTROL_DIGITAL_INTERACTIONS:"Puts you in control of your digital interactions by making power of cryptography more accessible",INSTALL_META_MASK_EXTENSION:"Install MetaMask Extension"},PENDING_MODAL:{OPEN_META_MASK_SELECT_CODE:"Please open the MetaMask wallet app and select the code on the screen OR disconnect",OPEN_META_MASK_CONTINUE:"Open the MetaMask app to continue with your session.",NUMBER_AFTER_OPEN_NOTICE:"If a number doesn't appear after opening MetaMask, please click disconnect and re-scan the QRCode.",DISCONNECT:"Disconnect"},SELECT_MODAL:{CRYPTO_TAKE_CONTROL_TEXT:"Take control of your crypto and explore the blockchain with the wallet trusted by over 30 million people worldwide"},META_MASK_MODAL:{ADDRESS_COPIED:"Address copied to clipboard!",DISCONNECT:"Disconnect",ACTIVE_NETWORK:"Active Network"}};class uP{constructor(e){var t;this.translations=uL,this.supportedLocales=["es","fr","he","it","pt","tr"],this.baseUrl=null!=(t=null==e?void 0:e.baseUrl)?t:"https://raw.githubusercontent.com/MetaMask/metamask-sdk/refs/heads/gh-pages/locales"}getBrowserLanguage(){if((navigator.languages||[navigator.language]).some(e=>e.toLowerCase().startsWith("en")))return"en";let e=navigator.language.toLowerCase().split("-")[0];return this.supportedLocales.includes(e)?e:"en"}async init(e){let t=this.getBrowserLanguage()||e.fallbackLng;await this.loadTranslations(t)}async loadTranslations(e){let t=e.split("-")[0];if("en"!==t&&this.supportedLocales.includes(t))try{let e=`${this.baseUrl}/${t}.json`,n=await fetch(e);if(!n.ok)throw Error(`HTTP error! status: ${n.status}`);this.translations=await n.json()}catch(e){console.warn(`❌ Failed to load ${t} translations, falling back to English:`,e),this.translations=uL}else this.translations=uL}t(e){return this.getNestedTranslation(e,this.translations)||e}getNestedTranslation(e,t){let n=e.split("."),r=t;for(let e of n){if("object"!=typeof r)return"";r=r[e]}return"string"==typeof r?r:""}}(r=i||(i={})).SDK_MODAL_VIEWED="sdk_modal_viewed",r.SDK_MODAL_BUTTON_CLICKED="sdk_modal_button_clicked",r.SDK_MODAL_TOGGLE_CHANGED="sdk_modal_toggle_changed";let uI=class{constructor(e){c0(this,e),this.close=dI(this,"close",7),this.startDesktopOnboarding=dI(this,"startDesktopOnboarding",7),this.trackAnalytics=dI(this,"trackA
6nalytics",7),this.link=void 0,this.sdkVersion=void 0,this.preferDesktop=void 0,this.tab=1,this.isDefaultTab=!0,this.translationsLoaded=!1,this.onClose=this.onClose.bind(this),this.onStartDesktopOnboardingHandler=this.onStartDesktopOnboardingHandler.bind(this),this.setTab=this.setTab.bind(this),this.render=this.render.bind(this),this.setTab(this.preferDesktop?1:2),this.i18nInstance=new uP}componentDidLoad(){this.trackAnalytics.emit({event:i.SDK_MODAL_VIEWED,params:{extensionInstalled:!1,tab:1===this.tab?"desktop":"mobile"}})}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}updatePreferDesktop(e){e?this.setTab(1):this.setTab(2)}onClose(e=!1){this.close.emit({shouldTerminate:e})}onStartDesktopOnboardingHandler(){this.trackAnalytics.emit({event:i.SDK_MODAL_BUTTON_CLICKED,params:{button_type:"install_extension",tab:"desktop"}}),this.startDesktopOnboarding.emit()}setTab(e,t=!1){t&&this.trackAnalytics.emit({event:i.SDK_MODAL_TOGGLE_CHANGED,params:{toggle:1===this.tab?"desktop_to_mobile":"mobile_to_desktop"}}),this.tab=e,this.isDefaultTab=!1}render(){if(!this.translationsLoaded)return null;let e=e=>this.i18nInstance.t(e),t=this.isDefaultTab?this.preferDesktop?1:2:this.tab,n=uA(this.link,"svg",{ecc:"medium",scale:2});return dS(un,{className:"install-model"},dS("div",{class:"backdrop",onClick:()=>this.onClose(!0)}),dS("div",{class:"modal"},dS("div",{class:"closeButtonContainer"},dS("div",{class:"right"},dS("span",{class:"closeButton",onClick:()=>this.onClose(!0)},dS(uc,null)))),dS("div",{class:"logoContainer"},dS(ud,null)),dS("div",null,dS("div",{class:"tabcontainer"},dS("div",{class:"flexContainer"},dS("div",{onClick:()=>this.setTab(1,!0),class:"tab flexItem "+(1===t?"tabactive":"")},e("DESKTOP")),dS("div",{onClick:()=>this.setTab(2,!0),class:"tab flexItem "+(2===t?"tabactive":"")},e("MOBILE")))),dS("div",{style:{display:1===t?"none":"block"}},dS("div",{class:"flexContainer"},dS("div",{class:"flexItem",style:{textAlign:"center",marginTop:"4"}},n&&dS("div",{id:"sdk-mm-qrcode",class:"center",innerHTML:n}),dS("div",{class:"connectMobileText"},e("SCAN_TO_CONNECT")," ",dS("br",null),dS("span",{class:"blue"},dS("b",null,e("META_MASK_MOBILE_APP"))))))),dS("div",{style:{display:2===t?"none":"block"}},dS("div",{class:"item"},dS(ur,{Icon:uo,text:e("INSTALL_MODAL.TRUSTED_BY_USERS")})),dS("div",{class:"item"},dS(ur,{Icon:ui,text:e("INSTALL_MODAL.LEADING_CRYPTO_WALLET")})),dS("div",{class:"item"},dS(ur,{Icon:ua,text:e("INSTALL_MODAL.CONTROL_DIGITAL_INTERACTIONS")})),dS("button",{class:"button",onClick:()=>this.onStartDesktopOnboardingHandler()},dS(us,null),dS("span",{class:"installExtensionText"},e("INSTALL_MODAL.INSTALL_META_MASK_EXTENSION"))))),dS(ul,{version:this.sdkVersion})))}get el(){return dP(this)}static get watchers(){return{preferDesktop:["updatePreferDesktop"]}}};uI.style=
vendor: 3,083 bytes, line 6
6".flexContainer {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    flex-direction: row;\n}\n\n.flexItem {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem11 {\n    flex: 11;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem1 {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.tab {\n    padding: 8px;\n    cursor: pointer;\n    background-color: #F2F4F6;\n    font-size: 12px;\n    text-align: center;\n    color: #24292E;\n}\n\n.tabcontainer {\n    padding: 4px;\n    background-color: #F2F4F6;\n    border-radius: 8px;\n    margin-bottom: 30px;\n    margin-top: 30px;\n}\n\n.tabactive {\n    background-color: white;\n    -webkit-transition: background-color 300ms linear;\n    -ms-transition: background-color 300ms linear;\n    transition: background-color 300ms linear;\n    border-radius: 8px;\n}\n\n.item {\n    font-size: 12px;\n    margin-bottom: 16px;\n    border-radius: 8px;\n    padding: 10px;\n    border: 2px #F2F4F6 solid;\n    color: #24292E;\n}\n\n.extensionLabel {\n    font-style: normal;\n    font-weight: bold;\n    font-size: 14px;\n    text-align: cetner;\n    color: #24272A;\n}\n\n.notice {\n    font-size: 12px;\n    margin-left: 10px;\n    margin-right: 10px;\n    color: grey;\n}\n\n.button {\n    margin-top: 41.5px;\n    margin-bottom: 20px;\n    width: 100%;\n    display: flex;\n    flex-direction: row;\n    justify-content: center;\n    align-items: center;\n    padding: 12px 20px;\n    background: #037DD6;\n    border-radius: 32px;\n    color: white;\n    border: 0;\n    font-size: 14px;\n    cursor: pointer;\n}\n\n.backdrop {\n    visibility: visible;\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    width: 100%;\n    z-index: 99998;\n    background: rgba(0, 0, 0, 0.87);\n    opacity: 0.3;\n}\n\n.modal {\n    visibility: visible;\n    position: fixed;\n    left: 50%;\n    transform: translate(-50%, -50%);\n    z-index: 99999;\n    background: white;\n    padding: 20px;\n    border-radius: 8px;\n    top: 50%;\n    max-width: 100%;\n    width: 460px;\n    min-width: 300px;\n    box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;\n    -webkit-font-smoothing: antialiased;\n}\n\n.closeButton {\n    color: #BBC0C5;\n    cursor: pointer;\n}\n\n.logoContainer {\n    margin-left: 24px;\n    margin-right: 24px;\n    margin-top: 24px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.connectMobileText {\n    font-size: 14px;\n    color: black;\n    margin-top: 28px;\n    margin-bottom: 28px;\n    line-height: 2;\n}\n\n.blue {\n    color: #037DD6;\n    font-weight: 700;\n}\n\n.installExtensionText {\n    margin-left: 10px;\n}\n\n.center {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.right {\n    display: flex;\n    align-items: center;\n    justify-content: right;\n}\n\n#sdk-mm-qrcode {\n    svg {\n        width: 50%;\n    }\n}";
6let uO=class{constructor(e){c0(this,e),this.close=dI(this,"close",7),this.disconnect=dI(this,"disconnect",7),this.updateOTPValue=dI(this,"updateOTPValue",7),this.displayOTP=void 0,this.sdkVersion=void 0,this.otpCode=void 0,this.translationsLoaded=!1,this.i18nInstance=new uP}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}onClose(){this.close.emit()}onDisconnect(){this.disconnect.emit()}onUpdateOTPValueHandler(e){this.updateOTPValue.emit({otpValue:e})}disconnectedCallback(){this.onClose()}render(){var e;if(!this.translationsLoaded)return null;let t=null==(e=this.displayOTP)||e,n=this.sdkVersion,r=e=>this.i18nInstance.t(e);return dS(un,{className:"pending-modal"},dS("div",{class:"backdrop",onClick:()=>this.onClose()}),dS("div",{class:"modal"},dS("div",{class:"closeButtonContainer"},dS("div",{class:"right"},dS("span",{class:"closeButton",onClick:()=>this.onClose()},dS(uc,null)))),dS("div",{class:"logoContainer"},dS(ud,null)),dS("div",null,dS("div",{class:"flexContainer",style:{flexDirection:"column",color:"black"}},dS("div",{class:"flexItem",style:{textAlign:"center",marginTop:"30px",marginBottom:"30px",fontSize:"16px"}},r(t?"PENDING_MODAL.OPEN_META_MASK_SELECT_CODE":"PENDING_MODAL.OPEN_META_MASK_CONTINUE")),dS("div",{id:"sdk-mm-otp-value",style:{padding:"10px",fontSize:"32px",display:this.otpCode?"block":"none"}},this.otpCode),t&&dS("div",{class:"notice"},"* ",r("PENDING_MODAL.NUMBER_AFTER_OPEN_NOTICE"))),dS("div",{style:{marginTop:"20px"}},dS("button",{class:"button blue",style:{marginTop:"5px",color:"#0376C9",borderColor:"#0376C9",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white"},onClick:()=>this.onDisconnect()},r("PENDING_MODAL.DISCONNECT")))),dS(ul,{version:n})))}get el(){return dP(this)}};uO.style=
vendor: 3,083 bytes, line 6
6".flexContainer {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    flex-direction: row;\n}\n\n.flexItem {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem11 {\n    flex: 11;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem1 {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.tab {\n    padding: 8px;\n    cursor: pointer;\n    background-color: #F2F4F6;\n    font-size: 12px;\n    text-align: center;\n    color: #24292E;\n}\n\n.tabcontainer {\n    padding: 4px;\n    background-color: #F2F4F6;\n    border-radius: 8px;\n    margin-bottom: 30px;\n    margin-top: 30px;\n}\n\n.tabactive {\n    background-color: white;\n    -webkit-transition: background-color 300ms linear;\n    -ms-transition: background-color 300ms linear;\n    transition: background-color 300ms linear;\n    border-radius: 8px;\n}\n\n.item {\n    font-size: 12px;\n    margin-bottom: 16px;\n    border-radius: 8px;\n    padding: 10px;\n    border: 2px #F2F4F6 solid;\n    color: #24292E;\n}\n\n.extensionLabel {\n    font-style: normal;\n    font-weight: bold;\n    font-size: 14px;\n    text-align: cetner;\n    color: #24272A;\n}\n\n.notice {\n    font-size: 12px;\n    margin-left: 10px;\n    margin-right: 10px;\n    color: grey;\n}\n\n.button {\n    margin-top: 41.5px;\n    margin-bottom: 20px;\n    width: 100%;\n    display: flex;\n    flex-direction: row;\n    justify-content: center;\n    align-items: center;\n    padding: 12px 20px;\n    background: #037DD6;\n    border-radius: 32px;\n    color: white;\n    border: 0;\n    font-size: 14px;\n    cursor: pointer;\n}\n\n.backdrop {\n    visibility: visible;\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    width: 100%;\n    z-index: 99998;\n    background: rgba(0, 0, 0, 0.87);\n    opacity: 0.3;\n}\n\n.modal {\n    visibility: visible;\n    position: fixed;\n    left: 50%;\n    transform: translate(-50%, -50%);\n    z-index: 99999;\n    background: white;\n    padding: 20px;\n    border-radius: 8px;\n    top: 50%;\n    max-width: 100%;\n    width: 460px;\n    min-width: 300px;\n    box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;\n    -webkit-font-smoothing: antialiased;\n}\n\n.closeButton {\n    color: #BBC0C5;\n    cursor: pointer;\n}\n\n.logoContainer {\n    margin-left: 24px;\n    margin-right: 24px;\n    margin-top: 24px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.connectMobileText {\n    font-size: 14px;\n    color: black;\n    margin-top: 28px;\n    margin-bottom: 28px;\n    line-height: 2;\n}\n\n.blue {\n    color: #037DD6;\n    font-weight: 700;\n}\n\n.installExtensionText {\n    margin-left: 10px;\n}\n\n.center {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.right {\n    display: flex;\n    align-items: center;\n    justify-content: right;\n}\n\n#sdk-mm-qrcode {\n    svg {\n        width: 50%;\n    }\n}";
6let uR=()=>dS("svg",{width:"21",height:"15",viewBox:"0 0 21 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dS("path",{d:"M14.1364 14.9851C13.5909 14.9851 13.2273 14.5851 13.2273 13.9851C13.2273 13.3851 13.5909 12.9851 14.1364 12.9851C16.6818 12.9851 18.6818 10.7851 18.6818 7.98508C18.6818 5.18508 16.6818 2.98508 14.1364 2.98508C11.5909 2.98508 9.59091 5.18508 9.59091 7.98508C9.59091 8.58508 9.22727 8.98508 8.68182 8.98508C8.13636 8.98508 7.77273 8.58508 7.77273 7.98508C7.77273 4.08508 10.5909 0.985077 14.1364 0.985077C17.6818 0.985077 20.5 4.08508 20.5 7.98508C20.5 11.8851 17.6818 14.9851 14.1364 14.9851ZM6.68182 14.7851C3.22727 14.7851 0.5 11.6851 0.5 7.98508C0.5 4.28508 3.22727 1.18508 6.68182 1.18508C7.22727 1.18508 7.59091 1.58508 7.59091 2.18508C7.59091 2.78508 7.22727 3.18508 6.68182 3.18508C4.22727 3.18508 2.31818 5.38508 2.31818 7.98508C2.31818 10.5851 4.22727 12.7851 6.68182 12.7851C9.13636 12.7851 11.0455 10.6851 11.0455 7.98508C11.0455 7.38508 11.4091 6.98508 11.9545 6.98508C12.5 6.98508 12.8636 7.38508 12.8636 7.98508C12.7727 11.6851 10.0455 14.7851 6.68182 14.7851Z",fill:"white"})),uT=()=>dS("svg",{width:"400",height:"300",viewBox:"0 0 467 300",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dS("path",{d:"M312.387 280.629C312.549 280.583 312.247 280.735 312.387 280.629L339.678 260.425C340.088 260.118 340.132 259.156 340.07 258.647C340.008 258.138 339.573 258.257 339.106 258.084L311.712 247.455C311.292 247.301 311.308 247.402 310.939 247.673C310.569 247.944 310.356 248.21 310.356 248.672L310.459 279.504C310.461 280.025 311.163 280.619 311.614 280.847C311.913 280.996 312.072 280.718 312.387 280.629ZM336.204 259.736L312.979 276.292L313.439 251.139L336.204 259.736Z",fill:"url(#paint0_linear_1356_14057)"}),dS("path",{d:"M324.639 260.342C324.358 259.547 323.485 258.91 322.707 259.215C319.6 260.432 318.17 262.313 317.287 264.066C316.482 265.665 316.197 267.482 314.188 268.269C312.178 269.055 310.763 268.663 309.162 268.007C307.406 267.287 305.504 266.182 302.397 267.399C299.289 268.616 297.859 270.497 296.976 272.25C296.171 273.849 295.697 274.886 293.685 275.673C291.675 276.459 290.261 276.067 288.659 275.411C286.903 274.691 284.999 273.587 281.894 274.803C278.789 276.019 277.549 278.681 276.666 280.434C275.861 282.034 275.386 283.07 273.374 283.857C272.596 284.161 271.931 285.055 272.211 285.849C272.492 286.644 273.365 287.281 274.143 286.977C277.25 285.76 278.68 283.879 279.563 282.125C280.368 280.526 280.65 278.71 282.662 277.923C284.672 277.136 286.087 277.528 287.688 278.184C289.444 278.904 291.348 280.009 294.453 278.793C297.561 277.576 298.991 275.695 299.874 273.941C300.679 272.342 301.153 271.306 303.165 270.519C305.175 269.732 306.589 270.124 308.191 270.78C309.947 271.5 311.849 272.605 314.956 271.388C318.063 270.172 319.301 267.511 320.184 265.757C320.989 264.158 321.466 263.121 323.476 262.335C324.254 262.032 324.919 261.137 324.639 260.342Z",fill:"url(#paint1_linear_1356_14057)"}),dS("path",{d:"M389.034 111.124C388.968 112.406 387.342 113.113 386.324 113.549C384.297 114.419 382.089 114.493 379.942 114.5C376.607 114.509 373.215 114.163 369.89 113.976C366.712 113.798 363.156 113.311 360.03 114.232C357.705 114.919 355.667 116.762 353.452 117.739C351.129 118.765 348.957 119.198 346.489 119.687C335.569 121.85 323.587 120.825 312.656 119.977C311.92 119.92 312.539 118.997 313.237 118.981C313.207 118.815 313.001 118.394 313.045 118.201C313.086 118.029 312.781 117.586 312.853 117.421C312.67 117.198 313.316 117.427 313.626 117.204C315.912 115.557 318.721 114.79 321.363 115.041C324.677 115.355 327.293 116.04 330.641 115.781C334.392 115.491 338.125 114.787 341.857 114.312C345.142 113.892 349.09 113.941 352.106 112.28C352.916 111.834 353.137 111.262 353.269 110.287C353.331 109.828 353.672 108.969 353.658 108.511C353.629 107.529 354.191 107.886 355.013 107.298C356.857 105.981 358.274 105.516 360.428 105.784C362.841 106.083 365.264 107.273 367.578 107.953C370.761 108.888 374.328 108.646 377.631 108.477C380.517 108.329 383.141 107.901 385.944 108.653C387.013 108.941 389.104 109.745 389.034 111.124Z",fill:"url(#paint2_linear_1356_14057)"}),dS("path",{d:"M278.118 85.4414C280.313 83.8186 283.302 83.9 285.853 83.2728C290.501 82.127 295.644 78.4476 300.549 79.1524C301.299 79.2595 300.904 81.0355 300.159 80.9295C300.131 80.9256 300.187 80.9333 300.159 80.9295C300.089 81.0185 299.516 81.1051 299.385 81.1463C294.999 82.515 292.895 87.5083 289.126 89.8598C287.799 90.688 286.771 90.8351 285.258 90.9441C283.515 91.0691 28
60.964 90.5775 279.269 90.1219C277.15 89.5532 275.965 87.034 278.118 85.4414Z",fill:"url(#paint3_linear_1356_14057)"}),dS("path",{d:"M122.567 166.093C113.597 172.832 104.535 179.836 99.517 190.092C98.5342 192.099 97.519 195.019 97.9533 197.204C98.9699 202.316 105.76 203.049 110.691 201.96C113.468 201.347 116.325 199.231 115.921 196.319C115.576 193.81 113.158 192.986 112.072 190.73C110.779 188.04 112.35 184.97 114.218 182.62C128.134 165.099 150.074 157.394 171.093 151.607C175.385 150.425 180.897 147.69 180.581 143.099C180.372 140.072 177.118 137.683 174.221 137.383C171.324 137.082 168.481 138.773 165.715 139.776C158.416 142.419 151.17 143.799 143.489 143.526C136.865 143.29 130.976 143.316 129.562 150.781C128.138 158.276 129.53 160.863 122.567 166.093Z",fill:"url(#paint4_linear_1356_14057)"}),dS("path",{d:"M79.1056 153.531C60.3932 164.378 43.7478 178.354 32.8214 197.415C30.3313 201.76 27.9216 206.554 27.1821 211.512C26.4448 216.47 27.7591 222.525 30.8133 226.337C34.908 231.446 41.6938 232.915 48.1811 233.125C50.7248 233.208 53.0035 233.066 55.3316 231.947C57.6602 230.83 59.7548 228.359 59.5978 225.742C59.3303 221.315 54.5491 219.665 50.9271 217.34C42.6566 212.037 40.4958 199.493 44.2381 190.032C47.9803 180.57 55.8228 173.173 63.2316 166.338C67.229 162.651 71.5194 158.372 76.777 157.522C79.9167 157.015 83.4706 157.589 86.6295 157.252C93.9004 156.479 99.64 151.404 105.588 146.912C115.048 139.765 126.045 134.283 137.501 132.093C141.913 131.248 146.293 130.493 149.682 127.831C151.37 126.507 150.803 123.567 148.726 123.93C138.542 125.713 128.652 131.135 119.142 134.758C105.627 139.914 91.7133 146.223 79.1056 153.531Z",fill:"url(#paint5_linear_1356_14057)"}),dS("path",{d:"M96.3677 117.321C96.0315 116.64 95.2914 116.612 94.6293 116.975C91.9858 118.417 91.5452 120.509 90.9466 122.178C90.4004 123.702 89.3647 124.67 87.6542 125.604C85.9437 126.538 85.0983 126.316 83.5956 125.91C81.9481 125.465 79.8603 125.424 77.2168 126.866C74.5734 128.309 74.1348 130.401 73.5341 132.07C72.9879 133.593 71.9522 134.562 70.2417 135.496C68.5313 136.43 67.6859 136.208 66.1832 135.801C64.5357 135.357 62.2569 134.538 59.6128 135.978C56.9694 137.42 56.5308 139.512 55.9301 141.181C55.3839 142.705 54.5398 144.454 52.8293 145.388C52.1667 145.748 52.1006 146.485 52.439 147.165C52.7752 147.845 53.5153 147.874 54.1773 147.511C56.8208 146.069 57.2594 143.977 57.86 142.307C58.4062 140.784 59.4419 139.815 61.1524 138.881C62.8629 137.948 63.7083 138.17 65.211 138.576C66.8585 139.021 68.9458 139.059 71.5898 137.619C74.2333 136.177 74.6718 134.085 75.2725 132.416C75.8187 130.892 76.8544 129.924 78.5649 128.99C80.2754 128.056 81.1207 128.278 82.6235 128.684C84.2709 129.129 86.5503 129.95 89.1938 128.507C91.8373 127.065 92.2779 124.973 92.8765 123.304C93.4227 121.78 94.2663 120.03 95.9773 119.098C96.6378 118.738 96.7039 118.001 96.3677 117.321Z",fill:"#FBC49D"}),dS("path",{d:"M391.827 164.699C392.04 164.639 392.39 164.573 392.6 164.481C393.87 163.921 395.363 162.429 395.893 161.051C396.421 159.673 396.237 158.321 395.712 156.931C394.629 154.061 391.777 152.62 389.155 153.775C386.531 154.931 384.962 158.455 386.042 161.325C387.038 163.963 389.369 165.392 391.827 164.699ZM394.166 157.367C394.529 158.332 394.52 159.751 394.156 160.706C393.792 161.662 393.1 162.534 392.218 162.921C390.398 163.723 388.338 162.878 387.589 160.889C387.226 159.925 387.234 158.506 387.599 157.55C387.963 156.594 388.654 155.723 389.536 155.336C391.356 154.534 393.416 155.376 394.166 157.367Z",fill:"#86E29B"}),dS("path",{d:"M62.7198 108.691C64.4912 108.191 66.6152 106.609 67.5596 104.824C68.4273 103.187 68.465 101.455 67.9609 99.7066C67.4547 97.9586 66.0792 96.5141 64.4963 95.6786C62.9135 94.843 61.2077 94.8578 59.4756 95.4255C57.7435 95.9933 56.2768 97.4364 55.409 99.074C53.6185 102.456 55.2032 106.494 58.4723 108.22C60.0142 109.035 61.1315 109.138 62.7198 108.691ZM60.6304 96.7682C61.819 96.4332 63.0232 96.8871 64.1048 97.4571C65.2463 98.0603 66.0495 98.8796 66.4145 100.142C66.7791 101.403 66.4488 103.299 65.8224 104.48C64.5299 106.919 61.2212 107.686 58.8638 106.441C56.5063 105.197 55.8538 101.858 57.1462 99.4185C57.7726 98.2375 58.6059 97.3957 59.8573 96.9862C59.9214 96.9635 60.5631 96.7872 60.6304 96.7682Z",fill:"#FFB0EB"}),dS("path",{d:"M77.0217 242.979C75.9542 243.28 75.1664 242.151 74.9029 241.074C74.6394 239.996 75 239.378 76.0676 239.077C77.1351 238.776 78.5053 238.907 78.7688 239.984C79.0323 241.061 78.0893 242.678 77.0217 242.979Z",fill:"url(#paint6_linear_1356_14057)"}),dS("path",{d:"M380.506 184.577C379.439 184.878 378.651 183.749 378.387 182.672C378.124 181.594 378.484 180.976 379.552 180.675C380.619 180.374 381.99 180.50
65 382.253 181.582C382.517 182.659 381.574 184.276 380.506 184.577Z",fill:"url(#paint7_linear_1356_14057)"}),dS("path",{d:"M348.82 246.969C347.752 247.27 346.382 247.14 346.119 246.063C345.855 244.985 346.798 243.369 347.866 243.068C348.933 242.767 349.721 243.896 349.985 244.973C350.248 246.05 349.888 246.669 348.82 246.969Z",fill:"url(#paint8_linear_1356_14057)"}),dS("path",{d:"M140.419 282.412C139.351 282.713 138.754 282.365 138.491 281.288C138.227 280.21 138.397 278.812 139.464 278.511C140.532 278.21 142.093 279.121 142.357 280.198C142.62 281.275 141.486 282.111 140.419 282.412Z",fill:"url(#paint9_linear_1356_14057)"}),dS("path",{d:"M121.462 101.679C120.395 101.979 119.798 101.631 119.534 100.554C119.271 99.4764 119.44 98.0779 120.508 97.777C121.575 97.4761 123.136 98.3868 123.4 99.4642C123.663 100.542 122.53 101.378 121.462 101.679Z",fill:"url(#paint10_linear_1356_14057)"}),dS("path",{d:"M370.749 159.005C369.682 159.306 368.311 159.175 368.048 158.098C367.784 157.021 368.727 155.404 369.795 155.103C370.863 154.802 371.65 155.931 371.914 157.008C372.177 158.086 371.817 158.704 370.749 159.005Z",fill:"url(#paint11_linear_1356_14057)"}),dS("path",{d:"M384.211 245.345C383.143 245.646 381.773 245.515 381.51 244.438C381.246 243.361 382.189 241.744 383.257 241.443C384.324 241.142 385.112 242.271 385.376 243.348C385.639 244.426 385.278 245.044 384.211 245.345Z",fill:"url(#paint12_linear_1356_14057)"}),dS("path",{d:"M364.771 41.3873C363.063 41.8687 361.337 40.8616 360.915 39.1378C360.493 37.414 361.536 35.6263 363.244 35.1449C364.953 34.6634 366.679 35.6706 367.101 37.3944C367.522 39.1182 366.479 40.9059 364.771 41.3873Z",fill:"url(#paint13_linear_1356_14057)"}),dS("path",{d:"M404.311 77.905C404.602 77.8231 404.875 77.9236 405.084 77.6871C405.437 77.2908 404.814 76.6385 404.703 76.1265L401.277 58.7418C401.149 58.163 400.687 57.5371 400.123 57.3991C399.558 57.2611 398.969 57.3812 398.576 57.835L385.784 73.1179C385.395 73.564 385.199 74.3453 385.393 74.8964C385.585 75.4481 385.978 76.1646 386.548 76.2391L403.538 78.123C403.744 78.1479 404.114 77.9607 404.311 77.905ZM398.948 62.7348L401.811 74.4394L389.841 72.8085L398.948 62.7348Z",fill:"#FFB0EB"}),dS("path",{d:"M97.5393 295.311C97.7108 295.263 97.4284 295.461 97.5393 295.311L108.785 280.464C108.975 280.211 108.718 279.972 108.594 279.684C108.47 279.396 108.124 279.917 107.821 279.902L88.5106 278.672C88.2101 278.659 87.895 278.62 87.7374 278.89C87.5798 279.159 87.7755 279.402 87.9283 279.67L96.5753 294.749C96.7102 294.99 97.2696 295.297 97.5393 295.311C97.6283 295.319 97.4556 295.335 97.5393 295.311ZM106.465 281.118L96.9667 292.97L90.6295 280.577L106.465 281.118Z",fill:"#86E29B"}),dS("path",{d:"M393.699 108.848C389.518 104.446 414.629 114.366 413.945 120.659C413.259 126.952 401.355 129.102 403.894 123.491C406.042 118.747 400.376 115.876 393.699 108.848Z",fill:"#FBC49D"}),dS("path",{d:"M139.414 115.959C139.434 115.953 139.392 115.965 139.414 115.959C141.963 115.2 143.436 111.976 142.717 109.189C142.37 107.839 141.526 107.199 140.408 106.504C139.289 105.808 138.171 105.449 136.933 105.815C135.698 106.182 134.85 107.033 134.222 108.247C133.595 109.461 133.282 111.234 133.63 112.585C133.978 113.935 134.821 114.574 135.94 115.27C137.04 115.952 138.199 116.301 139.414 115.959ZM137.315 107.375C138.222 107.12 139.005 106.994 139.825 107.502C140.661 108.02 140.912 108.618 141.171 109.625C141.708 111.704 140.935 113.834 139.032 114.398C138.11 114.675 137.356 114.791 136.522 114.272C135.686 113.753 135.436 113.155 135.176 112.149C134.917 111.142 134.718 109.714 135.186 108.81C135.654 107.905 136.394 107.649 137.315 107.375C137.329 107.371 137.299 107.38 137.315 107.375Z",fill:"#75C4FD"}),dS("path",{d:"M308.981 78.7519C310.052 78.4043 311.158 78.7096 312.265 78.6613C313.655 78.6006 314.936 78.517 316.323 78.3531C319.497 77.9795 322.798 77.4906 325.984 77.3012C329.309 77.1025 332.514 76.8551 335.836 77.0295C338.809 77.1842 342.163 77.3405 345.105 77.7558C352.129 78.7468 359.331 79.0578 366.347 80.1158C372.252 81.008 377.93 82.1319 383.722 83.5644C385.925 84.0054 388.267 85.0754 389.126 85.3792C389.421 85.4833 389.37 85.8347 389.317 86.1595C389.306 86.2271 389.353 86.1146 389.317 86.1595C388.269 87.414 386.564 86.8124 385.259 86.4677C384.406 86.241 381.488 85.9494 381.011 85.9957C380.14 86.0815 379.277 86.014 379.656 87.2114C380.122 88.6824 382.391 89.7375 383.704 90.2419C385.883 91.0803 388.771 91.2561 390.845 92.4015C392.968 92.821 395.425 93.5002 397.022 93.9986C402.83 95.8103 407.806 98.8678 413.033 102.002C415.503 103.482 417.829 104.764 419.973 106.72C421.647 108.248 423.771 109.882 424.595 112.091C425.113 113.482 424.451 115.471 422.848 115.085C420.353 114.488 419.638 111.665 418.227 109.714C415.003 105.251 410.067 102.067 405.118 100.06C402.64 99.0556 399.803 98.729 397.204 98.1176C394.411 97.4613 391.597 97.0442 388.707 97.1736C385.646 97.3097 382.846 97.5534 379.819 98.0078C377.027 98.4264 374.252 98.4441 371.514 97.8441C368.766 97.2421 366.276 96.7553 363.6 95.9021C361.662 95.2848 359.013 94.5583 357.232 93.5247C355.699 92.6339 355.631 91.2381 357.241 90.186C359.87 88.4656 362.778 89.8021 365.546 90.3497C365.561 90.3527 365.532 90.3468 365.546 90.3497C367.858 90.804 369.649 90.098 371.923 89.3884C372.489 89.2128 373.255 89.0482 373.47 88.953C374.383 88.5432 375.895 87.8227 375.407 86.7394C374.868 85.5457 372.659 84.8846 371.55 84.4891C369.74 83.8428 368.053 82.9215 366.147 82.6743C365.654 82.6095 365.109 83.1606 364.6 83.1097C363.36 83.1121 361.769 83.348 360.543 83.418C357.43 83.5916 354.583 83.6228 351.464 83.4719C348.714 83.3377 346.432 82.8542 343.741 82.3102C340.773 81.7101 337.52 81.5879 334.471 81.5839C331.393 81.5811 328.6 81.7214 325.583 82.4181C322.758 83.0702 319.757 83.6198 316.887 84.0326C314.698 84.3481 312.467 84.6054 310.319 84.2137C309.079 83.9871 306.994 83.3394 306.461 81.9635C305.846 80.3659 307.736 79.1556 308.981 78.7519Z",fill:"url(#paint14_linear_1356_14057)"}),dS("path",{d:"M242.269 242.95C242.295 242.947 242.244 242.955 242.269 242.95C244.934 242.606 247.53 241.858 250.2 241.574C253.133 241.264 256.006 240.56 258.906 239.982C263.26 239.117 268.026 238.52 272.254 237.097C274.429 236.365 276.067 235.298 278.251 234.592C280.361 233.909 283.058 233.12 285.216 232.652C289.317 231.764 293.049 231.66 297.016 230.198C301.109 228.69 305.088 226.673 308.819 224.409C312.645 222.086 316.282 219.769 320.622 218.62C322.381 218.154 323.919 218.219 325.65 218.886C327.016 219.413 327.739 220.337 327.196 221.79C326.557 223.504 324.659 224.7 323.131 225.423C320.854 226.5 319.53 227.184 317.134 227.927C314.619 228.707 311.888 229.24 309.395 230.083C308.226 230.947 307.17 232.522 306.105 233.501C303.996 235.441 301.666 237.03 298.945 237.996C292.934 240.129 286.354 238.602 280.183 239.056C279.661 239.095 279.162 239.442 278.635 239.487C275.592 240.135 272.2 240.63 269.156 241.294C264.546 242.299 260.456 243.409 255.808 244.179C251.971 244.814 243.815 245.854 243.815 245.854L242.074 245.505C240.575 245.281 240.751 243.152 242.269 242.95Z",fill:"url(#paint15_linear_1356_14057)"}),dS("path",{d:"M432.985 171.626C438.212 165.465 445.109 153.64 442.906 144.649C442.162 137.999 433.671 132.912 424.963 135.518C420.16 136.957 416.435 142.146 419.724 144.498
6C420.656 145.164 422.187 145.591 423.391 145.969C434.204 149.375 434.925 162.538 425.069 169.683C421.087 172.569 416.347 174.292 411.914 176.719C400.151 183.162 399.887 196.847 387.7 202.712C382.326 205.298 375.761 206.838 370.297 209.275C359.98 213.88 352.555 221.733 342.241 226.341C337.225 228.584 330.266 231.632 323.483 234.12C321.475 234.855 321.999 237.058 324.056 236.46C324.098 236.449 324.017 236.474 324.056 236.46C329.079 234.971 334.437 233.161 339.331 231.33C352.278 226.48 365.28 220.971 377.43 214.775C401.78 202.367 416.881 190.609 432.985 171.626Z",fill:"url(#paint16_linear_1356_14057)"}),dS("path",{d:"M343.644 241.104C348.002 234.144 357.126 232.455 364.343 231.134C368.176 230.431 372.406 229.878 376.137 228.662C380.691 227.175 384.558 224.095 388.327 221.077C389.452 220.177 391.204 218.466 392.393 217.436C393.185 216.748 393.644 216.026 394.33 215.225C396 213.275 399.599 209.812 401.687 208.16C403.263 206.914 407.779 204.758 408.259 207.986C408.611 210.359 406.379 213.087 404.961 214.747C402.224 217.953 398.998 221.079 395.475 223.243C391.749 225.531 387.701 227.439 383.674 229.051C381.672 229.853 379.519 230.073 377.486 230.785C376.001 231.307 374.486 232.236 373.037 232.866C371.034 233.738 368.99 234.28 367.041 235.38C364.436 236.849 361.782 238.783 359.108 240.105C356.331 241.477 353.823 242.691 350.791 243.27C348.6 243.687 345.501 243.641 343.836 241.884C343.526 241.554 343.389 241.51 343.644 241.104Z",fill:"url(#paint17_linear_1356_14057)"}),dS("path",{d:"M190.163 273.219C222.905 268.849 232.64 262.943 213.962 259.057C195.285 255.172 187.5 262.08 188.434 266.2C189.366 270.32 180.381 271.326 169.286 272.39C158.193 273.454 157.141 276.354 190.163 273.219Z",fill:"url(#paint18_linear_1356_14057)"}),dS("path",{d:"M295.952 95.4242L241.395 135.226L251.54 111.77L295.952 95.4242Z",fill:"#E17726",stroke:"#E17726","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M170.111 95.4242L224.181 135.598L214.522 111.77L170.111 95.4242Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M276.309 187.712L261.793 209.576L292.876 218.014L301.78 188.189L276.309 187.712Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M164.336 188.189L173.186 218.014L204.215 209.576L189.753 187.712L164.336 188.189Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M202.542 150.776L193.908 163.618L224.667 164.998L223.642 132.36L202.542 150.776Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M263.52 150.775L242.097 131.989L241.395 164.998L272.154 163.618L263.52 150.775Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M204.215 209.576L222.832 200.714L206.805 188.402L204.215 209.576Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M243.23 200.714L261.793 209.576L259.257 188.402L243.23 200.714Z",fill:"#E27625",stroke:"#E27625","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M261.793 209.576L243.23 200.714L244.741 212.601L244.579 217.643L261.793 209.576Z",fill:"#D5BFB2",stroke:"#D5BFB2","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M204.215 209.576L221.483 217.643L221.375 212.601L222.832 200.714L204.215 209.576Z",fill:"#D5BFB2",stroke:"#D5BFB2","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M221.807 180.547L206.373 176.09L217.274 171.154L221.807 180.547Z",fill:"#233447",stroke:"#233447","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M244.255 180.547L248.788 171.154L259.742 176.09L244.255 180.547Z",fill:"#233447",stroke:"#233447","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M204.215 209.576L206.913 187.712L189.753 188.189L204.215 209.576Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M259.149 187.712L261.793 209.576L276.309 188.189L259.149 187.712Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M272.154 163.618L241.395 164.998L244.255 180.547L248.788 171.154L259.742 176.09L272.154 163.618Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M206.373 176.09L217.274 171.154L221.807 180.547L224.667 164.998L193.908 163.618L206.373 176.09Z",fill:"#CC6228",stroke:"#CC6228","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M193.908 163.618L206.805 188.402L206.373 176.09L193.908 163.618Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M259.743 176.09L259.257 188.402L272.154 163.618L259.743 176.09Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M224.667 164.998L221.807 180.548L225.422 198.909L226.232 174.71L224.667 164.998Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M241.395 164.998L239.884 174.657L240.64 198.909L244.255 180.548L241.395 164.998Z",fill:"#E27525",stroke:"#E27525","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M244.255 180.547L240.64 198.909L243.23 200.714L259.257 188.402L259.743 176.09L244.255 180.547Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M206.373 176.09L206.805 188.402L222.832 200.714L225.422 198.909L221.807 180.547L206.373 176.09Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M244.579 217.643L244.741 212.601L243.338 211.434H222.724L221.375 212.601L221.483 217.643L204.215 209.576L210.259 214.459L222.508 222.791H243.5L255.803 214.459L261.793 209.576L244.579 217.643Z",fill:"#C0AC9D",stroke:"#C0AC9D","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M243.23 200.714L240.64 198.909H225.422L222.832 200.714L221.375 212.601L222.724 211.434H243.338L244.741 212.601L243.23 200.714Z",fill:"#161616",stroke:"#161616","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M298.272 137.827L302.859 115.856L295.952 95.4242L243.23 133.899L263.52 150.775L292.174 159.001L298.488 151.731L295.736 149.767L300.107 145.84L296.761 143.293L301.
6132 140.002L298.272 137.827Z",fill:"#763E1A",stroke:"#763E1A","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M163.203 115.856L167.844 137.827L164.876 140.002L169.301 143.293L165.955 145.84L170.326 149.767L167.574 151.731L173.888 159.001L202.542 150.775L222.832 133.899L170.11 95.4242L163.203 115.856Z",fill:"#763E1A",stroke:"#763E1A","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M292.175 159.001L263.52 150.775L272.154 163.618L259.257 188.402L276.309 188.189H301.78L292.175 159.001Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M202.542 150.775L173.888 159.001L164.336 188.189H189.753L206.805 188.402L193.908 163.618L202.542 150.775Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("path",{d:"M241.395 164.998L243.23 133.9L251.54 111.77H214.522L222.832 133.9L224.667 164.998L225.368 174.763L225.422 198.909H240.64L240.694 174.763L241.395 164.998Z",fill:"#F5841F",stroke:"#F5841F","stroke-width":"0.94513","stroke-linecap":"round","stroke-linejoin":"round"}),dS("defs",null,dS("linearGradient",{id:"paint0_linear_1356_14057",x1:"335.991",y1:"250.487",x2:"303.873",y2:"266.801",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#FFE466"}),dS("stop",{offset:"1","stop-color":"#FFAFEA"})),dS("linearGradient",{id:"paint1_linear_1356_14057",x1:"276.993",y1:"303.722",x2:"205.254",y2:"401.574",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"0.0929","stop-color":"#81C2F6"}),dS("stop",{offset:"1","stop-color":"#F0B8BD"})),dS("linearGradient",{id:"paint2_linear_1356_14057",x1:"271.074",y1:"119.924",x2:"553.077",y2:"104.53",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#FFE466"}),dS("stop",{offset:"1","stop-color":"#FFAFEA"})),dS("linearGradient",{id:"paint3_linear_1356_14057",x1:"264.209",y1:"91.0943",x2:"357.834",y2:"72.8792",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#FFE466"}),dS("stop",{offset:"1","stop-color":"#FFAFEA"})),dS("linearGradient",{id:"paint4_linear_1356_14057",x1:"212.46",y1:"121.997",x2:"92.6119",y2:"183.406",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#FFE466"}),dS("stop",{offset:"1","stop-color":"#FFAFEA"})),dS("linearGradient",{id:"paint5_linear_1356_14057",x1:"23.0498",y1:"204.411",x2:"161.86",y2:"163.003",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"0.0929","stop-color":"#81C2F6"}),dS("stop",{offset:"1","stop-color":"#F0B8BD"})),dS("linearGradient",{id:"paint6_linear_1356_14057",x1:"78.8647",y1:"240.375",x2:"74.9655",y2:"241.328",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"1","stop-color":"#75C3FC"})),dS("linearGradient",{id:"paint7_linear_1356_14057",x1:"382.349",y1:"181.971",x2:"378.45",y2:"182.925",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"1","stop-color":"#75C3FC"})),dS("linearGradient",{id:"paint8_linear_1356_14057",x1:"349.889",y1:"244.583",x2:"345.99",y2:"245.537",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"1","stop-color":"#75C3FC"})),dS("linearGradient",{id:"paint9_linear_1356_14057",x1:"142.262",y1:"279.808",x2:"138.362",y2:"280.762",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"1","stop-color":"#75C3FC"})),dS("linearGradient",{id:"paint10_linear_1356_14057",x1:"123.305",y1:"99.0746",x2:"119.406",y2:"100.028",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"1","stop-color":"#75C3FC"})),dS("linearGradient",{id:"paint11_linear_1356_14057",x1:"371.818",y1:"156.617",x2:"367.919",y2:"157.571",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"1","stop-color":"#75C3FC"})),dS("linearGradient",{id:"paint12_linear_1356_14057",x1:"385.281",y1:"242.958",x2:"381.382",y2:"243.911",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"1","stop-color":"#75C3FC"})),dS("linearGradient",{id:"paint13_linear_1356_14057",x1:"367.125",y1:"37.5052",x2:"360.843",y2:"38.8076",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"1","stop-color":"#75C3FC"})),dS("linearGradient",{id:"paint14_linear_1356_14057",x1:"300.182",y1:"91.321",x2:"479.464",y2:"104.041",gradientUnits:"userSpaceOnUse"}
6,dS("stop",{"stop-color":"#FFE466"}),dS("stop",{offset:"1","stop-color":"#FFAFEA"})),dS("linearGradient",{id:"paint15_linear_1356_14057",x1:"363.434",y1:"201.232",x2:"102.977",y2:"302.269",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#FFE466"}),dS("stop",{offset:"1","stop-color":"#FFAFEA"})),dS("linearGradient",{id:"paint16_linear_1356_14057",x1:"447.962",y1:"165.159",x2:"313.049",y2:"197.95",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"0.0929","stop-color":"#81C2F6"}),dS("stop",{offset:"1","stop-color":"#F0B8BD"})),dS("linearGradient",{id:"paint17_linear_1356_14057",x1:"410.211",y1:"215.859",x2:"341.378",y2:"232.788",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#75C3FC"}),dS("stop",{offset:"0.0929","stop-color":"#81C2F6"}),dS("stop",{offset:"1","stop-color":"#F0B8BD"})),dS("linearGradient",{id:"paint18_linear_1356_14057",x1:"222.282",y1:"258.986",x2:"162.257",y2:"273.774",gradientUnits:"userSpaceOnUse"},dS("stop",{"stop-color":"#FFE466"}),dS("stop",{offset:"1","stop-color":"#FFAFEA"})))),u$=class{constructor(e){c0(this,e),this.close=dI(this,"close",7),this.connectWithExtension=dI(this,"connectWithExtension",7),this.link=void 0,this.sdkVersion=void 0,this.preferDesktop=void 0,this.tab=1,this.isDefaultTab=!0,this.translationsLoaded=!1,this.i18nInstance=new uP,this.setTab(this.preferDesktop?1:2)}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}onClose(e=!1){this.close.emit({shouldTerminate:e})}connectWithExtensionHandler(){this.connectWithExtension.emit()}setTab(e){this.tab=e,this.isDefaultTab=!1}disconnectedCallback(){this.onClose()}updatePreferDesktop(e){e?this.setTab(1):this.setTab(2)}render(){if(!this.translationsLoaded)return null;let e=e=>this.i18nInstance.t(e),t=this.sdkVersion,n=this.isDefaultTab?this.preferDesktop?1:2:this.tab,r=uA(this.link,"svg",{ecc:"medium",scale:2});return dS(un,{className:"select-modal"},dS("div",{class:"backdrop",onClick:()=>this.onClose(!0)}),dS("div",{class:"modal"},dS("div",{class:"closeButtonContainer"},dS("div",{class:"right"},dS("span",{class:"closeButton",onClick:()=>this.onClose(!0)},dS(uc,null)))),dS("div",{class:"logoContainer"},dS(ud,null)),dS("div",null,dS("div",{class:"tabcontainer"},dS("div",{class:"flexContainer"},dS("div",{onClick:()=>this.setTab(1),class:"tab flexItem "+(1===n?"tabactive":"")},e("DESKTOP")),dS("div",{onClick:()=>this.setTab(2),class:"tab flexItem "+(2===n?"tabactive":"")},e("MOBILE")))),dS("div",{style:{display:1===n?"none":"block"}},dS("div",{class:"flexContainer"},dS("div",{class:"flexItem",style:{textAlign:"center",marginTop:"4"}},dS("div",{class:"center",id:"sdk-mm-qrcode",innerHTML:r}),dS("div",{class:"connectMobileText"},e("SCAN_TO_CONNECT"),dS("br",null),dS("span",{class:"blue"},dS("b",null,e("META_MASK_MOBILE_APP"))))))),dS("div",{style:{display:2===n?"none":"block"}},dS("div",{style:{display:"flex",justifyContent:"center",height:"300",marginTop:"-20"}},dS(uT,null)),dS("div",{class:"extensionLabel"},e("SELECT_MODAL.CRYPTO_TAKE_CONTROL_TEXT")),dS("button",{class:"button",onClick:()=>this.connectWithExtensionHandler()},dS(uR,null),dS("span",{class:"installExtensionText"},e("CONNECT_WITH_EXTENSION"))))),dS(ul,{version:t})))}get el(){return dP(this)}static get watchers(){return{preferDesktop:["updatePreferDesktop"]}}};u$.style=
vendor: 3,083 bytes, line 6
6".flexContainer {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    flex-direction: row;\n}\n\n.flexItem {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem11 {\n    flex: 11;\n    justify-content: center;\n    align-items: center;\n}\n\n.flexItem1 {\n    flex: 1;\n    justify-content: center;\n    align-items: center;\n}\n\n.tab {\n    padding: 8px;\n    cursor: pointer;\n    background-color: #F2F4F6;\n    font-size: 12px;\n    text-align: center;\n    color: #24292E;\n}\n\n.tabcontainer {\n    padding: 4px;\n    background-color: #F2F4F6;\n    border-radius: 8px;\n    margin-bottom: 30px;\n    margin-top: 30px;\n}\n\n.tabactive {\n    background-color: white;\n    -webkit-transition: background-color 300ms linear;\n    -ms-transition: background-color 300ms linear;\n    transition: background-color 300ms linear;\n    border-radius: 8px;\n}\n\n.item {\n    font-size: 12px;\n    margin-bottom: 16px;\n    border-radius: 8px;\n    padding: 10px;\n    border: 2px #F2F4F6 solid;\n    color: #24292E;\n}\n\n.extensionLabel {\n    font-style: normal;\n    font-weight: bold;\n    font-size: 14px;\n    text-align: cetner;\n    color: #24272A;\n}\n\n.notice {\n    font-size: 12px;\n    margin-left: 10px;\n    margin-right: 10px;\n    color: grey;\n}\n\n.button {\n    margin-top: 41.5px;\n    margin-bottom: 20px;\n    width: 100%;\n    display: flex;\n    flex-direction: row;\n    justify-content: center;\n    align-items: center;\n    padding: 12px 20px;\n    background: #037DD6;\n    border-radius: 32px;\n    color: white;\n    border: 0;\n    font-size: 14px;\n    cursor: pointer;\n}\n\n.backdrop {\n    visibility: visible;\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    width: 100%;\n    z-index: 99998;\n    background: rgba(0, 0, 0, 0.87);\n    opacity: 0.3;\n}\n\n.modal {\n    visibility: visible;\n    position: fixed;\n    left: 50%;\n    transform: translate(-50%, -50%);\n    z-index: 99999;\n    background: white;\n    padding: 20px;\n    border-radius: 8px;\n    top: 50%;\n    max-width: 100%;\n    width: 460px;\n    min-width: 300px;\n    box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;\n    -webkit-font-smoothing: antialiased;\n}\n\n.closeButton {\n    color: #BBC0C5;\n    cursor: pointer;\n}\n\n.logoContainer {\n    margin-left: 24px;\n    margin-right: 24px;\n    margin-top: 24px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.connectMobileText {\n    font-size: 14px;\n    color: black;\n    margin-top: 28px;\n    margin-bottom: 28px;\n    line-height: 2;\n}\n\n.blue {\n    color: #037DD6;\n    font-weight: 700;\n}\n\n.installExtensionText {\n    margin-left: 10px;\n}\n\n.center {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.right {\n    display: flex;\n    align-items: center;\n    justify-content: right;\n}\n\n#sdk-mm-qrcode {\n    svg {\n        width: 50%;\n    }\n}";
6var uN=Object.freeze({__proto__:null,mm_install_modal:uI,mm_pending_modal:uO,mm_select_modal:u$})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.