@walletconnect/ethereum-provider 1.7.4 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/umd/index.min.js +4 -4
- package/package.json +6 -6
package/dist/umd/index.min.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("WalletConnectProvider",[],e):"object"==typeof exports?exports.WalletConnectProvider=e():t.WalletConnectProvider=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=56)}([function(t,e,n){"use strict";(function(t){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.removeHexLeadingZeros=e.sanitizeHex=e.addHexPrefix=e.removeHexPrefix=e.padRight=e.padLeft=e.sanitizeBytes=e.swapHex=e.swapBytes=e.splitBytes=e.calcByteLength=e.trimRight=e.trimLeft=e.concatArrays=e.concatBuffers=e.getEncoding=e.getType=e.isArrayBuffer=e.isTypedArray=e.isBuffer=e.isHexString=e.isBinaryString=e.binaryToNumber=e.binaryToUtf8=e.binaryToHex=e.binaryToArray=e.binaryToBuffer=e.numberToBinary=e.numberToUtf8=e.numberToHex=e.numberToArray=e.numberToBuffer=e.utf8ToBinary=e.utf8ToNumber=e.utf8ToHex=e.utf8ToArray=e.utf8ToBuffer=e.hexToBinary=e.hexToNumber=e.hexToUtf8=e.hexToArray=e.hexToBuffer=e.arrayToBinary=e.arrayToNumber=e.arrayToUtf8=e.arrayToHex=e.arrayToBuffer=e.bufferToBinary=e.bufferToNumber=e.bufferToUtf8=e.bufferToHex=e.bufferToArray=void 0;const o=r(n(37)),i=r(n(65));function s(t){return new Uint8Array(t)}function a(t,e=!1){const n=t.toString("hex");return e?L(n):n}function u(t){return t.toString("utf8")}function c(t){return t.readUIntBE(0,t.length)}function l(t){return i.default(t)}function h(t,e=!1){return a(l(t),e)}function f(t){return u(l(t))}function d(t){return c(l(t))}function p(t){return Array.from(t).map(w).join("")}function g(e){return t.from(B(e),"hex")}function m(t){return s(g(t))}function v(t){return p(m(t))}function _(e){return t.from(e,"utf8")}function y(t){return s(_(t))}function w(t){return I((t>>>0).toString(2))}function b(t){return l(M(t))}function M(t){return new Uint8Array(C(t).map(t=>parseInt(t,2)))}function x(t,e){return h(M(t),e)}function E(t){return!("string"!=typeof t||!new RegExp(/^[01]+$/).test(t))&&t.length%8==0}function R(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function S(e){return t.isBuffer(e)}function T(t){return o.default.strict(t)&&!S(t)}function A(t){return!T(t)&&!S(t)&&void 0!==t.byteLength}function k(t,e=8){const n=t%e;return n?(t-n)/e*e+e:t}function C(t,e=8){const n=I(t).match(new RegExp(`.{${e}}`,"gi"));return Array.from(n||[])}function O(t){return C(t).map(N).join("")}function I(t,e=8,n="0"){return P(t,k(t.length,e),n)}function P(t,e,n="0"){return U(t,e,!0,n)}function B(t){return t.replace(/^0x/,"")}function L(t){return t.startsWith("0x")?t:"0x"+t}function N(t){return t.split("").reverse().join("")}function U(t,e,n,r="0"){const o=e-t.length;let i=t;if(o>0){const e=r.repeat(o);i=n?e+t:t+e}return i}e.bufferToArray=s,e.bufferToHex=a,e.bufferToUtf8=u,e.bufferToNumber=c,e.bufferToBinary=function(t){return p(s(t))},e.arrayToBuffer=l,e.arrayToHex=h,e.arrayToUtf8=f,e.arrayToNumber=d,e.arrayToBinary=p,e.hexToBuffer=g,e.hexToArray=m,e.hexToUtf8=function(t){return u(g(t))},e.hexToNumber=function(t){return d(m(t))},e.hexToBinary=v,e.utf8ToBuffer=_,e.utf8ToArray=y,e.utf8ToHex=function(t,e=!1){return a(_(t),e)},e.utf8ToNumber=function(t){const e=parseInt(t,10);return function(t,e){if(!t)throw new Error(e)}(!function(t){return void 0===t}(e),"Number can only safely store up to 53 bits"),e},e.utf8ToBinary=function(t){return p(y(t))},e.numberToBuffer=function(t){return b(w(t))},e.numberToArray=function(t){return M(w(t))},e.numberToHex=function(t,e){return x(w(t),e)},e.numberToUtf8=function(t){return""+t},e.numberToBinary=w,e.binaryToBuffer=b,e.binaryToArray=M,e.binaryToHex=x,e.binaryToUtf8=function(t){return f(M(t))},e.binaryToNumber=function(t){return d(M(t))},e.isBinaryString=E,e.isHexString=R,e.isBuffer=S,e.isTypedArray=T,e.isArrayBuffer=A,e.getType=function(t){return S(t)?"buffer":T(t)?"typed-array":A(t)?"array-buffer":Array.isArray(t)?"array":typeof t},e.getEncoding=function(t){return E(t)?"binary":R(t)?"hex":"utf8"},e.concatBuffers=function(...e){return t.concat(e)},e.concatArrays=function(...t){let e=[];return t.forEach(t=>e=e.concat(Array.from(t))),new Uint8Array([...e])},e.trimLeft=function(t,e){const n=t.length-e;return n>0&&(t=t.slice(n)),t},e.trimRight=function(t,e){return t.slice(0,e)},e.calcByteLength=k,e.splitBytes=C,e.swapBytes=O,e.swapHex=function(t){return x(O(v(t)))},e.sanitizeBytes=I,e.padLeft=P,e.padRight=function(t,e,n="0"){return U(t,e,!1,n)},e.removeHexPrefix=B,e.addHexPrefix=L,e.sanitizeHex=function(t){return(t=I(t=B(t),2))&&(t=L(t)),t},e.removeHexLeadingZeros=function(t){const e=t.startsWith("0x");return t=(t=B(t)).startsWith("0")?t.substring(1):t,e?L(t):t}}).call(this,n(21).Buffer)},function(t,e,n){"use strict";n.r(e);var r=n(24);const o=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],i=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],s=["eth_accounts","eth_chainId","net_version"],a={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var u=n(16),c=n.n(u),l=n(0);function h(t){return l.arrayToBuffer(new Uint8Array(t))}function f(t){return l.arrayToUtf8(new Uint8Array(t))}function d(t,e){return l.arrayToHex(new Uint8Array(t),!e)}function p(t){return l.arrayToNumber(new Uint8Array(t))}function g(...t){return l.hexToArray(t.map(t=>l.arrayToHex(new Uint8Array(t))).join("")).buffer}function m(t){return l.bufferToArray(t).buffer}function v(t){return l.bufferToUtf8(t)}function _(t,e){return l.bufferToHex(t,!e)}function y(t){return l.bufferToNumber(t)}function w(...t){return l.concatBuffers(...t)}function b(t){return l.utf8ToArray(t).buffer}function M(t){return l.utf8ToBuffer(t)}function x(t,e){return l.utf8ToHex(t,!e)}function E(t){return new c.a(t,10).toNumber()}function R(t){return l.hexToBuffer(t)}function S(t){return l.hexToArray(t).buffer}function T(t){return l.hexToUtf8(t)}function A(t){return new c.a(l.removeHexPrefix(t),"hex").toNumber()}function k(t){return l.numberToBuffer(t)}function C(t){return l.numberToArray(t).buffer}function O(t){return new c.a(t).toString()}function I(t,e){const n=l.removeHexPrefix(l.sanitizeHex(new c.a(t).toString(16)));return e?n:l.addHexPrefix(n)}var P=n(52);function B(t){return l.sanitizeHex(t)}function L(t){return l.addHexPrefix(t)}function N(t){return l.removeHexPrefix(t)}function U(t){return l.removeHexLeadingZeros(l.addHexPrefix(t))}const j=n(5).payloadId;function q(){return((t,e)=>{for(e=t="";t++<36;e+=51*t&52?(15^t?8^Math.random()*(20^t?16:4):4).toString(16):"-");return e})()}function D(){console.warn("DEPRECATION WARNING: This WalletConnect client library will be deprecated in favor of @walletconnect/client. Please check docs.walletconnect.org to learn more about this migration!")}function H(t,e){let n;const r=a[t];return r&&(n=`https://${r}.infura.io/v3/${e}`),n}function J(t,e){let n;const r=H(t,e.infuraId);return e.custom&&e.custom[t]?n=e.custom[t]:r&&(n=r),n}function F(t){return""===t||"string"==typeof t&&""===t.trim()}function z(t){return!(t&&t.length)}function W(t){return l.isBuffer(t)}function Y(t){return l.isTypedArray(t)}function $(t){return l.isArrayBuffer(t)}function V(t){return l.getType(t)}function K(t){return l.getEncoding(t)}function Q(t,e){return l.isHexString(t,e)}function Z(t){return"object"==typeof t.params}function X(t){return void 0!==t.method}function G(t){return void 0!==t.result}function tt(t){return void 0!==t.error}function et(t){return void 0!==t.event}function nt(t){return o.includes(t)||t.startsWith("wc_")}function rt(t){return!!t.method.startsWith("wc_")||!i.includes(t.method)}function ot(t){t=Object(l.removeHexPrefix)(t.toLowerCase());const e=Object(l.removeHexPrefix)(Object(P.keccak_256)(M(t)));let n="";for(let r=0;r<t.length;r++)parseInt(e[r],16)>7?n+=t[r].toUpperCase():n+=t[r];return Object(l.addHexPrefix)(n)}const it=t=>!!t&&("0x"===t.toLowerCase().substring(0,2)&&(!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t))||t===ot(t))));function st(t){return z(t)||Q(t[0])||(t[0]=x(t[0])),t}function at(t){if(void 0!==t.type&&"0"!==t.type)return t;if(void 0===t.from||!it(t.from))throw new Error("Transaction object must include a valid 'from' value.");function e(t){let e=t;return("number"==typeof t||"string"==typeof t&&!F(t))&&(Q(t)?"string"==typeof t&&(e=B(t)):e=I(t)),"string"==typeof e&&(e=U(e)),e}const n={from:B(t.from),to:void 0===t.to?"":B(t.to),gasPrice:void 0===t.gasPrice?"":e(t.gasPrice),gas:void 0===t.gas?void 0===t.gasLimit?"":e(t.gasLimit):e(t.gas),value:void 0===t.value?"":e(t.value),nonce:void 0===t.nonce?"":e(t.nonce),data:void 0===t.data?"":B(t.data)||"0x"},r=["gasPrice","gas","value","nonce"];return Object.keys(n).forEach(t=>{!n[t].trim().length&&r.includes(t)&&delete n[t]}),n}function ut(t,e){return async(...n)=>new Promise((r,o)=>{t.apply(e,[...n,(t,e)=>{null==t&&o(t),r(e)}])})}function ct(t){const e=t.message||"Failed or Rejected Request";let n=-32e3;if(t&&!t.code)switch(e){case"Parse error":n=-32700;break;case"Invalid request":n=-32600;break;case"Method not found":n=-32601;break;case"Invalid params":n=-32602;break;case"Internal error":n=-32603;break;default:n=-32e3}return{code:n,message:e}}var lt=n(27);function ht(t){const e=-1!==t.indexOf("?")?t.indexOf("?"):void 0;return void 0!==e?t.substr(e):""}function ft(t,e){let n=dt(t);return n=Object.assign(Object.assign({},n),e),t=pt(n)}function dt(t){return lt.parse(t)}function pt(t){return lt.stringify(t)}function gt(t){return void 0!==t.bridge}function mt(t){const e=t.indexOf(":"),n=-1!==t.indexOf("?")?t.indexOf("?"):void 0,r=t.substring(0,e);const o=function(t){const e=t.split("@");return{handshakeTopic:e[0],version:parseInt(e[1],10)}}(t.substring(e+1,n));const i=function(t){const e=dt(t);return{key:e.key||"",bridge:e.bridge||""}}(void 0!==n?t.substr(n):"");return Object.assign(Object.assign({protocol:r},o),i)}n.d(e,"detectEnv",(function(){return r.detectEnv})),n.d(e,"detectOS",(function(){return r.detectOS})),n.d(e,"isAndroid",(function(){return r.isAndroid})),n.d(e,"isIOS",(function(){return r.isIOS})),n.d(e,"isMobile",(function(){return r.isMobile})),n.d(e,"isNode",(function(){return r.isNode})),n.d(e,"isBrowser",(function(){return r.isBrowser})),n.d(e,"getFromWindow",(function(){return r.getFromWindow})),n.d(e,"getFromWindowOrThrow",(function(){return r.getFromWindowOrThrow})),n.d(e,"getDocumentOrThrow",(function(){return r.getDocumentOrThrow})),n.d(e,"getDocument",(function(){return r.getDocument})),n.d(e,"getNavigatorOrThrow",(function(){return r.getNavigatorOrThrow})),n.d(e,"getNavigator",(function(){return r.getNavigator})),n.d(e,"getLocationOrThrow",(function(){return r.getLocationOrThrow})),n.d(e,"getLocation",(function(){return r.getLocation})),n.d(e,"getCryptoOrThrow",(function(){return r.getCryptoOrThrow})),n.d(e,"getCrypto",(function(){return r.getCrypto})),n.d(e,"getLocalStorageOrThrow",(function(){return r.getLocalStorageOrThrow})),n.d(e,"getLocalStorage",(function(){return r.getLocalStorage})),n.d(e,"getClientMeta",(function(){return r.getClientMeta})),n.d(e,"safeJsonParse",(function(){return r.safeJsonParse})),n.d(e,"safeJsonStringify",(function(){return r.safeJsonStringify})),n.d(e,"setLocal",(function(){return r.setLocal})),n.d(e,"getLocal",(function(){return r.getLocal})),n.d(e,"removeLocal",(function(){return r.removeLocal})),n.d(e,"mobileLinkChoiceKey",(function(){return r.mobileLinkChoiceKey})),n.d(e,"formatIOSMobile",(function(){return r.formatIOSMobile})),n.d(e,"saveMobileLinkInfo",(function(){return r.saveMobileLinkInfo})),n.d(e,"getMobileRegistryEntry",(function(){return r.getMobileRegistryEntry})),n.d(e,"getMobileLinkRegistry",(function(){return r.getMobileLinkRegistry})),n.d(e,"getWalletRegistryUrl",(function(){return r.getWalletRegistryUrl})),n.d(e,"getDappRegistryUrl",(function(){return r.getDappRegistryUrl})),n.d(e,"formatMobileRegistryEntry",(function(){return r.formatMobileRegistryEntry})),n.d(e,"formatMobileRegistry",(function(){return r.formatMobileRegistry})),n.d(e,"reservedEvents",(function(){return o})),n.d(e,"signingMethods",(function(){return i})),n.d(e,"stateMethods",(function(){return s})),n.d(e,"infuraNetworks",(function(){return a})),n.d(e,"convertArrayBufferToBuffer",(function(){return h})),n.d(e,"convertArrayBufferToUtf8",(function(){return f})),n.d(e,"convertArrayBufferToHex",(function(){return d})),n.d(e,"convertArrayBufferToNumber",(function(){return p})),n.d(e,"concatArrayBuffers",(function(){return g})),n.d(e,"convertBufferToArrayBuffer",(function(){return m})),n.d(e,"convertBufferToUtf8",(function(){return v})),n.d(e,"convertBufferToHex",(function(){return _})),n.d(e,"convertBufferToNumber",(function(){return y})),n.d(e,"concatBuffers",(function(){return w})),n.d(e,"convertUtf8ToArrayBuffer",(function(){return b})),n.d(e,"convertUtf8ToBuffer",(function(){return M})),n.d(e,"convertUtf8ToHex",(function(){return x})),n.d(e,"convertUtf8ToNumber",(function(){return E})),n.d(e,"convertHexToBuffer",(function(){return R})),n.d(e,"convertHexToArrayBuffer",(function(){return S})),n.d(e,"convertHexToUtf8",(function(){return T})),n.d(e,"convertHexToNumber",(function(){return A})),n.d(e,"convertNumberToBuffer",(function(){return k})),n.d(e,"convertNumberToArrayBuffer",(function(){return C})),n.d(e,"convertNumberToUtf8",(function(){return O})),n.d(e,"convertNumberToHex",(function(){return I})),n.d(e,"toChecksumAddress",(function(){return ot})),n.d(e,"isValidAddress",(function(){return it})),n.d(e,"parsePersonalSign",(function(){return st})),n.d(e,"parseTransactionData",(function(){return at})),n.d(e,"sanitizeHex",(function(){return B})),n.d(e,"addHexPrefix",(function(){return L})),n.d(e,"removeHexPrefix",(function(){return N})),n.d(e,"removeHexLeadingZeros",(function(){return U})),n.d(e,"payloadId",(function(){return j})),n.d(e,"uuid",(function(){return q})),n.d(e,"logDeprecationWarning",(function(){return D})),n.d(e,"getInfuraRpcUrl",(function(){return H})),n.d(e,"getRpcUrl",(function(){return J})),n.d(e,"promisify",(function(){return ut})),n.d(e,"formatRpcError",(function(){return ct})),n.d(e,"isWalletConnectSession",(function(){return gt})),n.d(e,"parseWalletConnectUri",(function(){return mt})),n.d(e,"getQueryString",(function(){return ht})),n.d(e,"appendToQueryString",(function(){return ft})),n.d(e,"parseQueryString",(function(){return dt})),n.d(e,"formatQueryString",(function(){return pt})),n.d(e,"isEmptyString",(function(){return F})),n.d(e,"isEmptyArray",(function(){return z})),n.d(e,"isBuffer",(function(){return W})),n.d(e,"isTypedArray",(function(){return Y})),n.d(e,"isArrayBuffer",(function(){return $})),n.d(e,"getType",(function(){return V})),n.d(e,"getEncoding",(function(){return K})),n.d(e,"isHexString",(function(){return Q})),n.d(e,"isJsonRpcSubscription",(function(){return Z})),n.d(e,"isJsonRpcRequest",(function(){return X})),n.d(e,"isJsonRpcResponseSuccess",(function(){return G})),n.d(e,"isJsonRpcResponseError",(function(){return tt})),n.d(e,"isInternalEvent",(function(){return et})),n.d(e,"isReservedEvent",(function(){return nt})),n.d(e,"isSilentPayload",(function(){return rt}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return 256})),n.d(e,"g",(function(){return 256})),n.d(e,"a",(function(){return"AES-CBC"})),n.d(e,"f",(function(){return"SHA-256"})),n.d(e,"e",(function(){return"HMAC"})),n.d(e,"i",(function(){return"SHA-256"})),n.d(e,"j",(function(){return"SHA-512"})),n.d(e,"h",(function(){return 512})),n.d(e,"d",(function(){return"encrypt"})),n.d(e,"c",(function(){return"decrypt"})),n.d(e,"k",(function(){return"sign"})),n.d(e,"l",(function(){return"verify"}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return i})),n.d(e,"d",(function(){return s})),n.d(e,"e",(function(){return a}));const r="INTERNAL_ERROR",o="SERVER_ERROR",i=[-32700,-32600,-32601,-32602,-32603],s=[-32e3,-32099],a={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[r]:{code:-32603,message:"Internal error"},[o]:{code:-32e3,message:"Server error"}}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(58),e),o(n(59),e)},function(t,e,n){"use strict";n(3);var r=n(10);n.d(e,"parseConnectionError",(function(){return r.d}));var o=n(28);n.o(o,"IJsonRpcProvider")&&n.d(e,"IJsonRpcProvider",(function(){return o.IJsonRpcProvider})),n.o(o,"formatJsonRpcError")&&n.d(e,"formatJsonRpcError",(function(){return o.formatJsonRpcError})),n.o(o,"formatJsonRpcRequest")&&n.d(e,"formatJsonRpcRequest",(function(){return o.formatJsonRpcRequest})),n.o(o,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return o.isHttpUrl})),n.o(o,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return o.isJsonRpcError})),n.o(o,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return o.isJsonRpcResponse})),n.o(o,"payloadId")&&n.d(e,"payloadId",(function(){return o.payloadId}));var i=n(29);n.d(e,"formatJsonRpcError",(function(){return i.a})),n.d(e,"formatJsonRpcRequest",(function(){return i.b})),n.d(e,"payloadId",(function(){return i.c}));n(30);var s=n(31);n.o(s,"IJsonRpcProvider")&&n.d(e,"IJsonRpcProvider",(function(){return s.IJsonRpcProvider})),n.o(s,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return s.isHttpUrl})),n.o(s,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return s.isJsonRpcError})),n.o(s,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return s.isJsonRpcResponse}));var a=n(35);n.d(e,"isHttpUrl",(function(){return a.a}));var u=n(36);n.d(e,"isJsonRpcError",(function(){return u.a})),n.d(e,"isJsonRpcResponse",(function(){return u.b}))},function(t,e,n){"use strict";function r(t){let e=void 0;return"undefined"!=typeof window&&void 0!==window[t]&&(e=window[t]),e}function o(t){const e=r(t);if(!e)throw new Error(t+" is not defined in Window");return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=r,e.getFromWindowOrThrow=o,e.getDocumentOrThrow=function(){return o("document")},e.getDocument=function(){return r("document")},e.getNavigatorOrThrow=function(){return o("navigator")},e.getNavigator=function(){return r("navigator")},e.getLocationOrThrow=function(){return o("location")},e.getLocation=function(){return r("location")},e.getCryptoOrThrow=function(){return o("crypto")},e.getCrypto=function(){return r("crypto")},e.getLocalStorageOrThrow=function(){return o("localStorage")},e.getLocalStorage=function(){return r("localStorage")}},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return c})),n.d(e,"e",(function(){return l})),n.d(e,"f",(function(){return h}));var r=n(4),o=n(2);async function i(t,e=o.a){return r.getSubtleCrypto().importKey("raw",t,function(t){return t===o.a?{length:o.b,name:o.a}:{hash:{name:o.f},name:o.e}}(e),!0,function(t){return t===o.a?[o.d,o.c]:[o.k,o.l]}(e))}async function s(t,e,n){const s=r.getSubtleCrypto(),a=await i(e,o.a),u=await s.encrypt({iv:t,name:o.a},a,n);return new Uint8Array(u)}async function a(t,e,n){const s=r.getSubtleCrypto(),a=await i(e,o.a),u=await s.decrypt({iv:t,name:o.a},a,n);return new Uint8Array(u)}async function u(t,e){const n=r.getSubtleCrypto(),s=await i(t,o.e),a=await n.sign({length:o.g,name:o.e},s,e);return new Uint8Array(a)}async function c(t,e){const n=r.getSubtleCrypto(),s=await i(t,o.e),a=await n.sign({length:o.h,name:o.e},s,e);return new Uint8Array(a)}async function l(t){const e=r.getSubtleCrypto(),n=await e.digest({name:o.i},t);return new Uint8Array(n)}async function h(t){const e=r.getSubtleCrypto(),n=await e.digest({name:o.j},t);return new Uint8Array(n)}},function(t,e){var n,r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},e.getSymbolTotalCodewords=function(t){return r[t]},e.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(t){return n(t)}},function(t,e,n){var r=n(47),o=n(48);e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!r.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return o.testNumeric(t)?e.NUMERIC:o.testAlphanumeric(t)?e.ALPHANUMERIC:o.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return n}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return a}));var r=n(3);function o(t){return r.b.includes(t)}function i(t){return Object.keys(r.e).includes(t)?r.e[t]:r.e[r.a]}function s(t){const e=Object.values(r.e).find(e=>e.code===t);return e||r.e[r.a]}function a(t,e,n){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${e}`):t}},function(t,e,n){"use strict";function r(t){if("string"!=typeof t)throw new Error("Cannot safe json parse value of type "+typeof t);try{return JSON.parse(t)}catch(e){return t}}function o(t){return"string"==typeof t?t:JSON.stringify(t)}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return o}))},function(t,e,n){"use strict";var r=n(22);i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}();var o=i.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function i(t,e,n){return i.TYPED_ARRAY_SUPPORT||this instanceof i?"number"==typeof t?u(this,t):function(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return function(t,e,n,r){if(n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");var o;o=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);i.TYPED_ARRAY_SUPPORT?o.__proto__=i.prototype:o=c(t,o);return o}(t,e,n,r);if("string"==typeof e)return function(t,e){var n=0|h(e),r=a(t,n),o=r.write(e);o!==n&&(r=r.slice(0,o));return r}(t,e);return function(t,e){if(i.isBuffer(e)){var n=0|s(e.length),r=a(t,n);return 0===r.length||e.copy(r,0,0,n),r}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(o=e.length)!=o?a(t,0):c(t,e);if("Buffer"===e.type&&Array.isArray(e.data))return c(t,e.data)}var o;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}(this,t,e,n):new i(t,e,n)}function s(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function a(t,e){var n;return i.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(e)).__proto__=i.prototype:(null===(n=t)&&(n=new i(e)),n.length=e),n}function u(t,e){var n=a(t,e<0?0:0|s(e));if(!i.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)n[r]=0;return n}function c(t,e){for(var n=e.length<0?0:0|s(e.length),r=a(t,n),o=0;o<n;o+=1)r[o]=255&e[o];return r}function l(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function h(t){return i.isBuffer(t)?t.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)?t.byteLength:("string"!=typeof t&&(t=""+t),0===t.length?0:l(t).length)}i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),i.prototype.write=function(t,e,n){void 0===e||void 0===n&&"string"==typeof e?(n=this.length,e=0):isFinite(e)&&(e|=0,isFinite(n)?n|=0:n=void 0);var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(t,e,n,r){return function(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}(l(e,t.length-n),t,n,r)}(this,t,e,n)},i.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),i.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=i.prototype;else{var o=e-t;n=new i(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+t]}return n},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o,s=r-n;if(this===t&&n<e&&e<r)for(o=s-1;o>=0;--o)t[o+e]=this[o+n];else if(s<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s},i.prototype.fill=function(t,e,n){if("string"==typeof t){if("string"==typeof e?(e=0,n=this.length):"string"==typeof n&&(n=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=i.isBuffer(t)?t:new i(t),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this},i.concat=function(t,e){if(!r(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a(null,0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var o=u(null,e),s=0;for(n=0;n<t.length;++n){var c=t[n];if(!i.isBuffer(c))throw new TypeError('"list" argument must be an Array of Buffers');c.copy(o,s),s+=c.length}return o},i.byteLength=h,i.prototype._isBuffer=!0,i.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.exports.alloc=function(t){var e=new i(t);return e.fill(0),e},t.exports.from=function(t){return new i(t)}},function(t,e,n){"use strict";var r=n(38);n.d(e,"randomBytes",(function(){return r.a}));var o=n(39);n.d(e,"aesCbcDecrypt",(function(){return o.a})),n.d(e,"aesCbcEncrypt",(function(){return o.b}));var i=n(40);n.d(e,"hmacSha256Sign",(function(){return i.a}));n(45),n(15),n(2)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{}},function(t,e,n){"use strict";var r=n(41);n.o(r,"isConstantTime")&&n.d(e,"isConstantTime",(function(){return r.isConstantTime}));n(42);var o=n(43);n.o(o,"isConstantTime")&&n.d(e,"isConstantTime",(function(){return o.isConstantTime}));var i=n(44);n.d(e,"isConstantTime",(function(){return i.a}))},function(t,e,n){(function(t){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var s;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{s=n(61).Buffer}catch(t){}function a(t,e,n){for(var r=0,o=Math.min(t.length,n),i=e;i<o;i++){var s=t.charCodeAt(i)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function u(t,e,n,r){for(var o=0,i=Math.min(t.length,n),s=e;s<i;s++){var a=t.charCodeAt(s)-48;o*=r,o+=a>=49?a-49+10:a>=17?a-17+10:a}return o}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&o++,16===e?this._parseHex(t,o):this._parseBase(t,e,o),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,s,a=0;if("be"===n)for(o=t.length-1,i=0;o>=0;o-=3)s=t[o]|t[o-1]<<8|t[o-2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===n)for(o=0,i=0;o<t.length;o+=3)s=t[o]|t[o+1]<<8|t[o+2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,o,i=0;for(n=t.length-6,r=0;n>=e;n-=6)o=a(t,n,n+6),this.words[r]|=o<<i&67108863,this.words[r+1]|=o>>>26-i&4194303,(i+=24)>=26&&(i-=26,r++);n+6!==e&&(o=a(t,e,n+6),this.words[r]|=o<<i&67108863,this.words[r+1]|=o>>>26-i&4194303),this.strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=e)r++;r--,o=o/e|0;for(var i=t.length-n,s=i%r,a=Math.min(i,i-s)+n,c=0,l=n;l<a;l+=r)c=u(t,l,l+r,e),this.imuln(o),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var h=1;for(c=u(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var o=0|t.words[0],i=0|e.words[0],s=o*i,a=67108863&s,u=s/67108864|0;n.words[0]=a;for(var c=1;c<r;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(o=0|t.words[p])*(i=0|e.words[d])+h)/67108864|0,h=67108863&s}n.words[c]=0|h,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var o=0,i=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<o|i)).toString(16);n=0!==(i=a>>>24-o&16777215)||s!==this.length-1?c[6-u.length]+u+n:u+n,(o+=2)>=26&&(o-=26,s--)}for(0!==i&&(n=i.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var f=l[t],d=h[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);n=(p=p.idivn(d)).isZero()?g+n:c[f-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==s),this.toArrayLike(s,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,c=new t(i),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<i;a++)c[a]=0}else{for(a=0;a<i-o;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[i-a-1]=s}return c},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},i.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this.strip()},i.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},i.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var o=0;o<e;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,o=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var o=0,i=0;i<r.length;i++)e=(0|n.words[i])+(0|r.words[i])+o,this.words[i]=67108863&e,o=e>>>26;for(;0!==o&&i<n.length;i++)e=(0|n.words[i])+o,this.words[i]=67108863&e,o=e>>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,o=this.cmp(t);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=t):(n=t,r=this);for(var i=0,s=0;s<r.length;s++)i=(e=(0|n.words[s])-(0|r.words[s])+i)>>26,this.words[s]=67108863&e;for(;0!==i&&s<n.length;s++)i=(e=(0|n.words[s])+i)>>26,this.words[s]=67108863&e;if(0===i&&s<n.length&&n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this.length=Math.max(this.length,s),n!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,n){var r,o,i,s=t.words,a=e.words,u=n.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,g=d>>>13,m=0|s[2],v=8191&m,_=m>>>13,y=0|s[3],w=8191&y,b=y>>>13,M=0|s[4],x=8191&M,E=M>>>13,R=0|s[5],S=8191&R,T=R>>>13,A=0|s[6],k=8191&A,C=A>>>13,O=0|s[7],I=8191&O,P=O>>>13,B=0|s[8],L=8191&B,N=B>>>13,U=0|s[9],j=8191&U,q=U>>>13,D=0|a[0],H=8191&D,J=D>>>13,F=0|a[1],z=8191&F,W=F>>>13,Y=0|a[2],$=8191&Y,V=Y>>>13,K=0|a[3],Q=8191&K,Z=K>>>13,X=0|a[4],G=8191&X,tt=X>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,ot=0|a[6],it=8191&ot,st=ot>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191<,ft=lt>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(c+(r=Math.imul(h,H))|0)+((8191&(o=(o=Math.imul(h,J))+Math.imul(f,H)|0))<<13)|0;c=((i=Math.imul(f,J))+(o>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,H),o=(o=Math.imul(p,J))+Math.imul(g,H)|0,i=Math.imul(g,J);var vt=(c+(r=r+Math.imul(h,z)|0)|0)+((8191&(o=(o=o+Math.imul(h,W)|0)+Math.imul(f,z)|0))<<13)|0;c=((i=i+Math.imul(f,W)|0)+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,H),o=(o=Math.imul(v,J))+Math.imul(_,H)|0,i=Math.imul(_,J),r=r+Math.imul(p,z)|0,o=(o=o+Math.imul(p,W)|0)+Math.imul(g,z)|0,i=i+Math.imul(g,W)|0;var _t=(c+(r=r+Math.imul(h,$)|0)|0)+((8191&(o=(o=o+Math.imul(h,V)|0)+Math.imul(f,$)|0))<<13)|0;c=((i=i+Math.imul(f,V)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(w,H),o=(o=Math.imul(w,J))+Math.imul(b,H)|0,i=Math.imul(b,J),r=r+Math.imul(v,z)|0,o=(o=o+Math.imul(v,W)|0)+Math.imul(_,z)|0,i=i+Math.imul(_,W)|0,r=r+Math.imul(p,$)|0,o=(o=o+Math.imul(p,V)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,V)|0;var yt=(c+(r=r+Math.imul(h,Q)|0)|0)+((8191&(o=(o=o+Math.imul(h,Z)|0)+Math.imul(f,Q)|0))<<13)|0;c=((i=i+Math.imul(f,Z)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(x,H),o=(o=Math.imul(x,J))+Math.imul(E,H)|0,i=Math.imul(E,J),r=r+Math.imul(w,z)|0,o=(o=o+Math.imul(w,W)|0)+Math.imul(b,z)|0,i=i+Math.imul(b,W)|0,r=r+Math.imul(v,$)|0,o=(o=o+Math.imul(v,V)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,V)|0,r=r+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(g,Q)|0,i=i+Math.imul(g,Z)|0;var wt=(c+(r=r+Math.imul(h,G)|0)|0)+((8191&(o=(o=o+Math.imul(h,tt)|0)+Math.imul(f,G)|0))<<13)|0;c=((i=i+Math.imul(f,tt)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,H),o=(o=Math.imul(S,J))+Math.imul(T,H)|0,i=Math.imul(T,J),r=r+Math.imul(x,z)|0,o=(o=o+Math.imul(x,W)|0)+Math.imul(E,z)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(w,$)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(b,$)|0,i=i+Math.imul(b,V)|0,r=r+Math.imul(v,Q)|0,o=(o=o+Math.imul(v,Z)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,Z)|0,r=r+Math.imul(p,G)|0,o=(o=o+Math.imul(p,tt)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,tt)|0;var bt=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(o=(o=o+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;c=((i=i+Math.imul(f,rt)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(k,H),o=(o=Math.imul(k,J))+Math.imul(C,H)|0,i=Math.imul(C,J),r=r+Math.imul(S,z)|0,o=(o=o+Math.imul(S,W)|0)+Math.imul(T,z)|0,i=i+Math.imul(T,W)|0,r=r+Math.imul(x,$)|0,o=(o=o+Math.imul(x,V)|0)+Math.imul(E,$)|0,i=i+Math.imul(E,V)|0,r=r+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,Z)|0)+Math.imul(b,Q)|0,i=i+Math.imul(b,Z)|0,r=r+Math.imul(v,G)|0,o=(o=o+Math.imul(v,tt)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,tt)|0,r=r+Math.imul(p,nt)|0,o=(o=o+Math.imul(p,rt)|0)+Math.imul(g,nt)|0,i=i+Math.imul(g,rt)|0;var Mt=(c+(r=r+Math.imul(h,it)|0)|0)+((8191&(o=(o=o+Math.imul(h,st)|0)+Math.imul(f,it)|0))<<13)|0;c=((i=i+Math.imul(f,st)|0)+(o>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(I,H),o=(o=Math.imul(I,J))+Math.imul(P,H)|0,i=Math.imul(P,J),r=r+Math.imul(k,z)|0,o=(o=o+Math.imul(k,W)|0)+Math.imul(C,z)|0,i=i+Math.imul(C,W)|0,r=r+Math.imul(S,$)|0,o=(o=o+Math.imul(S,V)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,V)|0,r=r+Math.imul(x,Q)|0,o=(o=o+Math.imul(x,Z)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(w,G)|0,o=(o=o+Math.imul(w,tt)|0)+Math.imul(b,G)|0,i=i+Math.imul(b,tt)|0,r=r+Math.imul(v,nt)|0,o=(o=o+Math.imul(v,rt)|0)+Math.imul(_,nt)|0,i=i+Math.imul(_,rt)|0,r=r+Math.imul(p,it)|0,o=(o=o+Math.imul(p,st)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,st)|0;var xt=(c+(r=r+Math.imul(h,ut)|0)|0)+((8191&(o=(o=o+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((i=i+Math.imul(f,ct)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(L,H),o=(o=Math.imul(L,J))+Math.imul(N,H)|0,i=Math.imul(N,J),r=r+Math.imul(I,z)|0,o=(o=o+Math.imul(I,W)|0)+Math.imul(P,z)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(k,$)|0,o=(o=o+Math.imul(k,V)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(S,Q)|0,o=(o=o+Math.imul(S,Z)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(x,G)|0,o=(o=o+Math.imul(x,tt)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,tt)|0,r=r+Math.imul(w,nt)|0,o=(o=o+Math.imul(w,rt)|0)+Math.imul(b,nt)|0,i=i+Math.imul(b,rt)|0,r=r+Math.imul(v,it)|0,o=(o=o+Math.imul(v,st)|0)+Math.imul(_,it)|0,i=i+Math.imul(_,st)|0,r=r+Math.imul(p,ut)|0,o=(o=o+Math.imul(p,ct)|0)+Math.imul(g,ut)|0,i=i+Math.imul(g,ct)|0;var Et=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(o=(o=o+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((i=i+Math.imul(f,ft)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(j,H),o=(o=Math.imul(j,J))+Math.imul(q,H)|0,i=Math.imul(q,J),r=r+Math.imul(L,z)|0,o=(o=o+Math.imul(L,W)|0)+Math.imul(N,z)|0,i=i+Math.imul(N,W)|0,r=r+Math.imul(I,$)|0,o=(o=o+Math.imul(I,V)|0)+Math.imul(P,$)|0,i=i+Math.imul(P,V)|0,r=r+Math.imul(k,Q)|0,o=(o=o+Math.imul(k,Z)|0)+Math.imul(C,Q)|0,i=i+Math.imul(C,Z)|0,r=r+Math.imul(S,G)|0,o=(o=o+Math.imul(S,tt)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,tt)|0,r=r+Math.imul(x,nt)|0,o=(o=o+Math.imul(x,rt)|0)+Math.imul(E,nt)|0,i=i+Math.imul(E,rt)|0,r=r+Math.imul(w,it)|0,o=(o=o+Math.imul(w,st)|0)+Math.imul(b,it)|0,i=i+Math.imul(b,st)|0,r=r+Math.imul(v,ut)|0,o=(o=o+Math.imul(v,ct)|0)+Math.imul(_,ut)|0,i=i+Math.imul(_,ct)|0,r=r+Math.imul(p,ht)|0,o=(o=o+Math.imul(p,ft)|0)+Math.imul(g,ht)|0,i=i+Math.imul(g,ft)|0;var Rt=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(o=(o=o+Math.imul(h,gt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((i=i+Math.imul(f,gt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(j,z),o=(o=Math.imul(j,W))+Math.imul(q,z)|0,i=Math.imul(q,W),r=r+Math.imul(L,$)|0,o=(o=o+Math.imul(L,V)|0)+Math.imul(N,$)|0,i=i+Math.imul(N,V)|0,r=r+Math.imul(I,Q)|0,o=(o=o+Math.imul(I,Z)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(k,G)|0,o=(o=o+Math.imul(k,tt)|0)+Math.imul(C,G)|0,i=i+Math.imul(C,tt)|0,r=r+Math.imul(S,nt)|0,o=(o=o+Math.imul(S,rt)|0)+Math.imul(T,nt)|0,i=i+Math.imul(T,rt)|0,r=r+Math.imul(x,it)|0,o=(o=o+Math.imul(x,st)|0)+Math.imul(E,it)|0,i=i+Math.imul(E,st)|0,r=r+Math.imul(w,ut)|0,o=(o=o+Math.imul(w,ct)|0)+Math.imul(b,ut)|0,i=i+Math.imul(b,ct)|0,r=r+Math.imul(v,ht)|0,o=(o=o+Math.imul(v,ft)|0)+Math.imul(_,ht)|0,i=i+Math.imul(_,ft)|0;var St=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(o=(o=o+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((i=i+Math.imul(g,gt)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,$),o=(o=Math.imul(j,V))+Math.imul(q,$)|0,i=Math.imul(q,V),r=r+Math.imul(L,Q)|0,o=(o=o+Math.imul(L,Z)|0)+Math.imul(N,Q)|0,i=i+Math.imul(N,Z)|0,r=r+Math.imul(I,G)|0,o=(o=o+Math.imul(I,tt)|0)+Math.imul(P,G)|0,i=i+Math.imul(P,tt)|0,r=r+Math.imul(k,nt)|0,o=(o=o+Math.imul(k,rt)|0)+Math.imul(C,nt)|0,i=i+Math.imul(C,rt)|0,r=r+Math.imul(S,it)|0,o=(o=o+Math.imul(S,st)|0)+Math.imul(T,it)|0,i=i+Math.imul(T,st)|0,r=r+Math.imul(x,ut)|0,o=(o=o+Math.imul(x,ct)|0)+Math.imul(E,ut)|0,i=i+Math.imul(E,ct)|0,r=r+Math.imul(w,ht)|0,o=(o=o+Math.imul(w,ft)|0)+Math.imul(b,ht)|0,i=i+Math.imul(b,ft)|0;var Tt=(c+(r=r+Math.imul(v,pt)|0)|0)+((8191&(o=(o=o+Math.imul(v,gt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((i=i+Math.imul(_,gt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,Q),o=(o=Math.imul(j,Z))+Math.imul(q,Q)|0,i=Math.imul(q,Z),r=r+Math.imul(L,G)|0,o=(o=o+Math.imul(L,tt)|0)+Math.imul(N,G)|0,i=i+Math.imul(N,tt)|0,r=r+Math.imul(I,nt)|0,o=(o=o+Math.imul(I,rt)|0)+Math.imul(P,nt)|0,i=i+Math.imul(P,rt)|0,r=r+Math.imul(k,it)|0,o=(o=o+Math.imul(k,st)|0)+Math.imul(C,it)|0,i=i+Math.imul(C,st)|0,r=r+Math.imul(S,ut)|0,o=(o=o+Math.imul(S,ct)|0)+Math.imul(T,ut)|0,i=i+Math.imul(T,ct)|0,r=r+Math.imul(x,ht)|0,o=(o=o+Math.imul(x,ft)|0)+Math.imul(E,ht)|0,i=i+Math.imul(E,ft)|0;var At=(c+(r=r+Math.imul(w,pt)|0)|0)+((8191&(o=(o=o+Math.imul(w,gt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((i=i+Math.imul(b,gt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(j,G),o=(o=Math.imul(j,tt))+Math.imul(q,G)|0,i=Math.imul(q,tt),r=r+Math.imul(L,nt)|0,o=(o=o+Math.imul(L,rt)|0)+Math.imul(N,nt)|0,i=i+Math.imul(N,rt)|0,r=r+Math.imul(I,it)|0,o=(o=o+Math.imul(I,st)|0)+Math.imul(P,it)|0,i=i+Math.imul(P,st)|0,r=r+Math.imul(k,ut)|0,o=(o=o+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,i=i+Math.imul(C,ct)|0,r=r+Math.imul(S,ht)|0,o=(o=o+Math.imul(S,ft)|0)+Math.imul(T,ht)|0,i=i+Math.imul(T,ft)|0;var kt=(c+(r=r+Math.imul(x,pt)|0)|0)+((8191&(o=(o=o+Math.imul(x,gt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((i=i+Math.imul(E,gt)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(j,nt),o=(o=Math.imul(j,rt))+Math.imul(q,nt)|0,i=Math.imul(q,rt),r=r+Math.imul(L,it)|0,o=(o=o+Math.imul(L,st)|0)+Math.imul(N,it)|0,i=i+Math.imul(N,st)|0,r=r+Math.imul(I,ut)|0,o=(o=o+Math.imul(I,ct)|0)+Math.imul(P,ut)|0,i=i+Math.imul(P,ct)|0,r=r+Math.imul(k,ht)|0,o=(o=o+Math.imul(k,ft)|0)+Math.imul(C,ht)|0,i=i+Math.imul(C,ft)|0;var Ct=(c+(r=r+Math.imul(S,pt)|0)|0)+((8191&(o=(o=o+Math.imul(S,gt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((i=i+Math.imul(T,gt)|0)+(o>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,it),o=(o=Math.imul(j,st))+Math.imul(q,it)|0,i=Math.imul(q,st),r=r+Math.imul(L,ut)|0,o=(o=o+Math.imul(L,ct)|0)+Math.imul(N,ut)|0,i=i+Math.imul(N,ct)|0,r=r+Math.imul(I,ht)|0,o=(o=o+Math.imul(I,ft)|0)+Math.imul(P,ht)|0,i=i+Math.imul(P,ft)|0;var Ot=(c+(r=r+Math.imul(k,pt)|0)|0)+((8191&(o=(o=o+Math.imul(k,gt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((i=i+Math.imul(C,gt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(j,ut),o=(o=Math.imul(j,ct))+Math.imul(q,ut)|0,i=Math.imul(q,ct),r=r+Math.imul(L,ht)|0,o=(o=o+Math.imul(L,ft)|0)+Math.imul(N,ht)|0,i=i+Math.imul(N,ft)|0;var It=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(o=(o=o+Math.imul(I,gt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((i=i+Math.imul(P,gt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,ht),o=(o=Math.imul(j,ft))+Math.imul(q,ht)|0,i=Math.imul(q,ft);var Pt=(c+(r=r+Math.imul(L,pt)|0)|0)+((8191&(o=(o=o+Math.imul(L,gt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((i=i+Math.imul(N,gt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Bt=(c+(r=Math.imul(j,pt))|0)+((8191&(o=(o=Math.imul(j,gt))+Math.imul(q,pt)|0))<<13)|0;return c=((i=Math.imul(q,gt))+(o>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=mt,u[1]=vt,u[2]=_t,u[3]=yt,u[4]=wt,u[5]=bt,u[6]=Mt,u[7]=xt,u[8]=Et,u[9]=Rt,u[10]=St,u[11]=Tt,u[12]=At,u[13]=kt,u[14]=Ct,u[15]=Ot,u[16]=It,u[17]=Pt,u[18]=Bt,0!==c&&(u[19]=c,n.length++),n};function p(t,e,n){return(new g).mulp(t,e,n)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=f),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):n<63?f(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,o=0,i=0;i<n.length-1;i++){var s=o;o=0;for(var a=67108863&r,u=Math.min(i,e.length-1),c=Math.max(0,i-t.length+1);c<=u;c++){var l=i-c,h=(0|t.words[l])*(0|e.words[c]),f=67108863&h;a=67108863&(f=f+a|0),o+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}n.words[i]=a,r=s,s=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),n=i.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,n,t);return e},g.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var r=0,o=0;o<e;o++)r|=(1&t)<<e-o-1,t>>=1;return r},g.prototype.permute=function(t,e,n,r,o,i){for(var s=0;s<i;s++)r[s]=e[t[s]],o[s]=n[t[s]]},g.prototype.transform=function(t,e,n,r,o,i){this.permute(i,t,e,n,r,o);for(var s=1;s<o;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<o;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=n[l+d],g=r[l+d],m=n[l+d+s],v=r[l+d+s],_=h*m-f*v;v=h*v+f*m,m=_,n[l+d]=p+m,r[l+d]=g+v,n[l+d+s]=p-m,r[l+d+s]=g-v,d!==a&&(_=u*h-c*f,f=u*f+c*h,h=_)}},g.prototype.guessLen13b=function(t,e){var n=1|Math.max(e,t),r=1&n,o=0;for(n=n/2|0;n;n>>>=1)o++;return 1<<o+1+r},g.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var r=0;r<n/2;r++){var o=t[r];t[r]=t[n-r-1],t[n-r-1]=o,o=e[r],e[r]=-e[n-r-1],e[n-r-1]=-o}},g.prototype.normalize13b=function(t,e){for(var n=0,r=0;r<e/2;r++){var o=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+n;t[r]=67108863&o,n=o<67108864?0:o/67108864|0}return t},g.prototype.convert13b=function(t,e,n,o){for(var i=0,s=0;s<e;s++)i+=0|t[s],n[2*s]=8191&i,i>>>=13,n[2*s+1]=8191&i,i>>>=13;for(s=2*e;s<o;++s)n[s]=0;r(0===i),r(0==(-8192&i))},g.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},g.prototype.mulp=function(t,e,n){var r=2*this.guessLen13b(t.length,e.length),o=this.makeRBT(r),i=this.stub(r),s=new Array(r),a=new Array(r),u=new Array(r),c=new Array(r),l=new Array(r),h=new Array(r),f=n.words;f.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,c,r),this.transform(s,i,a,u,r,o),this.transform(c,i,l,h,r,o);for(var d=0;d<r;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,r),this.transform(a,u,f,i,r,o),this.conjugate(f,i,r),this.normalize13b(f,r),n.negative=t.negative^e.negative,n.length=t.length+e.length,n.strip()},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),p(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,n=0;n<this.length;n++){var o=(0|this.words[n])*t,i=(67108863&o)+(67108863&e);e>>=26,e+=o/67108864|0,e+=i>>>26,this.words[n]=67108863&i}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,o=n%26;e[n]=(t.words[r]&1<<o)>>>o}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var o=n.sqr();r<e.length;r++,o=o.sqr())0!==e[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,n=t%26,o=(t-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&i,u=(0|this.words[e])-a<<n;this.words[e]=u|s,s=a>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==o){for(e=this.length-1;e>=0;e--)this.words[e+o]=this.words[e];for(e=0;e<o;e++)this.words[e]=0;this.length+=o}return this.strip()},i.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,n){var o;r("number"==typeof t&&t>=0),o=e?(e-e%26)/26:0;var i=t%26,s=Math.min((t-i)/26,this.length),a=67108863^67108863>>>i<<i,u=n;if(o-=s,o=Math.max(0,o),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=o);c--){var h=0|this.words[c];this.words[c]=l<<26-i|h>>>i,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,o=1<<e;return!(this.length<=n)&&!!(this.words[n]&o)},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var o=67108863^67108863>>>e<<e;this.words[this.length-1]&=o}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var o,i,s=t.length+n;this._expand(s);var a=0;for(o=0;o<t.length;o++){i=(0|this.words[o+n])+a;var u=(0|t.words[o])*e;a=((i-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)a=(i=(0|this.words[o+n])+a)>>26,this.words[o+n]=67108863&i;if(0===a)return this.strip();for(r(-1===a),a=0,o=0;o<this.length;o++)a=(i=-(0|this.words[o])+a)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,s=0|o.words[o.length-1];0!==(n=26-this._countBits(s))&&(o=o.ushln(n),r.iushln(n),s=0|o.words[o.length-1]);var a,u=r.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=r.clone()._ishlnsubmul(o,1,u);0===l.negative&&(r=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);a&&(a.words[h]=f)}return a&&a.strip(),r.strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),o=t.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(e*n+(0|this.words[o]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*e;this.words[n]=o/t|0,e=o%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(u)):(n.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(n.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=e.cmp(n);if(o<0){var i=e;e=n,n=i}else if(0===o||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,o=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,s=n;0!==i&&s<this.length;s++){var a=0|this.words[s];i=(a+=i)>>>26,a&=67108863,this.words[s]=a}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var o=0|this.words[0];e=o===t?0:o<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],o=0|t.words[n];if(r!==o){r<o?e=-1:r>o&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new M(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):n.strip(),n},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},o(_,v),_.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r<n;r++)e.words[r]=t.words[r];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=4194303&o,r=10;r<t.length;r++){var i=0|t.words[r];t.words[r-10]=(4194303&i)<<4|o>>>22,o=i}o>>>=22,t.words[r-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},o(y,v),o(w,v),o(b,v),b.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,o=67108863&r;r>>>=26,t.words[n]=o,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new y;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return m[t]=e,e},M.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m<p);var v=this.pow(h,new i(1).iushln(p-m-1));f=f.redMul(v),h=v.redSqr(),d=d.redMul(h),p=m}return f},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var o=n[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var c=e.words[r],l=u-1;l>=0;l--){var h=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===r&&0===l)&&(o=this.mul(o,n[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new x(t)},o(x,M),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(60)(t))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!l){var t=a(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(32);n.o(r,"IJsonRpcConnection")&&n.d(e,"IJsonRpcConnection",(function(){return r.IJsonRpcConnection})),n.o(r,"IJsonRpcProvider")&&n.d(e,"IJsonRpcProvider",(function(){return r.IJsonRpcProvider})),n.o(r,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return r.isHttpUrl})),n.o(r,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return r.isJsonRpcError})),n.o(r,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return r.isJsonRpcResponse}));n(14);var o=n(33);n.d(e,"IJsonRpcConnection",(function(){return o.a})),n.d(e,"IJsonRpcProvider",(function(){return o.b}));var i=n(34);n.o(i,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return i.isHttpUrl})),n.o(i,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return i.isJsonRpcError})),n.o(i,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return i.isJsonRpcResponse}))},function(t,e,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(t,e){return new Promise((function(n,r){function o(n){t.removeListener(e,i),r(n)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),n([].slice.call(arguments))}v(t,e,i,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&v(t,"error",e,n)}(t,o,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,n,r){var o,i,s,a;if(c(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),s=i[e]),void 0===s)s=i[e]=n,++t._eventsCount;else if("function"==typeof s?s=i[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=l(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function p(t,e,n){var r=t._events;if(void 0===r)return[];var o=r[e];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(o):m(o,o.length)}function g(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function v(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(i){r.once&&t.removeEventListener(e,o),n(i)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");u=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var c=u.length,l=m(u,c);for(n=0;n<c;++n)i(l[n],this,e)}return!0},a.prototype.addListener=function(t,e){return h(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return h(this,t,e,!0)},a.prototype.once=function(t,e){return c(e),this.on(t,d(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,d(this,t,e)),this},a.prototype.removeListener=function(t,e){var n,r,o,i,s;if(c(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===e||n[i].listener===e){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,o),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,s||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";(function(t){
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("WalletConnectProvider",[],e):"object"==typeof exports?exports.WalletConnectProvider=e():t.WalletConnectProvider=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=57)}([function(t,e,n){"use strict";(function(t){n.d(e,"f",(function(){return a})),n.d(e,"g",(function(){return u})),n.d(e,"i",(function(){return c})),n.d(e,"h",(function(){return l})),n.d(e,"b",(function(){return h})),n.d(e,"c",(function(){return f})),n.d(e,"e",(function(){return d})),n.d(e,"d",(function(){return p})),n.d(e,"o",(function(){return g})),n.d(e,"n",(function(){return m})),n.d(e,"p",(function(){return v})),n.d(e,"A",(function(){return _})),n.d(e,"z",(function(){return y})),n.d(e,"B",(function(){return w})),n.d(e,"v",(function(){return b})),n.d(e,"u",(function(){return M})),n.d(e,"s",(function(){return R})),n.d(e,"r",(function(){return S})),n.d(e,"t",(function(){return k})),n.d(e,"q",(function(){return A})),n.d(e,"m",(function(){return C})),n.d(e,"l",(function(){return O})),n.d(e,"k",(function(){return T})),n.d(e,"j",(function(){return I})),n.d(e,"x",(function(){return L})),n.d(e,"a",(function(){return N})),n.d(e,"y",(function(){return j})),n.d(e,"w",(function(){return U}));var r=n(26),o=n.n(r),i=n(52),s=n.n(i);function a(t){return new Uint8Array(t)}function u(t,e=!1){const n=t.toString("hex");return e?N(n):n}function c(t){return t.toString("utf8")}function l(t){return t.readUIntBE(0,t.length)}function h(t){return s()(t)}function f(t,e=!1){return u(h(t),e)}function d(t){return c(h(t))}function p(t){return l(h(t))}function g(e){return t.from(L(e),"hex")}function m(t){return a(g(t))}function v(t){return c(g(t))}function _(e){return t.from(e,"utf8")}function y(t){return a(_(t))}function w(t,e=!1){return u(_(t),e)}function b(t){return h(x(E(t)))}function M(t){return x(E(t))}function E(t){return B((t>>>0).toString(2))}function x(t){return new Uint8Array(P(t).map(t=>parseInt(t,2)))}function R(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function S(e){return t.isBuffer(e)}function k(t){return o.a.strict(t)&&!S(t)}function A(t){return!k(t)&&!S(t)&&void 0!==t.byteLength}function C(t){return S(t)?"buffer":k(t)?"typed-array":A(t)?"array-buffer":Array.isArray(t)?"array":typeof t}function O(t){return function(t){return!("string"!=typeof t||!new RegExp(/^[01]+$/).test(t))&&t.length%8==0}(t)?"binary":R(t)?"hex":"utf8"}function T(...e){return t.concat(e)}function I(...t){let e=[];return t.forEach(t=>e=e.concat(Array.from(t))),new Uint8Array([...e])}function P(t,e=8){const n=B(t).match(new RegExp(`.{${e}}`,"gi"));return Array.from(n||[])}function B(t,e=8,n="0"){return function(t,e,n="0"){return q(t,e,!0,n)}(t,function(t,e=8){const n=t%e;return n?(t-n)/e*e+e:t}(t.length,e),n)}function L(t){return t.replace(/^0x/,"")}function N(t){return t.startsWith("0x")?t:"0x"+t}function j(t){return(t=B(t=L(t),2))&&(t=N(t)),t}function U(t){const e=t.startsWith("0x");return t=(t=L(t)).startsWith("0")?t.substring(1):t,e?N(t):t}function q(t,e,n,r="0"){const o=e-t.length;let i=t;if(o>0){const e=r.repeat(o);i=n?e+t:t+e}return i}}).call(this,n(21).Buffer)},function(t,e,n){"use strict";n.r(e);var r=n(24);const o=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],i=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],s=["eth_accounts","eth_chainId","net_version"],a={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var u=n(16),c=n.n(u),l=n(0);function h(t){return l.b(new Uint8Array(t))}function f(t){return l.e(new Uint8Array(t))}function d(t,e){return l.c(new Uint8Array(t),!e)}function p(t){return l.d(new Uint8Array(t))}function g(...t){return l.n(t.map(t=>l.c(new Uint8Array(t))).join("")).buffer}function m(t){return l.f(t).buffer}function v(t){return l.i(t)}function _(t,e){return l.g(t,!e)}function y(t){return l.h(t)}function w(...t){return l.k(...t)}function b(t){return l.z(t).buffer}function M(t){return l.A(t)}function E(t,e){return l.B(t,!e)}function x(t){return new c.a(t,10).toNumber()}function R(t){return l.o(t)}function S(t){return l.n(t).buffer}function k(t){return l.p(t)}function A(t){return new c.a(l.x(t),"hex").toNumber()}function C(t){return l.v(t)}function O(t){return l.u(t).buffer}function T(t){return new c.a(t).toString()}function I(t,e){const n=l.x(l.y(new c.a(t).toString(16)));return e?n:l.a(n)}var P=n(53);function B(t){return l.y(t)}function L(t){return l.a(t)}function N(t){return l.x(t)}function j(t){return l.w(l.a(t))}const U=n(5).payloadId;function q(){return((t,e)=>{for(e=t="";t++<36;e+=51*t&52?(15^t?8^Math.random()*(20^t?16:4):4).toString(16):"-");return e})()}function D(){console.warn("DEPRECATION WARNING: This WalletConnect client library will be deprecated in favor of @walletconnect/client. Please check docs.walletconnect.org to learn more about this migration!")}function J(t,e){let n;const r=a[t];return r&&(n=`https://${r}.infura.io/v3/${e}`),n}function F(t,e){let n;const r=J(t,e.infuraId);return e.custom&&e.custom[t]?n=e.custom[t]:r&&(n=r),n}function H(t){return""===t||"string"==typeof t&&""===t.trim()}function W(t){return!(t&&t.length)}function z(t){return l.r(t)}function Y(t){return l.t(t)}function $(t){return l.q(t)}function V(t){return l.m(t)}function K(t){return l.l(t)}function Q(t,e){return l.s(t,e)}function Z(t){return"object"==typeof t.params}function X(t){return void 0!==t.method}function G(t){return void 0!==t.result}function tt(t){return void 0!==t.error}function et(t){return void 0!==t.event}function nt(t){return o.includes(t)||t.startsWith("wc_")}function rt(t){return!!t.method.startsWith("wc_")||!i.includes(t.method)}function ot(t){t=Object(l.x)(t.toLowerCase());const e=Object(l.x)(Object(P.keccak_256)(M(t)));let n="";for(let r=0;r<t.length;r++)parseInt(e[r],16)>7?n+=t[r].toUpperCase():n+=t[r];return Object(l.a)(n)}const it=t=>!!t&&("0x"===t.toLowerCase().substring(0,2)&&(!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t))||t===ot(t))));function st(t){return W(t)||Q(t[0])||(t[0]=E(t[0])),t}function at(t){if(void 0!==t.type&&"0"!==t.type)return t;if(void 0===t.from||!it(t.from))throw new Error("Transaction object must include a valid 'from' value.");function e(t){let e=t;return("number"==typeof t||"string"==typeof t&&!H(t))&&(Q(t)?"string"==typeof t&&(e=B(t)):e=I(t)),"string"==typeof e&&(e=j(e)),e}const n={from:B(t.from),to:void 0===t.to?"":B(t.to),gasPrice:void 0===t.gasPrice?"":e(t.gasPrice),gas:void 0===t.gas?void 0===t.gasLimit?"":e(t.gasLimit):e(t.gas),value:void 0===t.value?"":e(t.value),nonce:void 0===t.nonce?"":e(t.nonce),data:void 0===t.data?"":B(t.data)||"0x"},r=["gasPrice","gas","value","nonce"];return Object.keys(n).forEach(t=>{!n[t].trim().length&&r.includes(t)&&delete n[t]}),n}function ut(t,e){return async(...n)=>new Promise((r,o)=>{t.apply(e,[...n,(t,e)=>{null==t&&o(t),r(e)}])})}function ct(t){const e=t.message||"Failed or Rejected Request";let n=-32e3;if(t&&!t.code)switch(e){case"Parse error":n=-32700;break;case"Invalid request":n=-32600;break;case"Method not found":n=-32601;break;case"Invalid params":n=-32602;break;case"Internal error":n=-32603;break;default:n=-32e3}return{code:n,message:e}}var lt=n(28);function ht(t){const e=-1!==t.indexOf("?")?t.indexOf("?"):void 0;return void 0!==e?t.substr(e):""}function ft(t,e){let n=dt(t);return n=Object.assign(Object.assign({},n),e),t=pt(n)}function dt(t){return lt.parse(t)}function pt(t){return lt.stringify(t)}function gt(t){return void 0!==t.bridge}function mt(t){const e=t.indexOf(":"),n=-1!==t.indexOf("?")?t.indexOf("?"):void 0,r=t.substring(0,e);const o=function(t){const e=t.split("@");return{handshakeTopic:e[0],version:parseInt(e[1],10)}}(t.substring(e+1,n));const i=function(t){const e=dt(t);return{key:e.key||"",bridge:e.bridge||""}}(void 0!==n?t.substr(n):"");return Object.assign(Object.assign({protocol:r},o),i)}n.d(e,"detectEnv",(function(){return r.detectEnv})),n.d(e,"detectOS",(function(){return r.detectOS})),n.d(e,"isAndroid",(function(){return r.isAndroid})),n.d(e,"isIOS",(function(){return r.isIOS})),n.d(e,"isMobile",(function(){return r.isMobile})),n.d(e,"isNode",(function(){return r.isNode})),n.d(e,"isBrowser",(function(){return r.isBrowser})),n.d(e,"getFromWindow",(function(){return r.getFromWindow})),n.d(e,"getFromWindowOrThrow",(function(){return r.getFromWindowOrThrow})),n.d(e,"getDocumentOrThrow",(function(){return r.getDocumentOrThrow})),n.d(e,"getDocument",(function(){return r.getDocument})),n.d(e,"getNavigatorOrThrow",(function(){return r.getNavigatorOrThrow})),n.d(e,"getNavigator",(function(){return r.getNavigator})),n.d(e,"getLocationOrThrow",(function(){return r.getLocationOrThrow})),n.d(e,"getLocation",(function(){return r.getLocation})),n.d(e,"getCryptoOrThrow",(function(){return r.getCryptoOrThrow})),n.d(e,"getCrypto",(function(){return r.getCrypto})),n.d(e,"getLocalStorageOrThrow",(function(){return r.getLocalStorageOrThrow})),n.d(e,"getLocalStorage",(function(){return r.getLocalStorage})),n.d(e,"getClientMeta",(function(){return r.getClientMeta})),n.d(e,"safeJsonParse",(function(){return r.safeJsonParse})),n.d(e,"safeJsonStringify",(function(){return r.safeJsonStringify})),n.d(e,"setLocal",(function(){return r.setLocal})),n.d(e,"getLocal",(function(){return r.getLocal})),n.d(e,"removeLocal",(function(){return r.removeLocal})),n.d(e,"mobileLinkChoiceKey",(function(){return r.mobileLinkChoiceKey})),n.d(e,"formatIOSMobile",(function(){return r.formatIOSMobile})),n.d(e,"saveMobileLinkInfo",(function(){return r.saveMobileLinkInfo})),n.d(e,"getMobileRegistryEntry",(function(){return r.getMobileRegistryEntry})),n.d(e,"getMobileLinkRegistry",(function(){return r.getMobileLinkRegistry})),n.d(e,"getWalletRegistryUrl",(function(){return r.getWalletRegistryUrl})),n.d(e,"getDappRegistryUrl",(function(){return r.getDappRegistryUrl})),n.d(e,"formatMobileRegistryEntry",(function(){return r.formatMobileRegistryEntry})),n.d(e,"formatMobileRegistry",(function(){return r.formatMobileRegistry})),n.d(e,"reservedEvents",(function(){return o})),n.d(e,"signingMethods",(function(){return i})),n.d(e,"stateMethods",(function(){return s})),n.d(e,"infuraNetworks",(function(){return a})),n.d(e,"convertArrayBufferToBuffer",(function(){return h})),n.d(e,"convertArrayBufferToUtf8",(function(){return f})),n.d(e,"convertArrayBufferToHex",(function(){return d})),n.d(e,"convertArrayBufferToNumber",(function(){return p})),n.d(e,"concatArrayBuffers",(function(){return g})),n.d(e,"convertBufferToArrayBuffer",(function(){return m})),n.d(e,"convertBufferToUtf8",(function(){return v})),n.d(e,"convertBufferToHex",(function(){return _})),n.d(e,"convertBufferToNumber",(function(){return y})),n.d(e,"concatBuffers",(function(){return w})),n.d(e,"convertUtf8ToArrayBuffer",(function(){return b})),n.d(e,"convertUtf8ToBuffer",(function(){return M})),n.d(e,"convertUtf8ToHex",(function(){return E})),n.d(e,"convertUtf8ToNumber",(function(){return x})),n.d(e,"convertHexToBuffer",(function(){return R})),n.d(e,"convertHexToArrayBuffer",(function(){return S})),n.d(e,"convertHexToUtf8",(function(){return k})),n.d(e,"convertHexToNumber",(function(){return A})),n.d(e,"convertNumberToBuffer",(function(){return C})),n.d(e,"convertNumberToArrayBuffer",(function(){return O})),n.d(e,"convertNumberToUtf8",(function(){return T})),n.d(e,"convertNumberToHex",(function(){return I})),n.d(e,"toChecksumAddress",(function(){return ot})),n.d(e,"isValidAddress",(function(){return it})),n.d(e,"parsePersonalSign",(function(){return st})),n.d(e,"parseTransactionData",(function(){return at})),n.d(e,"sanitizeHex",(function(){return B})),n.d(e,"addHexPrefix",(function(){return L})),n.d(e,"removeHexPrefix",(function(){return N})),n.d(e,"removeHexLeadingZeros",(function(){return j})),n.d(e,"payloadId",(function(){return U})),n.d(e,"uuid",(function(){return q})),n.d(e,"logDeprecationWarning",(function(){return D})),n.d(e,"getInfuraRpcUrl",(function(){return J})),n.d(e,"getRpcUrl",(function(){return F})),n.d(e,"promisify",(function(){return ut})),n.d(e,"formatRpcError",(function(){return ct})),n.d(e,"isWalletConnectSession",(function(){return gt})),n.d(e,"parseWalletConnectUri",(function(){return mt})),n.d(e,"getQueryString",(function(){return ht})),n.d(e,"appendToQueryString",(function(){return ft})),n.d(e,"parseQueryString",(function(){return dt})),n.d(e,"formatQueryString",(function(){return pt})),n.d(e,"isEmptyString",(function(){return H})),n.d(e,"isEmptyArray",(function(){return W})),n.d(e,"isBuffer",(function(){return z})),n.d(e,"isTypedArray",(function(){return Y})),n.d(e,"isArrayBuffer",(function(){return $})),n.d(e,"getType",(function(){return V})),n.d(e,"getEncoding",(function(){return K})),n.d(e,"isHexString",(function(){return Q})),n.d(e,"isJsonRpcSubscription",(function(){return Z})),n.d(e,"isJsonRpcRequest",(function(){return X})),n.d(e,"isJsonRpcResponseSuccess",(function(){return G})),n.d(e,"isJsonRpcResponseError",(function(){return tt})),n.d(e,"isInternalEvent",(function(){return et})),n.d(e,"isReservedEvent",(function(){return nt})),n.d(e,"isSilentPayload",(function(){return rt}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return 256})),n.d(e,"g",(function(){return 256})),n.d(e,"a",(function(){return"AES-CBC"})),n.d(e,"f",(function(){return"SHA-256"})),n.d(e,"e",(function(){return"HMAC"})),n.d(e,"i",(function(){return"SHA-256"})),n.d(e,"j",(function(){return"SHA-512"})),n.d(e,"h",(function(){return 512})),n.d(e,"d",(function(){return"encrypt"})),n.d(e,"c",(function(){return"decrypt"})),n.d(e,"k",(function(){return"sign"})),n.d(e,"l",(function(){return"verify"}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return i})),n.d(e,"d",(function(){return s})),n.d(e,"e",(function(){return a}));const r="INTERNAL_ERROR",o="SERVER_ERROR",i=[-32700,-32600,-32601,-32602,-32603],s=[-32e3,-32099],a={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[r]:{code:-32603,message:"Internal error"},[o]:{code:-32e3,message:"Server error"}}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(59),e),o(n(60),e)},function(t,e,n){"use strict";n(3);var r=n(10);n.d(e,"parseConnectionError",(function(){return r.d}));var o=n(29);n.o(o,"IJsonRpcProvider")&&n.d(e,"IJsonRpcProvider",(function(){return o.IJsonRpcProvider})),n.o(o,"formatJsonRpcError")&&n.d(e,"formatJsonRpcError",(function(){return o.formatJsonRpcError})),n.o(o,"formatJsonRpcRequest")&&n.d(e,"formatJsonRpcRequest",(function(){return o.formatJsonRpcRequest})),n.o(o,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return o.isHttpUrl})),n.o(o,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return o.isJsonRpcError})),n.o(o,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return o.isJsonRpcResponse})),n.o(o,"payloadId")&&n.d(e,"payloadId",(function(){return o.payloadId}));var i=n(30);n.d(e,"formatJsonRpcError",(function(){return i.a})),n.d(e,"formatJsonRpcRequest",(function(){return i.b})),n.d(e,"payloadId",(function(){return i.c}));n(31);var s=n(32);n.o(s,"IJsonRpcProvider")&&n.d(e,"IJsonRpcProvider",(function(){return s.IJsonRpcProvider})),n.o(s,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return s.isHttpUrl})),n.o(s,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return s.isJsonRpcError})),n.o(s,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return s.isJsonRpcResponse}));var a=n(36);n.d(e,"isHttpUrl",(function(){return a.a}));var u=n(37);n.d(e,"isJsonRpcError",(function(){return u.a})),n.d(e,"isJsonRpcResponse",(function(){return u.b}))},function(t,e,n){"use strict";function r(t){let e=void 0;return"undefined"!=typeof window&&void 0!==window[t]&&(e=window[t]),e}function o(t){const e=r(t);if(!e)throw new Error(t+" is not defined in Window");return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=r,e.getFromWindowOrThrow=o,e.getDocumentOrThrow=function(){return o("document")},e.getDocument=function(){return r("document")},e.getNavigatorOrThrow=function(){return o("navigator")},e.getNavigator=function(){return r("navigator")},e.getLocationOrThrow=function(){return o("location")},e.getLocation=function(){return r("location")},e.getCryptoOrThrow=function(){return o("crypto")},e.getCrypto=function(){return r("crypto")},e.getLocalStorageOrThrow=function(){return o("localStorage")},e.getLocalStorage=function(){return r("localStorage")}},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return c})),n.d(e,"e",(function(){return l})),n.d(e,"f",(function(){return h}));var r=n(4),o=n(2);async function i(t,e=o.a){return r.getSubtleCrypto().importKey("raw",t,function(t){return t===o.a?{length:o.b,name:o.a}:{hash:{name:o.f},name:o.e}}(e),!0,function(t){return t===o.a?[o.d,o.c]:[o.k,o.l]}(e))}async function s(t,e,n){const s=r.getSubtleCrypto(),a=await i(e,o.a),u=await s.encrypt({iv:t,name:o.a},a,n);return new Uint8Array(u)}async function a(t,e,n){const s=r.getSubtleCrypto(),a=await i(e,o.a),u=await s.decrypt({iv:t,name:o.a},a,n);return new Uint8Array(u)}async function u(t,e){const n=r.getSubtleCrypto(),s=await i(t,o.e),a=await n.sign({length:o.g,name:o.e},s,e);return new Uint8Array(a)}async function c(t,e){const n=r.getSubtleCrypto(),s=await i(t,o.e),a=await n.sign({length:o.h,name:o.e},s,e);return new Uint8Array(a)}async function l(t){const e=r.getSubtleCrypto(),n=await e.digest({name:o.i},t);return new Uint8Array(n)}async function h(t){const e=r.getSubtleCrypto(),n=await e.digest({name:o.j},t);return new Uint8Array(n)}},function(t,e){var n,r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},e.getSymbolTotalCodewords=function(t){return r[t]},e.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(t){return n(t)}},function(t,e,n){var r=n(47),o=n(48);e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!r.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return o.testNumeric(t)?e.NUMERIC:o.testAlphanumeric(t)?e.ALPHANUMERIC:o.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return n}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return a}));var r=n(3);function o(t){return r.b.includes(t)}function i(t){return Object.keys(r.e).includes(t)?r.e[t]:r.e[r.a]}function s(t){const e=Object.values(r.e).find(e=>e.code===t);return e||r.e[r.a]}function a(t,e,n){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${e}`):t}},function(t,e,n){"use strict";function r(t){if("string"!=typeof t)throw new Error("Cannot safe json parse value of type "+typeof t);try{return JSON.parse(t)}catch(e){return t}}function o(t){return"string"==typeof t?t:JSON.stringify(t)}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return o}))},function(t,e,n){"use strict";var r=n(22);i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}();var o=i.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function i(t,e,n){return i.TYPED_ARRAY_SUPPORT||this instanceof i?"number"==typeof t?u(this,t):function(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return function(t,e,n,r){if(n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");var o;o=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);i.TYPED_ARRAY_SUPPORT?o.__proto__=i.prototype:o=c(t,o);return o}(t,e,n,r);if("string"==typeof e)return function(t,e){var n=0|h(e),r=a(t,n),o=r.write(e);o!==n&&(r=r.slice(0,o));return r}(t,e);return function(t,e){if(i.isBuffer(e)){var n=0|s(e.length),r=a(t,n);return 0===r.length||e.copy(r,0,0,n),r}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(o=e.length)!=o?a(t,0):c(t,e);if("Buffer"===e.type&&Array.isArray(e.data))return c(t,e.data)}var o;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}(this,t,e,n):new i(t,e,n)}function s(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function a(t,e){var n;return i.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(e)).__proto__=i.prototype:(null===(n=t)&&(n=new i(e)),n.length=e),n}function u(t,e){var n=a(t,e<0?0:0|s(e));if(!i.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)n[r]=0;return n}function c(t,e){for(var n=e.length<0?0:0|s(e.length),r=a(t,n),o=0;o<n;o+=1)r[o]=255&e[o];return r}function l(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function h(t){return i.isBuffer(t)?t.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)?t.byteLength:("string"!=typeof t&&(t=""+t),0===t.length?0:l(t).length)}i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),i.prototype.write=function(t,e,n){void 0===e||void 0===n&&"string"==typeof e?(n=this.length,e=0):isFinite(e)&&(e|=0,isFinite(n)?n|=0:n=void 0);var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(t,e,n,r){return function(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}(l(e,t.length-n),t,n,r)}(this,t,e,n)},i.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),i.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=i.prototype;else{var o=e-t;n=new i(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+t]}return n},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o,s=r-n;if(this===t&&n<e&&e<r)for(o=s-1;o>=0;--o)t[o+e]=this[o+n];else if(s<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s},i.prototype.fill=function(t,e,n){if("string"==typeof t){if("string"==typeof e?(e=0,n=this.length):"string"==typeof n&&(n=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=i.isBuffer(t)?t:new i(t),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this},i.concat=function(t,e){if(!r(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a(null,0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var o=u(null,e),s=0;for(n=0;n<t.length;++n){var c=t[n];if(!i.isBuffer(c))throw new TypeError('"list" argument must be an Array of Buffers');c.copy(o,s),s+=c.length}return o},i.byteLength=h,i.prototype._isBuffer=!0,i.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.exports.alloc=function(t){var e=new i(t);return e.fill(0),e},t.exports.from=function(t){return new i(t)}},function(t,e,n){"use strict";var r=n(38);n.d(e,"randomBytes",(function(){return r.a}));var o=n(39);n.d(e,"aesCbcDecrypt",(function(){return o.a})),n.d(e,"aesCbcEncrypt",(function(){return o.b}));var i=n(40);n.d(e,"hmacSha256Sign",(function(){return i.a}));n(45),n(15),n(2)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{}},function(t,e,n){"use strict";var r=n(41);n.o(r,"isConstantTime")&&n.d(e,"isConstantTime",(function(){return r.isConstantTime}));n(42);var o=n(43);n.o(o,"isConstantTime")&&n.d(e,"isConstantTime",(function(){return o.isConstantTime}));var i=n(44);n.d(e,"isConstantTime",(function(){return i.a}))},function(t,e,n){(function(t){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var s;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{s=n(62).Buffer}catch(t){}function a(t,e,n){for(var r=0,o=Math.min(t.length,n),i=e;i<o;i++){var s=t.charCodeAt(i)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function u(t,e,n,r){for(var o=0,i=Math.min(t.length,n),s=e;s<i;s++){var a=t.charCodeAt(s)-48;o*=r,o+=a>=49?a-49+10:a>=17?a-17+10:a}return o}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&o++,16===e?this._parseHex(t,o):this._parseBase(t,e,o),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,s,a=0;if("be"===n)for(o=t.length-1,i=0;o>=0;o-=3)s=t[o]|t[o-1]<<8|t[o-2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===n)for(o=0,i=0;o<t.length;o+=3)s=t[o]|t[o+1]<<8|t[o+2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,o,i=0;for(n=t.length-6,r=0;n>=e;n-=6)o=a(t,n,n+6),this.words[r]|=o<<i&67108863,this.words[r+1]|=o>>>26-i&4194303,(i+=24)>=26&&(i-=26,r++);n+6!==e&&(o=a(t,e,n+6),this.words[r]|=o<<i&67108863,this.words[r+1]|=o>>>26-i&4194303),this.strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=e)r++;r--,o=o/e|0;for(var i=t.length-n,s=i%r,a=Math.min(i,i-s)+n,c=0,l=n;l<a;l+=r)c=u(t,l,l+r,e),this.imuln(o),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var h=1;for(c=u(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var o=0|t.words[0],i=0|e.words[0],s=o*i,a=67108863&s,u=s/67108864|0;n.words[0]=a;for(var c=1;c<r;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(o=0|t.words[p])*(i=0|e.words[d])+h)/67108864|0,h=67108863&s}n.words[c]=0|h,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var o=0,i=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<o|i)).toString(16);n=0!==(i=a>>>24-o&16777215)||s!==this.length-1?c[6-u.length]+u+n:u+n,(o+=2)>=26&&(o-=26,s--)}for(0!==i&&(n=i.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var f=l[t],d=h[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);n=(p=p.idivn(d)).isZero()?g+n:c[f-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==s),this.toArrayLike(s,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,c=new t(i),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<i;a++)c[a]=0}else{for(a=0;a<i-o;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[i-a-1]=s}return c},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},i.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this.strip()},i.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},i.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var o=0;o<e;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,o=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var o=0,i=0;i<r.length;i++)e=(0|n.words[i])+(0|r.words[i])+o,this.words[i]=67108863&e,o=e>>>26;for(;0!==o&&i<n.length;i++)e=(0|n.words[i])+o,this.words[i]=67108863&e,o=e>>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,o=this.cmp(t);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=t):(n=t,r=this);for(var i=0,s=0;s<r.length;s++)i=(e=(0|n.words[s])-(0|r.words[s])+i)>>26,this.words[s]=67108863&e;for(;0!==i&&s<n.length;s++)i=(e=(0|n.words[s])+i)>>26,this.words[s]=67108863&e;if(0===i&&s<n.length&&n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this.length=Math.max(this.length,s),n!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,n){var r,o,i,s=t.words,a=e.words,u=n.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,g=d>>>13,m=0|s[2],v=8191&m,_=m>>>13,y=0|s[3],w=8191&y,b=y>>>13,M=0|s[4],E=8191&M,x=M>>>13,R=0|s[5],S=8191&R,k=R>>>13,A=0|s[6],C=8191&A,O=A>>>13,T=0|s[7],I=8191&T,P=T>>>13,B=0|s[8],L=8191&B,N=B>>>13,j=0|s[9],U=8191&j,q=j>>>13,D=0|a[0],J=8191&D,F=D>>>13,H=0|a[1],W=8191&H,z=H>>>13,Y=0|a[2],$=8191&Y,V=Y>>>13,K=0|a[3],Q=8191&K,Z=K>>>13,X=0|a[4],G=8191&X,tt=X>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,ot=0|a[6],it=8191&ot,st=ot>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191<,ft=lt>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(c+(r=Math.imul(h,J))|0)+((8191&(o=(o=Math.imul(h,F))+Math.imul(f,J)|0))<<13)|0;c=((i=Math.imul(f,F))+(o>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,J),o=(o=Math.imul(p,F))+Math.imul(g,J)|0,i=Math.imul(g,F);var vt=(c+(r=r+Math.imul(h,W)|0)|0)+((8191&(o=(o=o+Math.imul(h,z)|0)+Math.imul(f,W)|0))<<13)|0;c=((i=i+Math.imul(f,z)|0)+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,J),o=(o=Math.imul(v,F))+Math.imul(_,J)|0,i=Math.imul(_,F),r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,z)|0)+Math.imul(g,W)|0,i=i+Math.imul(g,z)|0;var _t=(c+(r=r+Math.imul(h,$)|0)|0)+((8191&(o=(o=o+Math.imul(h,V)|0)+Math.imul(f,$)|0))<<13)|0;c=((i=i+Math.imul(f,V)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(w,J),o=(o=Math.imul(w,F))+Math.imul(b,J)|0,i=Math.imul(b,F),r=r+Math.imul(v,W)|0,o=(o=o+Math.imul(v,z)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,z)|0,r=r+Math.imul(p,$)|0,o=(o=o+Math.imul(p,V)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,V)|0;var yt=(c+(r=r+Math.imul(h,Q)|0)|0)+((8191&(o=(o=o+Math.imul(h,Z)|0)+Math.imul(f,Q)|0))<<13)|0;c=((i=i+Math.imul(f,Z)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(E,J),o=(o=Math.imul(E,F))+Math.imul(x,J)|0,i=Math.imul(x,F),r=r+Math.imul(w,W)|0,o=(o=o+Math.imul(w,z)|0)+Math.imul(b,W)|0,i=i+Math.imul(b,z)|0,r=r+Math.imul(v,$)|0,o=(o=o+Math.imul(v,V)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,V)|0,r=r+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(g,Q)|0,i=i+Math.imul(g,Z)|0;var wt=(c+(r=r+Math.imul(h,G)|0)|0)+((8191&(o=(o=o+Math.imul(h,tt)|0)+Math.imul(f,G)|0))<<13)|0;c=((i=i+Math.imul(f,tt)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,J),o=(o=Math.imul(S,F))+Math.imul(k,J)|0,i=Math.imul(k,F),r=r+Math.imul(E,W)|0,o=(o=o+Math.imul(E,z)|0)+Math.imul(x,W)|0,i=i+Math.imul(x,z)|0,r=r+Math.imul(w,$)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(b,$)|0,i=i+Math.imul(b,V)|0,r=r+Math.imul(v,Q)|0,o=(o=o+Math.imul(v,Z)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,Z)|0,r=r+Math.imul(p,G)|0,o=(o=o+Math.imul(p,tt)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,tt)|0;var bt=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(o=(o=o+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;c=((i=i+Math.imul(f,rt)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(C,J),o=(o=Math.imul(C,F))+Math.imul(O,J)|0,i=Math.imul(O,F),r=r+Math.imul(S,W)|0,o=(o=o+Math.imul(S,z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,z)|0,r=r+Math.imul(E,$)|0,o=(o=o+Math.imul(E,V)|0)+Math.imul(x,$)|0,i=i+Math.imul(x,V)|0,r=r+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,Z)|0)+Math.imul(b,Q)|0,i=i+Math.imul(b,Z)|0,r=r+Math.imul(v,G)|0,o=(o=o+Math.imul(v,tt)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,tt)|0,r=r+Math.imul(p,nt)|0,o=(o=o+Math.imul(p,rt)|0)+Math.imul(g,nt)|0,i=i+Math.imul(g,rt)|0;var Mt=(c+(r=r+Math.imul(h,it)|0)|0)+((8191&(o=(o=o+Math.imul(h,st)|0)+Math.imul(f,it)|0))<<13)|0;c=((i=i+Math.imul(f,st)|0)+(o>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(I,J),o=(o=Math.imul(I,F))+Math.imul(P,J)|0,i=Math.imul(P,F),r=r+Math.imul(C,W)|0,o=(o=o+Math.imul(C,z)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,z)|0,r=r+Math.imul(S,$)|0,o=(o=o+Math.imul(S,V)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,V)|0,r=r+Math.imul(E,Q)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(x,Q)|0,i=i+Math.imul(x,Z)|0,r=r+Math.imul(w,G)|0,o=(o=o+Math.imul(w,tt)|0)+Math.imul(b,G)|0,i=i+Math.imul(b,tt)|0,r=r+Math.imul(v,nt)|0,o=(o=o+Math.imul(v,rt)|0)+Math.imul(_,nt)|0,i=i+Math.imul(_,rt)|0,r=r+Math.imul(p,it)|0,o=(o=o+Math.imul(p,st)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,st)|0;var Et=(c+(r=r+Math.imul(h,ut)|0)|0)+((8191&(o=(o=o+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((i=i+Math.imul(f,ct)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(L,J),o=(o=Math.imul(L,F))+Math.imul(N,J)|0,i=Math.imul(N,F),r=r+Math.imul(I,W)|0,o=(o=o+Math.imul(I,z)|0)+Math.imul(P,W)|0,i=i+Math.imul(P,z)|0,r=r+Math.imul(C,$)|0,o=(o=o+Math.imul(C,V)|0)+Math.imul(O,$)|0,i=i+Math.imul(O,V)|0,r=r+Math.imul(S,Q)|0,o=(o=o+Math.imul(S,Z)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(E,G)|0,o=(o=o+Math.imul(E,tt)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,tt)|0,r=r+Math.imul(w,nt)|0,o=(o=o+Math.imul(w,rt)|0)+Math.imul(b,nt)|0,i=i+Math.imul(b,rt)|0,r=r+Math.imul(v,it)|0,o=(o=o+Math.imul(v,st)|0)+Math.imul(_,it)|0,i=i+Math.imul(_,st)|0,r=r+Math.imul(p,ut)|0,o=(o=o+Math.imul(p,ct)|0)+Math.imul(g,ut)|0,i=i+Math.imul(g,ct)|0;var xt=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(o=(o=o+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((i=i+Math.imul(f,ft)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(U,J),o=(o=Math.imul(U,F))+Math.imul(q,J)|0,i=Math.imul(q,F),r=r+Math.imul(L,W)|0,o=(o=o+Math.imul(L,z)|0)+Math.imul(N,W)|0,i=i+Math.imul(N,z)|0,r=r+Math.imul(I,$)|0,o=(o=o+Math.imul(I,V)|0)+Math.imul(P,$)|0,i=i+Math.imul(P,V)|0,r=r+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,Z)|0,r=r+Math.imul(S,G)|0,o=(o=o+Math.imul(S,tt)|0)+Math.imul(k,G)|0,i=i+Math.imul(k,tt)|0,r=r+Math.imul(E,nt)|0,o=(o=o+Math.imul(E,rt)|0)+Math.imul(x,nt)|0,i=i+Math.imul(x,rt)|0,r=r+Math.imul(w,it)|0,o=(o=o+Math.imul(w,st)|0)+Math.imul(b,it)|0,i=i+Math.imul(b,st)|0,r=r+Math.imul(v,ut)|0,o=(o=o+Math.imul(v,ct)|0)+Math.imul(_,ut)|0,i=i+Math.imul(_,ct)|0,r=r+Math.imul(p,ht)|0,o=(o=o+Math.imul(p,ft)|0)+Math.imul(g,ht)|0,i=i+Math.imul(g,ft)|0;var Rt=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(o=(o=o+Math.imul(h,gt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((i=i+Math.imul(f,gt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(U,W),o=(o=Math.imul(U,z))+Math.imul(q,W)|0,i=Math.imul(q,z),r=r+Math.imul(L,$)|0,o=(o=o+Math.imul(L,V)|0)+Math.imul(N,$)|0,i=i+Math.imul(N,V)|0,r=r+Math.imul(I,Q)|0,o=(o=o+Math.imul(I,Z)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(C,G)|0,o=(o=o+Math.imul(C,tt)|0)+Math.imul(O,G)|0,i=i+Math.imul(O,tt)|0,r=r+Math.imul(S,nt)|0,o=(o=o+Math.imul(S,rt)|0)+Math.imul(k,nt)|0,i=i+Math.imul(k,rt)|0,r=r+Math.imul(E,it)|0,o=(o=o+Math.imul(E,st)|0)+Math.imul(x,it)|0,i=i+Math.imul(x,st)|0,r=r+Math.imul(w,ut)|0,o=(o=o+Math.imul(w,ct)|0)+Math.imul(b,ut)|0,i=i+Math.imul(b,ct)|0,r=r+Math.imul(v,ht)|0,o=(o=o+Math.imul(v,ft)|0)+Math.imul(_,ht)|0,i=i+Math.imul(_,ft)|0;var St=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(o=(o=o+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((i=i+Math.imul(g,gt)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(U,$),o=(o=Math.imul(U,V))+Math.imul(q,$)|0,i=Math.imul(q,V),r=r+Math.imul(L,Q)|0,o=(o=o+Math.imul(L,Z)|0)+Math.imul(N,Q)|0,i=i+Math.imul(N,Z)|0,r=r+Math.imul(I,G)|0,o=(o=o+Math.imul(I,tt)|0)+Math.imul(P,G)|0,i=i+Math.imul(P,tt)|0,r=r+Math.imul(C,nt)|0,o=(o=o+Math.imul(C,rt)|0)+Math.imul(O,nt)|0,i=i+Math.imul(O,rt)|0,r=r+Math.imul(S,it)|0,o=(o=o+Math.imul(S,st)|0)+Math.imul(k,it)|0,i=i+Math.imul(k,st)|0,r=r+Math.imul(E,ut)|0,o=(o=o+Math.imul(E,ct)|0)+Math.imul(x,ut)|0,i=i+Math.imul(x,ct)|0,r=r+Math.imul(w,ht)|0,o=(o=o+Math.imul(w,ft)|0)+Math.imul(b,ht)|0,i=i+Math.imul(b,ft)|0;var kt=(c+(r=r+Math.imul(v,pt)|0)|0)+((8191&(o=(o=o+Math.imul(v,gt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((i=i+Math.imul(_,gt)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(U,Q),o=(o=Math.imul(U,Z))+Math.imul(q,Q)|0,i=Math.imul(q,Z),r=r+Math.imul(L,G)|0,o=(o=o+Math.imul(L,tt)|0)+Math.imul(N,G)|0,i=i+Math.imul(N,tt)|0,r=r+Math.imul(I,nt)|0,o=(o=o+Math.imul(I,rt)|0)+Math.imul(P,nt)|0,i=i+Math.imul(P,rt)|0,r=r+Math.imul(C,it)|0,o=(o=o+Math.imul(C,st)|0)+Math.imul(O,it)|0,i=i+Math.imul(O,st)|0,r=r+Math.imul(S,ut)|0,o=(o=o+Math.imul(S,ct)|0)+Math.imul(k,ut)|0,i=i+Math.imul(k,ct)|0,r=r+Math.imul(E,ht)|0,o=(o=o+Math.imul(E,ft)|0)+Math.imul(x,ht)|0,i=i+Math.imul(x,ft)|0;var At=(c+(r=r+Math.imul(w,pt)|0)|0)+((8191&(o=(o=o+Math.imul(w,gt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((i=i+Math.imul(b,gt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(U,G),o=(o=Math.imul(U,tt))+Math.imul(q,G)|0,i=Math.imul(q,tt),r=r+Math.imul(L,nt)|0,o=(o=o+Math.imul(L,rt)|0)+Math.imul(N,nt)|0,i=i+Math.imul(N,rt)|0,r=r+Math.imul(I,it)|0,o=(o=o+Math.imul(I,st)|0)+Math.imul(P,it)|0,i=i+Math.imul(P,st)|0,r=r+Math.imul(C,ut)|0,o=(o=o+Math.imul(C,ct)|0)+Math.imul(O,ut)|0,i=i+Math.imul(O,ct)|0,r=r+Math.imul(S,ht)|0,o=(o=o+Math.imul(S,ft)|0)+Math.imul(k,ht)|0,i=i+Math.imul(k,ft)|0;var Ct=(c+(r=r+Math.imul(E,pt)|0)|0)+((8191&(o=(o=o+Math.imul(E,gt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((i=i+Math.imul(x,gt)|0)+(o>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(U,nt),o=(o=Math.imul(U,rt))+Math.imul(q,nt)|0,i=Math.imul(q,rt),r=r+Math.imul(L,it)|0,o=(o=o+Math.imul(L,st)|0)+Math.imul(N,it)|0,i=i+Math.imul(N,st)|0,r=r+Math.imul(I,ut)|0,o=(o=o+Math.imul(I,ct)|0)+Math.imul(P,ut)|0,i=i+Math.imul(P,ct)|0,r=r+Math.imul(C,ht)|0,o=(o=o+Math.imul(C,ft)|0)+Math.imul(O,ht)|0,i=i+Math.imul(O,ft)|0;var Ot=(c+(r=r+Math.imul(S,pt)|0)|0)+((8191&(o=(o=o+Math.imul(S,gt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((i=i+Math.imul(k,gt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(U,it),o=(o=Math.imul(U,st))+Math.imul(q,it)|0,i=Math.imul(q,st),r=r+Math.imul(L,ut)|0,o=(o=o+Math.imul(L,ct)|0)+Math.imul(N,ut)|0,i=i+Math.imul(N,ct)|0,r=r+Math.imul(I,ht)|0,o=(o=o+Math.imul(I,ft)|0)+Math.imul(P,ht)|0,i=i+Math.imul(P,ft)|0;var Tt=(c+(r=r+Math.imul(C,pt)|0)|0)+((8191&(o=(o=o+Math.imul(C,gt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((i=i+Math.imul(O,gt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(U,ut),o=(o=Math.imul(U,ct))+Math.imul(q,ut)|0,i=Math.imul(q,ct),r=r+Math.imul(L,ht)|0,o=(o=o+Math.imul(L,ft)|0)+Math.imul(N,ht)|0,i=i+Math.imul(N,ft)|0;var It=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(o=(o=o+Math.imul(I,gt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((i=i+Math.imul(P,gt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(U,ht),o=(o=Math.imul(U,ft))+Math.imul(q,ht)|0,i=Math.imul(q,ft);var Pt=(c+(r=r+Math.imul(L,pt)|0)|0)+((8191&(o=(o=o+Math.imul(L,gt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((i=i+Math.imul(N,gt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Bt=(c+(r=Math.imul(U,pt))|0)+((8191&(o=(o=Math.imul(U,gt))+Math.imul(q,pt)|0))<<13)|0;return c=((i=Math.imul(q,gt))+(o>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=mt,u[1]=vt,u[2]=_t,u[3]=yt,u[4]=wt,u[5]=bt,u[6]=Mt,u[7]=Et,u[8]=xt,u[9]=Rt,u[10]=St,u[11]=kt,u[12]=At,u[13]=Ct,u[14]=Ot,u[15]=Tt,u[16]=It,u[17]=Pt,u[18]=Bt,0!==c&&(u[19]=c,n.length++),n};function p(t,e,n){return(new g).mulp(t,e,n)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=f),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):n<63?f(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,o=0,i=0;i<n.length-1;i++){var s=o;o=0;for(var a=67108863&r,u=Math.min(i,e.length-1),c=Math.max(0,i-t.length+1);c<=u;c++){var l=i-c,h=(0|t.words[l])*(0|e.words[c]),f=67108863&h;a=67108863&(f=f+a|0),o+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}n.words[i]=a,r=s,s=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),n=i.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,n,t);return e},g.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var r=0,o=0;o<e;o++)r|=(1&t)<<e-o-1,t>>=1;return r},g.prototype.permute=function(t,e,n,r,o,i){for(var s=0;s<i;s++)r[s]=e[t[s]],o[s]=n[t[s]]},g.prototype.transform=function(t,e,n,r,o,i){this.permute(i,t,e,n,r,o);for(var s=1;s<o;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<o;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=n[l+d],g=r[l+d],m=n[l+d+s],v=r[l+d+s],_=h*m-f*v;v=h*v+f*m,m=_,n[l+d]=p+m,r[l+d]=g+v,n[l+d+s]=p-m,r[l+d+s]=g-v,d!==a&&(_=u*h-c*f,f=u*f+c*h,h=_)}},g.prototype.guessLen13b=function(t,e){var n=1|Math.max(e,t),r=1&n,o=0;for(n=n/2|0;n;n>>>=1)o++;return 1<<o+1+r},g.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var r=0;r<n/2;r++){var o=t[r];t[r]=t[n-r-1],t[n-r-1]=o,o=e[r],e[r]=-e[n-r-1],e[n-r-1]=-o}},g.prototype.normalize13b=function(t,e){for(var n=0,r=0;r<e/2;r++){var o=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+n;t[r]=67108863&o,n=o<67108864?0:o/67108864|0}return t},g.prototype.convert13b=function(t,e,n,o){for(var i=0,s=0;s<e;s++)i+=0|t[s],n[2*s]=8191&i,i>>>=13,n[2*s+1]=8191&i,i>>>=13;for(s=2*e;s<o;++s)n[s]=0;r(0===i),r(0==(-8192&i))},g.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},g.prototype.mulp=function(t,e,n){var r=2*this.guessLen13b(t.length,e.length),o=this.makeRBT(r),i=this.stub(r),s=new Array(r),a=new Array(r),u=new Array(r),c=new Array(r),l=new Array(r),h=new Array(r),f=n.words;f.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,c,r),this.transform(s,i,a,u,r,o),this.transform(c,i,l,h,r,o);for(var d=0;d<r;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,r),this.transform(a,u,f,i,r,o),this.conjugate(f,i,r),this.normalize13b(f,r),n.negative=t.negative^e.negative,n.length=t.length+e.length,n.strip()},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),p(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,n=0;n<this.length;n++){var o=(0|this.words[n])*t,i=(67108863&o)+(67108863&e);e>>=26,e+=o/67108864|0,e+=i>>>26,this.words[n]=67108863&i}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,o=n%26;e[n]=(t.words[r]&1<<o)>>>o}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var o=n.sqr();r<e.length;r++,o=o.sqr())0!==e[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,n=t%26,o=(t-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&i,u=(0|this.words[e])-a<<n;this.words[e]=u|s,s=a>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==o){for(e=this.length-1;e>=0;e--)this.words[e+o]=this.words[e];for(e=0;e<o;e++)this.words[e]=0;this.length+=o}return this.strip()},i.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,n){var o;r("number"==typeof t&&t>=0),o=e?(e-e%26)/26:0;var i=t%26,s=Math.min((t-i)/26,this.length),a=67108863^67108863>>>i<<i,u=n;if(o-=s,o=Math.max(0,o),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=o);c--){var h=0|this.words[c];this.words[c]=l<<26-i|h>>>i,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,o=1<<e;return!(this.length<=n)&&!!(this.words[n]&o)},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var o=67108863^67108863>>>e<<e;this.words[this.length-1]&=o}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var o,i,s=t.length+n;this._expand(s);var a=0;for(o=0;o<t.length;o++){i=(0|this.words[o+n])+a;var u=(0|t.words[o])*e;a=((i-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)a=(i=(0|this.words[o+n])+a)>>26,this.words[o+n]=67108863&i;if(0===a)return this.strip();for(r(-1===a),a=0,o=0;o<this.length;o++)a=(i=-(0|this.words[o])+a)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,s=0|o.words[o.length-1];0!==(n=26-this._countBits(s))&&(o=o.ushln(n),r.iushln(n),s=0|o.words[o.length-1]);var a,u=r.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=r.clone()._ishlnsubmul(o,1,u);0===l.negative&&(r=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);a&&(a.words[h]=f)}return a&&a.strip(),r.strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),o=t.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(e*n+(0|this.words[o]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*e;this.words[n]=o/t|0,e=o%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(u)):(n.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(n.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=e.cmp(n);if(o<0){var i=e;e=n,n=i}else if(0===o||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,o=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,s=n;0!==i&&s<this.length;s++){var a=0|this.words[s];i=(a+=i)>>>26,a&=67108863,this.words[s]=a}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var o=0|this.words[0];e=o===t?0:o<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],o=0|t.words[n];if(r!==o){r<o?e=-1:r>o&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new M(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):n.strip(),n},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},o(_,v),_.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r<n;r++)e.words[r]=t.words[r];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=4194303&o,r=10;r<t.length;r++){var i=0|t.words[r];t.words[r-10]=(4194303&i)<<4|o>>>22,o=i}o>>>=22,t.words[r-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},o(y,v),o(w,v),o(b,v),b.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,o=67108863&r;r>>>=26,t.words[n]=o,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new y;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return m[t]=e,e},M.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m<p);var v=this.pow(h,new i(1).iushln(p-m-1));f=f.redMul(v),h=v.redSqr(),d=d.redMul(h),p=m}return f},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var o=n[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var c=e.words[r],l=u-1;l>=0;l--){var h=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===r&&0===l)&&(o=this.mul(o,n[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new E(t)},o(E,M),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(61)(t))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!l){var t=a(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(33);n.o(r,"IJsonRpcConnection")&&n.d(e,"IJsonRpcConnection",(function(){return r.IJsonRpcConnection})),n.o(r,"IJsonRpcProvider")&&n.d(e,"IJsonRpcProvider",(function(){return r.IJsonRpcProvider})),n.o(r,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return r.isHttpUrl})),n.o(r,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return r.isJsonRpcError})),n.o(r,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return r.isJsonRpcResponse}));n(14);var o=n(34);n.d(e,"IJsonRpcConnection",(function(){return o.a})),n.d(e,"IJsonRpcProvider",(function(){return o.b}));var i=n(35);n.o(i,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return i.isHttpUrl})),n.o(i,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return i.isJsonRpcError})),n.o(i,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return i.isJsonRpcResponse}))},function(t,e,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(t,e){return new Promise((function(n,r){function o(n){t.removeListener(e,i),r(n)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),n([].slice.call(arguments))}v(t,e,i,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&v(t,"error",e,n)}(t,o,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,n,r){var o,i,s,a;if(c(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),s=i[e]),void 0===s)s=i[e]=n,++t._eventsCount;else if("function"==typeof s?s=i[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=l(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function p(t,e,n){var r=t._events;if(void 0===r)return[];var o=r[e];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(o):m(o,o.length)}function g(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function v(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(i){r.once&&t.removeEventListener(e,o),n(i)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");u=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var c=u.length,l=m(u,c);for(n=0;n<c;++n)i(l[n],this,e)}return!0},a.prototype.addListener=function(t,e){return h(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return h(this,t,e,!0)},a.prototype.once=function(t,e){return c(e),this.on(t,d(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,d(this,t,e)),this},a.prototype.removeListener=function(t,e){var n,r,o,i,s;if(c(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===e||n[i].listener===e){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,o),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,s||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";(function(t){
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
5
5
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
7
|
*/
|
|
8
|
-
var r=n(62),o=n(63),i=n(64);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(e,n),o=(t=a(t,r)).write(e,n);o!==r&&(t=t.slice(0,o));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|d(e.length);return 0===(t=a(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):f(t,e);if("Buffer"===e.type&&i(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=a(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|d(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(r)return D(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return T(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return R(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:_(t,e,n,r,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):_(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function _(t,e,n,r,o){var i,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var l=-1;for(i=n;i<a;i++)if(c(t,i)===c(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*s}else-1!==l&&(i-=i-l),l=-1}else for(n+u>a&&(n=a-u),i=n;i>=0;i--){for(var h=!0,f=0;f<u;f++)if(c(t,i+f)!==c(e,f)){h=!1;break}if(h)return i}return-1}function y(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function w(t,e,n,r){return J(D(e,t.length-n),t,n,r)}function b(t,e,n,r){return J(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function M(t,e,n,r){return b(t,e,n,r)}function x(t,e,n,r){return J(H(e),t,n,r)}function E(t,e,n,r){return J(function(t,e){for(var n,r,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function R(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o<n;){var i,s,a,u,c=t[o],l=null,h=c>239?4:c>223?3:c>191?2:1;if(o+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?a(t,e):void 0!==n?"string"==typeof r?a(t,e).fill(n,r):a(t,e).fill(n):a(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,i=Math.min(n,r);o<i;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).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}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var s=t[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(i,s),c=this.slice(r,o),l=t.slice(e,n),h=0;h<a;++h)if(c[h]!==l[h]){i=c[h],s=l[h];break}return i<s?-1:s<i?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return v(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return v(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return M(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(127&t[o]);return r}function A(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function k(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i)o+=q(t[i]);return o}function C(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function O(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,n,r,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function P(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o<i;++o)t[n+o]=(e&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function B(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o<i;++o)t[n+o]=e>>>8*(r?o:3-o)&255}function L(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,r,i){return i||L(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function U(t,e,n,r,i){return i||L(t,0,n,8),o.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var o=e-t;n=new u(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=this[t+--e],o=1;e>0&&(o*=256);)r+=this[t+--e]*o;return r},u.prototype.readUInt8=function(t,e){return e||O(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||O(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||O(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||O(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||O(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||O(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||O(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||O(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||O(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||I(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||I(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);I(this,t,e,n,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<n&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);I(this,t,e,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o,i=r-n;if(this===t&&n<e&&e<r)for(o=i-1;o>=0;--o)t[o+e]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),e);return i},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var s=u.isBuffer(t)?t:D(new u(t,r).toString()),a=s.length;for(i=0;i<n-e;++i)this[i+e]=s[i%a]}return this};var j=/[^+\/0-9A-Za-z-_]/g;function q(t){return t<16?"0"+t.toString(16):t.toString(16)}function D(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function H(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}}).call(this,n(17))},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return n}}},function(t,e,n){"use strict";n.r(e);var r=n(50),o=n(6),i=n(51);function s(t){return Object(i.a)(t)}function a(){const t=s();return t&&t.os?t.os:void 0}function u(){const t=a();return!!t&&t.toLowerCase().includes("android")}function c(){const t=a();return!!t&&(t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}function l(){return!!a()&&(u()||c())}function h(){const t=s();return!(!t||!t.name)&&"node"===t.name.toLowerCase()}function f(){return!h()&&!!_()}const d=o.getFromWindow,p=o.getFromWindowOrThrow,g=o.getDocumentOrThrow,m=o.getDocument,v=o.getNavigatorOrThrow,_=o.getNavigator,y=o.getLocationOrThrow,w=o.getLocation,b=o.getCryptoOrThrow,M=o.getCrypto,x=o.getLocalStorageOrThrow,E=o.getLocalStorage;function R(){return r.getWindowMetadata()}var S=n(11);const T=S.a,A=S.b;function k(t,e){const n=A(e),r=E();r&&r.setItem(t,n)}function C(t){let e=null,n=null;const r=E();return r&&(n=r.getItem(t)),e=n?T(n):n,e}function O(t){const e=E();e&&e.removeItem(t)}function I(t,e){const n=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${n}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${n}`:""}function P(t){const e=t.href.split("?")[0];k("WALLETCONNECT_DEEPLINK_CHOICE",Object.assign(Object.assign({},t),{href:e}))}function B(t,e){return t.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))[0]}function L(t,e){let n=t;return e&&(n=e.map(e=>B(t,e)).filter(Boolean)),n}const N="https://registry.walletconnect.com";function U(){return N+"/api/v2/wallets"}function j(){return N+"/api/v2/dapps"}function q(t,e="mobile"){var n;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:null!==(n=t.image_url.sm)&&void 0!==n?n:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function D(t,e="mobile"){return Object.values(t).filter(t=>!!t[e].universal||!!t[e].native).map(t=>q(t,e))}n.d(e,"detectEnv",(function(){return s})),n.d(e,"detectOS",(function(){return a})),n.d(e,"isAndroid",(function(){return u})),n.d(e,"isIOS",(function(){return c})),n.d(e,"isMobile",(function(){return l})),n.d(e,"isNode",(function(){return h})),n.d(e,"isBrowser",(function(){return f})),n.d(e,"getFromWindow",(function(){return d})),n.d(e,"getFromWindowOrThrow",(function(){return p})),n.d(e,"getDocumentOrThrow",(function(){return g})),n.d(e,"getDocument",(function(){return m})),n.d(e,"getNavigatorOrThrow",(function(){return v})),n.d(e,"getNavigator",(function(){return _})),n.d(e,"getLocationOrThrow",(function(){return y})),n.d(e,"getLocation",(function(){return w})),n.d(e,"getCryptoOrThrow",(function(){return b})),n.d(e,"getCrypto",(function(){return M})),n.d(e,"getLocalStorageOrThrow",(function(){return x})),n.d(e,"getLocalStorage",(function(){return E})),n.d(e,"getClientMeta",(function(){return R})),n.d(e,"safeJsonParse",(function(){return T})),n.d(e,"safeJsonStringify",(function(){return A})),n.d(e,"setLocal",(function(){return k})),n.d(e,"getLocal",(function(){return C})),n.d(e,"removeLocal",(function(){return O})),n.d(e,"mobileLinkChoiceKey",(function(){return"WALLETCONNECT_DEEPLINK_CHOICE"})),n.d(e,"formatIOSMobile",(function(){return I})),n.d(e,"saveMobileLinkInfo",(function(){return P})),n.d(e,"getMobileRegistryEntry",(function(){return B})),n.d(e,"getMobileLinkRegistry",(function(){return L})),n.d(e,"getWalletRegistryUrl",(function(){return U})),n.d(e,"getDappRegistryUrl",(function(){return j})),n.d(e,"formatMobileRegistryEntry",(function(){return q})),n.d(e,"formatMobileRegistry",(function(){return D}))},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,o="~";function i(){}function s(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||t,i),u=o?o+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function c(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)r.call(t,e)&&n.push(o?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=o?o+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,s=new Array(i);r<i;r++)s[r]=n[r].fn;return s},c.prototype.listenerCount=function(t){var e=o?o+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,r,i,s){var a=o?o+t:t;if(!this._events[a])return!1;var u,c,l=this._events[a],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,i),!0;case 6:return l.fn.call(l.context,e,n,r,i,s),!0}for(c=1,u=new Array(h-1);c<h;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,d=l.length;for(c=0;c<d;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,n);break;case 4:l[c].fn.call(l[c].context,e,n,r);break;default:if(!u)for(f=1,u=new Array(h-1);f<h;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},c.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},c.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},c.prototype.removeListener=function(t,e,n,r){var i=o?o+t:t;if(!this._events[i])return this;if(!e)return u(this,i),this;var s=this._events[i];if(s.fn)s.fn!==e||r&&!s.once||n&&s.context!==n||u(this,i);else{for(var a=0,c=[],l=s.length;a<l;a++)(s[a].fn!==e||r&&!s[a].once||n&&s[a].context!==n)&&c.push(s[a]);c.length?this._events[i]=1===c.length?c[0]:c:u(this,i)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=o?o+t:t,this._events[e]&&u(this,e)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=o,c.EventEmitter=c,t.exports=c},function(t,e){var n="undefined"!=typeof self?self:this,r=function(){function t(){this.fetch=!1,this.DOMException=n.DOMException}return t.prototype=n,new t}();!function(t){!function(e){var n="URLSearchParams"in t,r="Symbol"in t&&"iterator"in Symbol,o="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,s="ArrayBuffer"in t;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function g(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function m(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&o&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=m(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=m(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var t,e,n,r=d(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=p(e),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(t,e){t=c(t),e=l(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},f.prototype.delete=function(t){delete this.map[c(t)]},f.prototype.get=function(t){return t=c(t),this.has(t)?this.map[t]:null},f.prototype.has=function(t){return this.map.hasOwnProperty(c(t))},f.prototype.set=function(t,e){this.map[c(t)]=l(e)},f.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},f.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),h(t)},f.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},f.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),h(t)},r&&(f.prototype[Symbol.iterator]=f.prototype.entries);var _=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,e){var n,r,o=(e=e||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new f(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,o||null==t._bodyInit||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new f(e.headers)),this.method=(n=e.method||this.method||"GET",r=n.toUpperCase(),_.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},v.call(y.prototype),v.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var M=[301,302,303,307,308];b.redirect=function(t,e){if(-1===M.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function x(t,n){return new Promise((function(r,i){var s=new y(t,n);if(s.signal&&s.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var t,e,n={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();e.append(r,o)}})),e)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;r(new b(o,n))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&o&&(a.responseType="blob"),s.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),s.signal&&(s.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",u)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}x.polyfill=!0,t.fetch||(t.fetch=x,t.Headers=f,t.Request=y,t.Response=b),e.Headers=f,e.Request=y,e.Response=b,e.fetch=x,Object.defineProperty(e,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(e=o.fetch).default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e},function(t,e,n){"use strict";const r=n(67),o=n(68),i=n(69);function s(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function a(t,e){return e.encode?e.strict?r(t):encodeURIComponent(t):t}function u(t,e){return e.decode?o(t):t}function c(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function l(t){const e=(t=c(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function h(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function f(t,e){s((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const o="string"==typeof n&&n.split("").indexOf(t.arrayFormatSeparator)>-1?n.split(t.arrayFormatSeparator).map(e=>u(e,t)):null===n?n:u(n,t);r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const o of t.split("&")){let[t,s]=i(e.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator"].includes(e.arrayFormat)?s:u(s,e),n(u(t,e),s,r)}for(const t of Object.keys(r)){const n=r[t];if("object"==typeof n&&null!==n)for(const t of Object.keys(n))n[t]=h(n[t],e);else r[t]=h(n,e)}return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((t,e)=>Number(t)-Number(e)).map(t=>e[t]):e}(n):t[e]=n,t},Object.create(null))}e.extract=l,e.parse=f,e.stringify=(t,e)=>{if(!t)return"";s((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const n=n=>e.skipNull&&null==t[n]||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const o=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[a(e,t),"[",o,"]"].join("")]:[...n,[a(e,t),"[",a(o,t),"]=",a(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[a(e,t),"[]"].join("")]:[...n,[a(e,t),"[]=",a(r,t)].join("")];case"comma":case"separator":return e=>(n,r)=>null==r||0===r.length?n:0===n.length?[[a(e,t),"=",a(r,t)].join("")]:[[n,a(r,t)].join(t.arrayFormatSeparator)];default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,a(e,t)]:[...n,[a(e,t),"=",a(r,t)].join("")]}}(e),o={};for(const e of Object.keys(t))n(e)||(o[e]=t[e]);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map(n=>{const o=t[n];return void 0===o?"":null===o?a(n,e):Array.isArray(o)?o.reduce(r(n),[]).join("&"):a(n,e)+"="+a(o,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[n,r]=i(t,"#");return Object.assign({url:n.split("?")[0]||"",query:f(l(t),e)},e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,e)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0},n);const r=c(t.url).split("?")[0]||"",o=e.extract(t.url),i=e.parse(o,{sort:!1}),s=Object.assign(i,t.query);let u=e.stringify(s,n);u&&(u="?"+u);let l=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);return t.fragmentIdentifier&&(l="#"+a(t.fragmentIdentifier,n)),`${r}${u}${l}`}},function(t,e,n){"use strict";var r=n(4);n.o(r,"IJsonRpcProvider")&&n.d(e,"IJsonRpcProvider",(function(){return r.IJsonRpcProvider})),n.o(r,"formatJsonRpcError")&&n.d(e,"formatJsonRpcError",(function(){return r.formatJsonRpcError})),n.o(r,"formatJsonRpcRequest")&&n.d(e,"formatJsonRpcRequest",(function(){return r.formatJsonRpcRequest})),n.o(r,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return r.isHttpUrl})),n.o(r,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return r.isJsonRpcError})),n.o(r,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return r.isJsonRpcResponse})),n.o(r,"payloadId")&&n.d(e,"payloadId",(function(){return r.payloadId}));r.isNode},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return a}));var r=n(10),o=n(3);function i(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}function s(t,e,n){return{id:n||i(),jsonrpc:"2.0",method:t,params:e}}function a(t,e){return{id:t,jsonrpc:"2.0",error:u(e)}}function u(t){return void 0===t?Object(r.a)(o.a):("string"==typeof t&&(t=Object.assign(Object.assign({},Object(r.a)(o.c)),{message:t})),Object(r.c)(t.code)&&(t=Object(r.b)(t.code)),t)}},function(t,e,n){"use strict"},function(t,e,n){"use strict";var r=n(19);n.o(r,"IJsonRpcProvider")&&n.d(e,"IJsonRpcProvider",(function(){return r.IJsonRpcProvider})),n.o(r,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return r.isHttpUrl})),n.o(r,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return r.isJsonRpcError})),n.o(r,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return r.isJsonRpcResponse}))},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));var r=n(14);class o extends r.a{constructor(t){super()}}class i extends r.a{constructor(){super()}}class s extends i{constructor(t){super()}}},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));function r(t,e){const n=function(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(e&&e.length)return e[0]}(t);return void 0!==n&&new RegExp(e).test(n)}function o(t){return r(t,"^https?:")}},function(t,e,n){"use strict";function r(t){return"id"in t&&"jsonrpc"in t&&"2.0"===t.jsonrpc}function o(t){return r(t)&&(function(t){return"result"in t}(t)||i(t))}function i(t){return"error"in t}n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}))},function(t,e){t.exports=o,o.strict=i,o.loose=s;var n=Object.prototype.toString,r={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function o(t){return i(t)||s(t)}function i(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function s(t){return r[n.call(t)]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(4);function o(t){return r.getBrowerCrypto().getRandomValues(new Uint8Array(t))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}));var r=n(7);function o(t,e,n){return Object(r.b)(t,e,n)}function i(t,e,n){return Object(r.a)(t,e,n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(7);n(15);async function o(t,e){return await Object(r.c)(t,e)}},function(t,e,n){"use strict";var r=n(4);n.o(r,"isConstantTime")&&n.d(e,"isConstantTime",(function(){return r.isConstantTime}))},function(t,e,n){"use strict"},function(t,e){},function(t,e,n){"use strict";function r(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n(7)},function(t,e,n){var r=n(23),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(t,e){switch(e){case r.L:return o[4*(t-1)+0];case r.M:return o[4*(t-1)+1];case r.Q:return o[4*(t-1)+2];case r.H:return o[4*(t-1)+3];default:return}},e.getTotalCodewordsCount=function(t,e){switch(e){case r.L:return i[4*(t-1)+0];case r.M:return i[4*(t-1)+1];case r.Q:return i[4*(t-1)+2];case r.H:return i[4*(t-1)+3];default:return}}},function(t,e){e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},function(t,e){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",r="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";e.KANJI=new RegExp(n,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(r,"g"),e.NUMERIC=new RegExp("[0-9]+","g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var o=new RegExp("^"+n+"$"),i=new RegExp("^[0-9]+$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return o.test(t)},e.testNumeric=function(t){return i.test(t)},e.testAlphanumeric=function(t){return s.test(t)}},function(t,e){function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map((function(t){return[t,t]})))),6===e.length&&e.push("F","F");var n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,o=t.scale||4;return{width:r,scale:r?4:o,margin:e,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},e.getImageWidth=function(t,n){var r=e.getScale(t,n);return Math.floor((t+2*n.margin)*r)},e.qrToImageData=function(t,n,r){for(var o=n.modules.size,i=n.modules.data,s=e.getScale(o,r),a=Math.floor((o+2*r.margin)*s),u=r.margin*s,c=[r.color.light,r.color.dark],l=0;l<a;l++)for(var h=0;h<a;h++){var f=4*(l*a+h),d=r.color.light;if(l>=u&&h>=u&&l<a-u&&h<a-u)d=c[i[Math.floor((l-u)/s)*o+Math.floor((h-u)/s)]?1:0];t[f++]=d.r,t[f++]=d.g,t[f++]=d.b,t[f]=d.a}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getWindowMetadata=void 0;const r=n(6);e.getWindowMetadata=function(){let t,e;try{t=r.getDocumentOrThrow(),e=r.getLocationOrThrow()}catch(t){return null}function n(...e){const n=t.getElementsByTagName("meta");for(let t=0;t<n.length;t++){const r=n[t],o=["itemprop","property","name"].map(t=>r.getAttribute(t)).filter(t=>!!t&&e.includes(t));if(o.length&&o){const t=r.getAttribute("content");if(t)return t}}return""}const o=function(){let e=n("name","og:site_name","og:title","twitter:title");return e||(e=t.title),e}();return{description:n("description","og:description","twitter:description","keywords"),url:e.origin,icons:function(){const n=t.getElementsByTagName("link"),r=[];for(let t=0;t<n.length;t++){const o=n[t],i=o.getAttribute("rel");if(i&&i.toLowerCase().indexOf("icon")>-1){const t=o.getAttribute("href");if(t)if(-1===t.toLowerCase().indexOf("https:")&&-1===t.toLowerCase().indexOf("http:")&&0!==t.indexOf("//")){let n=e.protocol+"//"+e.host;if(0===t.indexOf("/"))n+=t;else{const r=e.pathname.split("/");r.pop();n+=r.join("/")+"/"+t}r.push(n)}else if(0===t.indexOf("//")){const n=e.protocol+t;r.push(n)}else r.push(t)}}return r}(),name:o}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return f}));var r=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},o=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},i=function(e){this.version=e,this.type="node",this.name="node",this.os=t.platform},s=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},a=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},u=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},c=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,l=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],h=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function f(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new u:"undefined"!=typeof navigator?p(navigator.userAgent):void 0!==t&&t.version?new i(t.version.slice(1)):null}function d(t){return""!==t&&l.reduce((function(e,n){var r=n[0],o=n[1];if(e)return e;var i=o.exec(t);return!!i&&[r,i]}),!1)}function p(t){var e=d(t);if(!e)return null;var n=e[0],i=e[1];if("searchbot"===n)return new a;var u=i[1]&&i[1].split(/[._]/).slice(0,3);u?u.length<3&&(u=r(u,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-u.length))):u=[];var l=u.join("."),f=function(t){for(var e=0,n=h.length;e<n;e++){var r=h[e],o=r[0];if(r[1].exec(t))return o}return null}(t),p=c.exec(t);return p&&p[1]?new s(n,l,f,p[1]):new o(n,l,f)}}).call(this,n(18))},function(t,e,n){(function(r,o){var i;
|
|
8
|
+
var r=n(63),o=n(64),i=n(65);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(e,n),o=(t=a(t,r)).write(e,n);o!==r&&(t=t.slice(0,o));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|d(e.length);return 0===(t=a(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):f(t,e);if("Buffer"===e.type&&i(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=a(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|d(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(t).length;default:if(r)return D(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return R(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:_(t,e,n,r,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):_(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function _(t,e,n,r,o){var i,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var l=-1;for(i=n;i<a;i++)if(c(t,i)===c(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*s}else-1!==l&&(i-=i-l),l=-1}else for(n+u>a&&(n=a-u),i=n;i>=0;i--){for(var h=!0,f=0;f<u;f++)if(c(t,i+f)!==c(e,f)){h=!1;break}if(h)return i}return-1}function y(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function w(t,e,n,r){return F(D(e,t.length-n),t,n,r)}function b(t,e,n,r){return F(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function M(t,e,n,r){return b(t,e,n,r)}function E(t,e,n,r){return F(J(e),t,n,r)}function x(t,e,n,r){return F(function(t,e){for(var n,r,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function R(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o<n;){var i,s,a,u,c=t[o],l=null,h=c>239?4:c>223?3:c>191?2:1;if(o+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?a(t,e):void 0!==n?"string"==typeof r?a(t,e).fill(n,r):a(t,e).fill(n):a(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,i=Math.min(n,r);o<i;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).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}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var s=t[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(i,s),c=this.slice(r,o),l=t.slice(e,n),h=0;h<a;++h)if(c[h]!==l[h]){i=c[h],s=l[h];break}return i<s?-1:s<i?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return v(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return v(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return M(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(127&t[o]);return r}function A(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function C(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i)o+=q(t[i]);return o}function O(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function T(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,n,r,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function P(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o<i;++o)t[n+o]=(e&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function B(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o<i;++o)t[n+o]=e>>>8*(r?o:3-o)&255}function L(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,r,i){return i||L(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function j(t,e,n,r,i){return i||L(t,0,n,8),o.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var o=e-t;n=new u(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t+--e],o=1;e>0&&(o*=256);)r+=this[t+--e]*o;return r},u.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||I(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||I(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);I(this,t,e,n,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<n&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);I(this,t,e,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return j(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return j(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o,i=r-n;if(this===t&&n<e&&e<r)for(o=i-1;o>=0;--o)t[o+e]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),e);return i},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var s=u.isBuffer(t)?t:D(new u(t,r).toString()),a=s.length;for(i=0;i<n-e;++i)this[i+e]=s[i%a]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function q(t){return t<16?"0"+t.toString(16):t.toString(16)}function D(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function J(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}}).call(this,n(17))},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return n}}},function(t,e,n){"use strict";n.r(e);var r=n(50),o=n(6),i=n(51);function s(t){return Object(i.a)(t)}function a(){const t=s();return t&&t.os?t.os:void 0}function u(){const t=a();return!!t&&t.toLowerCase().includes("android")}function c(){const t=a();return!!t&&(t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}function l(){return!!a()&&(u()||c())}function h(){const t=s();return!(!t||!t.name)&&"node"===t.name.toLowerCase()}function f(){return!h()&&!!_()}const d=o.getFromWindow,p=o.getFromWindowOrThrow,g=o.getDocumentOrThrow,m=o.getDocument,v=o.getNavigatorOrThrow,_=o.getNavigator,y=o.getLocationOrThrow,w=o.getLocation,b=o.getCryptoOrThrow,M=o.getCrypto,E=o.getLocalStorageOrThrow,x=o.getLocalStorage;function R(){return r.getWindowMetadata()}var S=n(11);const k=S.a,A=S.b;function C(t,e){const n=A(e),r=x();r&&r.setItem(t,n)}function O(t){let e=null,n=null;const r=x();return r&&(n=r.getItem(t)),e=n?k(n):n,e}function T(t){const e=x();e&&e.removeItem(t)}function I(t,e){const n=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${n}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${n}`:""}function P(t){const e=t.href.split("?")[0];C("WALLETCONNECT_DEEPLINK_CHOICE",Object.assign(Object.assign({},t),{href:e}))}function B(t,e){return t.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))[0]}function L(t,e){let n=t;return e&&(n=e.map(e=>B(t,e)).filter(Boolean)),n}const N="https://registry.walletconnect.com";function j(){return N+"/api/v2/wallets"}function U(){return N+"/api/v2/dapps"}function q(t,e="mobile"){var n;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:null!==(n=t.image_url.sm)&&void 0!==n?n:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function D(t,e="mobile"){return Object.values(t).filter(t=>!!t[e].universal||!!t[e].native).map(t=>q(t,e))}n.d(e,"detectEnv",(function(){return s})),n.d(e,"detectOS",(function(){return a})),n.d(e,"isAndroid",(function(){return u})),n.d(e,"isIOS",(function(){return c})),n.d(e,"isMobile",(function(){return l})),n.d(e,"isNode",(function(){return h})),n.d(e,"isBrowser",(function(){return f})),n.d(e,"getFromWindow",(function(){return d})),n.d(e,"getFromWindowOrThrow",(function(){return p})),n.d(e,"getDocumentOrThrow",(function(){return g})),n.d(e,"getDocument",(function(){return m})),n.d(e,"getNavigatorOrThrow",(function(){return v})),n.d(e,"getNavigator",(function(){return _})),n.d(e,"getLocationOrThrow",(function(){return y})),n.d(e,"getLocation",(function(){return w})),n.d(e,"getCryptoOrThrow",(function(){return b})),n.d(e,"getCrypto",(function(){return M})),n.d(e,"getLocalStorageOrThrow",(function(){return E})),n.d(e,"getLocalStorage",(function(){return x})),n.d(e,"getClientMeta",(function(){return R})),n.d(e,"safeJsonParse",(function(){return k})),n.d(e,"safeJsonStringify",(function(){return A})),n.d(e,"setLocal",(function(){return C})),n.d(e,"getLocal",(function(){return O})),n.d(e,"removeLocal",(function(){return T})),n.d(e,"mobileLinkChoiceKey",(function(){return"WALLETCONNECT_DEEPLINK_CHOICE"})),n.d(e,"formatIOSMobile",(function(){return I})),n.d(e,"saveMobileLinkInfo",(function(){return P})),n.d(e,"getMobileRegistryEntry",(function(){return B})),n.d(e,"getMobileLinkRegistry",(function(){return L})),n.d(e,"getWalletRegistryUrl",(function(){return j})),n.d(e,"getDappRegistryUrl",(function(){return U})),n.d(e,"formatMobileRegistryEntry",(function(){return q})),n.d(e,"formatMobileRegistry",(function(){return D}))},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,o="~";function i(){}function s(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||t,i),u=o?o+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function c(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)r.call(t,e)&&n.push(o?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=o?o+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,s=new Array(i);r<i;r++)s[r]=n[r].fn;return s},c.prototype.listenerCount=function(t){var e=o?o+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,r,i,s){var a=o?o+t:t;if(!this._events[a])return!1;var u,c,l=this._events[a],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,i),!0;case 6:return l.fn.call(l.context,e,n,r,i,s),!0}for(c=1,u=new Array(h-1);c<h;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,d=l.length;for(c=0;c<d;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,n);break;case 4:l[c].fn.call(l[c].context,e,n,r);break;default:if(!u)for(f=1,u=new Array(h-1);f<h;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},c.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},c.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},c.prototype.removeListener=function(t,e,n,r){var i=o?o+t:t;if(!this._events[i])return this;if(!e)return u(this,i),this;var s=this._events[i];if(s.fn)s.fn!==e||r&&!s.once||n&&s.context!==n||u(this,i);else{for(var a=0,c=[],l=s.length;a<l;a++)(s[a].fn!==e||r&&!s[a].once||n&&s[a].context!==n)&&c.push(s[a]);c.length?this._events[i]=1===c.length?c[0]:c:u(this,i)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=o?o+t:t,this._events[e]&&u(this,e)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=o,c.EventEmitter=c,t.exports=c},function(t,e){t.exports=o,o.strict=i,o.loose=s;var n=Object.prototype.toString,r={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function o(t){return i(t)||s(t)}function i(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function s(t){return r[n.call(t)]}},function(t,e){var n="undefined"!=typeof self?self:this,r=function(){function t(){this.fetch=!1,this.DOMException=n.DOMException}return t.prototype=n,new t}();!function(t){!function(e){var n="URLSearchParams"in t,r="Symbol"in t&&"iterator"in Symbol,o="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,s="ArrayBuffer"in t;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function g(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function m(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&o&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=m(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=m(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var t,e,n,r=d(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=p(e),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(t,e){t=c(t),e=l(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},f.prototype.delete=function(t){delete this.map[c(t)]},f.prototype.get=function(t){return t=c(t),this.has(t)?this.map[t]:null},f.prototype.has=function(t){return this.map.hasOwnProperty(c(t))},f.prototype.set=function(t,e){this.map[c(t)]=l(e)},f.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},f.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),h(t)},f.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},f.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),h(t)},r&&(f.prototype[Symbol.iterator]=f.prototype.entries);var _=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,e){var n,r,o=(e=e||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new f(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,o||null==t._bodyInit||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new f(e.headers)),this.method=(n=e.method||this.method||"GET",r=n.toUpperCase(),_.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},v.call(y.prototype),v.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var M=[301,302,303,307,308];b.redirect=function(t,e){if(-1===M.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function E(t,n){return new Promise((function(r,i){var s=new y(t,n);if(s.signal&&s.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var t,e,n={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();e.append(r,o)}})),e)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;r(new b(o,n))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&o&&(a.responseType="blob"),s.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),s.signal&&(s.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",u)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}E.polyfill=!0,t.fetch||(t.fetch=E,t.Headers=f,t.Request=y,t.Response=b),e.Headers=f,e.Request=y,e.Response=b,e.fetch=E,Object.defineProperty(e,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(e=o.fetch).default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e},function(t,e,n){"use strict";const r=n(67),o=n(68),i=n(69);function s(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function a(t,e){return e.encode?e.strict?r(t):encodeURIComponent(t):t}function u(t,e){return e.decode?o(t):t}function c(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function l(t){const e=(t=c(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function h(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function f(t,e){s((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const o="string"==typeof n&&n.split("").indexOf(t.arrayFormatSeparator)>-1?n.split(t.arrayFormatSeparator).map(e=>u(e,t)):null===n?n:u(n,t);r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const o of t.split("&")){let[t,s]=i(e.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator"].includes(e.arrayFormat)?s:u(s,e),n(u(t,e),s,r)}for(const t of Object.keys(r)){const n=r[t];if("object"==typeof n&&null!==n)for(const t of Object.keys(n))n[t]=h(n[t],e);else r[t]=h(n,e)}return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((t,e)=>Number(t)-Number(e)).map(t=>e[t]):e}(n):t[e]=n,t},Object.create(null))}e.extract=l,e.parse=f,e.stringify=(t,e)=>{if(!t)return"";s((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const n=n=>e.skipNull&&null==t[n]||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const o=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[a(e,t),"[",o,"]"].join("")]:[...n,[a(e,t),"[",a(o,t),"]=",a(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[a(e,t),"[]"].join("")]:[...n,[a(e,t),"[]=",a(r,t)].join("")];case"comma":case"separator":return e=>(n,r)=>null==r||0===r.length?n:0===n.length?[[a(e,t),"=",a(r,t)].join("")]:[[n,a(r,t)].join(t.arrayFormatSeparator)];default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,a(e,t)]:[...n,[a(e,t),"=",a(r,t)].join("")]}}(e),o={};for(const e of Object.keys(t))n(e)||(o[e]=t[e]);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map(n=>{const o=t[n];return void 0===o?"":null===o?a(n,e):Array.isArray(o)?o.reduce(r(n),[]).join("&"):a(n,e)+"="+a(o,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[n,r]=i(t,"#");return Object.assign({url:n.split("?")[0]||"",query:f(l(t),e)},e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,e)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0},n);const r=c(t.url).split("?")[0]||"",o=e.extract(t.url),i=e.parse(o,{sort:!1}),s=Object.assign(i,t.query);let u=e.stringify(s,n);u&&(u="?"+u);let l=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);return t.fragmentIdentifier&&(l="#"+a(t.fragmentIdentifier,n)),`${r}${u}${l}`}},function(t,e,n){"use strict";var r=n(4);n.o(r,"IJsonRpcProvider")&&n.d(e,"IJsonRpcProvider",(function(){return r.IJsonRpcProvider})),n.o(r,"formatJsonRpcError")&&n.d(e,"formatJsonRpcError",(function(){return r.formatJsonRpcError})),n.o(r,"formatJsonRpcRequest")&&n.d(e,"formatJsonRpcRequest",(function(){return r.formatJsonRpcRequest})),n.o(r,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return r.isHttpUrl})),n.o(r,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return r.isJsonRpcError})),n.o(r,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return r.isJsonRpcResponse})),n.o(r,"payloadId")&&n.d(e,"payloadId",(function(){return r.payloadId}));r.isNode},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return a}));var r=n(10),o=n(3);function i(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}function s(t,e,n){return{id:n||i(),jsonrpc:"2.0",method:t,params:e}}function a(t,e){return{id:t,jsonrpc:"2.0",error:u(e)}}function u(t){return void 0===t?Object(r.a)(o.a):("string"==typeof t&&(t=Object.assign(Object.assign({},Object(r.a)(o.c)),{message:t})),Object(r.c)(t.code)&&(t=Object(r.b)(t.code)),t)}},function(t,e,n){"use strict"},function(t,e,n){"use strict";var r=n(19);n.o(r,"IJsonRpcProvider")&&n.d(e,"IJsonRpcProvider",(function(){return r.IJsonRpcProvider})),n.o(r,"isHttpUrl")&&n.d(e,"isHttpUrl",(function(){return r.isHttpUrl})),n.o(r,"isJsonRpcError")&&n.d(e,"isJsonRpcError",(function(){return r.isJsonRpcError})),n.o(r,"isJsonRpcResponse")&&n.d(e,"isJsonRpcResponse",(function(){return r.isJsonRpcResponse}))},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));var r=n(14);class o extends r.a{constructor(t){super()}}class i extends r.a{constructor(){super()}}class s extends i{constructor(t){super()}}},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));function r(t,e){const n=function(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(e&&e.length)return e[0]}(t);return void 0!==n&&new RegExp(e).test(n)}function o(t){return r(t,"^https?:")}},function(t,e,n){"use strict";function r(t){return"id"in t&&"jsonrpc"in t&&"2.0"===t.jsonrpc}function o(t){return r(t)&&(function(t){return"result"in t}(t)||i(t))}function i(t){return"error"in t}n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(4);function o(t){return r.getBrowerCrypto().getRandomValues(new Uint8Array(t))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}));var r=n(7);function o(t,e,n){return Object(r.b)(t,e,n)}function i(t,e,n){return Object(r.a)(t,e,n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(7);n(15);async function o(t,e){return await Object(r.c)(t,e)}},function(t,e,n){"use strict";var r=n(4);n.o(r,"isConstantTime")&&n.d(e,"isConstantTime",(function(){return r.isConstantTime}))},function(t,e,n){"use strict"},function(t,e){},function(t,e,n){"use strict";function r(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n(7)},function(t,e,n){var r=n(23),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(t,e){switch(e){case r.L:return o[4*(t-1)+0];case r.M:return o[4*(t-1)+1];case r.Q:return o[4*(t-1)+2];case r.H:return o[4*(t-1)+3];default:return}},e.getTotalCodewordsCount=function(t,e){switch(e){case r.L:return i[4*(t-1)+0];case r.M:return i[4*(t-1)+1];case r.Q:return i[4*(t-1)+2];case r.H:return i[4*(t-1)+3];default:return}}},function(t,e){e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},function(t,e){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",r="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";e.KANJI=new RegExp(n,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(r,"g"),e.NUMERIC=new RegExp("[0-9]+","g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var o=new RegExp("^"+n+"$"),i=new RegExp("^[0-9]+$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return o.test(t)},e.testNumeric=function(t){return i.test(t)},e.testAlphanumeric=function(t){return s.test(t)}},function(t,e){function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map((function(t){return[t,t]})))),6===e.length&&e.push("F","F");var n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,o=t.scale||4;return{width:r,scale:r?4:o,margin:e,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},e.getImageWidth=function(t,n){var r=e.getScale(t,n);return Math.floor((t+2*n.margin)*r)},e.qrToImageData=function(t,n,r){for(var o=n.modules.size,i=n.modules.data,s=e.getScale(o,r),a=Math.floor((o+2*r.margin)*s),u=r.margin*s,c=[r.color.light,r.color.dark],l=0;l<a;l++)for(var h=0;h<a;h++){var f=4*(l*a+h),d=r.color.light;if(l>=u&&h>=u&&l<a-u&&h<a-u)d=c[i[Math.floor((l-u)/s)*o+Math.floor((h-u)/s)]?1:0];t[f++]=d.r,t[f++]=d.g,t[f++]=d.b,t[f]=d.a}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getWindowMetadata=void 0;const r=n(6);e.getWindowMetadata=function(){let t,e;try{t=r.getDocumentOrThrow(),e=r.getLocationOrThrow()}catch(t){return null}function n(...e){const n=t.getElementsByTagName("meta");for(let t=0;t<n.length;t++){const r=n[t],o=["itemprop","property","name"].map(t=>r.getAttribute(t)).filter(t=>!!t&&e.includes(t));if(o.length&&o){const t=r.getAttribute("content");if(t)return t}}return""}const o=function(){let e=n("name","og:site_name","og:title","twitter:title");return e||(e=t.title),e}();return{description:n("description","og:description","twitter:description","keywords"),url:e.origin,icons:function(){const n=t.getElementsByTagName("link"),r=[];for(let t=0;t<n.length;t++){const o=n[t],i=o.getAttribute("rel");if(i&&i.toLowerCase().indexOf("icon")>-1){const t=o.getAttribute("href");if(t)if(-1===t.toLowerCase().indexOf("https:")&&-1===t.toLowerCase().indexOf("http:")&&0!==t.indexOf("//")){let n=e.protocol+"//"+e.host;if(0===t.indexOf("/"))n+=t;else{const r=e.pathname.split("/");r.pop();n+=r.join("/")+"/"+t}r.push(n)}else if(0===t.indexOf("//")){const n=e.protocol+t;r.push(n)}else r.push(t)}}return r}(),name:o}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return f}));var r=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},o=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},i=function(e){this.version=e,this.type="node",this.name="node",this.os=t.platform},s=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},a=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},u=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},c=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,l=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],h=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function f(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new u:"undefined"!=typeof navigator?p(navigator.userAgent):void 0!==t&&t.version?new i(t.version.slice(1)):null}function d(t){return""!==t&&l.reduce((function(e,n){var r=n[0],o=n[1];if(e)return e;var i=o.exec(t);return!!i&&[r,i]}),!1)}function p(t){var e=d(t);if(!e)return null;var n=e[0],i=e[1];if("searchbot"===n)return new a;var u=i[1]&&i[1].split(/[._]/).slice(0,3);u?u.length<3&&(u=r(u,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-u.length))):u=[];var l=u.join("."),f=function(t){for(var e=0,n=h.length;e<n;e++){var r=h[e],o=r[0];if(r[1].exec(t))return o}return null}(t),p=c.exec(t);return p&&p[1]?new s(n,l,f,p[1]):new o(n,l,f)}}).call(this,n(18))},function(t,e,n){(function(e){var r=n(26).strict;t.exports=function(t){if(r(t)){var n=e.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(n=n.slice(t.byteOffset,t.byteOffset+t.byteLength)),n}return e.from(t)}}).call(this,n(21).Buffer)},function(t,e,n){(function(r,o){var i;
|
|
9
9
|
/**
|
|
10
10
|
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
11
11
|
*
|
|
@@ -13,7 +13,7 @@ var r=n(62),o=n(63),i=n(64);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647
|
|
|
13
13
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
14
14
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
15
15
|
* @license MIT
|
|
16
|
-
*/!function(){"use strict";var s="input is invalid type",a="object"==typeof window,u=a?window:{};u.JS_SHA3_NO_WINDOW&&(a=!1);var c=!a&&"object"==typeof self;!u.JS_SHA3_NO_NODE_JS&&"object"==typeof r&&r.versions&&r.versions.node?u=o:c&&(u=self);var l=!u.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,h=n(66),f=!u.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],g=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],_=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!u.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!f||!u.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var b=function(t,e,n){return function(r){return new N(t,e,t).update(r)[n]()}},M=function(t,e,n){return function(r,o){return new N(t,e,o).update(r)[n]()}},x=function(t,e,n){return function(e,r,o,i){return A["cshake"+t].update(e,r,o,i)[n]()}},E=function(t,e,n){return function(e,r,o,i){return A["kmac"+t].update(e,r,o,i)[n]()}},R=function(t,e,n,r){for(var o=0;o<y.length;++o){var i=y[o];t[i]=e(n,r,i)}return t},S=function(t,e){var n=b(t,e,"hex");return n.create=function(){return new N(t,e,t)},n.update=function(t){return n.create().update(t)},R(n,b,t,e)},T=[{name:"keccak",padding:[1,256,65536,16777216],bits:v,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:v,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:_,createMethod:function(t,e){var n=M(t,e,"hex");return n.create=function(n){return new N(t,e,n)},n.update=function(t,e){return n.create(e).update(t)},R(n,M,t,e)}},{name:"cshake",padding:p,bits:_,createMethod:function(t,e){var n=w[t],r=x(t,0,"hex");return r.create=function(r,o,i){return o||i?new N(t,e,r).bytepad([o,i],n):A["shake"+t].create(r)},r.update=function(t,e,n,o){return r.create(e,n,o).update(t)},R(r,x,t,e)}},{name:"kmac",padding:p,bits:_,createMethod:function(t,e){var n=w[t],r=E(t,0,"hex");return r.create=function(r,o,i){return new U(t,e,o).bytepad(["KMAC",i],n).bytepad([r],n)},r.update=function(t,e,n,o){return r.create(t,n,o).update(e)},R(r,E,t,e)}}],A={},k=[],C=0;C<T.length;++C)for(var O=T[C],I=O.bits,P=0;P<I.length;++P){var B=O.name+"_"+I[P];if(k.push(B),A[B]=O.createMethod(I[P],O.padding),"sha3"!==O.name){var L=O.name+I[P];k.push(L),A[L]=A[B]}}function N(t,e,n){this.blocks=[],this.s=[],this.padding=e,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function U(t,e,n){N.call(this,t,e,n)}N.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(s);if(null===t)throw new Error(s);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var r,o,i=this.blocks,a=this.byteCount,u=t.length,c=this.blockCount,l=0,h=this.s;l<u;){if(this.reset)for(this.reset=!1,i[0]=this.block,r=1;r<c+1;++r)i[r]=0;if(e)for(r=this.start;l<u&&r<a;++l)i[r>>2]|=t[l]<<g[3&r++];else for(r=this.start;l<u&&r<a;++l)(o=t.charCodeAt(l))<128?i[r>>2]|=o<<g[3&r++]:o<2048?(i[r>>2]|=(192|o>>6)<<g[3&r++],i[r>>2]|=(128|63&o)<<g[3&r++]):o<55296||o>=57344?(i[r>>2]|=(224|o>>12)<<g[3&r++],i[r>>2]|=(128|o>>6&63)<<g[3&r++],i[r>>2]|=(128|63&o)<<g[3&r++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++l)),i[r>>2]|=(240|o>>18)<<g[3&r++],i[r>>2]|=(128|o>>12&63)<<g[3&r++],i[r>>2]|=(128|o>>6&63)<<g[3&r++],i[r>>2]|=(128|63&o)<<g[3&r++]);if(this.lastByteIndex=r,r>=a){for(this.start=r-a,this.block=i[c],r=0;r<c;++r)h[r]^=i[r];j(h),this.reset=!0}else this.start=r}return this},N.prototype.encode=function(t,e){var n=255&t,r=1,o=[n];for(n=255&(t>>=8);n>0;)o.unshift(n),n=255&(t>>=8),++r;return e?o.push(r):o.unshift(r),this.update(o),o.length},N.prototype.encodeString=function(t){var e,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(s);if(null===t)throw new Error(s);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}var r=0,o=t.length;if(e)r=o;else for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);a<128?r+=1:a<2048?r+=2:a<55296||a>=57344?r+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++i)),r+=4)}return r+=this.encode(8*r),this.update(t),r},N.prototype.bytepad=function(t,e){for(var n=this.encode(e),r=0;r<t.length;++r)n+=this.encodeString(t[r]);var o=e-n%e,i=[];return i.length=o,this.update(i),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,n=this.blockCount,r=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e<n+1;++e)t[e]=0;for(t[n-1]|=2147483648,e=0;e<n;++e)r[e]^=t[e];j(r)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,n=this.s,r=this.outputBlocks,o=this.extraBytes,i=0,s=0,a="";s<r;){for(i=0;i<e&&s<r;++i,++s)t=n[i],a+=d[t>>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];s%e==0&&(j(n),i=0)}return o&&(t=n[i],a+=d[t>>4&15]+d[15&t],o>1&&(a+=d[t>>12&15]+d[t>>8&15]),o>2&&(a+=d[t>>20&15]+d[t>>16&15])),a},N.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,n=this.s,r=this.outputBlocks,o=this.extraBytes,i=0,s=0,a=this.outputBits>>3;t=o?new ArrayBuffer(r+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<r;){for(i=0;i<e&&s<r;++i,++s)u[s]=n[i];s%e==0&&j(n)}return o&&(u[i]=n[i],t=t.slice(0,a)),t},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var t,e,n=this.blockCount,r=this.s,o=this.outputBlocks,i=this.extraBytes,s=0,a=0,u=[];a<o;){for(s=0;s<n&&a<o;++s,++a)t=a<<2,e=r[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%n==0&&j(r)}return i&&(t=a<<2,e=r[s],u[t]=255&e,i>1&&(u[t+1]=e>>8&255),i>2&&(u[t+2]=e>>16&255)),u},U.prototype=new N,U.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var j=function(t){var e,n,r,o,i,s,a,u,c,l,h,f,d,p,g,v,_,y,w,b,M,x,E,R,S,T,A,k,C,O,I,P,B,L,N,U,j,q,D,H,J,F,z,W,Y,$,V,K,Q,Z,X,G,tt,et,nt,rt,ot,it,st,at,ut,ct,lt;for(r=0;r<48;r+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],h=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),n=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=o^(u<<1|c>>>31),n=i^(c<<1|u>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=s^(l<<1|h>>>31),n=a^(h<<1|l>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=u^(f<<1|d>>>31),n=c^(d<<1|f>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=l^(o<<1|i>>>31),n=h^(i<<1|o>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,p=t[0],g=t[1],$=t[11]<<4|t[10]>>>28,V=t[10]<<4|t[11]>>>28,k=t[20]<<3|t[21]>>>29,C=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,F=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,L=t[2]<<1|t[3]>>>31,N=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,_=t[12]<<12|t[13]>>>20,K=t[22]<<10|t[23]>>>22,Q=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,I=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,nt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,j=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Z=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,P=t[45]<<29|t[44]>>>3,B=t[44]<<29|t[45]>>>3,R=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,ot=t[16]<<23|t[17]>>>9,q=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,b=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,G=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,Y=t[9]<<27|t[8]>>>5,T=t[18]<<20|t[19]>>>12,A=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,H=t[38]<<8|t[39]>>>24,J=t[39]<<8|t[38]>>>24,x=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=p^~v&y,t[1]=g^~_&w,t[10]=R^~T&k,t[11]=S^~A&C,t[20]=L^~U&q,t[21]=N^~j&D,t[30]=W^~$&K,t[31]=Y^~V&Q,t[40]=et^~rt&it,t[41]=nt^~ot&st,t[2]=v^~y&b,t[3]=_^~w&M,t[12]=T^~k&O,t[13]=A^~C&I,t[22]=U^~q&H,t[23]=j^~D&J,t[32]=$^~K&Z,t[33]=V^~Q&X,t[42]=rt^~it&at,t[43]=ot^~st&ut,t[4]=y^~b&x,t[5]=w^~M&E,t[14]=k^~O&P,t[15]=C^~I&B,t[24]=q^~H&F,t[25]=D^~J&z,t[34]=K^~Z&G,t[35]=Q^~X&tt,t[44]=it^~at&ct,t[45]=st^~ut<,t[6]=b^~x&p,t[7]=M^~E&g,t[16]=O^~P&R,t[17]=I^~B&S,t[26]=H^~F&L,t[27]=J^~z&N,t[36]=Z^~G&W,t[37]=X^~tt&Y,t[46]=at^~ct&et,t[47]=ut^~lt&nt,t[8]=x^~p&v,t[9]=E^~g&_,t[18]=P^~R&T,t[19]=B^~S&A,t[28]=F^~L&U,t[29]=z^~N&j,t[38]=G^~W&$,t[39]=tt^~Y&V,t[48]=ct^~et&rt,t[49]=lt^~nt&ot,t[0]^=m[r],t[1]^=m[r+1]};if(l)t.exports=A;else{for(C=0;C<k.length;++C)u[k[C]]=A[k[C]];h&&(void 0===(i=function(){return A}.call(e,n,e,t))||(t.exports=i))}}()}).call(this,n(18),n(17))},function(t,e,n){"use strict";(function(t){var r=n(1),o=n(54);const i=void 0!==t.WebSocket?t.WebSocket:n(70);e.a=class{constructor(t){if(this.opts=t,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=t.protocol,this._version=t.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new o.a,!t.url||"string"!=typeof t.url)throw new Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",()=>this._socketCreate())}set readyState(t){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(t){}get connecting(){return 0===this.readyState}set connected(t){}get connected(){return 1===this.readyState}set closing(t){}get closing(){return 2===this.readyState}set closed(t){}get closed(){return 3===this.readyState}open(){this._socketCreate()}close(){this._socketClose()}send(t,e,n){if(!e||"string"!=typeof e)throw new Error("Missing or invalid topic field");this._socketSend({topic:e,type:"pub",payload:t,silent:!!n})}subscribe(t){this._socketSend({topic:t,type:"sub",payload:"",silent:!0})}on(t,e){this._events.push({event:t,callback:e})}_socketCreate(){if(this._nextSocket)return;const t=function(t,e,n){var o,i;const s=(t.startsWith("https")?t.replace("https","wss"):t.startsWith("http")?t.replace("http","ws"):t).split("?"),a=Object(r.isBrowser)()?{protocol:e,version:n,env:"browser",host:(null===(o=Object(r.getLocation)())||void 0===o?void 0:o.host)||""}:{protocol:e,version:n,env:(null===(i=Object(r.detectEnv)())||void 0===i?void 0:i.name)||""},u=Object(r.appendToQueryString)(Object(r.getQueryString)(s[1]||""),a);return s[0]+"?"+u}(this._url,this._protocol,this._version);if(this._nextSocket=new i(t),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=t=>this._socketReceive(t),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=t=>this._socketError(t),this._nextSocket.onclose=()=>{setTimeout(()=>{this._nextSocket=null,this._socketCreate()},1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(t){const e=JSON.stringify(t);this._socket&&1===this._socket.readyState?this._socket.send(e):(this._setToQueue(t),this._socketCreate())}async _socketReceive(t){let e;try{e=JSON.parse(t.data)}catch(t){return}if(this._socketSend({topic:e.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState){const t=this._events.filter(t=>"message"===t.event);t&&t.length&&t.forEach(t=>t.callback(e))}}_socketError(t){const e=this._events.filter(t=>"error"===t.event);e&&e.length&&e.forEach(e=>e.callback(t))}_queueSubscriptions(){this._subscriptions.forEach(t=>this._queue.push({topic:t,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(t){this._queue.push(t)}_pushQueue(){this._queue.forEach(t=>this._socketSend(t)),this._queue=[]}}}).call(this,n(17))},function(t,e,n){"use strict";e.a=class{constructor(){this._eventEmitters=[],"undefined"!=typeof window&&void 0!==window.addEventListener&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(t,e){this._eventEmitters.push({event:t,callback:e})}trigger(t){let e=[];t&&(e=this._eventEmitters.filter(e=>e.event===t)),e.forEach(t=>{t.callback()})}}},function(t,e,n){(function(e){function r(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var o=n(24),i=r(n(71)),s=r(n(92)),a=n(95);"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function u(t){return a.createElement("div",{className:"walletconnect-modal__header"},a.createElement("img",{src:"data:image/svg+xml,%3Csvg height='185' viewBox='0 0 300 185' width='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m61.4385429 36.2562612c48.9112241-47.8881663 128.2119871-47.8881663 177.1232091 0l5.886545 5.7634174c2.445561 2.3944081 2.445561 6.2765112 0 8.6709204l-20.136695 19.715503c-1.222781 1.1972051-3.2053 1.1972051-4.428081 0l-8.100584-7.9311479c-34.121692-33.4079817-89.443886-33.4079817-123.5655788 0l-8.6750562 8.4936051c-1.2227816 1.1972041-3.205301 1.1972041-4.4280806 0l-20.1366949-19.7155031c-2.4455612-2.3944092-2.4455612-6.2765122 0-8.6709204zm218.7677961 40.7737449 17.921697 17.546897c2.445549 2.3943969 2.445563 6.2764769.000031 8.6708899l-80.810171 79.121134c-2.445544 2.394426-6.410582 2.394453-8.85616.000062-.00001-.00001-.000022-.000022-.000032-.000032l-57.354143-56.154572c-.61139-.598602-1.60265-.598602-2.21404 0-.000004.000004-.000007.000008-.000011.000011l-57.3529212 56.154531c-2.4455368 2.394432-6.4105755 2.394472-8.8561612.000087-.0000143-.000014-.0000296-.000028-.0000449-.000044l-80.81241943-79.122185c-2.44556021-2.394408-2.44556021-6.2765115 0-8.6709197l17.92172963-17.5468673c2.4455602-2.3944082 6.4105989-2.3944082 8.8561602 0l57.3549775 56.155357c.6113908.598602 1.602649.598602 2.2140398 0 .0000092-.000009.0000174-.000017.0000265-.000024l57.3521031-56.155333c2.445505-2.3944633 6.410544-2.3945531 8.856161-.0002.000034.0000336.000068.0000673.000101.000101l57.354902 56.155432c.61139.598601 1.60265.598601 2.21404 0l57.353975-56.1543249c2.445561-2.3944092 6.410599-2.3944092 8.85616 0z' fill='%233b99fc'/%3E%3C/svg%3E",className:"walletconnect-modal__headerLogo"}),a.createElement("p",null,"WalletConnect"),a.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:t.onClose},a.createElement("div",{id:"walletconnect-qrcode-close",className:"walletconnect-modal__close__icon"},a.createElement("div",{className:"walletconnect-modal__close__line1"}),a.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function c(t){return a.createElement("a",{className:"walletconnect-connect__button",href:t.href,id:"walletconnect-connect-button-"+t.name,onClick:t.onClick,rel:"noopener noreferrer",style:{backgroundColor:t.color},target:"_blank"},t.name)}function l(t){var e=t.color,n=t.href,r=t.name,o=t.logo,i=t.onClick;return a.createElement("a",{className:"walletconnect-modal__base__row",href:n,onClick:i,rel:"noopener noreferrer",target:"_blank"},a.createElement("h3",{className:"walletconnect-modal__base__row__h3"},r),a.createElement("div",{className:"walletconnect-modal__base__row__right"},a.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+o+"') "+e,backgroundSize:"100%"}}),a.createElement("img",{src:"data:image/svg+xml,%3Csvg fill='none' height='18' viewBox='0 0 8 18' width='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath clip-rule='evenodd' d='m.586301.213898c-.435947.33907-.5144813.967342-.175411 1.403292l4.87831 6.27212c.28087.36111.28087.86677 0 1.22788l-4.878311 6.27211c-.33907.436-.260536 1.0642.175412 1.4033.435949.3391 1.064219.2605 1.403289-.1754l4.87832-6.2721c.84259-1.08336.84259-2.60034 0-3.68367l-4.87832-6.27212c-.33907-.4359474-.96734-.514482-1.403289-.175412z' fill='%233c4252' fill-rule='evenodd'/%3E%3C/svg%3E",className:"walletconnect-modal__base__row__right__caret"})))}function h(t){var e=t.color,n=t.href,r=t.name,o=t.logo,i=t.onClick,s=window.innerWidth<768?(r.length>8?2.5:2.7)+"vw":"inherit";return a.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:n,onClick:i,rel:"noopener noreferrer",target:"_blank"},a.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+o+"') "+e,backgroundSize:"100%"}}),a.createElement("div",{style:{fontSize:s},className:"walletconnect-connect__button__text"},r))}function f(t){var e=o.isAndroid(),n=a.useState(""),r=n[0],i=n[1],s=a.useState(""),u=s[0],f=s[1],d=a.useState(1),p=d[0],g=d[1],m=u?t.links.filter((function(t){return t.name.toLowerCase().includes(u.toLowerCase())})):t.links,v=t.errorMessage,_=u||m.length>5,y=Math.ceil(m.length/12),w=[12*(p-1)+1,12*p],b=m.length?m.filter((function(t,e){return e+1>=w[0]&&e+1<=w[1]})):[],M=!(e||!(y>1)),x=void 0;return a.createElement("div",null,a.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},e?t.text.connect_mobile_wallet:t.text.choose_preferred_wallet),!e&&a.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:r,onChange:function(t){i(t.target.value),clearTimeout(x),t.target.value?x=setTimeout((function(){f(t.target.value),g(1)}),1e3):(i(""),f(""),g(1))}}),a.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(e?"__android":_&&m.length?"__wrap":"")},e?a.createElement(c,{name:t.text.connect,color:"rgb(64, 153, 255)",href:t.uri,onClick:a.useCallback((function(){o.saveMobileLinkInfo({name:"Unknown",href:t.uri})}),[])}):b.length?b.map((function(e){var n=e.color,r=e.name,i=e.shortName,s=e.logo,u=o.formatIOSMobile(t.uri,e),c=a.useCallback((function(){o.saveMobileLinkInfo({name:r,href:u})}),[b]);return _?a.createElement(h,{color:n,href:u,name:i||r,logo:s,onClick:c}):a.createElement(l,{color:n,href:u,name:r,logo:s,onClick:c})})):a.createElement(a.Fragment,null,a.createElement("p",null,v.length?t.errorMessage:t.links.length&&!m.length?t.text.no_wallets_found:t.text.loading))),M&&a.createElement("div",{className:"walletconnect-modal__footer"},Array(y).fill(0).map((function(t,e){var n=e+1,r=p===n;return a.createElement("a",{style:{margin:"auto 10px",fontWeight:r?"bold":"normal"},onClick:function(){return g(n)}},n)}))))}function d(t){var e=!!t.message.trim();return a.createElement("div",{className:"walletconnect-qrcode__notification"+(e?" notification__show":"")},t.message)}function p(t){var e=a.useState(""),n=e[0],r=e[1],o=a.useState(""),u=o[0],c=o[1];a.useEffect((function(){try{return Promise.resolve(function(t){try{var e="";return Promise.resolve(i.toString(t,{margin:0,type:"svg"})).then((function(t){return"string"==typeof t&&(e=t.replace("<svg",'<svg class="walletconnect-qrcode__image"')),e}))}catch(t){return Promise.reject(t)}}(t.uri)).then((function(t){c(t)}))}catch(t){Promise.reject(t)}}),[]);return a.createElement("div",null,a.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},t.text.scan_qrcode_with_wallet),a.createElement("div",{dangerouslySetInnerHTML:{__html:u}}),a.createElement("div",{className:"walletconnect-modal__footer"},a.createElement("a",{onClick:function(){s(t.uri)?(r(t.text.copied_to_clipboard),setInterval((function(){return r("")}),1200)):(r("Error"),setInterval((function(){return r("")}),1200))}},t.text.copy_to_clipboard)),a.createElement(d,{message:n}))}function g(t){var e=o.isAndroid(),n=o.isMobile(),r=n?t.qrcodeModalOptions&&t.qrcodeModalOptions.mobileLinks?t.qrcodeModalOptions.mobileLinks:void 0:t.qrcodeModalOptions&&t.qrcodeModalOptions.desktopLinks?t.qrcodeModalOptions.desktopLinks:void 0,i=a.useState(!1),s=i[0],c=i[1],l=a.useState(!1),h=l[0],d=l[1],g=a.useState(!n),m=g[0],v=g[1],_={mobile:n,text:t.text,uri:t.uri,qrcodeModalOptions:t.qrcodeModalOptions},y=a.useState(""),w=y[0],b=y[1],M=a.useState(!1),x=M[0],E=M[1],R=a.useState([]),S=R[0],T=R[1],A=a.useState(""),k=A[0],C=A[1],O=function(){h||s||r&&!r.length||S.length>0||a.useEffect((function(){!function(){try{if(e)return Promise.resolve();c(!0);var i=function(t,e){try{var n=t()}catch(t){return e(t)}return n&&n.then?n.then(void 0,e):n}((function(){var e=t.qrcodeModalOptions&&t.qrcodeModalOptions.registryUrl?t.qrcodeModalOptions.registryUrl:o.getWalletRegistryUrl();return Promise.resolve(fetch(e)).then((function(e){return Promise.resolve(e.json()).then((function(e){var i=e.listings,s=n?"mobile":"desktop",a=o.getMobileLinkRegistry(o.formatMobileRegistry(i,s),r);c(!1),d(!0),C(a.length?"":t.text.no_supported_wallets),T(a);var u=1===a.length;u&&(b(o.formatIOSMobile(t.uri,a[0])),v(!0)),E(u)}))}))}),(function(e){c(!1),d(!0),C(t.text.something_went_wrong),console.error(e)}));Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(t){return Promise.reject(t)}}()}))};O();var I=n?m:!m;return a.createElement("div",{id:"walletconnect-qrcode-modal",className:"walletconnect-qrcode__base animated fadeIn"},a.createElement("div",{className:"walletconnect-modal__base"},a.createElement(u,{onClose:t.onClose}),x&&m?a.createElement("div",{className:"walletconnect-modal__single_wallet"},a.createElement("a",{onClick:function(){return o.saveMobileLinkInfo({name:S[0].name,href:w})},href:w,rel:"noopener noreferrer",target:"_blank"},t.text.connect_with+" "+(x?S[0].name:"")+" ›")):e||s||!s&&S.length?a.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(I?" right__selected":"")},a.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),n?a.createElement(a.Fragment,null,a.createElement("a",{onClick:function(){return v(!1),O()}},t.text.mobile),a.createElement("a",{onClick:function(){return v(!0)}},t.text.qrcode)):a.createElement(a.Fragment,null,a.createElement("a",{onClick:function(){return v(!0)}},t.text.qrcode),a.createElement("a",{onClick:function(){return v(!1),O()}},t.text.desktop))):null,a.createElement("div",null,m||!e&&!s&&!S.length?a.createElement(p,Object.assign({},_)):a.createElement(f,Object.assign({},_,{links:S,errorMessage:k})))))}var m={de:{choose_preferred_wallet:"Wähle bevorzugte Wallet",connect_mobile_wallet:"Verbinde mit Mobile Wallet",scan_qrcode_with_wallet:"Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",connect:"Verbinden",qrcode:"QR-Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"In die Zwischenablage kopieren",copied_to_clipboard:"In die Zwischenablage kopiert!",connect_with:"Verbinden mit Hilfe von",loading:"Laden...",something_went_wrong:"Etwas ist schief gelaufen",no_supported_wallets:"Es gibt noch keine unterstützten Wallet",no_wallets_found:"keine Wallet gefunden"},en:{choose_preferred_wallet:"Choose your preferred wallet",connect_mobile_wallet:"Connect to Mobile Wallet",scan_qrcode_with_wallet:"Scan QR code with a WalletConnect-compatible wallet",connect:"Connect",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copy to clipboard",copied_to_clipboard:"Copied to clipboard!",connect_with:"Connect with",loading:"Loading...",something_went_wrong:"Something went wrong",no_supported_wallets:"There are no supported wallets yet",no_wallets_found:"No wallets found"},es:{choose_preferred_wallet:"Elige tu billetera preferida",connect_mobile_wallet:"Conectar a billetera móvil",scan_qrcode_with_wallet:"Escanea el código QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo salió mal",no_supported_wallets:"Todavía no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},fr:{choose_preferred_wallet:"Choisissez votre portefeuille préféré",connect_mobile_wallet:"Se connecter au portefeuille mobile",scan_qrcode_with_wallet:"Scannez le QR code avec un portefeuille compatible WalletConnect",connect:"Se connecter",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copier",copied_to_clipboard:"Copié!",connect_with:"Connectez-vous à l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourné",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouvé"},ko:{choose_preferred_wallet:"원하는 지갑을 선택하세요",connect_mobile_wallet:"모바일 지갑과 연결",scan_qrcode_with_wallet:"WalletConnect 지원 지갑에서 QR코드를 스캔하세요",connect:"연결",qrcode:"QR 코드",mobile:"모바일",desktop:"데스크탑",copy_to_clipboard:"클립보드에 복사",copied_to_clipboard:"클립보드에 복사되었습니다!",connect_with:"와 연결하다",loading:"로드 중...",something_went_wrong:"문제가 발생했습니다.",no_supported_wallets:"아직 지원되는 지갑이 없습니다",no_wallets_found:"지갑을 찾을 수 없습니다"},pt:{choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se à carteira móvel",scan_qrcode_with_wallet:"Ler o código QR com uma carteira compatível com WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvel",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Ligar por meio de",loading:"Carregamento...",something_went_wrong:"Algo correu mal",no_supported_wallets:"Ainda não há carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},zh:{choose_preferred_wallet:"选择你的钱包",connect_mobile_wallet:"连接至移动端钱包",scan_qrcode_with_wallet:"使用兼容 WalletConnect 的钱包扫描二维码",connect:"连接",qrcode:"二维码",mobile:"移动",desktop:"桌面",copy_to_clipboard:"复制到剪贴板",copied_to_clipboard:"复制到剪贴板成功!",connect_with:"通过以下方式连接",loading:"正在加载...",something_went_wrong:"出了问题",no_supported_wallets:"目前还没有支持的钱包",no_wallets_found:"没有找到钱包"},fa:{choose_preferred_wallet:"کیف پول مورد نظر خود را انتخاب کنید",connect_mobile_wallet:"به کیف پول موبایل وصل شوید",scan_qrcode_with_wallet:"کد QR را با یک کیف پول سازگار با WalletConnect اسکن کنید",connect:"اتصال",qrcode:"کد QR",mobile:"سیار",desktop:"دسکتاپ",copy_to_clipboard:"کپی به کلیپ بورد",copied_to_clipboard:"در کلیپ بورد کپی شد!",connect_with:"ارتباط با",loading:"...بارگذاری",something_went_wrong:"مشکلی پیش آمد",no_supported_wallets:"هنوز هیچ کیف پول پشتیبانی شده ای وجود ندارد",no_wallets_found:"هیچ کیف پولی پیدا نشد"}};function v(){var t=o.getDocumentOrThrow(),e=t.getElementById("walletconnect-qrcode-modal");e&&(e.className=e.className.replace("fadeIn","fadeOut"),setTimeout((function(){var e=t.getElementById("walletconnect-wrapper");e&&t.body.removeChild(e)}),300))}function _(t){return function(){v(),t&&t()}}function y(t,e,n){!function(){var t=o.getDocumentOrThrow(),e=t.getElementById("walletconnect-style-sheet");e&&t.head.removeChild(e);var n=t.createElement("style");n.setAttribute("id","walletconnect-style-sheet"),n.innerText=':root {\n --animation-duration: 300ms;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.animated {\n animation-duration: var(--animation-duration);\n animation-fill-mode: both;\n}\n\n.fadeIn {\n animation-name: fadeIn;\n}\n\n.fadeOut {\n animation-name: fadeOut;\n}\n\n#walletconnect-wrapper {\n -webkit-user-select: none;\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n left: 0;\n pointer-events: none;\n position: fixed;\n top: 0;\n user-select: none;\n width: 100%;\n z-index: 99999999999999;\n}\n\n.walletconnect-modal__headerLogo {\n height: 21px;\n}\n\n.walletconnect-modal__header p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n align-items: flex-start;\n display: flex;\n flex: 1;\n margin-left: 5px;\n}\n\n.walletconnect-modal__close__wrapper {\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 10000;\n background: white;\n border-radius: 26px;\n padding: 6px;\n box-sizing: border-box;\n width: 26px;\n height: 26px;\n cursor: pointer;\n}\n\n.walletconnect-modal__close__icon {\n position: relative;\n top: 7px;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: rotate(45deg);\n}\n\n.walletconnect-modal__close__line1 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n}\n\n.walletconnect-modal__close__line2 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n transform: rotate(90deg);\n}\n\n.walletconnect-qrcode__base {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n background: rgba(37, 41, 46, 0.95);\n height: 100%;\n left: 0;\n pointer-events: auto;\n position: fixed;\n top: 0;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n width: 100%;\n will-change: opacity;\n padding: 40px;\n box-sizing: border-box;\n}\n\n.walletconnect-qrcode__text {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 10px 0 20px 0;\n text-align: center;\n width: 100%;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-qrcode__text {\n font-size: 4vw;\n }\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-qrcode__text {\n font-size: 14px;\n }\n}\n\n.walletconnect-qrcode__image {\n width: calc(100% - 30px);\n box-sizing: border-box;\n cursor: none;\n margin: 0 auto;\n}\n\n.walletconnect-qrcode__notification {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n font-size: 16px;\n padding: 16px 20px;\n border-radius: 16px;\n text-align: center;\n transition: all 0.1s ease-in-out;\n background: white;\n color: black;\n margin-bottom: -60px;\n opacity: 0;\n}\n\n.walletconnect-qrcode__notification.notification__show {\n opacity: 1;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__header {\n height: 130px;\n }\n .walletconnect-modal__base {\n overflow: auto;\n }\n}\n\n@media only screen and (min-device-width: 415px) and (max-width: 768px) {\n #content {\n max-width: 768px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 375px) and (max-width: 415px) {\n #content {\n max-width: 414px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 320px) and (max-width: 375px) {\n #content {\n max-width: 375px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (max-width: 320px) {\n #content {\n max-width: 320px;\n box-sizing: border-box;\n }\n}\n\n.walletconnect-modal__base {\n -webkit-font-smoothing: antialiased;\n background: #ffffff;\n border-radius: 24px;\n box-shadow: 0 10px 50px 5px rgba(0, 0, 0, 0.4);\n font-family: ui-rounded, "SF Pro Rounded", "SF Pro Text", medium-content-sans-serif-font,\n -apple-system, BlinkMacSystemFont, ui-sans-serif, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,\n "Open Sans", "Helvetica Neue", sans-serif;\n margin-top: 41px;\n padding: 24px 24px 22px;\n pointer-events: auto;\n position: relative;\n text-align: center;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n will-change: transform;\n overflow: visible;\n transform: translateY(-50%);\n top: 50%;\n max-width: 500px;\n margin: auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__base {\n padding: 24px 12px;\n }\n}\n\n.walletconnect-modal__base .hidden {\n transform: translateY(150%);\n transition: 0.125s cubic-bezier(0.4, 0, 1, 1);\n}\n\n.walletconnect-modal__header {\n align-items: center;\n display: flex;\n height: 26px;\n left: 0;\n justify-content: space-between;\n position: absolute;\n top: -42px;\n width: 100%;\n}\n\n.walletconnect-modal__base .wc-logo {\n align-items: center;\n display: flex;\n height: 26px;\n margin-top: 15px;\n padding-bottom: 15px;\n pointer-events: auto;\n}\n\n.walletconnect-modal__base .wc-logo div {\n background-color: #3399ff;\n height: 21px;\n margin-right: 5px;\n mask-image: url("images/wc-logo.svg") center no-repeat;\n width: 32px;\n}\n\n.walletconnect-modal__base .wc-logo p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n}\n\n.walletconnect-modal__base h2 {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 0 0 19px 0;\n text-align: center;\n width: 100%;\n}\n\n.walletconnect-modal__base__row {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n align-items: center;\n border-radius: 20px;\n cursor: pointer;\n display: flex;\n height: 56px;\n justify-content: space-between;\n padding: 0 15px;\n position: relative;\n margin: 0px 0px 8px;\n text-align: left;\n transition: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n will-change: transform;\n text-decoration: none;\n}\n\n.walletconnect-modal__base__row:hover {\n background: rgba(60, 66, 82, 0.06);\n}\n\n.walletconnect-modal__base__row:active {\n background: rgba(60, 66, 82, 0.06);\n transform: scale(0.975);\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n}\n\n.walletconnect-modal__base__row__h3 {\n color: #25292e;\n font-size: 20px;\n font-weight: 700;\n margin: 0;\n padding-bottom: 3px;\n}\n\n.walletconnect-modal__base__row__right {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.walletconnect-modal__base__row__right__app-icon {\n border-radius: 8px;\n height: 34px;\n margin: 0 11px 2px 0;\n width: 34px;\n background-size: 100%;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-modal__base__row__right__caret {\n height: 18px;\n opacity: 0.3;\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n width: 8px;\n will-change: opacity;\n}\n\n.walletconnect-modal__base__row:hover .caret,\n.walletconnect-modal__base__row:active .caret {\n opacity: 0.6;\n}\n\n.walletconnect-modal__mobile__toggle {\n width: 80%;\n display: flex;\n margin: 0 auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n margin-bottom: 18px;\n background: #d4d5d9;\n}\n\n.walletconnect-modal__single_wallet {\n display: flex;\n justify-content: center;\n margin-top: 7px;\n margin-bottom: 18px;\n}\n\n.walletconnect-modal__single_wallet a {\n cursor: pointer;\n color: rgb(64, 153, 255);\n font-size: 21px;\n font-weight: 800;\n text-decoration: none !important;\n margin: 0 auto;\n}\n\n.walletconnect-modal__mobile__toggle_selector {\n width: calc(50% - 8px);\n background: white;\n position: absolute;\n border-radius: 5px;\n height: calc(100% - 8px);\n top: 4px;\n transition: all 0.2s ease-in-out;\n transform: translate3d(4px, 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle.right__selected .walletconnect-modal__mobile__toggle_selector {\n transform: translate3d(calc(100% + 12px), 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle a {\n font-size: 12px;\n width: 50%;\n text-align: center;\n padding: 8px;\n margin: 0;\n font-weight: 600;\n z-index: 1;\n}\n\n.walletconnect-modal__footer {\n display: flex;\n justify-content: center;\n margin-top: 20px;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__footer {\n margin-top: 5vw;\n }\n}\n\n.walletconnect-modal__footer a {\n cursor: pointer;\n color: #898d97;\n font-size: 15px;\n margin: 0 auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__footer a {\n font-size: 14px;\n }\n}\n\n.walletconnect-connect__buttons__wrapper {\n max-height: 44vh;\n}\n\n.walletconnect-connect__buttons__wrapper__android {\n margin: 50% 0;\n}\n\n.walletconnect-connect__buttons__wrapper__wrap {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n margin: 10px 0;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__buttons__wrapper__wrap {\n margin-top: 40px;\n }\n}\n\n.walletconnect-connect__button {\n background-color: rgb(64, 153, 255);\n padding: 12px;\n border-radius: 8px;\n text-decoration: none;\n color: rgb(255, 255, 255);\n font-weight: 500;\n}\n\n.walletconnect-connect__button__icon_anchor {\n cursor: pointer;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: 8px;\n width: 42px;\n justify-self: center;\n flex-direction: column;\n text-decoration: none !important;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-connect__button__icon_anchor {\n margin: 4px;\n }\n}\n\n.walletconnect-connect__button__icon {\n border-radius: 10px;\n height: 42px;\n margin: 0;\n width: 42px;\n background-size: cover !important;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-connect__button__text {\n color: #424952;\n font-size: 2.7vw;\n text-decoration: none !important;\n padding: 0;\n margin-top: 1.8vw;\n font-weight: 600;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__button__text {\n font-size: 16px;\n margin-top: 12px;\n }\n}\n\n.walletconnect-search__input {\n border: none;\n background: #d4d5d9;\n border-style: none;\n padding: 8px 16px;\n outline: none;\n font-style: normal;\n font-stretch: normal;\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: left;\n border-radius: 8px;\n width: calc(100% - 16px);\n margin: 0;\n margin-bottom: 8px;\n}\n',t.head.appendChild(n)}();var r,i=function(){var t=o.getDocumentOrThrow(),e=t.createElement("div");return e.setAttribute("id","walletconnect-wrapper"),t.body.appendChild(e),e}();a.render(a.createElement(g,{text:(r=o.getNavigatorOrThrow().language.split("-")[0]||"en",m[r]||m.en),uri:t,onClose:_(e),qrcodeModalOptions:n}),i)}var w=function(){return void 0!==e&&void 0!==e.versions&&void 0!==e.versions.node};var b={open:function(t,e,n){console.log(t),w()?function(t){i.toString(t,{type:"terminal"}).then(console.log)}(t):y(t,e,n)},close:function(){w()||v()}};t.exports=b}).call(this,n(18))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(57),o=r.__importDefault(n(25)),i=n(96),s=n(97),a=n(1),u=n(94);e.default=class{constructor(t){this.events=new o.default,this.rpc={infuraId:null==t?void 0:t.infuraId,custom:null==t?void 0:t.rpc},this.signer=new i.JsonRpcProvider(new u.SignerConnection(t));const e=this.signer.connection.chainId||(null==t?void 0:t.chainId)||1;this.http=this.setHttpProvider(e),this.registerEventListeners()}get connected(){return this.signer.connection.connected}get connector(){return this.signer.connection.connector}get accounts(){return this.signer.connection.accounts}get chainId(){return this.signer.connection.chainId}get rpcUrl(){var t;return(null===(t=this.http)||void 0===t?void 0:t.connection).url||""}request(t){return r.__awaiter(this,void 0,void 0,(function*(){switch(t.method){case"eth_requestAccounts":return yield this.connect(),this.signer.connection.accounts;case"eth_accounts":return this.signer.connection.accounts;case"eth_chainId":return this.signer.connection.chainId}if(a.signingMethods.includes(t.method))return this.signer.request(t);if(void 0===this.http)throw new Error(`Cannot request JSON-RPC method (${t.method}) without provided rpc url`);return this.http.request(t)}))}sendAsync(t,e){this.request(t).then(t=>e(null,t)).catch(t=>e(t,void 0))}enable(){return r.__awaiter(this,void 0,void 0,(function*(){return yield this.request({method:"eth_requestAccounts"})}))}connect(){return r.__awaiter(this,void 0,void 0,(function*(){this.signer.connection.connected||(yield this.signer.connect())}))}disconnect(){return r.__awaiter(this,void 0,void 0,(function*(){this.signer.connection.connected&&(yield this.signer.disconnect())}))}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}removeListener(t,e){this.events.removeListener(t,e)}off(t,e){this.events.off(t,e)}get isWalletConnect(){return!0}registerEventListeners(){this.signer.connection.on("accountsChanged",t=>{this.events.emit("accountsChanged",t)}),this.signer.connection.on("chainChanged",t=>{this.http=this.setHttpProvider(t),this.events.emit("chainChanged",t)}),this.signer.on("disconnect",()=>{this.events.emit("disconnect")})}setHttpProvider(t){const e=(0,a.getRpcUrl)(t,this.rpc);if(void 0===e)return;return new i.JsonRpcProvider(new s.HttpConnection(e))}}},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return o})),n.d(e,"__assign",(function(){return i})),n.d(e,"__rest",(function(){return s})),n.d(e,"__decorate",(function(){return a})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__exportStar",(function(){return f})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return p})),n.d(e,"__spread",(function(){return g})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return v})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return y})),n.d(e,"__makeTemplateObject",(function(){return w})),n.d(e,"__importStar",(function(){return b})),n.d(e,"__importDefault",(function(){return M}));
|
|
16
|
+
*/!function(){"use strict";var s="input is invalid type",a="object"==typeof window,u=a?window:{};u.JS_SHA3_NO_WINDOW&&(a=!1);var c=!a&&"object"==typeof self;!u.JS_SHA3_NO_NODE_JS&&"object"==typeof r&&r.versions&&r.versions.node?u=o:c&&(u=self);var l=!u.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,h=n(66),f=!u.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],g=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],_=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!u.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!f||!u.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var b=function(t,e,n){return function(r){return new N(t,e,t).update(r)[n]()}},M=function(t,e,n){return function(r,o){return new N(t,e,o).update(r)[n]()}},E=function(t,e,n){return function(e,r,o,i){return A["cshake"+t].update(e,r,o,i)[n]()}},x=function(t,e,n){return function(e,r,o,i){return A["kmac"+t].update(e,r,o,i)[n]()}},R=function(t,e,n,r){for(var o=0;o<y.length;++o){var i=y[o];t[i]=e(n,r,i)}return t},S=function(t,e){var n=b(t,e,"hex");return n.create=function(){return new N(t,e,t)},n.update=function(t){return n.create().update(t)},R(n,b,t,e)},k=[{name:"keccak",padding:[1,256,65536,16777216],bits:v,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:v,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:_,createMethod:function(t,e){var n=M(t,e,"hex");return n.create=function(n){return new N(t,e,n)},n.update=function(t,e){return n.create(e).update(t)},R(n,M,t,e)}},{name:"cshake",padding:p,bits:_,createMethod:function(t,e){var n=w[t],r=E(t,0,"hex");return r.create=function(r,o,i){return o||i?new N(t,e,r).bytepad([o,i],n):A["shake"+t].create(r)},r.update=function(t,e,n,o){return r.create(e,n,o).update(t)},R(r,E,t,e)}},{name:"kmac",padding:p,bits:_,createMethod:function(t,e){var n=w[t],r=x(t,0,"hex");return r.create=function(r,o,i){return new j(t,e,o).bytepad(["KMAC",i],n).bytepad([r],n)},r.update=function(t,e,n,o){return r.create(t,n,o).update(e)},R(r,x,t,e)}}],A={},C=[],O=0;O<k.length;++O)for(var T=k[O],I=T.bits,P=0;P<I.length;++P){var B=T.name+"_"+I[P];if(C.push(B),A[B]=T.createMethod(I[P],T.padding),"sha3"!==T.name){var L=T.name+I[P];C.push(L),A[L]=A[B]}}function N(t,e,n){this.blocks=[],this.s=[],this.padding=e,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function j(t,e,n){N.call(this,t,e,n)}N.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(s);if(null===t)throw new Error(s);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var r,o,i=this.blocks,a=this.byteCount,u=t.length,c=this.blockCount,l=0,h=this.s;l<u;){if(this.reset)for(this.reset=!1,i[0]=this.block,r=1;r<c+1;++r)i[r]=0;if(e)for(r=this.start;l<u&&r<a;++l)i[r>>2]|=t[l]<<g[3&r++];else for(r=this.start;l<u&&r<a;++l)(o=t.charCodeAt(l))<128?i[r>>2]|=o<<g[3&r++]:o<2048?(i[r>>2]|=(192|o>>6)<<g[3&r++],i[r>>2]|=(128|63&o)<<g[3&r++]):o<55296||o>=57344?(i[r>>2]|=(224|o>>12)<<g[3&r++],i[r>>2]|=(128|o>>6&63)<<g[3&r++],i[r>>2]|=(128|63&o)<<g[3&r++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++l)),i[r>>2]|=(240|o>>18)<<g[3&r++],i[r>>2]|=(128|o>>12&63)<<g[3&r++],i[r>>2]|=(128|o>>6&63)<<g[3&r++],i[r>>2]|=(128|63&o)<<g[3&r++]);if(this.lastByteIndex=r,r>=a){for(this.start=r-a,this.block=i[c],r=0;r<c;++r)h[r]^=i[r];U(h),this.reset=!0}else this.start=r}return this},N.prototype.encode=function(t,e){var n=255&t,r=1,o=[n];for(n=255&(t>>=8);n>0;)o.unshift(n),n=255&(t>>=8),++r;return e?o.push(r):o.unshift(r),this.update(o),o.length},N.prototype.encodeString=function(t){var e,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(s);if(null===t)throw new Error(s);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}var r=0,o=t.length;if(e)r=o;else for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);a<128?r+=1:a<2048?r+=2:a<55296||a>=57344?r+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++i)),r+=4)}return r+=this.encode(8*r),this.update(t),r},N.prototype.bytepad=function(t,e){for(var n=this.encode(e),r=0;r<t.length;++r)n+=this.encodeString(t[r]);var o=e-n%e,i=[];return i.length=o,this.update(i),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,n=this.blockCount,r=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e<n+1;++e)t[e]=0;for(t[n-1]|=2147483648,e=0;e<n;++e)r[e]^=t[e];U(r)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,n=this.s,r=this.outputBlocks,o=this.extraBytes,i=0,s=0,a="";s<r;){for(i=0;i<e&&s<r;++i,++s)t=n[i],a+=d[t>>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];s%e==0&&(U(n),i=0)}return o&&(t=n[i],a+=d[t>>4&15]+d[15&t],o>1&&(a+=d[t>>12&15]+d[t>>8&15]),o>2&&(a+=d[t>>20&15]+d[t>>16&15])),a},N.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,n=this.s,r=this.outputBlocks,o=this.extraBytes,i=0,s=0,a=this.outputBits>>3;t=o?new ArrayBuffer(r+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<r;){for(i=0;i<e&&s<r;++i,++s)u[s]=n[i];s%e==0&&U(n)}return o&&(u[i]=n[i],t=t.slice(0,a)),t},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var t,e,n=this.blockCount,r=this.s,o=this.outputBlocks,i=this.extraBytes,s=0,a=0,u=[];a<o;){for(s=0;s<n&&a<o;++s,++a)t=a<<2,e=r[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%n==0&&U(r)}return i&&(t=a<<2,e=r[s],u[t]=255&e,i>1&&(u[t+1]=e>>8&255),i>2&&(u[t+2]=e>>16&255)),u},j.prototype=new N,j.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var U=function(t){var e,n,r,o,i,s,a,u,c,l,h,f,d,p,g,v,_,y,w,b,M,E,x,R,S,k,A,C,O,T,I,P,B,L,N,j,U,q,D,J,F,H,W,z,Y,$,V,K,Q,Z,X,G,tt,et,nt,rt,ot,it,st,at,ut,ct,lt;for(r=0;r<48;r+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],h=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),n=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=o^(u<<1|c>>>31),n=i^(c<<1|u>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=s^(l<<1|h>>>31),n=a^(h<<1|l>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=u^(f<<1|d>>>31),n=c^(d<<1|f>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=l^(o<<1|i>>>31),n=h^(i<<1|o>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,p=t[0],g=t[1],$=t[11]<<4|t[10]>>>28,V=t[10]<<4|t[11]>>>28,C=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,L=t[2]<<1|t[3]>>>31,N=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,_=t[12]<<12|t[13]>>>20,K=t[22]<<10|t[23]>>>22,Q=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,I=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,nt=t[4]<<30|t[5]>>>2,j=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Z=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,P=t[45]<<29|t[44]>>>3,B=t[44]<<29|t[45]>>>3,R=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,ot=t[16]<<23|t[17]>>>9,q=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,b=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,G=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,z=t[8]<<27|t[9]>>>5,Y=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,A=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,J=t[38]<<8|t[39]>>>24,F=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=p^~v&y,t[1]=g^~_&w,t[10]=R^~k&C,t[11]=S^~A&O,t[20]=L^~j&q,t[21]=N^~U&D,t[30]=z^~$&K,t[31]=Y^~V&Q,t[40]=et^~rt&it,t[41]=nt^~ot&st,t[2]=v^~y&b,t[3]=_^~w&M,t[12]=k^~C&T,t[13]=A^~O&I,t[22]=j^~q&J,t[23]=U^~D&F,t[32]=$^~K&Z,t[33]=V^~Q&X,t[42]=rt^~it&at,t[43]=ot^~st&ut,t[4]=y^~b&E,t[5]=w^~M&x,t[14]=C^~T&P,t[15]=O^~I&B,t[24]=q^~J&H,t[25]=D^~F&W,t[34]=K^~Z&G,t[35]=Q^~X&tt,t[44]=it^~at&ct,t[45]=st^~ut<,t[6]=b^~E&p,t[7]=M^~x&g,t[16]=T^~P&R,t[17]=I^~B&S,t[26]=J^~H&L,t[27]=F^~W&N,t[36]=Z^~G&z,t[37]=X^~tt&Y,t[46]=at^~ct&et,t[47]=ut^~lt&nt,t[8]=E^~p&v,t[9]=x^~g&_,t[18]=P^~R&k,t[19]=B^~S&A,t[28]=H^~L&j,t[29]=W^~N&U,t[38]=G^~z&$,t[39]=tt^~Y&V,t[48]=ct^~et&rt,t[49]=lt^~nt&ot,t[0]^=m[r],t[1]^=m[r+1]};if(l)t.exports=A;else{for(O=0;O<C.length;++O)u[C[O]]=A[C[O]];h&&(void 0===(i=function(){return A}.call(e,n,e,t))||(t.exports=i))}}()}).call(this,n(18),n(17))},function(t,e,n){"use strict";(function(t){var r=n(1),o=n(55);const i=void 0!==t.WebSocket?t.WebSocket:n(70);e.a=class{constructor(t){if(this.opts=t,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=t.protocol,this._version=t.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new o.a,!t.url||"string"!=typeof t.url)throw new Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",()=>this._socketCreate())}set readyState(t){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(t){}get connecting(){return 0===this.readyState}set connected(t){}get connected(){return 1===this.readyState}set closing(t){}get closing(){return 2===this.readyState}set closed(t){}get closed(){return 3===this.readyState}open(){this._socketCreate()}close(){this._socketClose()}send(t,e,n){if(!e||"string"!=typeof e)throw new Error("Missing or invalid topic field");this._socketSend({topic:e,type:"pub",payload:t,silent:!!n})}subscribe(t){this._socketSend({topic:t,type:"sub",payload:"",silent:!0})}on(t,e){this._events.push({event:t,callback:e})}_socketCreate(){if(this._nextSocket)return;const t=function(t,e,n){var o,i;const s=(t.startsWith("https")?t.replace("https","wss"):t.startsWith("http")?t.replace("http","ws"):t).split("?"),a=Object(r.isBrowser)()?{protocol:e,version:n,env:"browser",host:(null===(o=Object(r.getLocation)())||void 0===o?void 0:o.host)||""}:{protocol:e,version:n,env:(null===(i=Object(r.detectEnv)())||void 0===i?void 0:i.name)||""},u=Object(r.appendToQueryString)(Object(r.getQueryString)(s[1]||""),a);return s[0]+"?"+u}(this._url,this._protocol,this._version);if(this._nextSocket=new i(t),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=t=>this._socketReceive(t),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=t=>this._socketError(t),this._nextSocket.onclose=()=>{setTimeout(()=>{this._nextSocket=null,this._socketCreate()},1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(t){const e=JSON.stringify(t);this._socket&&1===this._socket.readyState?this._socket.send(e):(this._setToQueue(t),this._socketCreate())}async _socketReceive(t){let e;try{e=JSON.parse(t.data)}catch(t){return}if(this._socketSend({topic:e.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState){const t=this._events.filter(t=>"message"===t.event);t&&t.length&&t.forEach(t=>t.callback(e))}}_socketError(t){const e=this._events.filter(t=>"error"===t.event);e&&e.length&&e.forEach(e=>e.callback(t))}_queueSubscriptions(){this._subscriptions.forEach(t=>this._queue.push({topic:t,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(t){this._queue.push(t)}_pushQueue(){this._queue.forEach(t=>this._socketSend(t)),this._queue=[]}}}).call(this,n(17))},function(t,e,n){"use strict";e.a=class{constructor(){this._eventEmitters=[],"undefined"!=typeof window&&void 0!==window.addEventListener&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(t,e){this._eventEmitters.push({event:t,callback:e})}trigger(t){let e=[];t&&(e=this._eventEmitters.filter(e=>e.event===t)),e.forEach(t=>{t.callback()})}}},function(t,e,n){(function(e){function r(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var o=n(24),i=r(n(71)),s=r(n(92)),a=n(95);"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function u(t){return a.createElement("div",{className:"walletconnect-modal__header"},a.createElement("img",{src:"data:image/svg+xml,%3Csvg height='185' viewBox='0 0 300 185' width='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m61.4385429 36.2562612c48.9112241-47.8881663 128.2119871-47.8881663 177.1232091 0l5.886545 5.7634174c2.445561 2.3944081 2.445561 6.2765112 0 8.6709204l-20.136695 19.715503c-1.222781 1.1972051-3.2053 1.1972051-4.428081 0l-8.100584-7.9311479c-34.121692-33.4079817-89.443886-33.4079817-123.5655788 0l-8.6750562 8.4936051c-1.2227816 1.1972041-3.205301 1.1972041-4.4280806 0l-20.1366949-19.7155031c-2.4455612-2.3944092-2.4455612-6.2765122 0-8.6709204zm218.7677961 40.7737449 17.921697 17.546897c2.445549 2.3943969 2.445563 6.2764769.000031 8.6708899l-80.810171 79.121134c-2.445544 2.394426-6.410582 2.394453-8.85616.000062-.00001-.00001-.000022-.000022-.000032-.000032l-57.354143-56.154572c-.61139-.598602-1.60265-.598602-2.21404 0-.000004.000004-.000007.000008-.000011.000011l-57.3529212 56.154531c-2.4455368 2.394432-6.4105755 2.394472-8.8561612.000087-.0000143-.000014-.0000296-.000028-.0000449-.000044l-80.81241943-79.122185c-2.44556021-2.394408-2.44556021-6.2765115 0-8.6709197l17.92172963-17.5468673c2.4455602-2.3944082 6.4105989-2.3944082 8.8561602 0l57.3549775 56.155357c.6113908.598602 1.602649.598602 2.2140398 0 .0000092-.000009.0000174-.000017.0000265-.000024l57.3521031-56.155333c2.445505-2.3944633 6.410544-2.3945531 8.856161-.0002.000034.0000336.000068.0000673.000101.000101l57.354902 56.155432c.61139.598601 1.60265.598601 2.21404 0l57.353975-56.1543249c2.445561-2.3944092 6.410599-2.3944092 8.85616 0z' fill='%233b99fc'/%3E%3C/svg%3E",className:"walletconnect-modal__headerLogo"}),a.createElement("p",null,"WalletConnect"),a.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:t.onClose},a.createElement("div",{id:"walletconnect-qrcode-close",className:"walletconnect-modal__close__icon"},a.createElement("div",{className:"walletconnect-modal__close__line1"}),a.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function c(t){return a.createElement("a",{className:"walletconnect-connect__button",href:t.href,id:"walletconnect-connect-button-"+t.name,onClick:t.onClick,rel:"noopener noreferrer",style:{backgroundColor:t.color},target:"_blank"},t.name)}function l(t){var e=t.color,n=t.href,r=t.name,o=t.logo,i=t.onClick;return a.createElement("a",{className:"walletconnect-modal__base__row",href:n,onClick:i,rel:"noopener noreferrer",target:"_blank"},a.createElement("h3",{className:"walletconnect-modal__base__row__h3"},r),a.createElement("div",{className:"walletconnect-modal__base__row__right"},a.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+o+"') "+e,backgroundSize:"100%"}}),a.createElement("img",{src:"data:image/svg+xml,%3Csvg fill='none' height='18' viewBox='0 0 8 18' width='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath clip-rule='evenodd' d='m.586301.213898c-.435947.33907-.5144813.967342-.175411 1.403292l4.87831 6.27212c.28087.36111.28087.86677 0 1.22788l-4.878311 6.27211c-.33907.436-.260536 1.0642.175412 1.4033.435949.3391 1.064219.2605 1.403289-.1754l4.87832-6.2721c.84259-1.08336.84259-2.60034 0-3.68367l-4.87832-6.27212c-.33907-.4359474-.96734-.514482-1.403289-.175412z' fill='%233c4252' fill-rule='evenodd'/%3E%3C/svg%3E",className:"walletconnect-modal__base__row__right__caret"})))}function h(t){var e=t.color,n=t.href,r=t.name,o=t.logo,i=t.onClick,s=window.innerWidth<768?(r.length>8?2.5:2.7)+"vw":"inherit";return a.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:n,onClick:i,rel:"noopener noreferrer",target:"_blank"},a.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+o+"') "+e,backgroundSize:"100%"}}),a.createElement("div",{style:{fontSize:s},className:"walletconnect-connect__button__text"},r))}function f(t){var e=o.isAndroid(),n=a.useState(""),r=n[0],i=n[1],s=a.useState(""),u=s[0],f=s[1],d=a.useState(1),p=d[0],g=d[1],m=u?t.links.filter((function(t){return t.name.toLowerCase().includes(u.toLowerCase())})):t.links,v=t.errorMessage,_=u||m.length>5,y=Math.ceil(m.length/12),w=[12*(p-1)+1,12*p],b=m.length?m.filter((function(t,e){return e+1>=w[0]&&e+1<=w[1]})):[],M=!(e||!(y>1)),E=void 0;return a.createElement("div",null,a.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},e?t.text.connect_mobile_wallet:t.text.choose_preferred_wallet),!e&&a.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:r,onChange:function(t){i(t.target.value),clearTimeout(E),t.target.value?E=setTimeout((function(){f(t.target.value),g(1)}),1e3):(i(""),f(""),g(1))}}),a.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(e?"__android":_&&m.length?"__wrap":"")},e?a.createElement(c,{name:t.text.connect,color:"rgb(64, 153, 255)",href:t.uri,onClick:a.useCallback((function(){o.saveMobileLinkInfo({name:"Unknown",href:t.uri})}),[])}):b.length?b.map((function(e){var n=e.color,r=e.name,i=e.shortName,s=e.logo,u=o.formatIOSMobile(t.uri,e),c=a.useCallback((function(){o.saveMobileLinkInfo({name:r,href:u})}),[b]);return _?a.createElement(h,{color:n,href:u,name:i||r,logo:s,onClick:c}):a.createElement(l,{color:n,href:u,name:r,logo:s,onClick:c})})):a.createElement(a.Fragment,null,a.createElement("p",null,v.length?t.errorMessage:t.links.length&&!m.length?t.text.no_wallets_found:t.text.loading))),M&&a.createElement("div",{className:"walletconnect-modal__footer"},Array(y).fill(0).map((function(t,e){var n=e+1,r=p===n;return a.createElement("a",{style:{margin:"auto 10px",fontWeight:r?"bold":"normal"},onClick:function(){return g(n)}},n)}))))}function d(t){var e=!!t.message.trim();return a.createElement("div",{className:"walletconnect-qrcode__notification"+(e?" notification__show":"")},t.message)}function p(t){var e=a.useState(""),n=e[0],r=e[1],o=a.useState(""),u=o[0],c=o[1];a.useEffect((function(){try{return Promise.resolve(function(t){try{var e="";return Promise.resolve(i.toString(t,{margin:0,type:"svg"})).then((function(t){return"string"==typeof t&&(e=t.replace("<svg",'<svg class="walletconnect-qrcode__image"')),e}))}catch(t){return Promise.reject(t)}}(t.uri)).then((function(t){c(t)}))}catch(t){Promise.reject(t)}}),[]);return a.createElement("div",null,a.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},t.text.scan_qrcode_with_wallet),a.createElement("div",{dangerouslySetInnerHTML:{__html:u}}),a.createElement("div",{className:"walletconnect-modal__footer"},a.createElement("a",{onClick:function(){s(t.uri)?(r(t.text.copied_to_clipboard),setInterval((function(){return r("")}),1200)):(r("Error"),setInterval((function(){return r("")}),1200))}},t.text.copy_to_clipboard)),a.createElement(d,{message:n}))}function g(t){var e=o.isAndroid(),n=o.isMobile(),r=n?t.qrcodeModalOptions&&t.qrcodeModalOptions.mobileLinks?t.qrcodeModalOptions.mobileLinks:void 0:t.qrcodeModalOptions&&t.qrcodeModalOptions.desktopLinks?t.qrcodeModalOptions.desktopLinks:void 0,i=a.useState(!1),s=i[0],c=i[1],l=a.useState(!1),h=l[0],d=l[1],g=a.useState(!n),m=g[0],v=g[1],_={mobile:n,text:t.text,uri:t.uri,qrcodeModalOptions:t.qrcodeModalOptions},y=a.useState(""),w=y[0],b=y[1],M=a.useState(!1),E=M[0],x=M[1],R=a.useState([]),S=R[0],k=R[1],A=a.useState(""),C=A[0],O=A[1],T=function(){h||s||r&&!r.length||S.length>0||a.useEffect((function(){!function(){try{if(e)return Promise.resolve();c(!0);var i=function(t,e){try{var n=t()}catch(t){return e(t)}return n&&n.then?n.then(void 0,e):n}((function(){var e=t.qrcodeModalOptions&&t.qrcodeModalOptions.registryUrl?t.qrcodeModalOptions.registryUrl:o.getWalletRegistryUrl();return Promise.resolve(fetch(e)).then((function(e){return Promise.resolve(e.json()).then((function(e){var i=e.listings,s=n?"mobile":"desktop",a=o.getMobileLinkRegistry(o.formatMobileRegistry(i,s),r);c(!1),d(!0),O(a.length?"":t.text.no_supported_wallets),k(a);var u=1===a.length;u&&(b(o.formatIOSMobile(t.uri,a[0])),v(!0)),x(u)}))}))}),(function(e){c(!1),d(!0),O(t.text.something_went_wrong),console.error(e)}));Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(t){return Promise.reject(t)}}()}))};T();var I=n?m:!m;return a.createElement("div",{id:"walletconnect-qrcode-modal",className:"walletconnect-qrcode__base animated fadeIn"},a.createElement("div",{className:"walletconnect-modal__base"},a.createElement(u,{onClose:t.onClose}),E&&m?a.createElement("div",{className:"walletconnect-modal__single_wallet"},a.createElement("a",{onClick:function(){return o.saveMobileLinkInfo({name:S[0].name,href:w})},href:w,rel:"noopener noreferrer",target:"_blank"},t.text.connect_with+" "+(E?S[0].name:"")+" ›")):e||s||!s&&S.length?a.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(I?" right__selected":"")},a.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),n?a.createElement(a.Fragment,null,a.createElement("a",{onClick:function(){return v(!1),T()}},t.text.mobile),a.createElement("a",{onClick:function(){return v(!0)}},t.text.qrcode)):a.createElement(a.Fragment,null,a.createElement("a",{onClick:function(){return v(!0)}},t.text.qrcode),a.createElement("a",{onClick:function(){return v(!1),T()}},t.text.desktop))):null,a.createElement("div",null,m||!e&&!s&&!S.length?a.createElement(p,Object.assign({},_)):a.createElement(f,Object.assign({},_,{links:S,errorMessage:C})))))}var m={de:{choose_preferred_wallet:"Wähle bevorzugte Wallet",connect_mobile_wallet:"Verbinde mit Mobile Wallet",scan_qrcode_with_wallet:"Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",connect:"Verbinden",qrcode:"QR-Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"In die Zwischenablage kopieren",copied_to_clipboard:"In die Zwischenablage kopiert!",connect_with:"Verbinden mit Hilfe von",loading:"Laden...",something_went_wrong:"Etwas ist schief gelaufen",no_supported_wallets:"Es gibt noch keine unterstützten Wallet",no_wallets_found:"keine Wallet gefunden"},en:{choose_preferred_wallet:"Choose your preferred wallet",connect_mobile_wallet:"Connect to Mobile Wallet",scan_qrcode_with_wallet:"Scan QR code with a WalletConnect-compatible wallet",connect:"Connect",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copy to clipboard",copied_to_clipboard:"Copied to clipboard!",connect_with:"Connect with",loading:"Loading...",something_went_wrong:"Something went wrong",no_supported_wallets:"There are no supported wallets yet",no_wallets_found:"No wallets found"},es:{choose_preferred_wallet:"Elige tu billetera preferida",connect_mobile_wallet:"Conectar a billetera móvil",scan_qrcode_with_wallet:"Escanea el código QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo salió mal",no_supported_wallets:"Todavía no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},fr:{choose_preferred_wallet:"Choisissez votre portefeuille préféré",connect_mobile_wallet:"Se connecter au portefeuille mobile",scan_qrcode_with_wallet:"Scannez le QR code avec un portefeuille compatible WalletConnect",connect:"Se connecter",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copier",copied_to_clipboard:"Copié!",connect_with:"Connectez-vous à l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourné",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouvé"},ko:{choose_preferred_wallet:"원하는 지갑을 선택하세요",connect_mobile_wallet:"모바일 지갑과 연결",scan_qrcode_with_wallet:"WalletConnect 지원 지갑에서 QR코드를 스캔하세요",connect:"연결",qrcode:"QR 코드",mobile:"모바일",desktop:"데스크탑",copy_to_clipboard:"클립보드에 복사",copied_to_clipboard:"클립보드에 복사되었습니다!",connect_with:"와 연결하다",loading:"로드 중...",something_went_wrong:"문제가 발생했습니다.",no_supported_wallets:"아직 지원되는 지갑이 없습니다",no_wallets_found:"지갑을 찾을 수 없습니다"},pt:{choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se à carteira móvel",scan_qrcode_with_wallet:"Ler o código QR com uma carteira compatível com WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvel",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Ligar por meio de",loading:"Carregamento...",something_went_wrong:"Algo correu mal",no_supported_wallets:"Ainda não há carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},zh:{choose_preferred_wallet:"选择你的钱包",connect_mobile_wallet:"连接至移动端钱包",scan_qrcode_with_wallet:"使用兼容 WalletConnect 的钱包扫描二维码",connect:"连接",qrcode:"二维码",mobile:"移动",desktop:"桌面",copy_to_clipboard:"复制到剪贴板",copied_to_clipboard:"复制到剪贴板成功!",connect_with:"通过以下方式连接",loading:"正在加载...",something_went_wrong:"出了问题",no_supported_wallets:"目前还没有支持的钱包",no_wallets_found:"没有找到钱包"},fa:{choose_preferred_wallet:"کیف پول مورد نظر خود را انتخاب کنید",connect_mobile_wallet:"به کیف پول موبایل وصل شوید",scan_qrcode_with_wallet:"کد QR را با یک کیف پول سازگار با WalletConnect اسکن کنید",connect:"اتصال",qrcode:"کد QR",mobile:"سیار",desktop:"دسکتاپ",copy_to_clipboard:"کپی به کلیپ بورد",copied_to_clipboard:"در کلیپ بورد کپی شد!",connect_with:"ارتباط با",loading:"...بارگذاری",something_went_wrong:"مشکلی پیش آمد",no_supported_wallets:"هنوز هیچ کیف پول پشتیبانی شده ای وجود ندارد",no_wallets_found:"هیچ کیف پولی پیدا نشد"}};function v(){var t=o.getDocumentOrThrow(),e=t.getElementById("walletconnect-qrcode-modal");e&&(e.className=e.className.replace("fadeIn","fadeOut"),setTimeout((function(){var e=t.getElementById("walletconnect-wrapper");e&&t.body.removeChild(e)}),300))}function _(t){return function(){v(),t&&t()}}function y(t,e,n){!function(){var t=o.getDocumentOrThrow(),e=t.getElementById("walletconnect-style-sheet");e&&t.head.removeChild(e);var n=t.createElement("style");n.setAttribute("id","walletconnect-style-sheet"),n.innerText=':root {\n --animation-duration: 300ms;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.animated {\n animation-duration: var(--animation-duration);\n animation-fill-mode: both;\n}\n\n.fadeIn {\n animation-name: fadeIn;\n}\n\n.fadeOut {\n animation-name: fadeOut;\n}\n\n#walletconnect-wrapper {\n -webkit-user-select: none;\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n left: 0;\n pointer-events: none;\n position: fixed;\n top: 0;\n user-select: none;\n width: 100%;\n z-index: 99999999999999;\n}\n\n.walletconnect-modal__headerLogo {\n height: 21px;\n}\n\n.walletconnect-modal__header p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n align-items: flex-start;\n display: flex;\n flex: 1;\n margin-left: 5px;\n}\n\n.walletconnect-modal__close__wrapper {\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 10000;\n background: white;\n border-radius: 26px;\n padding: 6px;\n box-sizing: border-box;\n width: 26px;\n height: 26px;\n cursor: pointer;\n}\n\n.walletconnect-modal__close__icon {\n position: relative;\n top: 7px;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: rotate(45deg);\n}\n\n.walletconnect-modal__close__line1 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n}\n\n.walletconnect-modal__close__line2 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n transform: rotate(90deg);\n}\n\n.walletconnect-qrcode__base {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n background: rgba(37, 41, 46, 0.95);\n height: 100%;\n left: 0;\n pointer-events: auto;\n position: fixed;\n top: 0;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n width: 100%;\n will-change: opacity;\n padding: 40px;\n box-sizing: border-box;\n}\n\n.walletconnect-qrcode__text {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 10px 0 20px 0;\n text-align: center;\n width: 100%;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-qrcode__text {\n font-size: 4vw;\n }\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-qrcode__text {\n font-size: 14px;\n }\n}\n\n.walletconnect-qrcode__image {\n width: calc(100% - 30px);\n box-sizing: border-box;\n cursor: none;\n margin: 0 auto;\n}\n\n.walletconnect-qrcode__notification {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n font-size: 16px;\n padding: 16px 20px;\n border-radius: 16px;\n text-align: center;\n transition: all 0.1s ease-in-out;\n background: white;\n color: black;\n margin-bottom: -60px;\n opacity: 0;\n}\n\n.walletconnect-qrcode__notification.notification__show {\n opacity: 1;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__header {\n height: 130px;\n }\n .walletconnect-modal__base {\n overflow: auto;\n }\n}\n\n@media only screen and (min-device-width: 415px) and (max-width: 768px) {\n #content {\n max-width: 768px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 375px) and (max-width: 415px) {\n #content {\n max-width: 414px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 320px) and (max-width: 375px) {\n #content {\n max-width: 375px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (max-width: 320px) {\n #content {\n max-width: 320px;\n box-sizing: border-box;\n }\n}\n\n.walletconnect-modal__base {\n -webkit-font-smoothing: antialiased;\n background: #ffffff;\n border-radius: 24px;\n box-shadow: 0 10px 50px 5px rgba(0, 0, 0, 0.4);\n font-family: ui-rounded, "SF Pro Rounded", "SF Pro Text", medium-content-sans-serif-font,\n -apple-system, BlinkMacSystemFont, ui-sans-serif, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,\n "Open Sans", "Helvetica Neue", sans-serif;\n margin-top: 41px;\n padding: 24px 24px 22px;\n pointer-events: auto;\n position: relative;\n text-align: center;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n will-change: transform;\n overflow: visible;\n transform: translateY(-50%);\n top: 50%;\n max-width: 500px;\n margin: auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__base {\n padding: 24px 12px;\n }\n}\n\n.walletconnect-modal__base .hidden {\n transform: translateY(150%);\n transition: 0.125s cubic-bezier(0.4, 0, 1, 1);\n}\n\n.walletconnect-modal__header {\n align-items: center;\n display: flex;\n height: 26px;\n left: 0;\n justify-content: space-between;\n position: absolute;\n top: -42px;\n width: 100%;\n}\n\n.walletconnect-modal__base .wc-logo {\n align-items: center;\n display: flex;\n height: 26px;\n margin-top: 15px;\n padding-bottom: 15px;\n pointer-events: auto;\n}\n\n.walletconnect-modal__base .wc-logo div {\n background-color: #3399ff;\n height: 21px;\n margin-right: 5px;\n mask-image: url("images/wc-logo.svg") center no-repeat;\n width: 32px;\n}\n\n.walletconnect-modal__base .wc-logo p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n}\n\n.walletconnect-modal__base h2 {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 0 0 19px 0;\n text-align: center;\n width: 100%;\n}\n\n.walletconnect-modal__base__row {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n align-items: center;\n border-radius: 20px;\n cursor: pointer;\n display: flex;\n height: 56px;\n justify-content: space-between;\n padding: 0 15px;\n position: relative;\n margin: 0px 0px 8px;\n text-align: left;\n transition: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n will-change: transform;\n text-decoration: none;\n}\n\n.walletconnect-modal__base__row:hover {\n background: rgba(60, 66, 82, 0.06);\n}\n\n.walletconnect-modal__base__row:active {\n background: rgba(60, 66, 82, 0.06);\n transform: scale(0.975);\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n}\n\n.walletconnect-modal__base__row__h3 {\n color: #25292e;\n font-size: 20px;\n font-weight: 700;\n margin: 0;\n padding-bottom: 3px;\n}\n\n.walletconnect-modal__base__row__right {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.walletconnect-modal__base__row__right__app-icon {\n border-radius: 8px;\n height: 34px;\n margin: 0 11px 2px 0;\n width: 34px;\n background-size: 100%;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-modal__base__row__right__caret {\n height: 18px;\n opacity: 0.3;\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n width: 8px;\n will-change: opacity;\n}\n\n.walletconnect-modal__base__row:hover .caret,\n.walletconnect-modal__base__row:active .caret {\n opacity: 0.6;\n}\n\n.walletconnect-modal__mobile__toggle {\n width: 80%;\n display: flex;\n margin: 0 auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n margin-bottom: 18px;\n background: #d4d5d9;\n}\n\n.walletconnect-modal__single_wallet {\n display: flex;\n justify-content: center;\n margin-top: 7px;\n margin-bottom: 18px;\n}\n\n.walletconnect-modal__single_wallet a {\n cursor: pointer;\n color: rgb(64, 153, 255);\n font-size: 21px;\n font-weight: 800;\n text-decoration: none !important;\n margin: 0 auto;\n}\n\n.walletconnect-modal__mobile__toggle_selector {\n width: calc(50% - 8px);\n background: white;\n position: absolute;\n border-radius: 5px;\n height: calc(100% - 8px);\n top: 4px;\n transition: all 0.2s ease-in-out;\n transform: translate3d(4px, 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle.right__selected .walletconnect-modal__mobile__toggle_selector {\n transform: translate3d(calc(100% + 12px), 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle a {\n font-size: 12px;\n width: 50%;\n text-align: center;\n padding: 8px;\n margin: 0;\n font-weight: 600;\n z-index: 1;\n}\n\n.walletconnect-modal__footer {\n display: flex;\n justify-content: center;\n margin-top: 20px;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__footer {\n margin-top: 5vw;\n }\n}\n\n.walletconnect-modal__footer a {\n cursor: pointer;\n color: #898d97;\n font-size: 15px;\n margin: 0 auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__footer a {\n font-size: 14px;\n }\n}\n\n.walletconnect-connect__buttons__wrapper {\n max-height: 44vh;\n}\n\n.walletconnect-connect__buttons__wrapper__android {\n margin: 50% 0;\n}\n\n.walletconnect-connect__buttons__wrapper__wrap {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n margin: 10px 0;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__buttons__wrapper__wrap {\n margin-top: 40px;\n }\n}\n\n.walletconnect-connect__button {\n background-color: rgb(64, 153, 255);\n padding: 12px;\n border-radius: 8px;\n text-decoration: none;\n color: rgb(255, 255, 255);\n font-weight: 500;\n}\n\n.walletconnect-connect__button__icon_anchor {\n cursor: pointer;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: 8px;\n width: 42px;\n justify-self: center;\n flex-direction: column;\n text-decoration: none !important;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-connect__button__icon_anchor {\n margin: 4px;\n }\n}\n\n.walletconnect-connect__button__icon {\n border-radius: 10px;\n height: 42px;\n margin: 0;\n width: 42px;\n background-size: cover !important;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-connect__button__text {\n color: #424952;\n font-size: 2.7vw;\n text-decoration: none !important;\n padding: 0;\n margin-top: 1.8vw;\n font-weight: 600;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__button__text {\n font-size: 16px;\n margin-top: 12px;\n }\n}\n\n.walletconnect-search__input {\n border: none;\n background: #d4d5d9;\n border-style: none;\n padding: 8px 16px;\n outline: none;\n font-style: normal;\n font-stretch: normal;\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: left;\n border-radius: 8px;\n width: calc(100% - 16px);\n margin: 0;\n margin-bottom: 8px;\n}\n',t.head.appendChild(n)}();var r,i=function(){var t=o.getDocumentOrThrow(),e=t.createElement("div");return e.setAttribute("id","walletconnect-wrapper"),t.body.appendChild(e),e}();a.render(a.createElement(g,{text:(r=o.getNavigatorOrThrow().language.split("-")[0]||"en",m[r]||m.en),uri:t,onClose:_(e),qrcodeModalOptions:n}),i)}var w=function(){return void 0!==e&&void 0!==e.versions&&void 0!==e.versions.node};var b={open:function(t,e,n){console.log(t),w()?function(t){i.toString(t,{type:"terminal"}).then(console.log)}(t):y(t,e,n)},close:function(){w()||v()}};t.exports=b}).call(this,n(18))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(58),o=r.__importDefault(n(25)),i=n(96),s=n(97),a=n(1),u=n(94);e.default=class{constructor(t){this.events=new o.default,this.rpc={infuraId:null==t?void 0:t.infuraId,custom:null==t?void 0:t.rpc},this.signer=new i.JsonRpcProvider(new u.SignerConnection(t));const e=this.signer.connection.chainId||(null==t?void 0:t.chainId)||1;this.http=this.setHttpProvider(e),this.registerEventListeners()}get connected(){return this.signer.connection.connected}get connector(){return this.signer.connection.connector}get accounts(){return this.signer.connection.accounts}get chainId(){return this.signer.connection.chainId}get rpcUrl(){var t;return(null===(t=this.http)||void 0===t?void 0:t.connection).url||""}request(t){return r.__awaiter(this,void 0,void 0,(function*(){switch(t.method){case"eth_requestAccounts":return yield this.connect(),this.signer.connection.accounts;case"eth_accounts":return this.signer.connection.accounts;case"eth_chainId":return this.signer.connection.chainId}if(a.signingMethods.includes(t.method))return this.signer.request(t);if(void 0===this.http)throw new Error(`Cannot request JSON-RPC method (${t.method}) without provided rpc url`);return this.http.request(t)}))}sendAsync(t,e){this.request(t).then(t=>e(null,t)).catch(t=>e(t,void 0))}enable(){return r.__awaiter(this,void 0,void 0,(function*(){return yield this.request({method:"eth_requestAccounts"})}))}connect(){return r.__awaiter(this,void 0,void 0,(function*(){this.signer.connection.connected||(yield this.signer.connect())}))}disconnect(){return r.__awaiter(this,void 0,void 0,(function*(){this.signer.connection.connected&&(yield this.signer.disconnect())}))}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}removeListener(t,e){this.events.removeListener(t,e)}off(t,e){this.events.off(t,e)}get isWalletConnect(){return!0}registerEventListeners(){this.signer.connection.on("accountsChanged",t=>{this.events.emit("accountsChanged",t)}),this.signer.connection.on("chainChanged",t=>{this.http=this.setHttpProvider(t),this.events.emit("chainChanged",t)}),this.signer.on("disconnect",()=>{this.events.emit("disconnect")})}setHttpProvider(t){const e=(0,a.getRpcUrl)(t,this.rpc);if(void 0===e)return;return new i.JsonRpcProvider(new s.HttpConnection(e))}}},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return o})),n.d(e,"__assign",(function(){return i})),n.d(e,"__rest",(function(){return s})),n.d(e,"__decorate",(function(){return a})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__exportStar",(function(){return f})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return p})),n.d(e,"__spread",(function(){return g})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return v})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return y})),n.d(e,"__makeTemplateObject",(function(){return w})),n.d(e,"__importStar",(function(){return b})),n.d(e,"__importDefault",(function(){return M}));
|
|
17
17
|
/*! *****************************************************************************
|
|
18
18
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
19
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -30,4 +30,4 @@ and limitations under the License.
|
|
|
30
30
|
***************************************************************************** */
|
|
31
31
|
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&(n[r[o]]=t[r[o]])}return n}function a(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(s,a)}u((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function f(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}function d(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function p(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function m(t){return this instanceof m?(this.v=t,this):new m(t)}function v(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){o[t]&&(r[t]=function(e){return new Promise((function(n,r){i.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=o[t](e)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(i[0][2],n)}catch(t){l(i[0][3],t)}var n}function u(t){a("next",t)}function c(t){a("throw",t)}function l(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,o){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:o?o(e):e}:o}}function y(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function b(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function M(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){"use strict";(function(t){function n(){return(null==t?void 0:t.crypto)||(null==t?void 0:t.msCrypto)||{}}function r(){const t=n();return t.subtle||t.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=n,e.getSubtleCrypto=r,e.isBrowserCryptoAvailable=function(){return!!n()&&!!r()}}).call(this,n(17))},function(t,e,n){"use strict";(function(t){function n(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function r(){return void 0!==t&&void 0!==t.versions&&void 0!==t.versions.node}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=n,e.isNode=r,e.isBrowser=function(){return!n()&&!r()}}).call(this,n(18))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),s=r[0],a=r[1],u=new i(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),l=0,h=a>0?s-4:s;for(n=0;n<h;n+=4)e=o[t.charCodeAt(n)]<<18|o[t.charCodeAt(n+1)]<<12|o[t.charCodeAt(n+2)]<<6|o[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===a&&(e=o[t.charCodeAt(n)]<<2|o[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===a&&(e=o[t.charCodeAt(n)]<<10|o[t.charCodeAt(n+1)]<<4|o[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=0,a=n-o;s<a;s+=16383)i.push(l(t,s,s+16383>a?a:s+16383));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var o,i,s=[],a=e;a<n;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
|
32
32
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
33
|
-
e.read=function(t,e,n,r,o){var i,s,a=8*o-r-1,u=(1<<a)-1,c=u>>1,l=-7,h=n?o-1:0,f=n?-1:1,d=t[e+h];for(h+=f,i=d&(1<<-l)-1,d>>=-l,l+=a;l>0;i=256*i+t[e+h],h+=f,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),i-=c}return(d?-1:1)*s*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var s,a,u,c=8*i-o-1,l=(1<<c)-1,h=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*u-1)*Math.pow(2,o),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;t[n+d]=255&a,d+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[n+d]=255&s,d+=p,s/=256,c-=8);t[n+d-p]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(function(e){var r=n(37).strict;t.exports=function(t){if(r(t)){var n=e.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(n=n.slice(t.byteOffset,t.byteOffset+t.byteLength)),n}return e.from(t)}}).call(this,n(21).Buffer)},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())},function(t,e,n){"use strict";var r=new RegExp("%[a-f0-9]{2}","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function i(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;e=e||1;var n=t.slice(0,e),r=t.slice(e);return Array.prototype.concat.call([],i(n),i(r))}function s(t){try{return decodeURIComponent(t)}catch(o){for(var e=t.match(r),n=1;n<e.length;n++)e=(t=i(e,n).join("")).match(r);return t}}t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=o.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch(t){var r=s(n[0]);r!==n[0]&&(e[n[0]]=r)}n=o.exec(t)}e["%C2"]="�";for(var i=Object.keys(e),a=0;a<i.length;a++){var u=i[a];t=t.replace(new RegExp(u,"g"),e[u])}return t}(t)}}},function(t,e,n){"use strict";t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}},function(t,e,n){"use strict";t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(t,e,n){var r=n(72),o=n(73),i=n(90),s=n(91);function a(t,e,n,i,s){var a=[].slice.call(arguments,1),u=a.length,c="function"==typeof a[u-1];if(!c&&!r())throw new Error("Callback required as last argument");if(!c){if(u<1)throw new Error("Too few arguments provided");return 1===u?(n=e,e=i=void 0):2!==u||e.getContext||(i=n,n=e,e=void 0),new Promise((function(r,s){try{var a=o.create(n,i);r(t(a,e,i))}catch(t){s(t)}}))}if(u<2)throw new Error("Too few arguments provided");2===u?(s=n,n=e,e=i=void 0):3===u&&(e.getContext&&void 0===s?(s=i,i=void 0):(s=i,i=n,n=e,e=void 0));try{var l=o.create(n,i);s(null,t(l,e,i))}catch(t){s(t)}}e.create=o.create,e.toCanvas=a.bind(null,i.render),e.toDataURL=a.bind(null,i.renderToDataURL),e.toString=a.bind(null,(function(t,e,n){return s.render(t,n)}))},function(t,e){t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},function(t,e,n){var r=n(12),o=n(8),i=n(23),s=n(74),a=n(75),u=n(76),c=n(77),l=n(78),h=n(46),f=n(79),d=n(82),p=n(83),g=n(9),m=n(84),v=n(22);function _(t,e,n){var r,o,i=t.size,s=p.getEncodedBits(e,n);for(r=0;r<15;r++)o=1==(s>>r&1),r<6?t.set(r,8,o,!0):r<8?t.set(r+1,8,o,!0):t.set(i-15+r,8,o,!0),r<8?t.set(8,i-r-1,o,!0):r<9?t.set(8,15-r-1+1,o,!0):t.set(8,15-r-1,o,!0);t.set(i-8,8,1,!0)}function y(t,e,n){var i=new s;n.forEach((function(e){i.put(e.mode.bit,4),i.put(e.getLength(),g.getCharCountIndicator(e.mode,t)),e.write(i)}));var a=8*(o.getSymbolTotalCodewords(t)-h.getTotalCodewordsCount(t,e));for(i.getLengthInBits()+4<=a&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);for(var u=(a-i.getLengthInBits())/8,c=0;c<u;c++)i.put(c%2?17:236,8);return function(t,e,n){for(var i=o.getSymbolTotalCodewords(e),s=h.getTotalCodewordsCount(e,n),a=i-s,u=h.getBlocksCount(e,n),c=u-i%u,l=Math.floor(i/u),d=Math.floor(a/u),p=d+1,g=l-d,m=new f(g),v=0,_=new Array(u),y=new Array(u),w=0,b=r.from(t.buffer),M=0;M<u;M++){var x=M<c?d:p;_[M]=b.slice(v,v+x),y[M]=m.encode(_[M]),v+=x,w=Math.max(w,x)}var E,R,S=r.alloc(i),T=0;for(E=0;E<w;E++)for(R=0;R<u;R++)E<_[R].length&&(S[T++]=_[R][E]);for(E=0;E<g;E++)for(R=0;R<u;R++)S[T++]=y[R][E];return S}(i,t,e)}function w(t,e,n,r){var i;if(v(t))i=m.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var s=e;if(!s){var h=m.rawSplit(t);s=d.getBestVersionForData(h,n)}i=m.fromString(t,s||40)}var f=d.getBestVersionForData(i,n);if(!f)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<f)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+f+".\n")}else e=f;var p=y(e,n,i),g=o.getSymbolSize(e),w=new a(g);return function(t,e){for(var n=t.size,r=c.getPositions(e),o=0;o<r.length;o++)for(var i=r[o][0],s=r[o][1],a=-1;a<=7;a++)if(!(i+a<=-1||n<=i+a))for(var u=-1;u<=7;u++)s+u<=-1||n<=s+u||(a>=0&&a<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===a||6===a)||a>=2&&a<=4&&u>=2&&u<=4?t.set(i+a,s+u,!0,!0):t.set(i+a,s+u,!1,!0))}(w,e),function(t){for(var e=t.size,n=8;n<e-8;n++){var r=n%2==0;t.set(n,6,r,!0),t.set(6,n,r,!0)}}(w),function(t,e){for(var n=u.getPositions(e),r=0;r<n.length;r++)for(var o=n[r][0],i=n[r][1],s=-2;s<=2;s++)for(var a=-2;a<=2;a++)-2===s||2===s||-2===a||2===a||0===s&&0===a?t.set(o+s,i+a,!0,!0):t.set(o+s,i+a,!1,!0)}(w,e),_(w,n,0),e>=7&&function(t,e){for(var n,r,o,i=t.size,s=d.getEncodedBits(e),a=0;a<18;a++)n=Math.floor(a/3),r=a%3+i-8-3,o=1==(s>>a&1),t.set(n,r,o,!0),t.set(r,n,o,!0)}(w,e),function(t,e){for(var n=t.size,r=-1,o=n-1,i=7,s=0,a=n-1;a>0;a-=2)for(6===a&&a--;;){for(var u=0;u<2;u++)if(!t.isReserved(o,a-u)){var c=!1;s<e.length&&(c=1==(e[s]>>>i&1)),t.set(o,a-u,c),-1===--i&&(s++,i=7)}if((o+=r)<0||n<=o){o-=r,r=-r;break}}}(w,p),isNaN(r)&&(r=l.getBestMask(w,_.bind(null,w,n))),l.applyMask(r,w),_(w,n,r),{modules:w,version:e,errorCorrectionLevel:n,maskPattern:r,segments:i}}e.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var n,r,s=i.M;return void 0!==e&&(s=i.from(e.errorCorrectionLevel,i.M),n=d.from(e.version),r=l.from(e.maskPattern),e.toSJISFunc&&o.setToSJISFunction(e.toSJISFunc)),w(t,n,s,r)}},function(t,e){function n(){this.buffer=[],this.length=0}n.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=n},function(t,e,n){var r=n(12);function o(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=r.alloc(t*t),this.reservedBit=r.alloc(t*t)}o.prototype.set=function(t,e,n,r){var o=t*this.size+e;this.data[o]=n,r&&(this.reservedBit[o]=!0)},o.prototype.get=function(t,e){return this.data[t*this.size+e]},o.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},o.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=o},function(t,e,n){var r=n(8).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,n=r(t),o=145===n?26:2*Math.ceil((n-13)/(2*e-2)),i=[n-7],s=1;s<e-1;s++)i[s]=i[s-1]-o;return i.push(6),i.reverse()},e.getPositions=function(t){for(var n=[],r=e.getRowColCoords(t),o=r.length,i=0;i<o;i++)for(var s=0;s<o;s++)0===i&&0===s||0===i&&s===o-1||i===o-1&&0===s||n.push([r[i],r[s]]);return n}},function(t,e,n){var r=n(8).getSymbolSize;e.getPositions=function(t){var e=r(t);return[[0,0],[e-7,0],[0,e-7]]}},function(t,e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var n=3,r=3,o=40,i=10;function s(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){for(var e=t.size,r=0,o=0,i=0,s=null,a=null,u=0;u<e;u++){o=i=0,s=a=null;for(var c=0;c<e;c++){var l=t.get(u,c);l===s?o++:(o>=5&&(r+=n+(o-5)),s=l,o=1),(l=t.get(c,u))===a?i++:(i>=5&&(r+=n+(i-5)),a=l,i=1)}o>=5&&(r+=n+(o-5)),i>=5&&(r+=n+(i-5))}return r},e.getPenaltyN2=function(t){for(var e=t.size,n=0,o=0;o<e-1;o++)for(var i=0;i<e-1;i++){var s=t.get(o,i)+t.get(o,i+1)+t.get(o+1,i)+t.get(o+1,i+1);4!==s&&0!==s||n++}return n*r},e.getPenaltyN3=function(t){for(var e=t.size,n=0,r=0,i=0,s=0;s<e;s++){r=i=0;for(var a=0;a<e;a++)r=r<<1&2047|t.get(s,a),a>=10&&(1488===r||93===r)&&n++,i=i<<1&2047|t.get(a,s),a>=10&&(1488===i||93===i)&&n++}return n*o},e.getPenaltyN4=function(t){for(var e=0,n=t.data.length,r=0;r<n;r++)e+=t.data[r];return Math.abs(Math.ceil(100*e/n/5)-10)*i},e.applyMask=function(t,e){for(var n=e.size,r=0;r<n;r++)for(var o=0;o<n;o++)e.isReserved(o,r)||e.xor(o,r,s(t,o,r))},e.getBestMask=function(t,n){for(var r=Object.keys(e.Patterns).length,o=0,i=1/0,s=0;s<r;s++){n(s),e.applyMask(s,t);var a=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(s,t),a<i&&(i=a,o=s)}return o}},function(t,e,n){var r=n(12),o=n(80),i=n(21).Buffer;function s(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}s.prototype.initialize=function(t){this.degree=t,this.genPoly=o.generateECPolynomial(this.degree)},s.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=r.alloc(this.degree),n=i.concat([t,e],t.length+this.degree),s=o.mod(n,this.genPoly),a=this.degree-s.length;if(a>0){var u=r.alloc(this.degree);return s.copy(u,a),u}return s},t.exports=s},function(t,e,n){var r=n(12),o=n(81);e.mul=function(t,e){for(var n=r.alloc(t.length+e.length-1),i=0;i<t.length;i++)for(var s=0;s<e.length;s++)n[i+s]^=o.mul(t[i],e[s]);return n},e.mod=function(t,e){for(var n=r.from(t);n.length-e.length>=0;){for(var i=n[0],s=0;s<e.length;s++)n[s]^=o.mul(e[s],i);for(var a=0;a<n.length&&0===n[a];)a++;n=n.slice(a)}return n},e.generateECPolynomial=function(t){for(var n=r.from([1]),i=0;i<t;i++)n=e.mul(n,[1,o.exp(i)]);return n}},function(t,e,n){var r=n(12),o=r.alloc(512),i=r.alloc(256);!function(){for(var t=1,e=0;e<255;e++)o[e]=t,i[t]=e,256&(t<<=1)&&(t^=285);for(e=255;e<512;e++)o[e]=o[e-255]}(),e.log=function(t){if(t<1)throw new Error("log("+t+")");return i[t]},e.exp=function(t){return o[t]},e.mul=function(t,e){return 0===t||0===e?0:o[i[t]+i[e]]}},function(t,e,n){var r=n(8),o=n(46),i=n(23),s=n(9),a=n(47),u=n(22),c=r.getBCHDigit(7973);function l(t,e){return s.getCharCountIndicator(t,e)+4}function h(t,e){var n=0;return t.forEach((function(t){var r=l(t.mode,e);n+=r+t.getBitsLength()})),n}e.from=function(t,e){return a.isValid(t)?parseInt(t,10):e},e.getCapacity=function(t,e,n){if(!a.isValid(t))throw new Error("Invalid QR Code version");void 0===n&&(n=s.BYTE);var i=8*(r.getSymbolTotalCodewords(t)-o.getTotalCodewordsCount(t,e));if(n===s.MIXED)return i;var u=i-l(n,t);switch(n){case s.NUMERIC:return Math.floor(u/10*3);case s.ALPHANUMERIC:return Math.floor(u/11*2);case s.KANJI:return Math.floor(u/13);case s.BYTE:default:return Math.floor(u/8)}},e.getBestVersionForData=function(t,n){var r,o=i.from(n,i.M);if(u(t)){if(t.length>1)return function(t,n){for(var r=1;r<=40;r++){if(h(t,r)<=e.getCapacity(r,n,s.MIXED))return r}}(t,o);if(0===t.length)return 1;r=t[0]}else r=t;return function(t,n,r){for(var o=1;o<=40;o++)if(n<=e.getCapacity(o,r,t))return o}(r.mode,r.getLength(),o)},e.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;r.getBCHDigit(e)-c>=0;)e^=7973<<r.getBCHDigit(e)-c;return t<<12|e}},function(t,e,n){var r=n(8),o=r.getBCHDigit(1335);e.getEncodedBits=function(t,e){for(var n=t.bit<<3|e,i=n<<10;r.getBCHDigit(i)-o>=0;)i^=1335<<r.getBCHDigit(i)-o;return 21522^(n<<10|i)}},function(t,e,n){var r=n(9),o=n(85),i=n(86),s=n(87),a=n(88),u=n(48),c=n(8),l=n(89);function h(t){return unescape(encodeURIComponent(t)).length}function f(t,e,n){for(var r,o=[];null!==(r=t.exec(n));)o.push({data:r[0],index:r.index,mode:e,length:r[0].length});return o}function d(t){var e,n,o=f(u.NUMERIC,r.NUMERIC,t),i=f(u.ALPHANUMERIC,r.ALPHANUMERIC,t);return c.isKanjiModeEnabled()?(e=f(u.BYTE,r.BYTE,t),n=f(u.KANJI,r.KANJI,t)):(e=f(u.BYTE_KANJI,r.BYTE,t),n=[]),o.concat(i,e,n).sort((function(t,e){return t.index-e.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function p(t,e){switch(e){case r.NUMERIC:return o.getBitsLength(t);case r.ALPHANUMERIC:return i.getBitsLength(t);case r.KANJI:return a.getBitsLength(t);case r.BYTE:return s.getBitsLength(t)}}function g(t,e){var n,u=r.getBestModeForData(t);if((n=r.from(e,u))!==r.BYTE&&n.bit<u.bit)throw new Error('"'+t+'" cannot be encoded with mode '+r.toString(n)+".\n Suggested mode is: "+r.toString(u));switch(n!==r.KANJI||c.isKanjiModeEnabled()||(n=r.BYTE),n){case r.NUMERIC:return new o(t);case r.ALPHANUMERIC:return new i(t);case r.KANJI:return new a(t);case r.BYTE:return new s(t)}}e.fromArray=function(t){return t.reduce((function(t,e){return"string"==typeof e?t.push(g(e,null)):e.data&&t.push(g(e.data,e.mode)),t}),[])},e.fromString=function(t,n){for(var o=function(t,e){for(var n={},o={start:{}},i=["start"],s=0;s<t.length;s++){for(var a=t[s],u=[],c=0;c<a.length;c++){var l=a[c],h=""+s+c;u.push(h),n[h]={node:l,lastCount:0},o[h]={};for(var f=0;f<i.length;f++){var d=i[f];n[d]&&n[d].node.mode===l.mode?(o[d][h]=p(n[d].lastCount+l.length,l.mode)-p(n[d].lastCount,l.mode),n[d].lastCount+=l.length):(n[d]&&(n[d].lastCount=l.length),o[d][h]=p(l.length,l.mode)+4+r.getCharCountIndicator(l.mode,e))}}i=u}for(f=0;f<i.length;f++)o[i[f]].end=0;return{map:o,table:n}}(function(t){for(var e=[],n=0;n<t.length;n++){var o=t[n];switch(o.mode){case r.NUMERIC:e.push([o,{data:o.data,mode:r.ALPHANUMERIC,length:o.length},{data:o.data,mode:r.BYTE,length:o.length}]);break;case r.ALPHANUMERIC:e.push([o,{data:o.data,mode:r.BYTE,length:o.length}]);break;case r.KANJI:e.push([o,{data:o.data,mode:r.BYTE,length:h(o.data)}]);break;case r.BYTE:e.push([{data:o.data,mode:r.BYTE,length:h(o.data)}])}}return e}(d(t,c.isKanjiModeEnabled())),n),i=l.find_path(o.map,"start","end"),s=[],a=1;a<i.length-1;a++)s.push(o.table[i[a]].node);return e.fromArray(function(t){return t.reduce((function(t,e){var n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)}),[])}(s))},e.rawSplit=function(t){return e.fromArray(d(t,c.isKanjiModeEnabled()))}},function(t,e,n){var r=n(9);function o(t){this.mode=r.NUMERIC,this.data=t.toString()}o.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){var e,n,r;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),r=parseInt(n,10),t.put(r,10);var o=this.data.length-e;o>0&&(n=this.data.substr(e),r=parseInt(n,10),t.put(r,3*o+1))},t.exports=o},function(t,e,n){var r=n(9),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(t){this.mode=r.ALPHANUMERIC,this.data=t}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e;for(e=0;e+2<=this.data.length;e+=2){var n=45*o.indexOf(this.data[e]);n+=o.indexOf(this.data[e+1]),t.put(n,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},t.exports=i},function(t,e,n){var r=n(12),o=n(9);function i(t){this.mode=o.BYTE,this.data=r.from(t)}i.getBitsLength=function(t){return 8*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){for(var e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)},t.exports=i},function(t,e,n){var r=n(9),o=n(8);function i(t){this.mode=r.KANJI,this.data=t}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e;for(e=0;e<this.data.length;e++){var n=o.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),t.put(n,13)}},t.exports=i},function(t,e,n){"use strict";var r={single_source_shortest_paths:function(t,e,n){var o={},i={};i[e]=0;var s,a,u,c,l,h,f,d=r.PriorityQueue.make();for(d.push(e,0);!d.empty();)for(u in a=(s=d.pop()).value,c=s.cost,l=t[a]||{})l.hasOwnProperty(u)&&(h=c+l[u],f=i[u],(void 0===i[u]||f>h)&&(i[u]=h,d.push(u,h),o[u]=a));if(void 0!==n&&void 0===i[n]){var p=["Could not find a path from ",e," to ",n,"."].join("");throw new Error(p)}return o},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],r=e;r;)n.push(r),t[r],r=t[r];return n.reverse(),n},find_path:function(t,e,n){var o=r.single_source_shortest_paths(t,e,n);return r.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(t){var e,n=r.PriorityQueue,o={};for(e in t=t||{},n)n.hasOwnProperty(e)&&(o[e]=n[e]);return o.queue=[],o.sorter=t.sorter||n.default_sorter,o},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=r},function(t,e,n){var r=n(49);e.render=function(t,e,n){var o=n,i=e;void 0!==o||e&&e.getContext||(o=e,e=void 0),e||(i=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),o=r.getOptions(o);var s=r.getImageWidth(t.modules.size,o),a=i.getContext("2d"),u=a.createImageData(s,s);return r.qrToImageData(u.data,t,o),function(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+"px",e.style.width=n+"px"}(a,i,s),a.putImageData(u,0,0),i},e.renderToDataURL=function(t,n,r){var o=r;void 0!==o||n&&n.getContext||(o=n,n=void 0),o||(o={});var i=e.render(t,n,o),s=o.type||"image/png",a=o.rendererOpts||{};return i.toDataURL(s,a.quality)}},function(t,e,n){var r=n(49);function o(t,e){var n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function i(t,e,n){var r=t+e;return void 0!==n&&(r+=" "+n),r}e.render=function(t,e,n){var s=r.getOptions(e),a=t.modules.size,u=t.modules.data,c=a+2*s.margin,l=s.color.light.a?"<path "+o(s.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",h="<path "+o(s.color.dark,"stroke")+' d="'+function(t,e,n){for(var r="",o=0,s=!1,a=0,u=0;u<t.length;u++){var c=Math.floor(u%e),l=Math.floor(u/e);c||s||(s=!0),t[u]?(a++,u>0&&c>0&&t[u-1]||(r+=s?i("M",c+n,.5+l+n):i("m",o,0),o=0,s=!1),c+1<e&&t[u+1]||(r+=i("h",a),a=0)):o++}return r}(u,a,s.margin)+'"/>',f='viewBox="0 0 '+c+" "+c+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+f+' shape-rendering="crispEdges">'+l+h+"</svg>\n";return"function"==typeof n&&n(null,d),d}},function(t,e,n){"use strict";var r=n(93),o={"text/plain":"Text","text/html":"Url",default:"Text"};t.exports=function(t,e){var n,i,s,a,u,c,l=!1;e||(e={}),n=e.debug||!1;try{if(s=r(),a=document.createRange(),u=document.getSelection(),(c=document.createElement("span")).textContent=t,c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(r){if(r.stopPropagation(),e.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=o[e.format]||o.default;window.clipboardData.setData(i,t)}else r.clipboardData.clearData(),r.clipboardData.setData(e.format,t);e.onCopy&&(r.preventDefault(),e.onCopy(r.clipboardData))})),document.body.appendChild(c),a.selectNodeContents(c),u.addRange(a),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),l=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),i=function(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}("message"in e?e.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,t)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(a):u.removeAllRanges()),c&&document.body.removeChild(c),s()}return l}},function(t,e){t.exports=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,n=[],r=0;r<t.rangeCount;r++)n.push(t.getRangeAt(r));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null}return t.removeAllRanges(),function(){"Caret"===t.type&&t.removeAllRanges(),t.rangeCount||n.forEach((function(e){t.addRange(e)})),e&&e.focus()}}},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"generateKey",(function(){return g})),n.d(r,"verifyHmac",(function(){return m})),n.d(r,"encrypt",(function(){return v})),n.d(r,"decrypt",(function(){return _}));var o=n(25),i=n.n(o),s=n(1),a=n(53);var u=class{constructor(){this._eventEmitters=[]}subscribe(t){this._eventEmitters.push(t)}unsubscribe(t){this._eventEmitters=this._eventEmitters.filter(e=>e.event!==t)}trigger(t){let e,n=[];e=Object(s.isJsonRpcRequest)(t)?t.method:Object(s.isJsonRpcResponseSuccess)(t)||Object(s.isJsonRpcResponseError)(t)?"response:"+t.id:Object(s.isInternalEvent)(t)?t.event:"",e&&(n=this._eventEmitters.filter(t=>t.event===e)),n&&n.length||Object(s.isReservedEvent)(e)||Object(s.isInternalEvent)(e)||(n=this._eventEmitters.filter(t=>"call_request"===t.event)),n.forEach(e=>{if(Object(s.isJsonRpcResponseError)(t)){const n=new Error(t.error.message);e.callback(n,null)}else e.callback(null,t)})}};var c=class{constructor(t="walletconnect"){this.storageId=t}getSession(){let t=null;const e=Object(s.getLocal)(this.storageId);return e&&Object(s.isWalletConnectSession)(e)&&(t=e),t}setSession(t){return Object(s.setLocal)(this.storageId,t),t}removeSession(){Object(s.removeLocal)(this.storageId)}};const l="abcdefghijklmnopqrstuvwxyz0123456789".split("").map(t=>`https://${t}.bridge.walletconnect.org`);function h(){return l[Math.floor(Math.random()*l.length)]}var f=class{constructor(t){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new u,this._clientMeta=Object(s.getClientMeta)()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new c(t.connectorOpts.storageId),this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,this._signingMethods=[...s.signingMethods,...t.connectorOpts.signingMethods||[]],!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw new Error("Missing one of the required parameters: bridge / uri / session");var e;t.connectorOpts.bridge&&(this.bridge=function(t){return"walletconnect.org"===function(t){return function(t){let e=t.indexOf("//")>-1?t.split("/")[2]:t.split("/")[0];return e=e.split(":")[0],e=e.split("?")[0],e}(t).split(".").slice(-2).join(".")}(t)}(e=t.connectorOpts.bridge)?h():e),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);const n=t.connectorOpts.session||this._getStorageSession();n&&(this.session=n),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new a.a({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}set bridge(t){t&&(this._bridge=t)}get bridge(){return this._bridge}set key(t){if(!t)return;const e=Object(s.convertHexToArrayBuffer)(t);this._key=e}get key(){if(this._key){return Object(s.convertArrayBufferToHex)(this._key,!0)}return""}set clientId(t){t&&(this._clientId=t)}get clientId(){let t=this._clientId;return t||(t=this._clientId=Object(s.uuid)()),this._clientId}set peerId(t){t&&(this._peerId=t)}get peerId(){return this._peerId}set clientMeta(t){}get clientMeta(){let t=this._clientMeta;return t||(t=this._clientMeta=Object(s.getClientMeta)()),t}set peerMeta(t){this._peerMeta=t}get peerMeta(){return this._peerMeta}set handshakeTopic(t){t&&(this._handshakeTopic=t)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(t){t&&(this._handshakeId=t)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(t){if(!t)return;const{handshakeTopic:e,bridge:n,key:r}=this._parseUri(t);this.handshakeTopic=e,this.bridge=n,this.key=r}set chainId(t){this._chainId=t}get chainId(){return this._chainId}set networkId(t){this._networkId=t}get networkId(){return this._networkId}set accounts(t){this._accounts=t}get accounts(){return this._accounts}set rpcUrl(t){this._rpcUrl=t}get rpcUrl(){return this._rpcUrl}set connected(t){}get connected(){return this._connected}set pending(t){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(t){t&&(this._connected=t.connected,this.accounts=t.accounts,this.chainId=t.chainId,this.bridge=t.bridge,this.key=t.key,this.clientId=t.clientId,this.clientMeta=t.clientMeta,this.peerId=t.peerId,this.peerMeta=t.peerMeta,this.handshakeId=t.handshakeId,this.handshakeTopic=t.handshakeTopic)}on(t,e){const n={event:t,callback:e};this._eventManager.subscribe(n)}off(t){this._eventManager.unsubscribe(t)}async createInstantRequest(t){this._key=await this._generateKey();const e=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(t)}]});this.handshakeId=e.id,this.handshakeTopic=Object(s.uuid)(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",()=>{throw new Error("User close QRCode Modal")});const n=()=>{this.killSession()};try{const t=await this._sendCallRequest(e);return t&&n(),t}catch(t){throw n(),t}}async connect(t){if(!this._qrcodeModal)throw new Error("QRCode Modal not provided");return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(t),new Promise(async(t,e)=>{this.on("modal_closed",()=>e(new Error("User close QRCode Modal"))),this.on("connect",(n,r)=>{if(n)return e(n);t(r.params[0])})}))}async createSession(t){if(this._connected)throw new Error("Session currently connected");if(this.pending)return;this._key=await this._generateKey();const e=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:t&&t.chainId?t.chainId:null}]});this.handshakeId=e.id,this.handshakeTopic=Object(s.uuid)(),this._sendSessionRequest(e,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(t){if(this._connected)throw new Error("Session currently connected");this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";const e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},n={id:this.handshakeId,jsonrpc:"2.0",result:e};this._sendResponse(n),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(t){if(this._connected)throw new Error("Session currently connected");const e=t&&t.message?t.message:"Session Rejected",n=this._formatResponse({id:this.handshakeId,error:{message:e}});this._sendResponse(n),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:e}]}),this._removeStorageSession()}updateSession(t){if(!this._connected)throw new Error("Session currently disconnected");this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";const e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},n=this._formatRequest({method:"wc_sessionUpdate",params:[e]});this._sendSessionRequest(n,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(t){const e=t?t.message:"Session Disconnected",n=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]});await this._sendRequest(n),this._handleSessionDisconnect(e)}async sendTransaction(t){if(!this._connected)throw new Error("Session currently disconnected");const e=Object(s.parseTransactionData)(t),n=this._formatRequest({method:"eth_sendTransaction",params:[e]});return await this._sendCallRequest(n)}async signTransaction(t){if(!this._connected)throw new Error("Session currently disconnected");const e=Object(s.parseTransactionData)(t),n=this._formatRequest({method:"eth_signTransaction",params:[e]});return await this._sendCallRequest(n)}async signMessage(t){if(!this._connected)throw new Error("Session currently disconnected");const e=this._formatRequest({method:"eth_sign",params:t});return await this._sendCallRequest(e)}async signPersonalMessage(t){if(!this._connected)throw new Error("Session currently disconnected");t=Object(s.parsePersonalSign)(t);const e=this._formatRequest({method:"personal_sign",params:t});return await this._sendCallRequest(e)}async signTypedData(t){if(!this._connected)throw new Error("Session currently disconnected");const e=this._formatRequest({method:"eth_signTypedData",params:t});return await this._sendCallRequest(e)}async updateChain(t){if(!this._connected)throw new Error("Session currently disconnected");const e=this._formatRequest({method:"wallet_updateChain",params:[t]});return await this._sendCallRequest(e)}unsafeSend(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),new Promise((e,n)=>{this._subscribeToResponse(t.id,(t,r)=>{if(t)n(t);else{if(!r)throw new Error("Missing JSON RPC response");e(r)}})})}async sendCustomRequest(t,e){if(!this._connected)throw new Error("Session currently disconnected");switch(t.method){case"eth_accounts":return this.accounts;case"eth_chainId":return Object(s.convertNumberToHex)(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":t.params&&(t.params[0]=Object(s.parseTransactionData)(t.params[0]));break;case"personal_sign":t.params&&(t.params=Object(s.parsePersonalSign)(t.params))}const n=this._formatRequest(t);return await this._sendCallRequest(n,e)}approveRequest(t){if(!Object(s.isJsonRpcResponseSuccess)(t))throw new Error('JSON-RPC success response must include "result" field');{const e=this._formatResponse(t);this._sendResponse(e)}}rejectRequest(t){if(!Object(s.isJsonRpcResponseError)(t))throw new Error('JSON-RPC error response must include "error" field');{const e=this._formatResponse(t);this._sendResponse(e)}}transportClose(){this._transport.close()}async _sendRequest(t,e){const n=this._formatRequest(t),r=await this._encrypt(n),o=void 0!==(null==e?void 0:e.topic)?e.topic:this.peerId,i=JSON.stringify(r),a=void 0!==(null==e?void 0:e.forcePushNotification)?!e.forcePushNotification:Object(s.isSilentPayload)(n);this._transport.send(i,o,a)}async _sendResponse(t){const e=await this._encrypt(t),n=this.peerId,r=JSON.stringify(e);this._transport.send(r,n,!0)}async _sendSessionRequest(t,e,n){this._sendRequest(t,n),this._subscribeToSessionResponse(t.id,e)}_sendCallRequest(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),this._subscribeToCallResponse(t.id)}_formatRequest(t){if(void 0===t.method)throw new Error('JSON RPC request must have valid "method" value');return{id:void 0===t.id?Object(s.payloadId)():t.id,jsonrpc:"2.0",method:t.method,params:void 0===t.params?[]:t.params}}_formatResponse(t){if(void 0===t.id)throw new Error('JSON RPC request must have valid "id" value');const e={id:t.id,jsonrpc:"2.0"};if(Object(s.isJsonRpcResponseError)(t)){const n=Object(s.formatRpcError)(t.error);return Object.assign(Object.assign(Object.assign({},e),t),{error:n})}if(Object(s.isJsonRpcResponseSuccess)(t)){return Object.assign(Object.assign({},e),t)}throw new Error("JSON RPC response format is invalid")}_handleSessionDisconnect(t){const e=t||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),Object(s.removeLocal)(s.mobileLinkChoiceKey)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:e}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(t,e){e&&e.approved?(this._connected?(e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),e.peerId&&!this.peerId&&(this.peerId=e.peerId),e.peerMeta&&!this.peerMeta&&(this.peerMeta=e.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(t)}async _handleIncomingMessages(t){if(![this.clientId,this.handshakeTopic].includes(t.topic))return;let e;try{e=JSON.parse(t.payload)}catch(t){return}const n=await this._decrypt(e);n&&this._eventManager.trigger(n)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(t,e){this.on("response:"+t,e)}_subscribeToSessionResponse(t,e){this._subscribeToResponse(t,(t,n)=>{t?this._handleSessionResponse(t.message):n.result?this._handleSessionResponse(e,n.result):n.error&&n.error.message?this._handleSessionResponse(n.error.message):this._handleSessionResponse(e)})}_subscribeToCallResponse(t){return new Promise((e,n)=>{this._subscribeToResponse(t,(t,r)=>{t?n(t):r.result?e(r.result):r.error&&r.error.message?n(new Error(r.error.message)):n(new Error("JSON RPC response format is invalid"))})})}_subscribeToInternalEvents(){this.on("display_uri",()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,()=>{this._eventManager.trigger({event:"modal_closed",params:[]})},this._qrcodeModalOptions)}),this.on("connect",()=>{this._qrcodeModal&&this._qrcodeModal.close()}),this.on("call_request_sent",(t,e)=>{const{request:n}=e.params[0];if(Object(s.isMobile)()&&this._signingMethods.includes(n.method)){const t=Object(s.getLocal)(s.mobileLinkChoiceKey);t&&(window.location.href=t.href)}}),this.on("wc_sessionRequest",(t,e)=>{t&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),this.handshakeId=e.id,this.peerId=e.params[0].peerId,this.peerMeta=e.params[0].peerMeta;const n=Object.assign(Object.assign({},e),{method:"session_request"});this._eventManager.trigger(n)}),this.on("wc_sessionUpdate",(t,e)=>{t&&this._handleSessionResponse(t.message),this._handleSessionResponse("Session disconnected",e.params[0])})}_initTransport(){this._transport.on("message",t=>this._handleIncomingMessages(t)),this._transport.on("open",()=>this._eventManager.trigger({event:"transport_open",params:[]})),this._transport.on("close",()=>this._eventManager.trigger({event:"transport_close",params:[]})),this._transport.on("error",()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})),this._transport.open()}_formatUri(){return`${this.protocol}:${this.handshakeTopic}@${this.version}?bridge=${encodeURIComponent(this.bridge)}&key=${this.key}`}_parseUri(t){const e=Object(s.parseWalletConnectUri)(t);if(e.protocol===this.protocol){if(!e.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const t=e.handshakeTopic;if(!e.bridge)throw Error("Invalid or missing bridge url parameter value");const n=decodeURIComponent(e.bridge);if(!e.key)throw Error("Invalid or missing key parameter value");return{handshakeTopic:t,bridge:n,key:e.key}}throw new Error("URI format is invalid")}async _generateKey(){if(this._cryptoLib){return await this._cryptoLib.generateKey()}return null}async _encrypt(t){const e=this._key;if(this._cryptoLib&&e){return await this._cryptoLib.encrypt(t,e)}return null}async _decrypt(t){const e=this._key;if(this._cryptoLib&&e){return await this._cryptoLib.decrypt(t,e)}return null}_getStorageSession(){let t=null;return this._sessionStorage&&(t=this._sessionStorage.getSession()),t}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(t){if(!t.url||"string"!=typeof t.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!t.type||"string"!=typeof t.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!t.token||"string"!=typeof t.token)throw Error("Invalid or missing pushServerOpts.token parameter value");const e={bridge:this.bridge,topic:this.clientId,type:t.type,token:t.token,peerName:"",language:t.language||""};this.on("connect",async(n,r)=>{if(n)throw n;if(t.peerMeta){const t=r.params[0].peerMeta.name;e.peerName=t}try{const n=await fetch(t.url+"/new",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)});if(!(await n.json()).success)throw Error("Failed to register in Push Server")}catch(n){throw Error("Failed to register in Push Server")}})}},d=n(13),p=n(0);async function g(t){const e=(t||256)/8,n=d.randomBytes(e);return Object(s.convertBufferToArrayBuffer)(p.arrayToBuffer(n))}async function m(t,e){const n=p.hexToArray(t.data),r=p.hexToArray(t.iv),o=p.hexToArray(t.hmac),i=p.arrayToHex(o,!1),s=p.concatArrays(n,r),a=await d.hmacSha256Sign(e,s),u=p.arrayToHex(a,!1);return p.removeHexPrefix(i)===p.removeHexPrefix(u)}async function v(t,e,n){const r=p.bufferToArray(Object(s.convertArrayBufferToBuffer)(e)),o=n||await g(128),i=p.bufferToArray(Object(s.convertArrayBufferToBuffer)(o)),a=p.arrayToHex(i,!1),u=JSON.stringify(t),c=p.utf8ToArray(u),l=await d.aesCbcEncrypt(i,r,c),h=p.arrayToHex(l,!1),f=p.concatArrays(l,i),m=await d.hmacSha256Sign(r,f);return{data:h,hmac:p.arrayToHex(m,!1),iv:a}}async function _(t,e){const n=p.bufferToArray(Object(s.convertArrayBufferToBuffer)(e));if(!n)throw new Error("Missing key: required for decryption");if(!await m(t,n))return null;const r=p.hexToArray(t.data),o=p.hexToArray(t.iv),i=await d.aesCbcDecrypt(o,n,r),a=p.arrayToUtf8(i);let u;try{u=JSON.parse(a)}catch(t){return null}return u}var y=class extends f{constructor(t,e){super({cryptoLib:r,connectorOpts:t,pushServerOpts:e})}},w=n(55),b=n.n(w),M=n(19),x=n(5);n.d(e,"SignerConnection",(function(){return E}));class E extends M.IJsonRpcConnection{constructor(t){super(),this.events=new i.a,this.accounts=[],this.chainId=1,this.pending=!1,this.bridge="https://bridge.walletconnect.org",this.qrcode=!0,this.qrcodeModalOptions=void 0,this.opts=t,this.chainId=(null==t?void 0:t.chainId)||this.chainId,this.wc=this.register(t)}get connected(){return void 0!==this.wc&&this.wc.connected}get connecting(){return this.pending}get connector(){return this.wc=this.register(this.opts),this.wc}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async open(t){if(!this.connected)return new Promise((e,n)=>{this.on("error",t=>{n(t)}),this.on("open",()=>{e()}),this.create(t)});this.onOpen()}async close(){void 0!==this.wc&&(this.wc.connected&&this.wc.killSession(),this.onClose())}async send(t){this.wc=this.register(this.opts),this.connected||await this.open(),this.sendPayload(t).then(t=>this.events.emit("payload",t)).catch(e=>this.events.emit("payload",Object(x.formatJsonRpcError)(t.id,e.message)))}register(t){if(this.wc)return this.wc;this.opts=t||this.opts,this.bridge=(null==t?void 0:t.connector)?t.connector.bridge:(null==t?void 0:t.bridge)||"https://bridge.walletconnect.org",this.qrcode=void 0===(null==t?void 0:t.qrcode)||!1!==t.qrcode,this.chainId=void 0!==(null==t?void 0:t.chainId)?t.chainId:this.chainId,this.qrcodeModalOptions=null==t?void 0:t.qrcodeModalOptions;const e={bridge:this.bridge,qrcodeModal:this.qrcode?b.a:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:null==t?void 0:t.storageId,signingMethods:null==t?void 0:t.signingMethods,clientMeta:null==t?void 0:t.clientMeta};if(this.wc=void 0!==(null==t?void 0:t.connector)?t.connector:new y(e),void 0===this.wc)throw new Error("Failed to register WalletConnect connector");return this.wc.accounts.length&&(this.accounts=this.wc.accounts),this.wc.chainId&&(this.chainId=this.wc.chainId),this.registerConnectorEvents(),this.wc}onOpen(t){this.pending=!1,t&&(this.wc=t),this.events.emit("open")}onClose(){this.pending=!1,this.wc&&(this.wc=void 0),this.events.emit("close")}onError(t,e="Failed or Rejected Request",n=-32e3){const r={id:t.id,jsonrpc:t.jsonrpc,error:{code:n,message:e}};return this.events.emit("payload",r),r}create(t){this.wc=this.register(this.opts),this.chainId=t||this.chainId,this.connected||this.pending||(this.pending=!0,this.registerConnectorEvents(),this.wc.createSession({chainId:this.chainId}).then(()=>this.events.emit("created")).catch(t=>this.events.emit("error",t)))}registerConnectorEvents(){this.wc=this.register(this.opts),this.wc.on("connect",t=>{var e,n;t?this.events.emit("error",t):(this.accounts=(null===(e=this.wc)||void 0===e?void 0:e.accounts)||[],this.chainId=(null===(n=this.wc)||void 0===n?void 0:n.chainId)||this.chainId,this.onOpen())}),this.wc.on("disconnect",t=>{t?this.events.emit("error",t):this.onClose()}),this.wc.on("modal_closed",()=>{this.events.emit("error",new Error("User closed modal"))}),this.wc.on("session_update",(t,e)=>{const{accounts:n,chainId:r}=e.params[0];(!this.accounts||n&&this.accounts!==n)&&(this.accounts=n,this.events.emit("accountsChanged",n)),(!this.chainId||r&&this.chainId!==r)&&(this.chainId=r,this.events.emit("chainChanged",r))})}async sendPayload(t){this.wc=this.register(this.opts);try{const e=await this.wc.unsafeSend(t);return this.sanitizeResponse(e)}catch(e){return this.onError(t,e.message)}}sanitizeResponse(t){return void 0!==t.error&&void 0===t.error.code?Object(x.formatJsonRpcError)(t.id,t.error.message):t}}e.default=E},function(t,e,n){"use strict";n.r(e);var r,o,i,s,a,u,c,l={},h=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function d(t,e){for(var n in e)t[n]=e[n];return t}function p(t){var e=t.parentNode;e&&e.removeChild(t)}function g(t,e,n){var r,o=arguments,i={};for(r in e)"key"!==r&&"ref"!==r&&(i[r]=e[r]);if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(o[r]);if(null!=n&&(i.children=n),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===i[r]&&(i[r]=t.defaultProps[r]);return m(t,i,e&&e.key,e&&e.ref,null)}function m(t,e,n,o,i){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i};return null==i&&(s.__v=s),r.vnode&&r.vnode(s),s}function v(){return{}}function _(t){return t.children}function y(t,e){this.props=t,this.context=e}function w(t,e){if(null==e)return t.__?w(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?w(t):null}function b(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return b(t)}}function M(t){(!t.__d&&(t.__d=!0)&&o.push(t)&&!i++||a!==r.debounceRendering)&&((a=r.debounceRendering)||s)(x)}function x(){for(var t;i=o.length;)t=o.sort((function(t,e){return t.__v.__b-e.__v.__b})),o=[],t.some((function(t){var e,n,r,o,i,s,a;t.__d&&(s=(i=(e=t).__v).__e,(a=e.__P)&&(n=[],(r=d({},i)).__v=r,o=k(a,i,r,e.__n,void 0!==a.ownerSVGElement,null,n,null==s?w(i):s),C(n,i),o!=s&&b(i)))}))}function E(t,e,n,r,o,i,s,a,u){var c,f,d,g,m,v,_,y=n&&n.__k||h,b=y.length;if(a==l&&(a=null!=i?i[0]:b?w(n,0):null),c=0,e.__k=R(e.__k,(function(n){if(null!=n){if(n.__=e,n.__b=e.__b+1,null===(d=y[c])||d&&n.key==d.key&&n.type===d.type)y[c]=void 0;else for(f=0;f<b;f++){if((d=y[f])&&n.key==d.key&&n.type===d.type){y[f]=void 0;break}d=null}if(g=k(t,n,d=d||l,r,o,i,s,a,u),(f=n.ref)&&d.ref!=f&&(_||(_=[]),d.ref&&_.push(d.ref,null,n),_.push(f,n.__c||g,n)),null!=g){var h;if(null==v&&(v=g),void 0!==n.__d)h=n.__d,n.__d=void 0;else if(i==d||g!=a||null==g.parentNode){t:if(null==a||a.parentNode!==t)t.appendChild(g),h=null;else{for(m=a,f=0;(m=m.nextSibling)&&f<b;f+=2)if(m==g)break t;t.insertBefore(g,a),h=a}"option"==e.type&&(t.value="")}a=void 0!==h?h:g.nextSibling,"function"==typeof e.type&&(e.__d=a)}else a&&d.__e==a&&a.parentNode!=t&&(a=w(d))}return c++,n})),e.__e=v,null!=i&&"function"!=typeof e.type)for(c=i.length;c--;)null!=i[c]&&p(i[c]);for(c=b;c--;)null!=y[c]&&P(y[c],y[c]);if(_)for(c=0;c<_.length;c++)I(_[c],_[++c],_[++c])}function R(t,e,n){if(null==n&&(n=[]),null==t||"boolean"==typeof t)e&&n.push(e(null));else if(Array.isArray(t))for(var r=0;r<t.length;r++)R(t[r],e,n);else n.push(e?e("string"==typeof t||"number"==typeof t?m(null,t,null,null,t):null!=t.__e||null!=t.__c?m(t.type,t.props,t.key,null,t.__v):t):t);return n}function S(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]="number"==typeof n&&!1===f.test(e)?n+"px":null==n?"":n}function T(t,e,n,r,o){var i,s,a,u,c;if(o?"className"===e&&(e="class"):"class"===e&&(e="className"),"style"===e)if(i=t.style,"string"==typeof n)i.cssText=n;else{if("string"==typeof r&&(i.cssText="",r=null),r)for(u in r)n&&u in n||S(i,u,"");if(n)for(c in n)r&&n[c]===r[c]||S(i,c,n[c])}else"o"===e[0]&&"n"===e[1]?(s=e!==(e=e.replace(/Capture$/,"")),a=e.toLowerCase(),e=(a in t?a:e).slice(2),n?(r||t.addEventListener(e,A,s),(t.l||(t.l={}))[e]=n):t.removeEventListener(e,A,s)):"list"!==e&&"tagName"!==e&&"form"!==e&&"type"!==e&&"size"!==e&&!o&&e in t?t[e]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==e&&(e!==(e=e.replace(/^xlink:?/,""))?null==n||!1===n?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),n):null==n||!1===n&&!/^ar/.test(e)?t.removeAttribute(e):t.setAttribute(e,n))}function A(t){this.l[t.type](r.event?r.event(t):t)}function k(t,e,n,o,i,s,a,u,c){var l,h,f,p,g,m,v,w,b,M,x=e.type;if(void 0!==e.constructor)return null;(l=r.__b)&&l(e);try{t:if("function"==typeof x){if(w=e.props,b=(l=x.contextType)&&o[l.__c],M=l?b?b.props.value:l.__:o,n.__c?v=(h=e.__c=n.__c).__=h.__E:("prototype"in x&&x.prototype.render?e.__c=h=new x(w,M):(e.__c=h=new y(w,M),h.constructor=x,h.render=B),b&&b.sub(h),h.props=w,h.state||(h.state={}),h.context=M,h.__n=o,f=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=x.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,x.getDerivedStateFromProps(w,h.__s))),p=h.props,g=h.state,f)null==x.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==x.getDerivedStateFromProps&&w!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(w,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(w,h.__s,M)||e.__v===n.__v&&!h.__){for(h.props=w,h.state=h.__s,e.__v!==n.__v&&(h.__d=!1),h.__v=e,e.__e=n.__e,e.__k=n.__k,h.__h.length&&a.push(h),l=0;l<e.__k.length;l++)e.__k[l]&&(e.__k[l].__=e);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(w,h.__s,M),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(p,g,m)}))}h.context=M,h.props=w,h.state=h.__s,(l=r.__r)&&l(e),h.__d=!1,h.__v=e,h.__P=t,l=h.render(h.props,h.state,h.context),e.__k=null!=l&&l.type==_&&null==l.key?l.props.children:Array.isArray(l)?l:[l],null!=h.getChildContext&&(o=d(d({},o),h.getChildContext())),f||null==h.getSnapshotBeforeUpdate||(m=h.getSnapshotBeforeUpdate(p,g)),E(t,e,n,o,i,s,a,u,c),h.base=e.__e,h.__h.length&&a.push(h),v&&(h.__E=h.__=null),h.__e=!1}else null==s&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=O(n.__e,e,n,o,i,s,a,c);(l=r.diffed)&&l(e)}catch(t){e.__v=null,r.__e(t,e,n)}return e.__e}function C(t,e){r.__c&&r.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){r.__e(t,e.__v)}}))}function O(t,e,n,r,o,i,s,a){var u,c,f,d,p,g=n.props,m=e.props;if(o="svg"===e.type||o,null!=i)for(u=0;u<i.length;u++)if(null!=(c=i[u])&&((null===e.type?3===c.nodeType:c.localName===e.type)||t==c)){t=c,i[u]=null;break}if(null==t){if(null===e.type)return document.createTextNode(m);t=o?document.createElementNS("http://www.w3.org/2000/svg",e.type):document.createElement(e.type,m.is&&{is:m.is}),i=null,a=!1}if(null===e.type)g!==m&&t.data!=m&&(t.data=m);else{if(null!=i&&(i=h.slice.call(t.childNodes)),f=(g=n.props||l).dangerouslySetInnerHTML,d=m.dangerouslySetInnerHTML,!a){if(g===l)for(g={},p=0;p<t.attributes.length;p++)g[t.attributes[p].name]=t.attributes[p].value;(d||f)&&(d&&f&&d.__html==f.__html||(t.innerHTML=d&&d.__html||""))}(function(t,e,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in e||T(t,i,null,n[i],r);for(i in e)o&&"function"!=typeof e[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===e[i]||T(t,i,e[i],n[i],r)})(t,m,g,o,a),d?e.__k=[]:(e.__k=e.props.children,E(t,e,n,r,"foreignObject"!==e.type&&o,i,s,l,a)),a||("value"in m&&void 0!==(u=m.value)&&u!==t.value&&T(t,"value",u,g.value,!1),"checked"in m&&void 0!==(u=m.checked)&&u!==t.checked&&T(t,"checked",u,g.checked,!1))}return t}function I(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){r.__e(t,n)}}function P(t,e,n){var o,i,s;if(r.unmount&&r.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||I(o,null,e)),n||"function"==typeof t.type||(n=null!=(i=t.__e)),t.__e=t.__d=void 0,null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){r.__e(t,e)}o.base=o.__P=null}if(o=t.__k)for(s=0;s<o.length;s++)o[s]&&P(o[s],e,n);null!=i&&p(i)}function B(t,e,n){return this.constructor(t,n)}function L(t,e,n){var o,i,s;r.__&&r.__(t,e),i=(o=n===u)?null:n&&n.__k||e.__k,t=g(_,null,[t]),s=[],k(e,(o?e:n||e).__k=t,i||l,l,void 0!==e.ownerSVGElement,n&&!o?[n]:i?null:h.slice.call(e.childNodes),s,n||l,o),C(s,t)}function N(t,e){L(t,e,u)}function U(t,e){var n,r;for(r in e=d(d({},t.props),e),arguments.length>2&&(e.children=h.slice.call(arguments,2)),n={},e)"key"!==r&&"ref"!==r&&(n[r]=e[r]);return m(t.type,n,e.key||t.key,e.ref||t.ref,null)}function j(t){var e={},n={__c:"__cC"+c++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var r,o=this;return this.getChildContext||(r=[],this.getChildContext=function(){return e[n.__c]=o,e},this.shouldComponentUpdate=function(t){o.props.value!==t.value&&r.some((function(e){e.context=t.value,M(e)}))},this.sub=function(t){r.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r.splice(r.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Consumer.contextType=n,n.Provider.__=n,n}r={__e:function(t,e){for(var n,r;e=e.__;)if((n=e.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError&&(r=!0,n.setState(n.constructor.getDerivedStateFromError(t))),null!=n.componentDidCatch&&(r=!0,n.componentDidCatch(t)),r)return M(n.__E=n)}catch(e){t=e}throw t}},y.prototype.setState=function(t,e){var n;n=this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof t&&(t=t(n,this.props)),t&&d(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),M(this))},y.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),M(this))},y.prototype.render=_,o=[],i=0,s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=l,c=0;var q,D,H,J=0,F=[],z=r.__r,W=r.diffed,Y=r.__c,$=r.unmount;function V(t,e){r.__h&&r.__h(D,t,J||e),J=0;var n=D.__H||(D.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function K(t){return J=1,Q(lt,t)}function Q(t,e,n){var r=V(q++,2);return r.__c||(r.__c=D,r.__=[n?n(e):lt(void 0,e),function(e){var n=t(r.__[0],e);r.__[0]!==n&&(r.__[0]=n,r.__c.setState({}))}]),r.__}function Z(t,e){var n=V(q++,3);!r.__s&&ct(n.__H,e)&&(n.__=t,n.__H=e,D.__H.__h.push(n))}function X(t,e){var n=V(q++,4);!r.__s&&ct(n.__H,e)&&(n.__=t,n.__H=e,D.__h.push(n))}function G(t){return J=5,et((function(){return{current:t}}),[])}function tt(t,e,n){J=6,X((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==n?n:n.concat(t))}function et(t,e){var n=V(q++,7);return ct(n.__H,e)?(n.__H=e,n.__h=t,n.__=t()):n.__}function nt(t,e){return J=8,et((function(){return t}),e)}function rt(t){var e=D.context[t.__c],n=V(q++,9);return n.__c=t,e?(null==n.__&&(n.__=!0,e.sub(D)),e.props.value):t.__}function ot(t,e){r.useDebugValue&&r.useDebugValue(e?e(t):t)}function it(t){var e=V(q++,10),n=K();return e.__=t,D.componentDidCatch||(D.componentDidCatch=function(t){e.__&&e.__(t),n[1](t)}),[n[0],function(){n[1](void 0)}]}function st(){F.some((function(t){if(t.__P)try{t.__H.__h.forEach(at),t.__H.__h.forEach(ut),t.__H.__h=[]}catch(e){return t.__H.__h=[],r.__e(e,t.__v),!0}})),F=[]}function at(t){t.t&&t.t()}function ut(t){var e=t.__();"function"==typeof e&&(t.t=e)}function ct(t,e){return!t||e.some((function(e,n){return e!==t[n]}))}function lt(t,e){return"function"==typeof e?e(t):e}function ht(t,e){for(var n in e)t[n]=e[n];return t}function ft(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var r in e)if("__source"!==r&&t[r]!==e[r])return!0;return!1}r.__r=function(t){z&&z(t),q=0,(D=t.__c).__H&&(D.__H.__h.forEach(at),D.__H.__h.forEach(ut),D.__H.__h=[])},r.diffed=function(t){W&&W(t);var e=t.__c;if(e){var n=e.__H;n&&n.__h.length&&(1!==F.push(e)&&H===r.requestAnimationFrame||((H=r.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(r),cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);"undefined"!=typeof window&&(e=requestAnimationFrame(n))})(st))}},r.__c=function(t,e){e.some((function(t){try{t.__h.forEach(at),t.__h=t.__h.filter((function(t){return!t.__||ut(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],r.__e(n,t.__v)}})),Y&&Y(t,e)},r.unmount=function(t){$&&$(t);var e=t.__c;if(e){var n=e.__H;if(n)try{n.__.forEach((function(t){return t.t&&t.t()}))}catch(t){r.__e(t,e.__v)}}},n.d(e,"version",(function(){return Ut})),n.d(e,"Children",(function(){return _t})),n.d(e,"render",(function(){return Ot})),n.d(e,"hydrate",(function(){return It})),n.d(e,"unmountComponentAtNode",(function(){return Ht})),n.d(e,"createPortal",(function(){return At})),n.d(e,"createFactory",(function(){return jt})),n.d(e,"cloneElement",(function(){return Dt})),n.d(e,"isValidElement",(function(){return qt})),n.d(e,"findDOMNode",(function(){return Jt})),n.d(e,"PureComponent",(function(){return dt})),n.d(e,"memo",(function(){return pt})),n.d(e,"forwardRef",(function(){return mt})),n.d(e,"unstable_batchedUpdates",(function(){return Ft})),n.d(e,"Suspense",(function(){return bt})),n.d(e,"SuspenseList",(function(){return Et})),n.d(e,"lazy",(function(){return xt})),n.d(e,"useState",(function(){return K})),n.d(e,"useReducer",(function(){return Q})),n.d(e,"useEffect",(function(){return Z})),n.d(e,"useLayoutEffect",(function(){return X})),n.d(e,"useRef",(function(){return G})),n.d(e,"useImperativeHandle",(function(){return tt})),n.d(e,"useMemo",(function(){return et})),n.d(e,"useCallback",(function(){return nt})),n.d(e,"useContext",(function(){return rt})),n.d(e,"useDebugValue",(function(){return ot})),n.d(e,"useErrorBoundary",(function(){return it})),n.d(e,"createElement",(function(){return g})),n.d(e,"createContext",(function(){return j})),n.d(e,"createRef",(function(){return v})),n.d(e,"Fragment",(function(){return _})),n.d(e,"Component",(function(){return y}));var dt=function(t){var e,n;function r(e){var n;return(n=t.call(this,e)||this).isPureReactComponent=!0,n}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.shouldComponentUpdate=function(t,e){return ft(this.props,t)||ft(this.state,e)},r}(y);function pt(t,e){function n(t){var n=this.props.ref,r=n==t.ref;return!r&&n&&(n.call?n(null):n.current=null),e?!e(this.props,t)||!r:ft(this.props,t)}function r(e){return this.shouldComponentUpdate=n,g(t,ht({},e))}return r.prototype.isReactComponent=!0,r.displayName="Memo("+(t.displayName||t.name)+")",r.t=!0,r}var gt=r.__b;function mt(t){function e(e){var n=ht({},e);return delete n.ref,t(n,e.ref)}return e.prototype.isReactComponent=e.t=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}r.__b=function(t){t.type&&t.type.t&&t.ref&&(t.props.ref=t.ref,t.ref=null),gt&>(t)};var vt=function(t,e){return t?R(t).reduce((function(t,n,r){return t.concat(e(n,r))}),[]):null},_t={map:vt,forEach:vt,count:function(t){return t?R(t).length:0},only:function(t){if(1!==(t=R(t)).length)throw new Error("Children.only() expects only one child.");return t[0]},toArray:R},yt=r.__e;function wt(t){return t&&((t=ht({},t)).__c=null,t.__k=t.__k&&t.__k.map(wt)),t}function bt(){this.__u=0,this.o=null,this.__b=null}function Mt(t){var e=t.__.__c;return e&&e.u&&e.u(t)}function xt(t){var e,n,r;function o(o){if(e||(e=t()).then((function(t){n=t.default||t}),(function(t){r=t})),r)throw r;if(!n)throw e;return g(n,o)}return o.displayName="Lazy",o.t=!0,o}function Et(){this.i=null,this.l=null}r.__e=function(t,e,n){if(t.then)for(var r,o=e;o=o.__;)if((r=o.__c)&&r.__c)return r.__c(t,e.__c);yt(t,e,n)},(bt.prototype=new y).__c=function(t,e){var n=this;null==n.o&&(n.o=[]),n.o.push(e);var r=Mt(n.__v),o=!1,i=function(){o||(o=!0,r?r(s):s())};e.__c=e.componentWillUnmount,e.componentWillUnmount=function(){i(),e.__c&&e.__c()};var s=function(){var t;if(!--n.__u)for(n.__v.__k[0]=n.state.u,n.setState({u:n.__b=null});t=n.o.pop();)t.forceUpdate()};n.__u++||n.setState({u:n.__b=n.__v.__k[0]}),t.then(i,i)},bt.prototype.render=function(t,e){return this.__b&&(this.__v.__k[0]=wt(this.__b),this.__b=null),[g(y,null,e.u?null:t.children),e.u&&t.fallback]};var Rt=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(Et.prototype=new y).u=function(t){var e=this,n=Mt(e.__v),r=e.l.get(t);return r[0]++,function(o){var i=function(){e.props.revealOrder?(r.push(o),Rt(e,t,r)):o()};n?n(i):i()}},Et.prototype.render=function(t){this.i=null,this.l=new Map;var e=R(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},Et.prototype.componentDidUpdate=Et.prototype.componentDidMount=function(){var t=this;t.l.forEach((function(e,n){Rt(t,n,e)}))};var St=function(){function t(){}var e=t.prototype;return e.getChildContext=function(){return this.props.context},e.render=function(t){return t.children},t}();function Tt(t){var e=this,n=t.container,r=g(St,{context:e.context},t.vnode);return e.s&&e.s!==n&&(e.v.parentNode&&e.s.removeChild(e.v),P(e.h),e.p=!1),t.vnode?e.p?(n.__k=e.__k,L(r,n),e.__k=n.__k):(e.v=document.createTextNode(""),N("",n),n.appendChild(e.v),e.p=!0,e.s=n,L(r,n,e.v),e.__k=e.v.__k):e.p&&(e.v.parentNode&&e.s.removeChild(e.v),P(e.h)),e.h=r,e.componentWillUnmount=function(){e.v.parentNode&&e.s.removeChild(e.v),P(e.h)},null}function At(t,e){return g(Tt,{vnode:t,container:e})}var kt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;y.prototype.isReactComponent={};var Ct="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;function Ot(t,e,n){if(null==e.__k)for(;e.firstChild;)e.removeChild(e.firstChild);return L(t,e),"function"==typeof n&&n(),t?t.__c:null}function It(t,e,n){return N(t,e),"function"==typeof n&&n(),t?t.__c:null}var Pt=r.event;function Bt(t,e){t["UNSAFE_"+e]&&!t[e]&&Object.defineProperty(t,e,{configurable:!1,get:function(){return this["UNSAFE_"+e]},set:function(t){this["UNSAFE_"+e]=t}})}r.event=function(t){Pt&&(t=Pt(t)),t.persist=function(){};var e=!1,n=!1,r=t.stopPropagation;t.stopPropagation=function(){r.call(t),e=!0};var o=t.preventDefault;return t.preventDefault=function(){o.call(t),n=!0},t.isPropagationStopped=function(){return e},t.isDefaultPrevented=function(){return n},t.nativeEvent=t};var Lt={configurable:!0,get:function(){return this.class}},Nt=r.vnode;r.vnode=function(t){t.$$typeof=Ct;var e=t.type,n=t.props;if(e){if(n.class!=n.className&&(Lt.enumerable="className"in n,null!=n.className&&(n.class=n.className),Object.defineProperty(n,"className",Lt)),"function"!=typeof e){var r,o,i;for(i in n.defaultValue&&void 0!==n.value&&(n.value||0===n.value||(n.value=n.defaultValue),delete n.defaultValue),Array.isArray(n.value)&&n.multiple&&"select"===e&&(R(n.children).forEach((function(t){-1!=n.value.indexOf(t.props.value)&&(t.props.selected=!0)})),delete n.value),n)if(r=kt.test(i))break;if(r)for(i in o=t.props={},n)o[kt.test(i)?i.replace(/[A-Z0-9]/,"-$&").toLowerCase():i]=n[i]}!function(e){var n=t.type,r=t.props;if(r&&"string"==typeof n){var o={};for(var i in r)/^on(Ani|Tra|Tou)/.test(i)&&(r[i.toLowerCase()]=r[i],delete r[i]),o[i.toLowerCase()]=i;if(o.ondoubleclick&&(r.ondblclick=r[o.ondoubleclick],delete r[o.ondoubleclick]),o.onbeforeinput&&(r.onbeforeinput=r[o.onbeforeinput],delete r[o.onbeforeinput]),o.onchange&&("textarea"===n||"input"===n.toLowerCase()&&!/^fil|che|ra/i.test(r.type))){var s=o.oninput||"oninput";r[s]||(r[s]=r[o.onchange],delete r[o.onchange])}}}(),"function"==typeof e&&!e.m&&e.prototype&&(Bt(e.prototype,"componentWillMount"),Bt(e.prototype,"componentWillReceiveProps"),Bt(e.prototype,"componentWillUpdate"),e.m=!0)}Nt&&Nt(t)};var Ut="16.8.0";function jt(t){return g.bind(null,t)}function qt(t){return!!t&&t.$$typeof===Ct}function Dt(t){return qt(t)?U.apply(null,arguments):t}function Ht(t){return!!t.__k&&(L(null,t),!0)}function Jt(t){return t&&(t.base||1===t.nodeType&&t)||null}var Ft=function(t,e){return t(e)};e.default={useState:K,useReducer:Q,useEffect:Z,useLayoutEffect:X,useRef:G,useImperativeHandle:tt,useMemo:et,useCallback:nt,useContext:rt,useDebugValue:ot,version:"16.8.0",Children:_t,render:Ot,hydrate:Ot,unmountComponentAtNode:Ht,createPortal:At,createElement:g,createContext:j,createFactory:jt,cloneElement:Dt,createRef:v,Fragment:_,isValidElement:qt,findDOMNode:Jt,Component:y,PureComponent:dt,memo:pt,forwardRef:mt,unstable_batchedUpdates:Ft,Suspense:bt,SuspenseList:Et,lazy:xt}},function(t,e,n){"use strict";n.r(e);var r=n(20),o=n(5);class i extends o.IJsonRpcProvider{constructor(t){super(t),this.events=new r.EventEmitter,this.connection=this.setConnection(t),this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async request(t,e){return this.requestStrict(Object(o.formatJsonRpcRequest)(t.method,t.params||[]),e)}async requestStrict(t,e){return new Promise(async(n,r)=>{if(!this.connection.connected)try{await this.open()}catch(t){r(t)}this.events.on(""+t.id,t=>{Object(o.isJsonRpcError)(t)?r(t.error.message):n(t.result)});try{await this.connection.send(t,e)}catch(t){r(t)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),Object(o.isJsonRpcResponse)(t)?this.events.emit(""+t.id,t):this.events.emit("message",{type:t.method,data:t.params})}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof t&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.events.emit("connect"))}async close(){await this.connection.close(),this.events.emit("disconnect")}registerEventListeners(){this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",()=>this.events.emit("disconnect")),this.connection.on("error",t=>this.events.emit("error",t))}}var s=i;n.d(e,"JsonRpcProvider",(function(){return i}));e.default=s},function(t,e,n){"use strict";n.r(e);var r=n(20),o=n(26),i=n.n(o),s=n(11),a=n(5);const u={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class c{constructor(t){if(this.url=t,this.events=new r.EventEmitter,this.isAvailable=!1,this.registering=!1,!Object(a.isHttpUrl)(t))throw new Error("Provided URL is not compatible with HTTP connection: "+t);this.url=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async open(t=this.url){await this.register(t)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(t,e){this.isAvailable||await this.register();try{const e=Object(s.b)(t),n=await i()(this.url,Object.assign(Object.assign({},u),{body:e})),r=await n.json();this.onPayload({data:r})}catch(e){this.onError(t.id,e)}}async register(t=this.url){if(!Object(a.isHttpUrl)(t))throw new Error("Provided URL is not compatible with HTTP connection: "+t);if(this.registering)return new Promise((t,e)=>{this.events.once("register_error",t=>{e(t)}),this.events.once("open",()=>{if(void 0===this.isAvailable)return e(new Error("HTTP connection is missing or invalid"));t()})});this.url=t,this.registering=!0;try{const e=Object(s.b)({id:1,jsonrpc:"2.0",method:"test",params:[]});await i()(t,Object.assign(Object.assign({},u),{body:e})),this.onOpen()}catch(t){const e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(t){if(void 0===t.data)return;const e="string"==typeof t.data?Object(s.a)(t.data):t.data;this.events.emit("payload",e)}onError(t,e){const n=this.parseError(e),r=n.message||n.toString(),o=Object(a.formatJsonRpcError)(t,r);this.events.emit("payload",o)}parseError(t,e=this.url){return Object(a.parseConnectionError)(t,e,"HTTP")}}var l=c;n.d(e,"HttpConnection",(function(){return c}));e.default=l}])}));
|
|
33
|
+
e.read=function(t,e,n,r,o){var i,s,a=8*o-r-1,u=(1<<a)-1,c=u>>1,l=-7,h=n?o-1:0,f=n?-1:1,d=t[e+h];for(h+=f,i=d&(1<<-l)-1,d>>=-l,l+=a;l>0;i=256*i+t[e+h],h+=f,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),i-=c}return(d?-1:1)*s*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var s,a,u,c=8*i-o-1,l=(1<<c)-1,h=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*u-1)*Math.pow(2,o),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;t[n+d]=255&a,d+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[n+d]=255&s,d+=p,s/=256,c-=8);t[n+d-p]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())},function(t,e,n){"use strict";var r=new RegExp("%[a-f0-9]{2}","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function i(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;e=e||1;var n=t.slice(0,e),r=t.slice(e);return Array.prototype.concat.call([],i(n),i(r))}function s(t){try{return decodeURIComponent(t)}catch(o){for(var e=t.match(r),n=1;n<e.length;n++)e=(t=i(e,n).join("")).match(r);return t}}t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=o.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch(t){var r=s(n[0]);r!==n[0]&&(e[n[0]]=r)}n=o.exec(t)}e["%C2"]="�";for(var i=Object.keys(e),a=0;a<i.length;a++){var u=i[a];t=t.replace(new RegExp(u,"g"),e[u])}return t}(t)}}},function(t,e,n){"use strict";t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}},function(t,e,n){"use strict";t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(t,e,n){var r=n(72),o=n(73),i=n(90),s=n(91);function a(t,e,n,i,s){var a=[].slice.call(arguments,1),u=a.length,c="function"==typeof a[u-1];if(!c&&!r())throw new Error("Callback required as last argument");if(!c){if(u<1)throw new Error("Too few arguments provided");return 1===u?(n=e,e=i=void 0):2!==u||e.getContext||(i=n,n=e,e=void 0),new Promise((function(r,s){try{var a=o.create(n,i);r(t(a,e,i))}catch(t){s(t)}}))}if(u<2)throw new Error("Too few arguments provided");2===u?(s=n,n=e,e=i=void 0):3===u&&(e.getContext&&void 0===s?(s=i,i=void 0):(s=i,i=n,n=e,e=void 0));try{var l=o.create(n,i);s(null,t(l,e,i))}catch(t){s(t)}}e.create=o.create,e.toCanvas=a.bind(null,i.render),e.toDataURL=a.bind(null,i.renderToDataURL),e.toString=a.bind(null,(function(t,e,n){return s.render(t,n)}))},function(t,e){t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},function(t,e,n){var r=n(12),o=n(8),i=n(23),s=n(74),a=n(75),u=n(76),c=n(77),l=n(78),h=n(46),f=n(79),d=n(82),p=n(83),g=n(9),m=n(84),v=n(22);function _(t,e,n){var r,o,i=t.size,s=p.getEncodedBits(e,n);for(r=0;r<15;r++)o=1==(s>>r&1),r<6?t.set(r,8,o,!0):r<8?t.set(r+1,8,o,!0):t.set(i-15+r,8,o,!0),r<8?t.set(8,i-r-1,o,!0):r<9?t.set(8,15-r-1+1,o,!0):t.set(8,15-r-1,o,!0);t.set(i-8,8,1,!0)}function y(t,e,n){var i=new s;n.forEach((function(e){i.put(e.mode.bit,4),i.put(e.getLength(),g.getCharCountIndicator(e.mode,t)),e.write(i)}));var a=8*(o.getSymbolTotalCodewords(t)-h.getTotalCodewordsCount(t,e));for(i.getLengthInBits()+4<=a&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);for(var u=(a-i.getLengthInBits())/8,c=0;c<u;c++)i.put(c%2?17:236,8);return function(t,e,n){for(var i=o.getSymbolTotalCodewords(e),s=h.getTotalCodewordsCount(e,n),a=i-s,u=h.getBlocksCount(e,n),c=u-i%u,l=Math.floor(i/u),d=Math.floor(a/u),p=d+1,g=l-d,m=new f(g),v=0,_=new Array(u),y=new Array(u),w=0,b=r.from(t.buffer),M=0;M<u;M++){var E=M<c?d:p;_[M]=b.slice(v,v+E),y[M]=m.encode(_[M]),v+=E,w=Math.max(w,E)}var x,R,S=r.alloc(i),k=0;for(x=0;x<w;x++)for(R=0;R<u;R++)x<_[R].length&&(S[k++]=_[R][x]);for(x=0;x<g;x++)for(R=0;R<u;R++)S[k++]=y[R][x];return S}(i,t,e)}function w(t,e,n,r){var i;if(v(t))i=m.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var s=e;if(!s){var h=m.rawSplit(t);s=d.getBestVersionForData(h,n)}i=m.fromString(t,s||40)}var f=d.getBestVersionForData(i,n);if(!f)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<f)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+f+".\n")}else e=f;var p=y(e,n,i),g=o.getSymbolSize(e),w=new a(g);return function(t,e){for(var n=t.size,r=c.getPositions(e),o=0;o<r.length;o++)for(var i=r[o][0],s=r[o][1],a=-1;a<=7;a++)if(!(i+a<=-1||n<=i+a))for(var u=-1;u<=7;u++)s+u<=-1||n<=s+u||(a>=0&&a<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===a||6===a)||a>=2&&a<=4&&u>=2&&u<=4?t.set(i+a,s+u,!0,!0):t.set(i+a,s+u,!1,!0))}(w,e),function(t){for(var e=t.size,n=8;n<e-8;n++){var r=n%2==0;t.set(n,6,r,!0),t.set(6,n,r,!0)}}(w),function(t,e){for(var n=u.getPositions(e),r=0;r<n.length;r++)for(var o=n[r][0],i=n[r][1],s=-2;s<=2;s++)for(var a=-2;a<=2;a++)-2===s||2===s||-2===a||2===a||0===s&&0===a?t.set(o+s,i+a,!0,!0):t.set(o+s,i+a,!1,!0)}(w,e),_(w,n,0),e>=7&&function(t,e){for(var n,r,o,i=t.size,s=d.getEncodedBits(e),a=0;a<18;a++)n=Math.floor(a/3),r=a%3+i-8-3,o=1==(s>>a&1),t.set(n,r,o,!0),t.set(r,n,o,!0)}(w,e),function(t,e){for(var n=t.size,r=-1,o=n-1,i=7,s=0,a=n-1;a>0;a-=2)for(6===a&&a--;;){for(var u=0;u<2;u++)if(!t.isReserved(o,a-u)){var c=!1;s<e.length&&(c=1==(e[s]>>>i&1)),t.set(o,a-u,c),-1===--i&&(s++,i=7)}if((o+=r)<0||n<=o){o-=r,r=-r;break}}}(w,p),isNaN(r)&&(r=l.getBestMask(w,_.bind(null,w,n))),l.applyMask(r,w),_(w,n,r),{modules:w,version:e,errorCorrectionLevel:n,maskPattern:r,segments:i}}e.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var n,r,s=i.M;return void 0!==e&&(s=i.from(e.errorCorrectionLevel,i.M),n=d.from(e.version),r=l.from(e.maskPattern),e.toSJISFunc&&o.setToSJISFunction(e.toSJISFunc)),w(t,n,s,r)}},function(t,e){function n(){this.buffer=[],this.length=0}n.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=n},function(t,e,n){var r=n(12);function o(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=r.alloc(t*t),this.reservedBit=r.alloc(t*t)}o.prototype.set=function(t,e,n,r){var o=t*this.size+e;this.data[o]=n,r&&(this.reservedBit[o]=!0)},o.prototype.get=function(t,e){return this.data[t*this.size+e]},o.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},o.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=o},function(t,e,n){var r=n(8).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,n=r(t),o=145===n?26:2*Math.ceil((n-13)/(2*e-2)),i=[n-7],s=1;s<e-1;s++)i[s]=i[s-1]-o;return i.push(6),i.reverse()},e.getPositions=function(t){for(var n=[],r=e.getRowColCoords(t),o=r.length,i=0;i<o;i++)for(var s=0;s<o;s++)0===i&&0===s||0===i&&s===o-1||i===o-1&&0===s||n.push([r[i],r[s]]);return n}},function(t,e,n){var r=n(8).getSymbolSize;e.getPositions=function(t){var e=r(t);return[[0,0],[e-7,0],[0,e-7]]}},function(t,e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var n=3,r=3,o=40,i=10;function s(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){for(var e=t.size,r=0,o=0,i=0,s=null,a=null,u=0;u<e;u++){o=i=0,s=a=null;for(var c=0;c<e;c++){var l=t.get(u,c);l===s?o++:(o>=5&&(r+=n+(o-5)),s=l,o=1),(l=t.get(c,u))===a?i++:(i>=5&&(r+=n+(i-5)),a=l,i=1)}o>=5&&(r+=n+(o-5)),i>=5&&(r+=n+(i-5))}return r},e.getPenaltyN2=function(t){for(var e=t.size,n=0,o=0;o<e-1;o++)for(var i=0;i<e-1;i++){var s=t.get(o,i)+t.get(o,i+1)+t.get(o+1,i)+t.get(o+1,i+1);4!==s&&0!==s||n++}return n*r},e.getPenaltyN3=function(t){for(var e=t.size,n=0,r=0,i=0,s=0;s<e;s++){r=i=0;for(var a=0;a<e;a++)r=r<<1&2047|t.get(s,a),a>=10&&(1488===r||93===r)&&n++,i=i<<1&2047|t.get(a,s),a>=10&&(1488===i||93===i)&&n++}return n*o},e.getPenaltyN4=function(t){for(var e=0,n=t.data.length,r=0;r<n;r++)e+=t.data[r];return Math.abs(Math.ceil(100*e/n/5)-10)*i},e.applyMask=function(t,e){for(var n=e.size,r=0;r<n;r++)for(var o=0;o<n;o++)e.isReserved(o,r)||e.xor(o,r,s(t,o,r))},e.getBestMask=function(t,n){for(var r=Object.keys(e.Patterns).length,o=0,i=1/0,s=0;s<r;s++){n(s),e.applyMask(s,t);var a=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(s,t),a<i&&(i=a,o=s)}return o}},function(t,e,n){var r=n(12),o=n(80),i=n(21).Buffer;function s(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}s.prototype.initialize=function(t){this.degree=t,this.genPoly=o.generateECPolynomial(this.degree)},s.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=r.alloc(this.degree),n=i.concat([t,e],t.length+this.degree),s=o.mod(n,this.genPoly),a=this.degree-s.length;if(a>0){var u=r.alloc(this.degree);return s.copy(u,a),u}return s},t.exports=s},function(t,e,n){var r=n(12),o=n(81);e.mul=function(t,e){for(var n=r.alloc(t.length+e.length-1),i=0;i<t.length;i++)for(var s=0;s<e.length;s++)n[i+s]^=o.mul(t[i],e[s]);return n},e.mod=function(t,e){for(var n=r.from(t);n.length-e.length>=0;){for(var i=n[0],s=0;s<e.length;s++)n[s]^=o.mul(e[s],i);for(var a=0;a<n.length&&0===n[a];)a++;n=n.slice(a)}return n},e.generateECPolynomial=function(t){for(var n=r.from([1]),i=0;i<t;i++)n=e.mul(n,[1,o.exp(i)]);return n}},function(t,e,n){var r=n(12),o=r.alloc(512),i=r.alloc(256);!function(){for(var t=1,e=0;e<255;e++)o[e]=t,i[t]=e,256&(t<<=1)&&(t^=285);for(e=255;e<512;e++)o[e]=o[e-255]}(),e.log=function(t){if(t<1)throw new Error("log("+t+")");return i[t]},e.exp=function(t){return o[t]},e.mul=function(t,e){return 0===t||0===e?0:o[i[t]+i[e]]}},function(t,e,n){var r=n(8),o=n(46),i=n(23),s=n(9),a=n(47),u=n(22),c=r.getBCHDigit(7973);function l(t,e){return s.getCharCountIndicator(t,e)+4}function h(t,e){var n=0;return t.forEach((function(t){var r=l(t.mode,e);n+=r+t.getBitsLength()})),n}e.from=function(t,e){return a.isValid(t)?parseInt(t,10):e},e.getCapacity=function(t,e,n){if(!a.isValid(t))throw new Error("Invalid QR Code version");void 0===n&&(n=s.BYTE);var i=8*(r.getSymbolTotalCodewords(t)-o.getTotalCodewordsCount(t,e));if(n===s.MIXED)return i;var u=i-l(n,t);switch(n){case s.NUMERIC:return Math.floor(u/10*3);case s.ALPHANUMERIC:return Math.floor(u/11*2);case s.KANJI:return Math.floor(u/13);case s.BYTE:default:return Math.floor(u/8)}},e.getBestVersionForData=function(t,n){var r,o=i.from(n,i.M);if(u(t)){if(t.length>1)return function(t,n){for(var r=1;r<=40;r++){if(h(t,r)<=e.getCapacity(r,n,s.MIXED))return r}}(t,o);if(0===t.length)return 1;r=t[0]}else r=t;return function(t,n,r){for(var o=1;o<=40;o++)if(n<=e.getCapacity(o,r,t))return o}(r.mode,r.getLength(),o)},e.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;r.getBCHDigit(e)-c>=0;)e^=7973<<r.getBCHDigit(e)-c;return t<<12|e}},function(t,e,n){var r=n(8),o=r.getBCHDigit(1335);e.getEncodedBits=function(t,e){for(var n=t.bit<<3|e,i=n<<10;r.getBCHDigit(i)-o>=0;)i^=1335<<r.getBCHDigit(i)-o;return 21522^(n<<10|i)}},function(t,e,n){var r=n(9),o=n(85),i=n(86),s=n(87),a=n(88),u=n(48),c=n(8),l=n(89);function h(t){return unescape(encodeURIComponent(t)).length}function f(t,e,n){for(var r,o=[];null!==(r=t.exec(n));)o.push({data:r[0],index:r.index,mode:e,length:r[0].length});return o}function d(t){var e,n,o=f(u.NUMERIC,r.NUMERIC,t),i=f(u.ALPHANUMERIC,r.ALPHANUMERIC,t);return c.isKanjiModeEnabled()?(e=f(u.BYTE,r.BYTE,t),n=f(u.KANJI,r.KANJI,t)):(e=f(u.BYTE_KANJI,r.BYTE,t),n=[]),o.concat(i,e,n).sort((function(t,e){return t.index-e.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function p(t,e){switch(e){case r.NUMERIC:return o.getBitsLength(t);case r.ALPHANUMERIC:return i.getBitsLength(t);case r.KANJI:return a.getBitsLength(t);case r.BYTE:return s.getBitsLength(t)}}function g(t,e){var n,u=r.getBestModeForData(t);if((n=r.from(e,u))!==r.BYTE&&n.bit<u.bit)throw new Error('"'+t+'" cannot be encoded with mode '+r.toString(n)+".\n Suggested mode is: "+r.toString(u));switch(n!==r.KANJI||c.isKanjiModeEnabled()||(n=r.BYTE),n){case r.NUMERIC:return new o(t);case r.ALPHANUMERIC:return new i(t);case r.KANJI:return new a(t);case r.BYTE:return new s(t)}}e.fromArray=function(t){return t.reduce((function(t,e){return"string"==typeof e?t.push(g(e,null)):e.data&&t.push(g(e.data,e.mode)),t}),[])},e.fromString=function(t,n){for(var o=function(t,e){for(var n={},o={start:{}},i=["start"],s=0;s<t.length;s++){for(var a=t[s],u=[],c=0;c<a.length;c++){var l=a[c],h=""+s+c;u.push(h),n[h]={node:l,lastCount:0},o[h]={};for(var f=0;f<i.length;f++){var d=i[f];n[d]&&n[d].node.mode===l.mode?(o[d][h]=p(n[d].lastCount+l.length,l.mode)-p(n[d].lastCount,l.mode),n[d].lastCount+=l.length):(n[d]&&(n[d].lastCount=l.length),o[d][h]=p(l.length,l.mode)+4+r.getCharCountIndicator(l.mode,e))}}i=u}for(f=0;f<i.length;f++)o[i[f]].end=0;return{map:o,table:n}}(function(t){for(var e=[],n=0;n<t.length;n++){var o=t[n];switch(o.mode){case r.NUMERIC:e.push([o,{data:o.data,mode:r.ALPHANUMERIC,length:o.length},{data:o.data,mode:r.BYTE,length:o.length}]);break;case r.ALPHANUMERIC:e.push([o,{data:o.data,mode:r.BYTE,length:o.length}]);break;case r.KANJI:e.push([o,{data:o.data,mode:r.BYTE,length:h(o.data)}]);break;case r.BYTE:e.push([{data:o.data,mode:r.BYTE,length:h(o.data)}])}}return e}(d(t,c.isKanjiModeEnabled())),n),i=l.find_path(o.map,"start","end"),s=[],a=1;a<i.length-1;a++)s.push(o.table[i[a]].node);return e.fromArray(function(t){return t.reduce((function(t,e){var n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)}),[])}(s))},e.rawSplit=function(t){return e.fromArray(d(t,c.isKanjiModeEnabled()))}},function(t,e,n){var r=n(9);function o(t){this.mode=r.NUMERIC,this.data=t.toString()}o.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){var e,n,r;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),r=parseInt(n,10),t.put(r,10);var o=this.data.length-e;o>0&&(n=this.data.substr(e),r=parseInt(n,10),t.put(r,3*o+1))},t.exports=o},function(t,e,n){var r=n(9),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(t){this.mode=r.ALPHANUMERIC,this.data=t}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e;for(e=0;e+2<=this.data.length;e+=2){var n=45*o.indexOf(this.data[e]);n+=o.indexOf(this.data[e+1]),t.put(n,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},t.exports=i},function(t,e,n){var r=n(12),o=n(9);function i(t){this.mode=o.BYTE,this.data=r.from(t)}i.getBitsLength=function(t){return 8*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){for(var e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)},t.exports=i},function(t,e,n){var r=n(9),o=n(8);function i(t){this.mode=r.KANJI,this.data=t}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e;for(e=0;e<this.data.length;e++){var n=o.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),t.put(n,13)}},t.exports=i},function(t,e,n){"use strict";var r={single_source_shortest_paths:function(t,e,n){var o={},i={};i[e]=0;var s,a,u,c,l,h,f,d=r.PriorityQueue.make();for(d.push(e,0);!d.empty();)for(u in a=(s=d.pop()).value,c=s.cost,l=t[a]||{})l.hasOwnProperty(u)&&(h=c+l[u],f=i[u],(void 0===i[u]||f>h)&&(i[u]=h,d.push(u,h),o[u]=a));if(void 0!==n&&void 0===i[n]){var p=["Could not find a path from ",e," to ",n,"."].join("");throw new Error(p)}return o},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],r=e;r;)n.push(r),t[r],r=t[r];return n.reverse(),n},find_path:function(t,e,n){var o=r.single_source_shortest_paths(t,e,n);return r.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(t){var e,n=r.PriorityQueue,o={};for(e in t=t||{},n)n.hasOwnProperty(e)&&(o[e]=n[e]);return o.queue=[],o.sorter=t.sorter||n.default_sorter,o},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=r},function(t,e,n){var r=n(49);e.render=function(t,e,n){var o=n,i=e;void 0!==o||e&&e.getContext||(o=e,e=void 0),e||(i=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),o=r.getOptions(o);var s=r.getImageWidth(t.modules.size,o),a=i.getContext("2d"),u=a.createImageData(s,s);return r.qrToImageData(u.data,t,o),function(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+"px",e.style.width=n+"px"}(a,i,s),a.putImageData(u,0,0),i},e.renderToDataURL=function(t,n,r){var o=r;void 0!==o||n&&n.getContext||(o=n,n=void 0),o||(o={});var i=e.render(t,n,o),s=o.type||"image/png",a=o.rendererOpts||{};return i.toDataURL(s,a.quality)}},function(t,e,n){var r=n(49);function o(t,e){var n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function i(t,e,n){var r=t+e;return void 0!==n&&(r+=" "+n),r}e.render=function(t,e,n){var s=r.getOptions(e),a=t.modules.size,u=t.modules.data,c=a+2*s.margin,l=s.color.light.a?"<path "+o(s.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",h="<path "+o(s.color.dark,"stroke")+' d="'+function(t,e,n){for(var r="",o=0,s=!1,a=0,u=0;u<t.length;u++){var c=Math.floor(u%e),l=Math.floor(u/e);c||s||(s=!0),t[u]?(a++,u>0&&c>0&&t[u-1]||(r+=s?i("M",c+n,.5+l+n):i("m",o,0),o=0,s=!1),c+1<e&&t[u+1]||(r+=i("h",a),a=0)):o++}return r}(u,a,s.margin)+'"/>',f='viewBox="0 0 '+c+" "+c+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+f+' shape-rendering="crispEdges">'+l+h+"</svg>\n";return"function"==typeof n&&n(null,d),d}},function(t,e,n){"use strict";var r=n(93),o={"text/plain":"Text","text/html":"Url",default:"Text"};t.exports=function(t,e){var n,i,s,a,u,c,l=!1;e||(e={}),n=e.debug||!1;try{if(s=r(),a=document.createRange(),u=document.getSelection(),(c=document.createElement("span")).textContent=t,c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(r){if(r.stopPropagation(),e.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=o[e.format]||o.default;window.clipboardData.setData(i,t)}else r.clipboardData.clearData(),r.clipboardData.setData(e.format,t);e.onCopy&&(r.preventDefault(),e.onCopy(r.clipboardData))})),document.body.appendChild(c),a.selectNodeContents(c),u.addRange(a),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),l=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),i=function(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}("message"in e?e.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,t)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(a):u.removeAllRanges()),c&&document.body.removeChild(c),s()}return l}},function(t,e){t.exports=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,n=[],r=0;r<t.rangeCount;r++)n.push(t.getRangeAt(r));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null}return t.removeAllRanges(),function(){"Caret"===t.type&&t.removeAllRanges(),t.rangeCount||n.forEach((function(e){t.addRange(e)})),e&&e.focus()}}},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"generateKey",(function(){return g})),n.d(r,"verifyHmac",(function(){return m})),n.d(r,"encrypt",(function(){return v})),n.d(r,"decrypt",(function(){return _}));var o=n(25),i=n.n(o),s=n(1),a=n(54);var u=class{constructor(){this._eventEmitters=[]}subscribe(t){this._eventEmitters.push(t)}unsubscribe(t){this._eventEmitters=this._eventEmitters.filter(e=>e.event!==t)}trigger(t){let e,n=[];e=Object(s.isJsonRpcRequest)(t)?t.method:Object(s.isJsonRpcResponseSuccess)(t)||Object(s.isJsonRpcResponseError)(t)?"response:"+t.id:Object(s.isInternalEvent)(t)?t.event:"",e&&(n=this._eventEmitters.filter(t=>t.event===e)),n&&n.length||Object(s.isReservedEvent)(e)||Object(s.isInternalEvent)(e)||(n=this._eventEmitters.filter(t=>"call_request"===t.event)),n.forEach(e=>{if(Object(s.isJsonRpcResponseError)(t)){const n=new Error(t.error.message);e.callback(n,null)}else e.callback(null,t)})}};var c=class{constructor(t="walletconnect"){this.storageId=t}getSession(){let t=null;const e=Object(s.getLocal)(this.storageId);return e&&Object(s.isWalletConnectSession)(e)&&(t=e),t}setSession(t){return Object(s.setLocal)(this.storageId,t),t}removeSession(){Object(s.removeLocal)(this.storageId)}};const l="abcdefghijklmnopqrstuvwxyz0123456789".split("").map(t=>`https://${t}.bridge.walletconnect.org`);function h(){return l[Math.floor(Math.random()*l.length)]}var f=class{constructor(t){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new u,this._clientMeta=Object(s.getClientMeta)()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new c(t.connectorOpts.storageId),this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,this._signingMethods=[...s.signingMethods,...t.connectorOpts.signingMethods||[]],!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw new Error("Missing one of the required parameters: bridge / uri / session");var e;t.connectorOpts.bridge&&(this.bridge=function(t){return"walletconnect.org"===function(t){return function(t){let e=t.indexOf("//")>-1?t.split("/")[2]:t.split("/")[0];return e=e.split(":")[0],e=e.split("?")[0],e}(t).split(".").slice(-2).join(".")}(t)}(e=t.connectorOpts.bridge)?h():e),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);const n=t.connectorOpts.session||this._getStorageSession();n&&(this.session=n),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new a.a({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}set bridge(t){t&&(this._bridge=t)}get bridge(){return this._bridge}set key(t){if(!t)return;const e=Object(s.convertHexToArrayBuffer)(t);this._key=e}get key(){if(this._key){return Object(s.convertArrayBufferToHex)(this._key,!0)}return""}set clientId(t){t&&(this._clientId=t)}get clientId(){let t=this._clientId;return t||(t=this._clientId=Object(s.uuid)()),this._clientId}set peerId(t){t&&(this._peerId=t)}get peerId(){return this._peerId}set clientMeta(t){}get clientMeta(){let t=this._clientMeta;return t||(t=this._clientMeta=Object(s.getClientMeta)()),t}set peerMeta(t){this._peerMeta=t}get peerMeta(){return this._peerMeta}set handshakeTopic(t){t&&(this._handshakeTopic=t)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(t){t&&(this._handshakeId=t)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(t){if(!t)return;const{handshakeTopic:e,bridge:n,key:r}=this._parseUri(t);this.handshakeTopic=e,this.bridge=n,this.key=r}set chainId(t){this._chainId=t}get chainId(){return this._chainId}set networkId(t){this._networkId=t}get networkId(){return this._networkId}set accounts(t){this._accounts=t}get accounts(){return this._accounts}set rpcUrl(t){this._rpcUrl=t}get rpcUrl(){return this._rpcUrl}set connected(t){}get connected(){return this._connected}set pending(t){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(t){t&&(this._connected=t.connected,this.accounts=t.accounts,this.chainId=t.chainId,this.bridge=t.bridge,this.key=t.key,this.clientId=t.clientId,this.clientMeta=t.clientMeta,this.peerId=t.peerId,this.peerMeta=t.peerMeta,this.handshakeId=t.handshakeId,this.handshakeTopic=t.handshakeTopic)}on(t,e){const n={event:t,callback:e};this._eventManager.subscribe(n)}off(t){this._eventManager.unsubscribe(t)}async createInstantRequest(t){this._key=await this._generateKey();const e=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(t)}]});this.handshakeId=e.id,this.handshakeTopic=Object(s.uuid)(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",()=>{throw new Error("User close QRCode Modal")});const n=()=>{this.killSession()};try{const t=await this._sendCallRequest(e);return t&&n(),t}catch(t){throw n(),t}}async connect(t){if(!this._qrcodeModal)throw new Error("QRCode Modal not provided");return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(t),new Promise(async(t,e)=>{this.on("modal_closed",()=>e(new Error("User close QRCode Modal"))),this.on("connect",(n,r)=>{if(n)return e(n);t(r.params[0])})}))}async createSession(t){if(this._connected)throw new Error("Session currently connected");if(this.pending)return;this._key=await this._generateKey();const e=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:t&&t.chainId?t.chainId:null}]});this.handshakeId=e.id,this.handshakeTopic=Object(s.uuid)(),this._sendSessionRequest(e,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(t){if(this._connected)throw new Error("Session currently connected");this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";const e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},n={id:this.handshakeId,jsonrpc:"2.0",result:e};this._sendResponse(n),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(t){if(this._connected)throw new Error("Session currently connected");const e=t&&t.message?t.message:"Session Rejected",n=this._formatResponse({id:this.handshakeId,error:{message:e}});this._sendResponse(n),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:e}]}),this._removeStorageSession()}updateSession(t){if(!this._connected)throw new Error("Session currently disconnected");this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";const e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},n=this._formatRequest({method:"wc_sessionUpdate",params:[e]});this._sendSessionRequest(n,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(t){const e=t?t.message:"Session Disconnected",n=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]});await this._sendRequest(n),this._handleSessionDisconnect(e)}async sendTransaction(t){if(!this._connected)throw new Error("Session currently disconnected");const e=Object(s.parseTransactionData)(t),n=this._formatRequest({method:"eth_sendTransaction",params:[e]});return await this._sendCallRequest(n)}async signTransaction(t){if(!this._connected)throw new Error("Session currently disconnected");const e=Object(s.parseTransactionData)(t),n=this._formatRequest({method:"eth_signTransaction",params:[e]});return await this._sendCallRequest(n)}async signMessage(t){if(!this._connected)throw new Error("Session currently disconnected");const e=this._formatRequest({method:"eth_sign",params:t});return await this._sendCallRequest(e)}async signPersonalMessage(t){if(!this._connected)throw new Error("Session currently disconnected");t=Object(s.parsePersonalSign)(t);const e=this._formatRequest({method:"personal_sign",params:t});return await this._sendCallRequest(e)}async signTypedData(t){if(!this._connected)throw new Error("Session currently disconnected");const e=this._formatRequest({method:"eth_signTypedData",params:t});return await this._sendCallRequest(e)}async updateChain(t){if(!this._connected)throw new Error("Session currently disconnected");const e=this._formatRequest({method:"wallet_updateChain",params:[t]});return await this._sendCallRequest(e)}unsafeSend(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),new Promise((e,n)=>{this._subscribeToResponse(t.id,(t,r)=>{if(t)n(t);else{if(!r)throw new Error("Missing JSON RPC response");e(r)}})})}async sendCustomRequest(t,e){if(!this._connected)throw new Error("Session currently disconnected");switch(t.method){case"eth_accounts":return this.accounts;case"eth_chainId":return Object(s.convertNumberToHex)(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":t.params&&(t.params[0]=Object(s.parseTransactionData)(t.params[0]));break;case"personal_sign":t.params&&(t.params=Object(s.parsePersonalSign)(t.params))}const n=this._formatRequest(t);return await this._sendCallRequest(n,e)}approveRequest(t){if(!Object(s.isJsonRpcResponseSuccess)(t))throw new Error('JSON-RPC success response must include "result" field');{const e=this._formatResponse(t);this._sendResponse(e)}}rejectRequest(t){if(!Object(s.isJsonRpcResponseError)(t))throw new Error('JSON-RPC error response must include "error" field');{const e=this._formatResponse(t);this._sendResponse(e)}}transportClose(){this._transport.close()}async _sendRequest(t,e){const n=this._formatRequest(t),r=await this._encrypt(n),o=void 0!==(null==e?void 0:e.topic)?e.topic:this.peerId,i=JSON.stringify(r),a=void 0!==(null==e?void 0:e.forcePushNotification)?!e.forcePushNotification:Object(s.isSilentPayload)(n);this._transport.send(i,o,a)}async _sendResponse(t){const e=await this._encrypt(t),n=this.peerId,r=JSON.stringify(e);this._transport.send(r,n,!0)}async _sendSessionRequest(t,e,n){this._sendRequest(t,n),this._subscribeToSessionResponse(t.id,e)}_sendCallRequest(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),this._subscribeToCallResponse(t.id)}_formatRequest(t){if(void 0===t.method)throw new Error('JSON RPC request must have valid "method" value');return{id:void 0===t.id?Object(s.payloadId)():t.id,jsonrpc:"2.0",method:t.method,params:void 0===t.params?[]:t.params}}_formatResponse(t){if(void 0===t.id)throw new Error('JSON RPC request must have valid "id" value');const e={id:t.id,jsonrpc:"2.0"};if(Object(s.isJsonRpcResponseError)(t)){const n=Object(s.formatRpcError)(t.error);return Object.assign(Object.assign(Object.assign({},e),t),{error:n})}if(Object(s.isJsonRpcResponseSuccess)(t)){return Object.assign(Object.assign({},e),t)}throw new Error("JSON RPC response format is invalid")}_handleSessionDisconnect(t){const e=t||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),Object(s.removeLocal)(s.mobileLinkChoiceKey)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:e}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(t,e){e&&e.approved?(this._connected?(e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),e.peerId&&!this.peerId&&(this.peerId=e.peerId),e.peerMeta&&!this.peerMeta&&(this.peerMeta=e.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(t)}async _handleIncomingMessages(t){if(![this.clientId,this.handshakeTopic].includes(t.topic))return;let e;try{e=JSON.parse(t.payload)}catch(t){return}const n=await this._decrypt(e);n&&this._eventManager.trigger(n)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(t,e){this.on("response:"+t,e)}_subscribeToSessionResponse(t,e){this._subscribeToResponse(t,(t,n)=>{t?this._handleSessionResponse(t.message):n.result?this._handleSessionResponse(e,n.result):n.error&&n.error.message?this._handleSessionResponse(n.error.message):this._handleSessionResponse(e)})}_subscribeToCallResponse(t){return new Promise((e,n)=>{this._subscribeToResponse(t,(t,r)=>{t?n(t):r.result?e(r.result):r.error&&r.error.message?n(new Error(r.error.message)):n(new Error("JSON RPC response format is invalid"))})})}_subscribeToInternalEvents(){this.on("display_uri",()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,()=>{this._eventManager.trigger({event:"modal_closed",params:[]})},this._qrcodeModalOptions)}),this.on("connect",()=>{this._qrcodeModal&&this._qrcodeModal.close()}),this.on("call_request_sent",(t,e)=>{const{request:n}=e.params[0];if(Object(s.isMobile)()&&this._signingMethods.includes(n.method)){const t=Object(s.getLocal)(s.mobileLinkChoiceKey);t&&(window.location.href=t.href)}}),this.on("wc_sessionRequest",(t,e)=>{t&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),this.handshakeId=e.id,this.peerId=e.params[0].peerId,this.peerMeta=e.params[0].peerMeta;const n=Object.assign(Object.assign({},e),{method:"session_request"});this._eventManager.trigger(n)}),this.on("wc_sessionUpdate",(t,e)=>{t&&this._handleSessionResponse(t.message),this._handleSessionResponse("Session disconnected",e.params[0])})}_initTransport(){this._transport.on("message",t=>this._handleIncomingMessages(t)),this._transport.on("open",()=>this._eventManager.trigger({event:"transport_open",params:[]})),this._transport.on("close",()=>this._eventManager.trigger({event:"transport_close",params:[]})),this._transport.on("error",()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})),this._transport.open()}_formatUri(){return`${this.protocol}:${this.handshakeTopic}@${this.version}?bridge=${encodeURIComponent(this.bridge)}&key=${this.key}`}_parseUri(t){const e=Object(s.parseWalletConnectUri)(t);if(e.protocol===this.protocol){if(!e.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const t=e.handshakeTopic;if(!e.bridge)throw Error("Invalid or missing bridge url parameter value");const n=decodeURIComponent(e.bridge);if(!e.key)throw Error("Invalid or missing key parameter value");return{handshakeTopic:t,bridge:n,key:e.key}}throw new Error("URI format is invalid")}async _generateKey(){if(this._cryptoLib){return await this._cryptoLib.generateKey()}return null}async _encrypt(t){const e=this._key;if(this._cryptoLib&&e){return await this._cryptoLib.encrypt(t,e)}return null}async _decrypt(t){const e=this._key;if(this._cryptoLib&&e){return await this._cryptoLib.decrypt(t,e)}return null}_getStorageSession(){let t=null;return this._sessionStorage&&(t=this._sessionStorage.getSession()),t}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(t){if(!t.url||"string"!=typeof t.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!t.type||"string"!=typeof t.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!t.token||"string"!=typeof t.token)throw Error("Invalid or missing pushServerOpts.token parameter value");const e={bridge:this.bridge,topic:this.clientId,type:t.type,token:t.token,peerName:"",language:t.language||""};this.on("connect",async(n,r)=>{if(n)throw n;if(t.peerMeta){const t=r.params[0].peerMeta.name;e.peerName=t}try{const n=await fetch(t.url+"/new",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)});if(!(await n.json()).success)throw Error("Failed to register in Push Server")}catch(n){throw Error("Failed to register in Push Server")}})}},d=n(13),p=n(0);async function g(t){const e=(t||256)/8,n=d.randomBytes(e);return Object(s.convertBufferToArrayBuffer)(p.b(n))}async function m(t,e){const n=p.n(t.data),r=p.n(t.iv),o=p.n(t.hmac),i=p.c(o,!1),s=p.j(n,r),a=await d.hmacSha256Sign(e,s),u=p.c(a,!1);return p.x(i)===p.x(u)}async function v(t,e,n){const r=p.f(Object(s.convertArrayBufferToBuffer)(e)),o=n||await g(128),i=p.f(Object(s.convertArrayBufferToBuffer)(o)),a=p.c(i,!1),u=JSON.stringify(t),c=p.z(u),l=await d.aesCbcEncrypt(i,r,c),h=p.c(l,!1),f=p.j(l,i),m=await d.hmacSha256Sign(r,f);return{data:h,hmac:p.c(m,!1),iv:a}}async function _(t,e){const n=p.f(Object(s.convertArrayBufferToBuffer)(e));if(!n)throw new Error("Missing key: required for decryption");if(!await m(t,n))return null;const r=p.n(t.data),o=p.n(t.iv),i=await d.aesCbcDecrypt(o,n,r),a=p.e(i);let u;try{u=JSON.parse(a)}catch(t){return null}return u}var y=class extends f{constructor(t,e){super({cryptoLib:r,connectorOpts:t,pushServerOpts:e})}},w=n(56),b=n.n(w),M=n(19),E=n(5);n.d(e,"SignerConnection",(function(){return x}));class x extends M.IJsonRpcConnection{constructor(t){super(),this.events=new i.a,this.accounts=[],this.chainId=1,this.pending=!1,this.bridge="https://bridge.walletconnect.org",this.qrcode=!0,this.qrcodeModalOptions=void 0,this.opts=t,this.chainId=(null==t?void 0:t.chainId)||this.chainId,this.wc=this.register(t)}get connected(){return void 0!==this.wc&&this.wc.connected}get connecting(){return this.pending}get connector(){return this.wc=this.register(this.opts),this.wc}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async open(t){if(!this.connected)return new Promise((e,n)=>{this.on("error",t=>{n(t)}),this.on("open",()=>{e()}),this.create(t)});this.onOpen()}async close(){void 0!==this.wc&&(this.wc.connected&&this.wc.killSession(),this.onClose())}async send(t){this.wc=this.register(this.opts),this.connected||await this.open(),this.sendPayload(t).then(t=>this.events.emit("payload",t)).catch(e=>this.events.emit("payload",Object(E.formatJsonRpcError)(t.id,e.message)))}register(t){if(this.wc)return this.wc;this.opts=t||this.opts,this.bridge=(null==t?void 0:t.connector)?t.connector.bridge:(null==t?void 0:t.bridge)||"https://bridge.walletconnect.org",this.qrcode=void 0===(null==t?void 0:t.qrcode)||!1!==t.qrcode,this.chainId=void 0!==(null==t?void 0:t.chainId)?t.chainId:this.chainId,this.qrcodeModalOptions=null==t?void 0:t.qrcodeModalOptions;const e={bridge:this.bridge,qrcodeModal:this.qrcode?b.a:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:null==t?void 0:t.storageId,signingMethods:null==t?void 0:t.signingMethods,clientMeta:null==t?void 0:t.clientMeta};if(this.wc=void 0!==(null==t?void 0:t.connector)?t.connector:new y(e),void 0===this.wc)throw new Error("Failed to register WalletConnect connector");return this.wc.accounts.length&&(this.accounts=this.wc.accounts),this.wc.chainId&&(this.chainId=this.wc.chainId),this.registerConnectorEvents(),this.wc}onOpen(t){this.pending=!1,t&&(this.wc=t),this.events.emit("open")}onClose(){this.pending=!1,this.wc&&(this.wc=void 0),this.events.emit("close")}onError(t,e="Failed or Rejected Request",n=-32e3){const r={id:t.id,jsonrpc:t.jsonrpc,error:{code:n,message:e}};return this.events.emit("payload",r),r}create(t){this.wc=this.register(this.opts),this.chainId=t||this.chainId,this.connected||this.pending||(this.pending=!0,this.registerConnectorEvents(),this.wc.createSession({chainId:this.chainId}).then(()=>this.events.emit("created")).catch(t=>this.events.emit("error",t)))}registerConnectorEvents(){this.wc=this.register(this.opts),this.wc.on("connect",t=>{var e,n;t?this.events.emit("error",t):(this.accounts=(null===(e=this.wc)||void 0===e?void 0:e.accounts)||[],this.chainId=(null===(n=this.wc)||void 0===n?void 0:n.chainId)||this.chainId,this.onOpen())}),this.wc.on("disconnect",t=>{t?this.events.emit("error",t):this.onClose()}),this.wc.on("modal_closed",()=>{this.events.emit("error",new Error("User closed modal"))}),this.wc.on("session_update",(t,e)=>{const{accounts:n,chainId:r}=e.params[0];(!this.accounts||n&&this.accounts!==n)&&(this.accounts=n,this.events.emit("accountsChanged",n)),(!this.chainId||r&&this.chainId!==r)&&(this.chainId=r,this.events.emit("chainChanged",r))})}async sendPayload(t){this.wc=this.register(this.opts);try{const e=await this.wc.unsafeSend(t);return this.sanitizeResponse(e)}catch(e){return this.onError(t,e.message)}}sanitizeResponse(t){return void 0!==t.error&&void 0===t.error.code?Object(E.formatJsonRpcError)(t.id,t.error.message):t}}e.default=x},function(t,e,n){"use strict";n.r(e);var r,o,i,s,a,u,c,l={},h=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function d(t,e){for(var n in e)t[n]=e[n];return t}function p(t){var e=t.parentNode;e&&e.removeChild(t)}function g(t,e,n){var r,o=arguments,i={};for(r in e)"key"!==r&&"ref"!==r&&(i[r]=e[r]);if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(o[r]);if(null!=n&&(i.children=n),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===i[r]&&(i[r]=t.defaultProps[r]);return m(t,i,e&&e.key,e&&e.ref,null)}function m(t,e,n,o,i){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i};return null==i&&(s.__v=s),r.vnode&&r.vnode(s),s}function v(){return{}}function _(t){return t.children}function y(t,e){this.props=t,this.context=e}function w(t,e){if(null==e)return t.__?w(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?w(t):null}function b(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return b(t)}}function M(t){(!t.__d&&(t.__d=!0)&&o.push(t)&&!i++||a!==r.debounceRendering)&&((a=r.debounceRendering)||s)(E)}function E(){for(var t;i=o.length;)t=o.sort((function(t,e){return t.__v.__b-e.__v.__b})),o=[],t.some((function(t){var e,n,r,o,i,s,a;t.__d&&(s=(i=(e=t).__v).__e,(a=e.__P)&&(n=[],(r=d({},i)).__v=r,o=C(a,i,r,e.__n,void 0!==a.ownerSVGElement,null,n,null==s?w(i):s),O(n,i),o!=s&&b(i)))}))}function x(t,e,n,r,o,i,s,a,u){var c,f,d,g,m,v,_,y=n&&n.__k||h,b=y.length;if(a==l&&(a=null!=i?i[0]:b?w(n,0):null),c=0,e.__k=R(e.__k,(function(n){if(null!=n){if(n.__=e,n.__b=e.__b+1,null===(d=y[c])||d&&n.key==d.key&&n.type===d.type)y[c]=void 0;else for(f=0;f<b;f++){if((d=y[f])&&n.key==d.key&&n.type===d.type){y[f]=void 0;break}d=null}if(g=C(t,n,d=d||l,r,o,i,s,a,u),(f=n.ref)&&d.ref!=f&&(_||(_=[]),d.ref&&_.push(d.ref,null,n),_.push(f,n.__c||g,n)),null!=g){var h;if(null==v&&(v=g),void 0!==n.__d)h=n.__d,n.__d=void 0;else if(i==d||g!=a||null==g.parentNode){t:if(null==a||a.parentNode!==t)t.appendChild(g),h=null;else{for(m=a,f=0;(m=m.nextSibling)&&f<b;f+=2)if(m==g)break t;t.insertBefore(g,a),h=a}"option"==e.type&&(t.value="")}a=void 0!==h?h:g.nextSibling,"function"==typeof e.type&&(e.__d=a)}else a&&d.__e==a&&a.parentNode!=t&&(a=w(d))}return c++,n})),e.__e=v,null!=i&&"function"!=typeof e.type)for(c=i.length;c--;)null!=i[c]&&p(i[c]);for(c=b;c--;)null!=y[c]&&P(y[c],y[c]);if(_)for(c=0;c<_.length;c++)I(_[c],_[++c],_[++c])}function R(t,e,n){if(null==n&&(n=[]),null==t||"boolean"==typeof t)e&&n.push(e(null));else if(Array.isArray(t))for(var r=0;r<t.length;r++)R(t[r],e,n);else n.push(e?e("string"==typeof t||"number"==typeof t?m(null,t,null,null,t):null!=t.__e||null!=t.__c?m(t.type,t.props,t.key,null,t.__v):t):t);return n}function S(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]="number"==typeof n&&!1===f.test(e)?n+"px":null==n?"":n}function k(t,e,n,r,o){var i,s,a,u,c;if(o?"className"===e&&(e="class"):"class"===e&&(e="className"),"style"===e)if(i=t.style,"string"==typeof n)i.cssText=n;else{if("string"==typeof r&&(i.cssText="",r=null),r)for(u in r)n&&u in n||S(i,u,"");if(n)for(c in n)r&&n[c]===r[c]||S(i,c,n[c])}else"o"===e[0]&&"n"===e[1]?(s=e!==(e=e.replace(/Capture$/,"")),a=e.toLowerCase(),e=(a in t?a:e).slice(2),n?(r||t.addEventListener(e,A,s),(t.l||(t.l={}))[e]=n):t.removeEventListener(e,A,s)):"list"!==e&&"tagName"!==e&&"form"!==e&&"type"!==e&&"size"!==e&&!o&&e in t?t[e]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==e&&(e!==(e=e.replace(/^xlink:?/,""))?null==n||!1===n?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),n):null==n||!1===n&&!/^ar/.test(e)?t.removeAttribute(e):t.setAttribute(e,n))}function A(t){this.l[t.type](r.event?r.event(t):t)}function C(t,e,n,o,i,s,a,u,c){var l,h,f,p,g,m,v,w,b,M,E=e.type;if(void 0!==e.constructor)return null;(l=r.__b)&&l(e);try{t:if("function"==typeof E){if(w=e.props,b=(l=E.contextType)&&o[l.__c],M=l?b?b.props.value:l.__:o,n.__c?v=(h=e.__c=n.__c).__=h.__E:("prototype"in E&&E.prototype.render?e.__c=h=new E(w,M):(e.__c=h=new y(w,M),h.constructor=E,h.render=B),b&&b.sub(h),h.props=w,h.state||(h.state={}),h.context=M,h.__n=o,f=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=E.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,E.getDerivedStateFromProps(w,h.__s))),p=h.props,g=h.state,f)null==E.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==E.getDerivedStateFromProps&&w!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(w,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(w,h.__s,M)||e.__v===n.__v&&!h.__){for(h.props=w,h.state=h.__s,e.__v!==n.__v&&(h.__d=!1),h.__v=e,e.__e=n.__e,e.__k=n.__k,h.__h.length&&a.push(h),l=0;l<e.__k.length;l++)e.__k[l]&&(e.__k[l].__=e);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(w,h.__s,M),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(p,g,m)}))}h.context=M,h.props=w,h.state=h.__s,(l=r.__r)&&l(e),h.__d=!1,h.__v=e,h.__P=t,l=h.render(h.props,h.state,h.context),e.__k=null!=l&&l.type==_&&null==l.key?l.props.children:Array.isArray(l)?l:[l],null!=h.getChildContext&&(o=d(d({},o),h.getChildContext())),f||null==h.getSnapshotBeforeUpdate||(m=h.getSnapshotBeforeUpdate(p,g)),x(t,e,n,o,i,s,a,u,c),h.base=e.__e,h.__h.length&&a.push(h),v&&(h.__E=h.__=null),h.__e=!1}else null==s&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=T(n.__e,e,n,o,i,s,a,c);(l=r.diffed)&&l(e)}catch(t){e.__v=null,r.__e(t,e,n)}return e.__e}function O(t,e){r.__c&&r.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){r.__e(t,e.__v)}}))}function T(t,e,n,r,o,i,s,a){var u,c,f,d,p,g=n.props,m=e.props;if(o="svg"===e.type||o,null!=i)for(u=0;u<i.length;u++)if(null!=(c=i[u])&&((null===e.type?3===c.nodeType:c.localName===e.type)||t==c)){t=c,i[u]=null;break}if(null==t){if(null===e.type)return document.createTextNode(m);t=o?document.createElementNS("http://www.w3.org/2000/svg",e.type):document.createElement(e.type,m.is&&{is:m.is}),i=null,a=!1}if(null===e.type)g!==m&&t.data!=m&&(t.data=m);else{if(null!=i&&(i=h.slice.call(t.childNodes)),f=(g=n.props||l).dangerouslySetInnerHTML,d=m.dangerouslySetInnerHTML,!a){if(g===l)for(g={},p=0;p<t.attributes.length;p++)g[t.attributes[p].name]=t.attributes[p].value;(d||f)&&(d&&f&&d.__html==f.__html||(t.innerHTML=d&&d.__html||""))}(function(t,e,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in e||k(t,i,null,n[i],r);for(i in e)o&&"function"!=typeof e[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===e[i]||k(t,i,e[i],n[i],r)})(t,m,g,o,a),d?e.__k=[]:(e.__k=e.props.children,x(t,e,n,r,"foreignObject"!==e.type&&o,i,s,l,a)),a||("value"in m&&void 0!==(u=m.value)&&u!==t.value&&k(t,"value",u,g.value,!1),"checked"in m&&void 0!==(u=m.checked)&&u!==t.checked&&k(t,"checked",u,g.checked,!1))}return t}function I(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){r.__e(t,n)}}function P(t,e,n){var o,i,s;if(r.unmount&&r.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||I(o,null,e)),n||"function"==typeof t.type||(n=null!=(i=t.__e)),t.__e=t.__d=void 0,null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){r.__e(t,e)}o.base=o.__P=null}if(o=t.__k)for(s=0;s<o.length;s++)o[s]&&P(o[s],e,n);null!=i&&p(i)}function B(t,e,n){return this.constructor(t,n)}function L(t,e,n){var o,i,s;r.__&&r.__(t,e),i=(o=n===u)?null:n&&n.__k||e.__k,t=g(_,null,[t]),s=[],C(e,(o?e:n||e).__k=t,i||l,l,void 0!==e.ownerSVGElement,n&&!o?[n]:i?null:h.slice.call(e.childNodes),s,n||l,o),O(s,t)}function N(t,e){L(t,e,u)}function j(t,e){var n,r;for(r in e=d(d({},t.props),e),arguments.length>2&&(e.children=h.slice.call(arguments,2)),n={},e)"key"!==r&&"ref"!==r&&(n[r]=e[r]);return m(t.type,n,e.key||t.key,e.ref||t.ref,null)}function U(t){var e={},n={__c:"__cC"+c++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var r,o=this;return this.getChildContext||(r=[],this.getChildContext=function(){return e[n.__c]=o,e},this.shouldComponentUpdate=function(t){o.props.value!==t.value&&r.some((function(e){e.context=t.value,M(e)}))},this.sub=function(t){r.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r.splice(r.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Consumer.contextType=n,n.Provider.__=n,n}r={__e:function(t,e){for(var n,r;e=e.__;)if((n=e.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError&&(r=!0,n.setState(n.constructor.getDerivedStateFromError(t))),null!=n.componentDidCatch&&(r=!0,n.componentDidCatch(t)),r)return M(n.__E=n)}catch(e){t=e}throw t}},y.prototype.setState=function(t,e){var n;n=this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof t&&(t=t(n,this.props)),t&&d(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),M(this))},y.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),M(this))},y.prototype.render=_,o=[],i=0,s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=l,c=0;var q,D,J,F=0,H=[],W=r.__r,z=r.diffed,Y=r.__c,$=r.unmount;function V(t,e){r.__h&&r.__h(D,t,F||e),F=0;var n=D.__H||(D.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function K(t){return F=1,Q(lt,t)}function Q(t,e,n){var r=V(q++,2);return r.__c||(r.__c=D,r.__=[n?n(e):lt(void 0,e),function(e){var n=t(r.__[0],e);r.__[0]!==n&&(r.__[0]=n,r.__c.setState({}))}]),r.__}function Z(t,e){var n=V(q++,3);!r.__s&&ct(n.__H,e)&&(n.__=t,n.__H=e,D.__H.__h.push(n))}function X(t,e){var n=V(q++,4);!r.__s&&ct(n.__H,e)&&(n.__=t,n.__H=e,D.__h.push(n))}function G(t){return F=5,et((function(){return{current:t}}),[])}function tt(t,e,n){F=6,X((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==n?n:n.concat(t))}function et(t,e){var n=V(q++,7);return ct(n.__H,e)?(n.__H=e,n.__h=t,n.__=t()):n.__}function nt(t,e){return F=8,et((function(){return t}),e)}function rt(t){var e=D.context[t.__c],n=V(q++,9);return n.__c=t,e?(null==n.__&&(n.__=!0,e.sub(D)),e.props.value):t.__}function ot(t,e){r.useDebugValue&&r.useDebugValue(e?e(t):t)}function it(t){var e=V(q++,10),n=K();return e.__=t,D.componentDidCatch||(D.componentDidCatch=function(t){e.__&&e.__(t),n[1](t)}),[n[0],function(){n[1](void 0)}]}function st(){H.some((function(t){if(t.__P)try{t.__H.__h.forEach(at),t.__H.__h.forEach(ut),t.__H.__h=[]}catch(e){return t.__H.__h=[],r.__e(e,t.__v),!0}})),H=[]}function at(t){t.t&&t.t()}function ut(t){var e=t.__();"function"==typeof e&&(t.t=e)}function ct(t,e){return!t||e.some((function(e,n){return e!==t[n]}))}function lt(t,e){return"function"==typeof e?e(t):e}function ht(t,e){for(var n in e)t[n]=e[n];return t}function ft(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var r in e)if("__source"!==r&&t[r]!==e[r])return!0;return!1}r.__r=function(t){W&&W(t),q=0,(D=t.__c).__H&&(D.__H.__h.forEach(at),D.__H.__h.forEach(ut),D.__H.__h=[])},r.diffed=function(t){z&&z(t);var e=t.__c;if(e){var n=e.__H;n&&n.__h.length&&(1!==H.push(e)&&J===r.requestAnimationFrame||((J=r.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(r),cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);"undefined"!=typeof window&&(e=requestAnimationFrame(n))})(st))}},r.__c=function(t,e){e.some((function(t){try{t.__h.forEach(at),t.__h=t.__h.filter((function(t){return!t.__||ut(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],r.__e(n,t.__v)}})),Y&&Y(t,e)},r.unmount=function(t){$&&$(t);var e=t.__c;if(e){var n=e.__H;if(n)try{n.__.forEach((function(t){return t.t&&t.t()}))}catch(t){r.__e(t,e.__v)}}},n.d(e,"version",(function(){return jt})),n.d(e,"Children",(function(){return _t})),n.d(e,"render",(function(){return Tt})),n.d(e,"hydrate",(function(){return It})),n.d(e,"unmountComponentAtNode",(function(){return Jt})),n.d(e,"createPortal",(function(){return At})),n.d(e,"createFactory",(function(){return Ut})),n.d(e,"cloneElement",(function(){return Dt})),n.d(e,"isValidElement",(function(){return qt})),n.d(e,"findDOMNode",(function(){return Ft})),n.d(e,"PureComponent",(function(){return dt})),n.d(e,"memo",(function(){return pt})),n.d(e,"forwardRef",(function(){return mt})),n.d(e,"unstable_batchedUpdates",(function(){return Ht})),n.d(e,"Suspense",(function(){return bt})),n.d(e,"SuspenseList",(function(){return xt})),n.d(e,"lazy",(function(){return Et})),n.d(e,"useState",(function(){return K})),n.d(e,"useReducer",(function(){return Q})),n.d(e,"useEffect",(function(){return Z})),n.d(e,"useLayoutEffect",(function(){return X})),n.d(e,"useRef",(function(){return G})),n.d(e,"useImperativeHandle",(function(){return tt})),n.d(e,"useMemo",(function(){return et})),n.d(e,"useCallback",(function(){return nt})),n.d(e,"useContext",(function(){return rt})),n.d(e,"useDebugValue",(function(){return ot})),n.d(e,"useErrorBoundary",(function(){return it})),n.d(e,"createElement",(function(){return g})),n.d(e,"createContext",(function(){return U})),n.d(e,"createRef",(function(){return v})),n.d(e,"Fragment",(function(){return _})),n.d(e,"Component",(function(){return y}));var dt=function(t){var e,n;function r(e){var n;return(n=t.call(this,e)||this).isPureReactComponent=!0,n}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.shouldComponentUpdate=function(t,e){return ft(this.props,t)||ft(this.state,e)},r}(y);function pt(t,e){function n(t){var n=this.props.ref,r=n==t.ref;return!r&&n&&(n.call?n(null):n.current=null),e?!e(this.props,t)||!r:ft(this.props,t)}function r(e){return this.shouldComponentUpdate=n,g(t,ht({},e))}return r.prototype.isReactComponent=!0,r.displayName="Memo("+(t.displayName||t.name)+")",r.t=!0,r}var gt=r.__b;function mt(t){function e(e){var n=ht({},e);return delete n.ref,t(n,e.ref)}return e.prototype.isReactComponent=e.t=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}r.__b=function(t){t.type&&t.type.t&&t.ref&&(t.props.ref=t.ref,t.ref=null),gt&>(t)};var vt=function(t,e){return t?R(t).reduce((function(t,n,r){return t.concat(e(n,r))}),[]):null},_t={map:vt,forEach:vt,count:function(t){return t?R(t).length:0},only:function(t){if(1!==(t=R(t)).length)throw new Error("Children.only() expects only one child.");return t[0]},toArray:R},yt=r.__e;function wt(t){return t&&((t=ht({},t)).__c=null,t.__k=t.__k&&t.__k.map(wt)),t}function bt(){this.__u=0,this.o=null,this.__b=null}function Mt(t){var e=t.__.__c;return e&&e.u&&e.u(t)}function Et(t){var e,n,r;function o(o){if(e||(e=t()).then((function(t){n=t.default||t}),(function(t){r=t})),r)throw r;if(!n)throw e;return g(n,o)}return o.displayName="Lazy",o.t=!0,o}function xt(){this.i=null,this.l=null}r.__e=function(t,e,n){if(t.then)for(var r,o=e;o=o.__;)if((r=o.__c)&&r.__c)return r.__c(t,e.__c);yt(t,e,n)},(bt.prototype=new y).__c=function(t,e){var n=this;null==n.o&&(n.o=[]),n.o.push(e);var r=Mt(n.__v),o=!1,i=function(){o||(o=!0,r?r(s):s())};e.__c=e.componentWillUnmount,e.componentWillUnmount=function(){i(),e.__c&&e.__c()};var s=function(){var t;if(!--n.__u)for(n.__v.__k[0]=n.state.u,n.setState({u:n.__b=null});t=n.o.pop();)t.forceUpdate()};n.__u++||n.setState({u:n.__b=n.__v.__k[0]}),t.then(i,i)},bt.prototype.render=function(t,e){return this.__b&&(this.__v.__k[0]=wt(this.__b),this.__b=null),[g(y,null,e.u?null:t.children),e.u&&t.fallback]};var Rt=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(xt.prototype=new y).u=function(t){var e=this,n=Mt(e.__v),r=e.l.get(t);return r[0]++,function(o){var i=function(){e.props.revealOrder?(r.push(o),Rt(e,t,r)):o()};n?n(i):i()}},xt.prototype.render=function(t){this.i=null,this.l=new Map;var e=R(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},xt.prototype.componentDidUpdate=xt.prototype.componentDidMount=function(){var t=this;t.l.forEach((function(e,n){Rt(t,n,e)}))};var St=function(){function t(){}var e=t.prototype;return e.getChildContext=function(){return this.props.context},e.render=function(t){return t.children},t}();function kt(t){var e=this,n=t.container,r=g(St,{context:e.context},t.vnode);return e.s&&e.s!==n&&(e.v.parentNode&&e.s.removeChild(e.v),P(e.h),e.p=!1),t.vnode?e.p?(n.__k=e.__k,L(r,n),e.__k=n.__k):(e.v=document.createTextNode(""),N("",n),n.appendChild(e.v),e.p=!0,e.s=n,L(r,n,e.v),e.__k=e.v.__k):e.p&&(e.v.parentNode&&e.s.removeChild(e.v),P(e.h)),e.h=r,e.componentWillUnmount=function(){e.v.parentNode&&e.s.removeChild(e.v),P(e.h)},null}function At(t,e){return g(kt,{vnode:t,container:e})}var Ct=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;y.prototype.isReactComponent={};var Ot="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;function Tt(t,e,n){if(null==e.__k)for(;e.firstChild;)e.removeChild(e.firstChild);return L(t,e),"function"==typeof n&&n(),t?t.__c:null}function It(t,e,n){return N(t,e),"function"==typeof n&&n(),t?t.__c:null}var Pt=r.event;function Bt(t,e){t["UNSAFE_"+e]&&!t[e]&&Object.defineProperty(t,e,{configurable:!1,get:function(){return this["UNSAFE_"+e]},set:function(t){this["UNSAFE_"+e]=t}})}r.event=function(t){Pt&&(t=Pt(t)),t.persist=function(){};var e=!1,n=!1,r=t.stopPropagation;t.stopPropagation=function(){r.call(t),e=!0};var o=t.preventDefault;return t.preventDefault=function(){o.call(t),n=!0},t.isPropagationStopped=function(){return e},t.isDefaultPrevented=function(){return n},t.nativeEvent=t};var Lt={configurable:!0,get:function(){return this.class}},Nt=r.vnode;r.vnode=function(t){t.$$typeof=Ot;var e=t.type,n=t.props;if(e){if(n.class!=n.className&&(Lt.enumerable="className"in n,null!=n.className&&(n.class=n.className),Object.defineProperty(n,"className",Lt)),"function"!=typeof e){var r,o,i;for(i in n.defaultValue&&void 0!==n.value&&(n.value||0===n.value||(n.value=n.defaultValue),delete n.defaultValue),Array.isArray(n.value)&&n.multiple&&"select"===e&&(R(n.children).forEach((function(t){-1!=n.value.indexOf(t.props.value)&&(t.props.selected=!0)})),delete n.value),n)if(r=Ct.test(i))break;if(r)for(i in o=t.props={},n)o[Ct.test(i)?i.replace(/[A-Z0-9]/,"-$&").toLowerCase():i]=n[i]}!function(e){var n=t.type,r=t.props;if(r&&"string"==typeof n){var o={};for(var i in r)/^on(Ani|Tra|Tou)/.test(i)&&(r[i.toLowerCase()]=r[i],delete r[i]),o[i.toLowerCase()]=i;if(o.ondoubleclick&&(r.ondblclick=r[o.ondoubleclick],delete r[o.ondoubleclick]),o.onbeforeinput&&(r.onbeforeinput=r[o.onbeforeinput],delete r[o.onbeforeinput]),o.onchange&&("textarea"===n||"input"===n.toLowerCase()&&!/^fil|che|ra/i.test(r.type))){var s=o.oninput||"oninput";r[s]||(r[s]=r[o.onchange],delete r[o.onchange])}}}(),"function"==typeof e&&!e.m&&e.prototype&&(Bt(e.prototype,"componentWillMount"),Bt(e.prototype,"componentWillReceiveProps"),Bt(e.prototype,"componentWillUpdate"),e.m=!0)}Nt&&Nt(t)};var jt="16.8.0";function Ut(t){return g.bind(null,t)}function qt(t){return!!t&&t.$$typeof===Ot}function Dt(t){return qt(t)?j.apply(null,arguments):t}function Jt(t){return!!t.__k&&(L(null,t),!0)}function Ft(t){return t&&(t.base||1===t.nodeType&&t)||null}var Ht=function(t,e){return t(e)};e.default={useState:K,useReducer:Q,useEffect:Z,useLayoutEffect:X,useRef:G,useImperativeHandle:tt,useMemo:et,useCallback:nt,useContext:rt,useDebugValue:ot,version:"16.8.0",Children:_t,render:Tt,hydrate:Tt,unmountComponentAtNode:Jt,createPortal:At,createElement:g,createContext:U,createFactory:Ut,cloneElement:Dt,createRef:v,Fragment:_,isValidElement:qt,findDOMNode:Ft,Component:y,PureComponent:dt,memo:pt,forwardRef:mt,unstable_batchedUpdates:Ht,Suspense:bt,SuspenseList:xt,lazy:Et}},function(t,e,n){"use strict";n.r(e);var r=n(20),o=n(5);class i extends o.IJsonRpcProvider{constructor(t){super(t),this.events=new r.EventEmitter,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async request(t,e){return this.requestStrict(Object(o.formatJsonRpcRequest)(t.method,t.params||[]),e)}async requestStrict(t,e){return new Promise(async(n,r)=>{if(!this.connection.connected)try{await this.open()}catch(t){r(t)}this.events.on(""+t.id,t=>{Object(o.isJsonRpcError)(t)?r(t.error.message):n(t.result)});try{await this.connection.send(t,e)}catch(t){r(t)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),Object(o.isJsonRpcResponse)(t)?this.events.emit(""+t.id,t):this.events.emit("message",{type:t.method,data:t.params})}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof t&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close(),this.events.emit("disconnect")}registerEventListeners(){this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",()=>this.events.emit("disconnect")),this.connection.on("error",t=>this.events.emit("error",t))}}var s=i;n.d(e,"JsonRpcProvider",(function(){return i}));e.default=s},function(t,e,n){"use strict";n.r(e);var r=n(20),o=n(27),i=n.n(o),s=n(11),a=n(5);const u={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class c{constructor(t){if(this.url=t,this.events=new r.EventEmitter,this.isAvailable=!1,this.registering=!1,!Object(a.isHttpUrl)(t))throw new Error("Provided URL is not compatible with HTTP connection: "+t);this.url=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async open(t=this.url){await this.register(t)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(t,e){this.isAvailable||await this.register();try{const e=Object(s.b)(t),n=await i()(this.url,Object.assign(Object.assign({},u),{body:e})),r=await n.json();this.onPayload({data:r})}catch(e){this.onError(t.id,e)}}async register(t=this.url){if(!Object(a.isHttpUrl)(t))throw new Error("Provided URL is not compatible with HTTP connection: "+t);if(this.registering)return new Promise((t,e)=>{this.events.once("register_error",t=>{e(t)}),this.events.once("open",()=>{if(void 0===this.isAvailable)return e(new Error("HTTP connection is missing or invalid"));t()})});this.url=t,this.registering=!0;try{const e=Object(s.b)({id:1,jsonrpc:"2.0",method:"test",params:[]});await i()(t,Object.assign(Object.assign({},u),{body:e})),this.onOpen()}catch(t){const e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(t){if(void 0===t.data)return;const e="string"==typeof t.data?Object(s.a)(t.data):t.data;this.events.emit("payload",e)}onError(t,e){const n=this.parseError(e),r=n.message||n.toString(),o=Object(a.formatJsonRpcError)(t,r);this.events.emit("payload",o)}parseError(t,e=this.url){return Object(a.parseConnectionError)(t,e,"HTTP")}}var l=c;n.d(e,"HttpConnection",(function(){return c}));e.default=l}])}));
|