diff --git a/angular-bare-bones-demo/dist/110.cab7602817242ae0.js b/angular-bare-bones-demo/dist/109.1f49d17e2055f0de.js similarity index 99% rename from angular-bare-bones-demo/dist/110.cab7602817242ae0.js rename to angular-bare-bones-demo/dist/109.1f49d17e2055f0de.js index 85097dbd4..cd3aa6870 100644 --- a/angular-bare-bones-demo/dist/110.cab7602817242ae0.js +++ b/angular-bare-bones-demo/dist/109.1f49d17e2055f0de.js @@ -1 +1 @@ -(self.webpackChunkAngular_bare_bones_demo=self.webpackChunkAngular_bare_bones_demo||[]).push([[110],{24110:(mt,dt,lt)=>{"use strict";lt.r(dt),lt.d(dt,{getWalletConnectProviderInstance:()=>m});var ge=lt(83667),z=lt.n(ge),l=lt(17040),m=function(y){return function(y,n,o,e){return new(o||(o=Promise))(function(i,u){function h(_){try{d(e.next(_))}catch(v){u(v)}}function f(_){try{d(e.throw(_))}catch(v){u(v)}}function d(_){_.done?i(_.value):function t(i){return i instanceof o?i:new o(function(u){u(i)})}(_.value).then(h,f)}d((e=e.apply(y,n||[])).next())})}(void 0,void 0,void 0,function(){return function(y,n){var e,t,i,u,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:h(0),throw:h(1),return:h(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function h(d){return function(_){return function f(d){if(e)throw new TypeError("Generator is already executing.");for(;u&&(u=0,d[0]&&(o=0)),o;)try{if(e=1,t&&(i=2&d[0]?t.return:d[0]?t.throw||((i=t.return)&&i.call(t),0):t.next)&&!(i=i.call(t,d[1])).done)return i;switch(t=0,i&&(d=[2&d[0],i.value]),d[0]){case 0:case 1:i=d;break;case 4:return o.label++,{value:d[1],done:!1};case 5:o.label++,t=d[1],d=[0];continue;case 7:d=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===d[0]||2===d[0])){o=0;continue}if(3===d[0]&&(!i||d[1]>i[0]&&d[1]>>0).toString(2))}function D(F){return new Uint8Array(function M(F,B=8){const N=E(F).match(new RegExp(`.{${B}}`,"gi"));return Array.from(N||[])}(F).map(B=>parseInt(B,2)))}function q(F,B){return!("string"!=typeof F||!F.match(/^0x[0-9A-Fa-f]*$/)||B&&F.length!==2+2*B)}function k(F){return s.isBuffer(F)}function p(F){return y.a.strict(F)&&!k(F)}function x(F){return!p(F)&&!k(F)&&void 0!==F.byteLength}function R(F){return k(F)?"buffer":p(F)?"typed-array":x(F)?"array-buffer":Array.isArray(F)?"array":typeof F}function r(F){return"string"==typeof(B=F)&&new RegExp(/^[01]+$/).test(B)&&B.length%8==0?"binary":q(F)?"hex":"utf8";var B}function a(...F){return s.concat(F)}function g(...F){let B=[];return F.forEach(N=>B=B.concat(Array.from(N))),new Uint8Array([...B])}function E(F,B=8,N="0"){return function(P,j,K="0"){return function W(F,B,N,P="0"){const j=B-F.length;let K=F;if(j>0){const Z=P.repeat(j);K=N?Z+F:F+Z}return K}(P,j,!0,K)}(F,function(P,j=8){const K=P%j;return K?(P-K)/j*j+j:P}(F.length,B),N)}function C(F){return F.replace(/^0x/,"")}function U(F){return F.startsWith("0x")?F:"0x"+F}function V(F){return(F=E(F=C(F),2))&&(F=U(F)),F}function I(F){const B=F.startsWith("0x");return F=(F=C(F)).startsWith("0")?F.substring(1):F,B?U(F):F}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";c.r(l);var s=c(76);const m=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],y=["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"],n=["eth_accounts","eth_chainId","net_version"],o={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var e=c(9),t=c.n(e),i=c(0);function u(Q){return i.b(new Uint8Array(Q))}function h(Q){return i.e(new Uint8Array(Q))}function f(Q,se){return i.c(new Uint8Array(Q),!se)}function d(Q){return i.d(new Uint8Array(Q))}function _(...Q){return i.n(Q.map(se=>i.c(new Uint8Array(se))).join("")).buffer}function v(Q){return i.f(Q).buffer}function T(Q){return i.i(Q)}function O(Q,se){return i.g(Q,!se)}function b(Q){return i.h(Q)}function S(...Q){return i.k(...Q)}function w(Q){return i.z(Q).buffer}function A(Q){return i.A(Q)}function L(Q,se){return i.B(Q,!se)}function H(Q){return new t.a(Q,10).toNumber()}function D(Q){return i.o(Q)}function q(Q){return i.n(Q).buffer}function k(Q){return i.p(Q)}function p(Q){return new t.a(i.x(Q),"hex").toNumber()}function x(Q){return i.v(Q)}function R(Q){return i.u(Q).buffer}function r(Q){return new t.a(Q).toString()}function a(Q,se){const le=i.x(i.y(new t.a(Q).toString(16)));return se?le:i.a(le)}var g=c(160);function M(Q){return i.y(Q)}function E(Q){return i.a(Q)}function C(Q){return i.x(Q)}function U(Q){return i.w(i.a(Q))}const V=c(161).payloadId;function I(){return((Q,se)=>{for(se=Q="";Q++<36;se+=51*Q&52?(15^Q?8^Math.random()*(20^Q?16:4):4).toString(16):"-");return se})()}function W(){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 F(Q,se){let le;const Le=o[Q];return Le&&(le=`https://${Le}.infura.io/v3/${se}`),le}function B(Q,se){let le;const Le=F(Q,se.infuraId);return se.custom&&se.custom[Q]?le=se.custom[Q]:Le&&(le=Le),le}function N(Q){return""===Q||"string"==typeof Q&&""===Q.trim()}function P(Q){return!(Q&&Q.length)}function j(Q){return i.r(Q)}function K(Q){return i.t(Q)}function Z(Q){return i.q(Q)}function J(Q){return i.m(Q)}function X(Q){return i.l(Q)}function ee(Q,se){return i.s(Q,se)}function te(Q){return"object"==typeof Q.params}function oe(Q){return void 0!==Q.method}function ve(Q){return void 0!==Q.result}function ie(Q){return void 0!==Q.error}function de(Q){return void 0!==Q.event}function fe(Q){return m.includes(Q)||Q.startsWith("wc_")}function re(Q){return!!Q.method.startsWith("wc_")||!y.includes(Q.method)}function _e(Q){Q=Object(i.x)(Q.toLowerCase());const se=Object(i.x)(Object(g.keccak_256)(A(Q)));let le="";for(let Le=0;Le7?le+=Q[Le].toUpperCase():le+=Q[Le];return Object(i.a)(le)}const Ke=Q=>!(!Q||"0x"!==Q.toLowerCase().substring(0,2)||!/^(0x)?[0-9a-f]{40}$/i.test(Q)||!/^(0x)?[0-9a-f]{40}$/.test(Q)&&!/^(0x)?[0-9A-F]{40}$/.test(Q)&&Q!==_e(Q));function pe(Q){return P(Q)||ee(Q[0])||(Q[0]=L(Q[0])),Q}function Te(Q){if(void 0!==Q.type&&"0"!==Q.type)return Q;if(void 0===Q.from||!Ke(Q.from))throw new Error("Transaction object must include a valid 'from' value.");function se(he){let Oe=he;return("number"==typeof he||"string"==typeof he&&!N(he))&&(ee(he)?"string"==typeof he&&(Oe=M(he)):Oe=a(he)),"string"==typeof Oe&&(Oe=U(Oe)),Oe}const le={from:M(Q.from),to:void 0===Q.to?void 0:M(Q.to),gasPrice:void 0===Q.gasPrice?"":se(Q.gasPrice),gas:void 0===Q.gas?void 0===Q.gasLimit?"":se(Q.gasLimit):se(Q.gas),value:void 0===Q.value?"":se(Q.value),nonce:void 0===Q.nonce?"":se(Q.nonce),data:void 0===Q.data?"":M(Q.data)||"0x"},Le=["gasPrice","gas","value","nonce"];return Object.keys(le).forEach(he=>{(void 0===le[he]||"string"==typeof le[he]&&!le[he].trim().length)&&Le.includes(he)&&delete le[he]}),le}function Ve(Q,se){return ge(function*(...le){return new Promise((Le,he)=>{Q.apply(se,[...le,(Oe,Ge)=>{null==Oe&&he(Oe),Le(Ge)}])})})}function be(Q){const se=Q.message||"Failed or Rejected Request";let le=-32e3;if(Q&&!Q.code)switch(se){case"Parse error":le=-32700;break;case"Invalid request":le=-32600;break;case"Method not found":le=-32601;break;case"Invalid params":le=-32602;break;case"Internal error":le=-32603;break;default:le=-32e3}const Le={code:le,message:se};return Q.data&&(Le.data=Q.data),Le}var Pe=c(78);function Ye(Q){const se=-1!==Q.indexOf("?")?Q.indexOf("?"):void 0;return void 0!==se?Q.substr(se):""}function we(Q,se){let le=Be(Q);return le=Object.assign(Object.assign({},le),se),$e(le)}function Be(Q){return Pe.parse(Q)}function $e(Q){return Pe.stringify(Q)}function Me(Q){return void 0!==Q.bridge}function je(Q){const se=Q.indexOf(":"),le=-1!==Q.indexOf("?")?Q.indexOf("?"):void 0,Le=Q.substring(0,se),he=function(Ge){const me=Ge.split("@");return{handshakeTopic:me[0],version:parseInt(me[1],10)}}(Q.substring(se+1,le)),Oe=function(Ge){const me=Be(Ge);return{key:me.key||"",bridge:me.bridge||""}}(void 0!==le?Q.substr(le):"");return Object.assign(Object.assign({protocol:Le},he),Oe)}c.d(l,"detectEnv",function(){return s.detectEnv}),c.d(l,"detectOS",function(){return s.detectOS}),c.d(l,"isAndroid",function(){return s.isAndroid}),c.d(l,"isIOS",function(){return s.isIOS}),c.d(l,"isMobile",function(){return s.isMobile}),c.d(l,"isNode",function(){return s.isNode}),c.d(l,"isBrowser",function(){return s.isBrowser}),c.d(l,"getFromWindow",function(){return s.getFromWindow}),c.d(l,"getFromWindowOrThrow",function(){return s.getFromWindowOrThrow}),c.d(l,"getDocumentOrThrow",function(){return s.getDocumentOrThrow}),c.d(l,"getDocument",function(){return s.getDocument}),c.d(l,"getNavigatorOrThrow",function(){return s.getNavigatorOrThrow}),c.d(l,"getNavigator",function(){return s.getNavigator}),c.d(l,"getLocationOrThrow",function(){return s.getLocationOrThrow}),c.d(l,"getLocation",function(){return s.getLocation}),c.d(l,"getCryptoOrThrow",function(){return s.getCryptoOrThrow}),c.d(l,"getCrypto",function(){return s.getCrypto}),c.d(l,"getLocalStorageOrThrow",function(){return s.getLocalStorageOrThrow}),c.d(l,"getLocalStorage",function(){return s.getLocalStorage}),c.d(l,"getClientMeta",function(){return s.getClientMeta}),c.d(l,"safeJsonParse",function(){return s.safeJsonParse}),c.d(l,"safeJsonStringify",function(){return s.safeJsonStringify}),c.d(l,"setLocal",function(){return s.setLocal}),c.d(l,"getLocal",function(){return s.getLocal}),c.d(l,"removeLocal",function(){return s.removeLocal}),c.d(l,"mobileLinkChoiceKey",function(){return s.mobileLinkChoiceKey}),c.d(l,"formatIOSMobile",function(){return s.formatIOSMobile}),c.d(l,"saveMobileLinkInfo",function(){return s.saveMobileLinkInfo}),c.d(l,"getMobileRegistryEntry",function(){return s.getMobileRegistryEntry}),c.d(l,"getMobileLinkRegistry",function(){return s.getMobileLinkRegistry}),c.d(l,"getWalletRegistryUrl",function(){return s.getWalletRegistryUrl}),c.d(l,"getDappRegistryUrl",function(){return s.getDappRegistryUrl}),c.d(l,"formatMobileRegistryEntry",function(){return s.formatMobileRegistryEntry}),c.d(l,"formatMobileRegistry",function(){return s.formatMobileRegistry}),c.d(l,"reservedEvents",function(){return m}),c.d(l,"signingMethods",function(){return y}),c.d(l,"stateMethods",function(){return n}),c.d(l,"infuraNetworks",function(){return o}),c.d(l,"convertArrayBufferToBuffer",function(){return u}),c.d(l,"convertArrayBufferToUtf8",function(){return h}),c.d(l,"convertArrayBufferToHex",function(){return f}),c.d(l,"convertArrayBufferToNumber",function(){return d}),c.d(l,"concatArrayBuffers",function(){return _}),c.d(l,"convertBufferToArrayBuffer",function(){return v}),c.d(l,"convertBufferToUtf8",function(){return T}),c.d(l,"convertBufferToHex",function(){return O}),c.d(l,"convertBufferToNumber",function(){return b}),c.d(l,"concatBuffers",function(){return S}),c.d(l,"convertUtf8ToArrayBuffer",function(){return w}),c.d(l,"convertUtf8ToBuffer",function(){return A}),c.d(l,"convertUtf8ToHex",function(){return L}),c.d(l,"convertUtf8ToNumber",function(){return H}),c.d(l,"convertHexToBuffer",function(){return D}),c.d(l,"convertHexToArrayBuffer",function(){return q}),c.d(l,"convertHexToUtf8",function(){return k}),c.d(l,"convertHexToNumber",function(){return p}),c.d(l,"convertNumberToBuffer",function(){return x}),c.d(l,"convertNumberToArrayBuffer",function(){return R}),c.d(l,"convertNumberToUtf8",function(){return r}),c.d(l,"convertNumberToHex",function(){return a}),c.d(l,"toChecksumAddress",function(){return _e}),c.d(l,"isValidAddress",function(){return Ke}),c.d(l,"parsePersonalSign",function(){return pe}),c.d(l,"parseTransactionData",function(){return Te}),c.d(l,"sanitizeHex",function(){return M}),c.d(l,"addHexPrefix",function(){return E}),c.d(l,"removeHexPrefix",function(){return C}),c.d(l,"removeHexLeadingZeros",function(){return U}),c.d(l,"payloadId",function(){return V}),c.d(l,"uuid",function(){return I}),c.d(l,"logDeprecationWarning",function(){return W}),c.d(l,"getInfuraRpcUrl",function(){return F}),c.d(l,"getRpcUrl",function(){return B}),c.d(l,"promisify",function(){return Ve}),c.d(l,"formatRpcError",function(){return be}),c.d(l,"isWalletConnectSession",function(){return Me}),c.d(l,"parseWalletConnectUri",function(){return je}),c.d(l,"getQueryString",function(){return Ye}),c.d(l,"appendToQueryString",function(){return we}),c.d(l,"parseQueryString",function(){return Be}),c.d(l,"formatQueryString",function(){return $e}),c.d(l,"isEmptyString",function(){return N}),c.d(l,"isEmptyArray",function(){return P}),c.d(l,"isBuffer",function(){return j}),c.d(l,"isTypedArray",function(){return K}),c.d(l,"isArrayBuffer",function(){return Z}),c.d(l,"getType",function(){return J}),c.d(l,"getEncoding",function(){return X}),c.d(l,"isHexString",function(){return ee}),c.d(l,"isJsonRpcSubscription",function(){return te}),c.d(l,"isJsonRpcRequest",function(){return oe}),c.d(l,"isJsonRpcResponseSuccess",function(){return ve}),c.d(l,"isJsonRpcResponseError",function(){return ie}),c.d(l,"isInternalEvent",function(){return de}),c.d(l,"isReservedEvent",function(){return fe}),c.d(l,"isSilentPayload",function(){return re})},function(z,l,c){"use strict";(function(s){var m=c(169),y=c(170),n=c(79);function o(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function e(P,j){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|P}function _(P,j){if(t.isBuffer(P))return P.length;if(typeof ArrayBuffer<"u"&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(P)||P instanceof ArrayBuffer))return P.byteLength;"string"!=typeof P&&(P=""+P);var K=P.length;if(0===K)return 0;for(var Z=!1;;)switch(j){case"ascii":case"latin1":case"binary":return K;case"utf8":case"utf-8":case void 0:return F(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*K;case"hex":return K>>>1;case"base64":return B(P).length;default:if(Z)return F(P).length;j=(""+j).toLowerCase(),Z=!0}}function v(P,j,K){var Z=!1;if((void 0===j||j<0)&&(j=0),j>this.length||((void 0===K||K>this.length)&&(K=this.length),K<=0)||(K>>>=0)<=(j>>>=0))return"";for(P||(P="utf8");;)switch(P){case"hex":return R(this,j,K);case"utf8":case"utf-8":return k(this,j,K);case"ascii":return p(this,j,K);case"latin1":case"binary":return x(this,j,K);case"base64":return q(this,j,K);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r(this,j,K);default:if(Z)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),Z=!0}}function T(P,j,K){var Z=P[j];P[j]=P[K],P[K]=Z}function O(P,j,K,Z,J){if(0===P.length)return-1;if("string"==typeof K?(Z=K,K=0):K>2147483647?K=2147483647:K<-2147483648&&(K=-2147483648),K=+K,isNaN(K)&&(K=J?0:P.length-1),K<0&&(K=P.length+K),K>=P.length){if(J)return-1;K=P.length-1}else if(K<0){if(!J)return-1;K=0}if("string"==typeof j&&(j=t.from(j,Z)),t.isBuffer(j))return 0===j.length?-1:b(P,j,K,Z,J);if("number"==typeof j)return j&=255,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?J?Uint8Array.prototype.indexOf.call(P,j,K):Uint8Array.prototype.lastIndexOf.call(P,j,K):b(P,[j],K,Z,J);throw new TypeError("val must be string, number or Buffer")}function b(P,j,K,Z,J){var X,ee=1,te=P.length,oe=j.length;if(void 0!==Z&&("ucs2"===(Z=String(Z).toLowerCase())||"ucs-2"===Z||"utf16le"===Z||"utf-16le"===Z)){if(P.length<2||j.length<2)return-1;ee=2,te/=2,oe/=2,K/=2}function ve(re,_e){return 1===ee?re[_e]:re.readUInt16BE(_e*ee)}if(J){var ie=-1;for(X=K;Xte&&(K=te-oe),X=K;X>=0;X--){for(var de=!0,fe=0;feJ&&(Z=J):Z=J;var X=j.length;if(X%2!=0)throw new TypeError("Invalid hex string");Z>X/2&&(Z=X/2);for(var ee=0;ee>8,ve.push(ee%256),ve.push(te);return ve}(j,P.length-K),P,K,Z)}function q(P,j,K){return m.fromByteArray(0===j&&K===P.length?P:P.slice(j,K))}function k(P,j,K){K=Math.min(P.length,K);for(var Z=[],J=j;J239?4:ve>223?3:ve>191?2:1;if(J+de<=K)switch(de){case 1:ve<128&&(ie=ve);break;case 2:128==(192&(X=P[J+1]))&&(oe=(31&ve)<<6|63&X)>127&&(ie=oe);break;case 3:ee=P[J+2],128==(192&(X=P[J+1]))&&128==(192&ee)&&(oe=(15&ve)<<12|(63&X)<<6|63&ee)>2047&&(oe<55296||oe>57343)&&(ie=oe);break;case 4:ee=P[J+2],te=P[J+3],128==(192&(X=P[J+1]))&&128==(192&ee)&&128==(192&te)&&(oe=(15&ve)<<18|(63&X)<<12|(63&ee)<<6|63&te)>65535&&oe<1114112&&(ie=oe)}null===ie?(ie=65533,de=1):ie>65535&&(Z.push((ie-=65536)>>>10&1023|55296),ie=56320|1023&ie),Z.push(ie),J+=de}return function(fe){var re=fe.length;if(re<=4096)return String.fromCharCode.apply(String,fe);for(var _e="",Ke=0;KeZ)&&(K=Z);for(var J="",X=j;XK)throw new RangeError("Trying to access beyond buffer length")}function g(P,j,K,Z,J,X){if(!t.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(j>J||jP.length)throw new RangeError("Index out of range")}function M(P,j,K,Z){j<0&&(j=65535+j+1);for(var J=0,X=Math.min(P.length-K,2);J>>8*(Z?J:1-J)}function E(P,j,K,Z){j<0&&(j=4294967295+j+1);for(var J=0,X=Math.min(P.length-K,4);J>>8*(Z?J:3-J)&255}function C(P,j,K,Z,J,X){if(K+Z>P.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("Index out of range")}function U(P,j,K,Z,J){return J||C(P,0,K,4),y.write(P,j,K,Z,23,4),K+4}function V(P,j,K,Z,J){return J||C(P,0,K,8),y.write(P,j,K,Z,52,8),K+8}l.Buffer=t,l.SlowBuffer=function(P){return+P!=P&&(P=0),t.alloc(+P)},l.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==s.TYPED_ARRAY_SUPPORT?s.TYPED_ARRAY_SUPPORT:function(){try{var P=new Uint8Array(1);return P.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===P.foo()&&"function"==typeof P.subarray&&0===P.subarray(1,1).byteLength}catch{return!1}}(),l.kMaxLength=o(),t.poolSize=8192,t._augment=function(P){return P.__proto__=t.prototype,P},t.from=function(P,j,K){return i(null,P,j,K)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(P,j,K){return Z=null,X=j,ee=K,u(J=P),J<=0?e(Z,J):void 0!==X?"string"==typeof ee?e(Z,J).fill(X,ee):e(Z,J).fill(X):e(Z,J);var Z,J,X,ee},t.allocUnsafe=function(P){return h(null,P)},t.allocUnsafeSlow=function(P){return h(null,P)},t.isBuffer=function(P){return!(null==P||!P._isBuffer)},t.compare=function(P,j){if(!t.isBuffer(P)||!t.isBuffer(j))throw new TypeError("Arguments must be Buffers");if(P===j)return 0;for(var K=P.length,Z=j.length,J=0,X=Math.min(K,Z);J0&&(P=this.toString("hex",0,j).match(/.{2}/g).join(" "),this.length>j&&(P+=" ... ")),""},t.prototype.compare=function(P,j,K,Z,J){if(!t.isBuffer(P))throw new TypeError("Argument must be a Buffer");if(void 0===j&&(j=0),void 0===K&&(K=P?P.length:0),void 0===Z&&(Z=0),void 0===J&&(J=this.length),j<0||K>P.length||Z<0||J>this.length)throw new RangeError("out of range index");if(Z>=J&&j>=K)return 0;if(Z>=J)return-1;if(j>=K)return 1;if(this===P)return 0;for(var X=(J>>>=0)-(Z>>>=0),ee=(K>>>=0)-(j>>>=0),te=Math.min(X,ee),oe=this.slice(Z,J),ve=P.slice(j,K),ie=0;ieJ)&&(K=J),P.length>0&&(K<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");for(var X=!1;;)switch(Z){case"hex":return S(this,P,j,K);case"utf8":case"utf-8":return w(this,P,j,K);case"ascii":return A(this,P,j,K);case"latin1":case"binary":return L(this,P,j,K);case"base64":return H(this,P,j,K);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,P,j,K);default:if(X)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),X=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(P,j){var K,Z=this.length;if((P=~~P)<0?(P+=Z)<0&&(P=0):P>Z&&(P=Z),(j=void 0===j?Z:~~j)<0?(j+=Z)<0&&(j=0):j>Z&&(j=Z),j0&&(J*=256);)Z+=this[P+--j]*J;return Z},t.prototype.readUInt8=function(P,j){return j||a(P,1,this.length),this[P]},t.prototype.readUInt16LE=function(P,j){return j||a(P,2,this.length),this[P]|this[P+1]<<8},t.prototype.readUInt16BE=function(P,j){return j||a(P,2,this.length),this[P]<<8|this[P+1]},t.prototype.readUInt32LE=function(P,j){return j||a(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+16777216*this[P+3]},t.prototype.readUInt32BE=function(P,j){return j||a(P,4,this.length),16777216*this[P]+(this[P+1]<<16|this[P+2]<<8|this[P+3])},t.prototype.readIntLE=function(P,j,K){P|=0,j|=0,K||a(P,j,this.length);for(var Z=this[P],J=1,X=0;++X=(J*=128)&&(Z-=Math.pow(2,8*j)),Z},t.prototype.readIntBE=function(P,j,K){P|=0,j|=0,K||a(P,j,this.length);for(var Z=j,J=1,X=this[P+--Z];Z>0&&(J*=256);)X+=this[P+--Z]*J;return X>=(J*=128)&&(X-=Math.pow(2,8*j)),X},t.prototype.readInt8=function(P,j){return j||a(P,1,this.length),128&this[P]?-1*(255-this[P]+1):this[P]},t.prototype.readInt16LE=function(P,j){j||a(P,2,this.length);var K=this[P]|this[P+1]<<8;return 32768&K?4294901760|K:K},t.prototype.readInt16BE=function(P,j){j||a(P,2,this.length);var K=this[P+1]|this[P]<<8;return 32768&K?4294901760|K:K},t.prototype.readInt32LE=function(P,j){return j||a(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},t.prototype.readInt32BE=function(P,j){return j||a(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},t.prototype.readFloatLE=function(P,j){return j||a(P,4,this.length),y.read(this,P,!0,23,4)},t.prototype.readFloatBE=function(P,j){return j||a(P,4,this.length),y.read(this,P,!1,23,4)},t.prototype.readDoubleLE=function(P,j){return j||a(P,8,this.length),y.read(this,P,!0,52,8)},t.prototype.readDoubleBE=function(P,j){return j||a(P,8,this.length),y.read(this,P,!1,52,8)},t.prototype.writeUIntLE=function(P,j,K,Z){P=+P,j|=0,K|=0,Z||g(this,P,j,K,Math.pow(2,8*K)-1,0);var J=1,X=0;for(this[j]=255&P;++X=0&&(X*=256);)this[j+J]=P/X&255;return j+K},t.prototype.writeUInt8=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,1,255,0),t.TYPED_ARRAY_SUPPORT||(P=Math.floor(P)),this[j]=255&P,j+1},t.prototype.writeUInt16LE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8):M(this,P,j,!0),j+2},t.prototype.writeUInt16BE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[j]=P>>>8,this[j+1]=255&P):M(this,P,j,!1),j+2},t.prototype.writeUInt32LE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[j+3]=P>>>24,this[j+2]=P>>>16,this[j+1]=P>>>8,this[j]=255&P):E(this,P,j,!0),j+4},t.prototype.writeUInt32BE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[j]=P>>>24,this[j+1]=P>>>16,this[j+2]=P>>>8,this[j+3]=255&P):E(this,P,j,!1),j+4},t.prototype.writeIntLE=function(P,j,K,Z){if(P=+P,j|=0,!Z){var J=Math.pow(2,8*K-1);g(this,P,j,K,J-1,-J)}var X=0,ee=1,te=0;for(this[j]=255&P;++X>0)-te&255;return j+K},t.prototype.writeIntBE=function(P,j,K,Z){if(P=+P,j|=0,!Z){var J=Math.pow(2,8*K-1);g(this,P,j,K,J-1,-J)}var X=K-1,ee=1,te=0;for(this[j+X]=255&P;--X>=0&&(ee*=256);)P<0&&0===te&&0!==this[j+X+1]&&(te=1),this[j+X]=(P/ee>>0)-te&255;return j+K},t.prototype.writeInt8=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,1,127,-128),t.TYPED_ARRAY_SUPPORT||(P=Math.floor(P)),P<0&&(P=255+P+1),this[j]=255&P,j+1},t.prototype.writeInt16LE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8):M(this,P,j,!0),j+2},t.prototype.writeInt16BE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[j]=P>>>8,this[j+1]=255&P):M(this,P,j,!1),j+2},t.prototype.writeInt32LE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8,this[j+2]=P>>>16,this[j+3]=P>>>24):E(this,P,j,!0),j+4},t.prototype.writeInt32BE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),t.TYPED_ARRAY_SUPPORT?(this[j]=P>>>24,this[j+1]=P>>>16,this[j+2]=P>>>8,this[j+3]=255&P):E(this,P,j,!1),j+4},t.prototype.writeFloatLE=function(P,j,K){return U(this,P,j,!0,K)},t.prototype.writeFloatBE=function(P,j,K){return U(this,P,j,!1,K)},t.prototype.writeDoubleLE=function(P,j,K){return V(this,P,j,!0,K)},t.prototype.writeDoubleBE=function(P,j,K){return V(this,P,j,!1,K)},t.prototype.copy=function(P,j,K,Z){if(K||(K=0),Z||0===Z||(Z=this.length),j>=P.length&&(j=P.length),j||(j=0),Z>0&&Z=this.length)throw new RangeError("sourceStart out of bounds");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),P.length-j=0;--J)P[J+j]=this[J+K];else if(X<1e3||!t.TYPED_ARRAY_SUPPORT)for(J=0;J>>=0,K=void 0===K?this.length:K>>>0,P||(P=0),"number"==typeof P)for(X=j;X55295&&K<57344){if(!J){if(K>56319){(j-=3)>-1&&X.push(239,191,189);continue}if(ee+1===Z){(j-=3)>-1&&X.push(239,191,189);continue}J=K;continue}if(K<56320){(j-=3)>-1&&X.push(239,191,189),J=K;continue}K=65536+(J-55296<<10|K-56320)}else J&&(j-=3)>-1&&X.push(239,191,189);if(J=null,K<128){if((j-=1)<0)break;X.push(K)}else if(K<2048){if((j-=2)<0)break;X.push(K>>6|192,63&K|128)}else if(K<65536){if((j-=3)<0)break;X.push(K>>12|224,K>>6&63|128,63&K|128)}else{if(!(K<1114112))throw new Error("Invalid code point");if((j-=4)<0)break;X.push(K>>18|240,K>>12&63|128,K>>6&63|128,63&K|128)}}return X}function B(P){return m.toByteArray(function(j){if((j=(K=j,K.trim?K.trim():K.replace(/^\s+|\s+$/g,"")).replace(I,"")).length<2)return"";for(var K;j.length%4!=0;)j+="=";return j}(P))}function N(P,j,K,Z){for(var J=0;J=j.length||J>=P.length);++J)j[J+K]=P[J];return J}}).call(this,c(6))},function(z,l){z.exports="function"==typeof Object.create?function(c,s){s&&(c.super_=s,c.prototype=Object.create(s.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:function(c,s){if(s){c.super_=s;var m=function(){};m.prototype=s.prototype,c.prototype=new m,c.prototype.constructor=c}}},function(z,l,c){"use strict";c.d(l,"b",function(){return 256}),c.d(l,"g",function(){return 256}),c.d(l,"a",function(){return"AES-CBC"}),c.d(l,"f",function(){return"SHA-256"}),c.d(l,"e",function(){return"HMAC"}),c.d(l,"i",function(){return"SHA-256"}),c.d(l,"j",function(){return"SHA-512"}),c.d(l,"h",function(){return 512}),c.d(l,"d",function(){return"encrypt"}),c.d(l,"c",function(){return"decrypt"}),c.d(l,"k",function(){return"sign"}),c.d(l,"l",function(){return"verify"})},function(z,l){var c,s,m=z.exports={};function y(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(v){if(c===setTimeout)return setTimeout(v,0);if((c===y||!c)&&setTimeout)return c=setTimeout,setTimeout(v,0);try{return c(v,0)}catch{try{return c.call(null,v,0)}catch{return c.call(this,v,0)}}}!function(){try{c="function"==typeof setTimeout?setTimeout:y}catch{c=y}try{s="function"==typeof clearTimeout?clearTimeout:n}catch{s=n}}();var e,t=[],i=!1,u=-1;function h(){i&&e&&(i=!1,e.length?t=e.concat(t):u=-1,t.length&&f())}function f(){if(!i){var v=o(h);i=!0;for(var T=t.length;T;){for(e=t,t=[];++u1)for(var O=1;O=49&&g<=54?g-49+10:g>=17&&g<=22?g-17+10:15&g}return R}function u(k,p,x,R){for(var r=0,a=Math.min(k.length,x),g=p;g=49?M-49+10:M>=17?M-17+10:M}return r}e.isBN=function(k){return k instanceof e||null!==k&&"object"==typeof k&&k.constructor.wordSize===e.wordSize&&Array.isArray(k.words)},e.max=function(k,p){return k.cmp(p)>0?k:p},e.min=function(k,p){return k.cmp(p)<0?k:p},e.prototype._init=function(k,p,x){if("number"==typeof k)return this._initNumber(k,p,x);if("object"==typeof k)return this._initArray(k,p,x);"hex"===p&&(p=16),n(p===(0|p)&&p>=2&&p<=36);var R=0;"-"===(k=k.toString().replace(/\s+/g,""))[0]&&R++,16===p?this._parseHex(k,R):this._parseBase(k,p,R),"-"===k[0]&&(this.negative=1),this.strip(),"le"===x&&this._initArray(this.toArray(),p,x)},e.prototype._initNumber=function(k,p,x){k<0&&(this.negative=1,k=-k),k<67108864?(this.words=[67108863&k],this.length=1):k<4503599627370496?(this.words=[67108863&k,k/67108864&67108863],this.length=2):(n(k<9007199254740992),this.words=[67108863&k,k/67108864&67108863,1],this.length=3),"le"===x&&this._initArray(this.toArray(),p,x)},e.prototype._initArray=function(k,p,x){if(n("number"==typeof k.length),k.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(k.length/3),this.words=new Array(this.length);for(var R=0;R=0;R-=3)this.words[r]|=(a=k[R]|k[R-1]<<8|k[R-2]<<16)<>>26-g&67108863,(g+=24)>=26&&(g-=26,r++);else if("le"===x)for(R=0,r=0;R>>26-g&67108863,(g+=24)>=26&&(g-=26,r++);return this.strip()},e.prototype._parseHex=function(k,p){this.length=Math.ceil((k.length-p)/6),this.words=new Array(this.length);for(var x=0;x=p;x-=6)r=i(k,x,x+6),this.words[R]|=r<>>26-a&4194303,(a+=24)>=26&&(a-=26,R++);x+6!==p&&(r=i(k,p,x+6),this.words[R]|=r<>>26-a&4194303),this.strip()},e.prototype._parseBase=function(k,p,x){this.words=[0],this.length=1;for(var R=0,r=1;r<=67108863;r*=p)R++;R--,r=r/p|0;for(var a=k.length-x,g=a%R,M=Math.min(a,a-g)+x,E=0,C=x;C1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},e.prototype.inspect=function(){return(this.red?""};var h=["","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"],f=[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],d=[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 _(k,p,x){x.negative=p.negative^k.negative;var R=k.length+p.length|0;x.length=R,R=R-1|0;var r=0|k.words[0],a=0|p.words[0],g=r*a,E=g/67108864|0;x.words[0]=67108863&g;for(var C=1;C>>26,V=67108863&E,I=Math.min(C,p.length-1),W=Math.max(0,C-k.length+1);W<=I;W++)U+=(g=(r=0|k.words[C-W|0])*(a=0|p.words[W])+V)/67108864|0,V=67108863&g;x.words[C]=0|V,E=0|U}return 0!==E?x.words[C]=0|E:x.length--,x.strip()}e.prototype.toString=function(k,p){var x;if(p=0|p||1,16===(k=k||10)||"hex"===k){x="";for(var R=0,r=0,a=0;a>>24-R&16777215)||a!==this.length-1?h[6-M.length]+M+x:M+x,(R+=2)>=26&&(R-=26,a--)}for(0!==r&&(x=r.toString(16)+x);x.length%p!=0;)x="0"+x;return 0!==this.negative&&(x="-"+x),x}if(k===(0|k)&&k>=2&&k<=36){var E=f[k],C=d[k];x="";var U=this.clone();for(U.negative=0;!U.isZero();){var V=U.modn(C).toString(k);x=(U=U.idivn(C)).isZero()?V+x:h[E-V.length]+V+x}for(this.isZero()&&(x="0"+x);x.length%p!=0;)x="0"+x;return 0!==this.negative&&(x="-"+x),x}n(!1,"Base should be between 2 and 36")},e.prototype.toNumber=function(){var k=this.words[0];return 2===this.length?k+=67108864*this.words[1]:3===this.length&&1===this.words[2]?k+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-k:k},e.prototype.toJSON=function(){return this.toString(16)},e.prototype.toBuffer=function(k,p){return n(void 0!==t),this.toArrayLike(t,k,p)},e.prototype.toArray=function(k,p){return this.toArrayLike(Array,k,p)},e.prototype.toArrayLike=function(k,p,x){var R=this.byteLength(),r=x||Math.max(1,R);n(R<=r,"byte array longer than desired length"),n(r>0,"Requested array length <= 0"),this.strip();var a,g,M="le"===p,E=new k(r),C=this.clone();if(M){for(g=0;!C.isZero();g++)a=C.andln(255),C.iushrn(8),E[g]=a;for(;g=4096&&(x+=13,p>>>=13),p>=64&&(x+=7,p>>>=7),p>=8&&(x+=4,p>>>=4),p>=2&&(x+=2,p>>>=2),x+p},e.prototype._zeroBits=function(k){if(0===k)return 26;var p=k,x=0;return 0==(8191&p)&&(x+=13,p>>>=13),0==(127&p)&&(x+=7,p>>>=7),0==(15&p)&&(x+=4,p>>>=4),0==(3&p)&&(x+=2,p>>>=2),0==(1&p)&&x++,x},e.prototype.bitLength=function(){var p=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+p},e.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,p=0;pk.length?this.clone().ior(k):k.clone().ior(this)},e.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},e.prototype.iuand=function(k){var p;p=this.length>k.length?k:this;for(var x=0;xk.length?this.clone().iand(k):k.clone().iand(this)},e.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},e.prototype.iuxor=function(k){var p,x;this.length>k.length?(p=this,x=k):(p=k,x=this);for(var R=0;Rk.length?this.clone().ixor(k):k.clone().ixor(this)},e.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},e.prototype.inotn=function(k){n("number"==typeof k&&k>=0);var p=0|Math.ceil(k/26),x=k%26;this._expand(p),x>0&&p--;for(var R=0;R0&&(this.words[R]=~this.words[R]&67108863>>26-x),this.strip()},e.prototype.notn=function(k){return this.clone().inotn(k)},e.prototype.setn=function(k,p){n("number"==typeof k&&k>=0);var x=k/26|0,R=k%26;return this._expand(x+1),this.words[x]=p?this.words[x]|1<k.length?(x=this,R=k):(x=k,R=this);for(var r=0,a=0;a>>26;for(;0!==r&&a>>26;if(this.length=x.length,0!==r)this.words[this.length]=r,this.length++;else if(x!==this)for(;ak.length?this.clone().iadd(k):k.clone().iadd(this)},e.prototype.isub=function(k){if(0!==k.negative){k.negative=0;var p=this.iadd(k);return k.negative=1,p._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var x,R,r=this.cmp(k);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(x=this,R=k):(x=k,R=this);for(var a=0,g=0;g>26,this.words[g]=67108863&p;for(;0!==a&&g>26,this.words[g]=67108863&p;if(0===a&&g>>13,W=0|g[1],F=8191&W,B=W>>>13,N=0|g[2],P=8191&N,j=N>>>13,K=0|g[3],Z=8191&K,J=K>>>13,X=0|g[4],ee=8191&X,te=X>>>13,oe=0|g[5],ve=8191&oe,ie=oe>>>13,de=0|g[6],fe=8191&de,re=de>>>13,_e=0|g[7],Ke=8191&_e,pe=_e>>>13,Te=0|g[8],Ve=8191&Te,be=Te>>>13,Pe=0|g[9],Ye=8191&Pe,we=Pe>>>13,Be=0|M[0],$e=8191&Be,Me=Be>>>13,je=0|M[1],Q=8191&je,se=je>>>13,le=0|M[2],Le=8191&le,he=le>>>13,Oe=0|M[3],Ge=8191&Oe,me=Oe>>>13,ze=0|M[4],rt=8191&ze,Re=ze>>>13,He=0|M[5],Qe=8191&He,Ee=He>>>13,Ne=0|M[6],it=8191&Ne,xe=Ne>>>13,qe=0|M[7],et=8191&qe,ke=qe>>>13,We=0|M[8],tt=8191&We,Se=We>>>13,Fe=0|M[9],nt=8191&Fe,Ae=Fe>>>13;x.negative=k.negative^p.negative,x.length=19;var Ue=(C+(R=Math.imul(V,$e))|0)+((8191&(r=(r=Math.imul(V,Me))+Math.imul(I,$e)|0))<<13)|0;C=((a=Math.imul(I,Me))+(r>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,R=Math.imul(F,$e),r=(r=Math.imul(F,Me))+Math.imul(B,$e)|0,a=Math.imul(B,Me);var Y=(C+(R=R+Math.imul(V,Q)|0)|0)+((8191&(r=(r=r+Math.imul(V,se)|0)+Math.imul(I,Q)|0))<<13)|0;C=((a=a+Math.imul(I,se)|0)+(r>>>13)|0)+(Y>>>26)|0,Y&=67108863,R=Math.imul(P,$e),r=(r=Math.imul(P,Me))+Math.imul(j,$e)|0,a=Math.imul(j,Me),R=R+Math.imul(F,Q)|0,r=(r=r+Math.imul(F,se)|0)+Math.imul(B,Q)|0,a=a+Math.imul(B,se)|0;var G=(C+(R=R+Math.imul(V,Le)|0)|0)+((8191&(r=(r=r+Math.imul(V,he)|0)+Math.imul(I,Le)|0))<<13)|0;C=((a=a+Math.imul(I,he)|0)+(r>>>13)|0)+(G>>>26)|0,G&=67108863,R=Math.imul(Z,$e),r=(r=Math.imul(Z,Me))+Math.imul(J,$e)|0,a=Math.imul(J,Me),R=R+Math.imul(P,Q)|0,r=(r=r+Math.imul(P,se)|0)+Math.imul(j,Q)|0,a=a+Math.imul(j,se)|0,R=R+Math.imul(F,Le)|0,r=(r=r+Math.imul(F,he)|0)+Math.imul(B,Le)|0,a=a+Math.imul(B,he)|0;var $=(C+(R=R+Math.imul(V,Ge)|0)|0)+((8191&(r=(r=r+Math.imul(V,me)|0)+Math.imul(I,Ge)|0))<<13)|0;C=((a=a+Math.imul(I,me)|0)+(r>>>13)|0)+($>>>26)|0,$&=67108863,R=Math.imul(ee,$e),r=(r=Math.imul(ee,Me))+Math.imul(te,$e)|0,a=Math.imul(te,Me),R=R+Math.imul(Z,Q)|0,r=(r=r+Math.imul(Z,se)|0)+Math.imul(J,Q)|0,a=a+Math.imul(J,se)|0,R=R+Math.imul(P,Le)|0,r=(r=r+Math.imul(P,he)|0)+Math.imul(j,Le)|0,a=a+Math.imul(j,he)|0,R=R+Math.imul(F,Ge)|0,r=(r=r+Math.imul(F,me)|0)+Math.imul(B,Ge)|0,a=a+Math.imul(B,me)|0;var ne=(C+(R=R+Math.imul(V,rt)|0)|0)+((8191&(r=(r=r+Math.imul(V,Re)|0)+Math.imul(I,rt)|0))<<13)|0;C=((a=a+Math.imul(I,Re)|0)+(r>>>13)|0)+(ne>>>26)|0,ne&=67108863,R=Math.imul(ve,$e),r=(r=Math.imul(ve,Me))+Math.imul(ie,$e)|0,a=Math.imul(ie,Me),R=R+Math.imul(ee,Q)|0,r=(r=r+Math.imul(ee,se)|0)+Math.imul(te,Q)|0,a=a+Math.imul(te,se)|0,R=R+Math.imul(Z,Le)|0,r=(r=r+Math.imul(Z,he)|0)+Math.imul(J,Le)|0,a=a+Math.imul(J,he)|0,R=R+Math.imul(P,Ge)|0,r=(r=r+Math.imul(P,me)|0)+Math.imul(j,Ge)|0,a=a+Math.imul(j,me)|0,R=R+Math.imul(F,rt)|0,r=(r=r+Math.imul(F,Re)|0)+Math.imul(B,rt)|0,a=a+Math.imul(B,Re)|0;var ce=(C+(R=R+Math.imul(V,Qe)|0)|0)+((8191&(r=(r=r+Math.imul(V,Ee)|0)+Math.imul(I,Qe)|0))<<13)|0;C=((a=a+Math.imul(I,Ee)|0)+(r>>>13)|0)+(ce>>>26)|0,ce&=67108863,R=Math.imul(fe,$e),r=(r=Math.imul(fe,Me))+Math.imul(re,$e)|0,a=Math.imul(re,Me),R=R+Math.imul(ve,Q)|0,r=(r=r+Math.imul(ve,se)|0)+Math.imul(ie,Q)|0,a=a+Math.imul(ie,se)|0,R=R+Math.imul(ee,Le)|0,r=(r=r+Math.imul(ee,he)|0)+Math.imul(te,Le)|0,a=a+Math.imul(te,he)|0,R=R+Math.imul(Z,Ge)|0,r=(r=r+Math.imul(Z,me)|0)+Math.imul(J,Ge)|0,a=a+Math.imul(J,me)|0,R=R+Math.imul(P,rt)|0,r=(r=r+Math.imul(P,Re)|0)+Math.imul(j,rt)|0,a=a+Math.imul(j,Re)|0,R=R+Math.imul(F,Qe)|0,r=(r=r+Math.imul(F,Ee)|0)+Math.imul(B,Qe)|0,a=a+Math.imul(B,Ee)|0;var ue=(C+(R=R+Math.imul(V,it)|0)|0)+((8191&(r=(r=r+Math.imul(V,xe)|0)+Math.imul(I,it)|0))<<13)|0;C=((a=a+Math.imul(I,xe)|0)+(r>>>13)|0)+(ue>>>26)|0,ue&=67108863,R=Math.imul(Ke,$e),r=(r=Math.imul(Ke,Me))+Math.imul(pe,$e)|0,a=Math.imul(pe,Me),R=R+Math.imul(fe,Q)|0,r=(r=r+Math.imul(fe,se)|0)+Math.imul(re,Q)|0,a=a+Math.imul(re,se)|0,R=R+Math.imul(ve,Le)|0,r=(r=r+Math.imul(ve,he)|0)+Math.imul(ie,Le)|0,a=a+Math.imul(ie,he)|0,R=R+Math.imul(ee,Ge)|0,r=(r=r+Math.imul(ee,me)|0)+Math.imul(te,Ge)|0,a=a+Math.imul(te,me)|0,R=R+Math.imul(Z,rt)|0,r=(r=r+Math.imul(Z,Re)|0)+Math.imul(J,rt)|0,a=a+Math.imul(J,Re)|0,R=R+Math.imul(P,Qe)|0,r=(r=r+Math.imul(P,Ee)|0)+Math.imul(j,Qe)|0,a=a+Math.imul(j,Ee)|0,R=R+Math.imul(F,it)|0,r=(r=r+Math.imul(F,xe)|0)+Math.imul(B,it)|0,a=a+Math.imul(B,xe)|0;var Ce=(C+(R=R+Math.imul(V,et)|0)|0)+((8191&(r=(r=r+Math.imul(V,ke)|0)+Math.imul(I,et)|0))<<13)|0;C=((a=a+Math.imul(I,ke)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,R=Math.imul(Ve,$e),r=(r=Math.imul(Ve,Me))+Math.imul(be,$e)|0,a=Math.imul(be,Me),R=R+Math.imul(Ke,Q)|0,r=(r=r+Math.imul(Ke,se)|0)+Math.imul(pe,Q)|0,a=a+Math.imul(pe,se)|0,R=R+Math.imul(fe,Le)|0,r=(r=r+Math.imul(fe,he)|0)+Math.imul(re,Le)|0,a=a+Math.imul(re,he)|0,R=R+Math.imul(ve,Ge)|0,r=(r=r+Math.imul(ve,me)|0)+Math.imul(ie,Ge)|0,a=a+Math.imul(ie,me)|0,R=R+Math.imul(ee,rt)|0,r=(r=r+Math.imul(ee,Re)|0)+Math.imul(te,rt)|0,a=a+Math.imul(te,Re)|0,R=R+Math.imul(Z,Qe)|0,r=(r=r+Math.imul(Z,Ee)|0)+Math.imul(J,Qe)|0,a=a+Math.imul(J,Ee)|0,R=R+Math.imul(P,it)|0,r=(r=r+Math.imul(P,xe)|0)+Math.imul(j,it)|0,a=a+Math.imul(j,xe)|0,R=R+Math.imul(F,et)|0,r=(r=r+Math.imul(F,ke)|0)+Math.imul(B,et)|0,a=a+Math.imul(B,ke)|0;var Ie=(C+(R=R+Math.imul(V,tt)|0)|0)+((8191&(r=(r=r+Math.imul(V,Se)|0)+Math.imul(I,tt)|0))<<13)|0;C=((a=a+Math.imul(I,Se)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,R=Math.imul(Ye,$e),r=(r=Math.imul(Ye,Me))+Math.imul(we,$e)|0,a=Math.imul(we,Me),R=R+Math.imul(Ve,Q)|0,r=(r=r+Math.imul(Ve,se)|0)+Math.imul(be,Q)|0,a=a+Math.imul(be,se)|0,R=R+Math.imul(Ke,Le)|0,r=(r=r+Math.imul(Ke,he)|0)+Math.imul(pe,Le)|0,a=a+Math.imul(pe,he)|0,R=R+Math.imul(fe,Ge)|0,r=(r=r+Math.imul(fe,me)|0)+Math.imul(re,Ge)|0,a=a+Math.imul(re,me)|0,R=R+Math.imul(ve,rt)|0,r=(r=r+Math.imul(ve,Re)|0)+Math.imul(ie,rt)|0,a=a+Math.imul(ie,Re)|0,R=R+Math.imul(ee,Qe)|0,r=(r=r+Math.imul(ee,Ee)|0)+Math.imul(te,Qe)|0,a=a+Math.imul(te,Ee)|0,R=R+Math.imul(Z,it)|0,r=(r=r+Math.imul(Z,xe)|0)+Math.imul(J,it)|0,a=a+Math.imul(J,xe)|0,R=R+Math.imul(P,et)|0,r=(r=r+Math.imul(P,ke)|0)+Math.imul(j,et)|0,a=a+Math.imul(j,ke)|0,R=R+Math.imul(F,tt)|0,r=(r=r+Math.imul(F,Se)|0)+Math.imul(B,tt)|0,a=a+Math.imul(B,Se)|0;var De=(C+(R=R+Math.imul(V,nt)|0)|0)+((8191&(r=(r=r+Math.imul(V,Ae)|0)+Math.imul(I,nt)|0))<<13)|0;C=((a=a+Math.imul(I,Ae)|0)+(r>>>13)|0)+(De>>>26)|0,De&=67108863,R=Math.imul(Ye,Q),r=(r=Math.imul(Ye,se))+Math.imul(we,Q)|0,a=Math.imul(we,se),R=R+Math.imul(Ve,Le)|0,r=(r=r+Math.imul(Ve,he)|0)+Math.imul(be,Le)|0,a=a+Math.imul(be,he)|0,R=R+Math.imul(Ke,Ge)|0,r=(r=r+Math.imul(Ke,me)|0)+Math.imul(pe,Ge)|0,a=a+Math.imul(pe,me)|0,R=R+Math.imul(fe,rt)|0,r=(r=r+Math.imul(fe,Re)|0)+Math.imul(re,rt)|0,a=a+Math.imul(re,Re)|0,R=R+Math.imul(ve,Qe)|0,r=(r=r+Math.imul(ve,Ee)|0)+Math.imul(ie,Qe)|0,a=a+Math.imul(ie,Ee)|0,R=R+Math.imul(ee,it)|0,r=(r=r+Math.imul(ee,xe)|0)+Math.imul(te,it)|0,a=a+Math.imul(te,xe)|0,R=R+Math.imul(Z,et)|0,r=(r=r+Math.imul(Z,ke)|0)+Math.imul(J,et)|0,a=a+Math.imul(J,ke)|0,R=R+Math.imul(P,tt)|0,r=(r=r+Math.imul(P,Se)|0)+Math.imul(j,tt)|0,a=a+Math.imul(j,Se)|0;var ye=(C+(R=R+Math.imul(F,nt)|0)|0)+((8191&(r=(r=r+Math.imul(F,Ae)|0)+Math.imul(B,nt)|0))<<13)|0;C=((a=a+Math.imul(B,Ae)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,R=Math.imul(Ye,Le),r=(r=Math.imul(Ye,he))+Math.imul(we,Le)|0,a=Math.imul(we,he),R=R+Math.imul(Ve,Ge)|0,r=(r=r+Math.imul(Ve,me)|0)+Math.imul(be,Ge)|0,a=a+Math.imul(be,me)|0,R=R+Math.imul(Ke,rt)|0,r=(r=r+Math.imul(Ke,Re)|0)+Math.imul(pe,rt)|0,a=a+Math.imul(pe,Re)|0,R=R+Math.imul(fe,Qe)|0,r=(r=r+Math.imul(fe,Ee)|0)+Math.imul(re,Qe)|0,a=a+Math.imul(re,Ee)|0,R=R+Math.imul(ve,it)|0,r=(r=r+Math.imul(ve,xe)|0)+Math.imul(ie,it)|0,a=a+Math.imul(ie,xe)|0,R=R+Math.imul(ee,et)|0,r=(r=r+Math.imul(ee,ke)|0)+Math.imul(te,et)|0,a=a+Math.imul(te,ke)|0,R=R+Math.imul(Z,tt)|0,r=(r=r+Math.imul(Z,Se)|0)+Math.imul(J,tt)|0,a=a+Math.imul(J,Se)|0;var ae=(C+(R=R+Math.imul(P,nt)|0)|0)+((8191&(r=(r=r+Math.imul(P,Ae)|0)+Math.imul(j,nt)|0))<<13)|0;C=((a=a+Math.imul(j,Ae)|0)+(r>>>13)|0)+(ae>>>26)|0,ae&=67108863,R=Math.imul(Ye,Ge),r=(r=Math.imul(Ye,me))+Math.imul(we,Ge)|0,a=Math.imul(we,me),R=R+Math.imul(Ve,rt)|0,r=(r=r+Math.imul(Ve,Re)|0)+Math.imul(be,rt)|0,a=a+Math.imul(be,Re)|0,R=R+Math.imul(Ke,Qe)|0,r=(r=r+Math.imul(Ke,Ee)|0)+Math.imul(pe,Qe)|0,a=a+Math.imul(pe,Ee)|0,R=R+Math.imul(fe,it)|0,r=(r=r+Math.imul(fe,xe)|0)+Math.imul(re,it)|0,a=a+Math.imul(re,xe)|0,R=R+Math.imul(ve,et)|0,r=(r=r+Math.imul(ve,ke)|0)+Math.imul(ie,et)|0,a=a+Math.imul(ie,ke)|0,R=R+Math.imul(ee,tt)|0,r=(r=r+Math.imul(ee,Se)|0)+Math.imul(te,tt)|0,a=a+Math.imul(te,Se)|0;var Je=(C+(R=R+Math.imul(Z,nt)|0)|0)+((8191&(r=(r=r+Math.imul(Z,Ae)|0)+Math.imul(J,nt)|0))<<13)|0;C=((a=a+Math.imul(J,Ae)|0)+(r>>>13)|0)+(Je>>>26)|0,Je&=67108863,R=Math.imul(Ye,rt),r=(r=Math.imul(Ye,Re))+Math.imul(we,rt)|0,a=Math.imul(we,Re),R=R+Math.imul(Ve,Qe)|0,r=(r=r+Math.imul(Ve,Ee)|0)+Math.imul(be,Qe)|0,a=a+Math.imul(be,Ee)|0,R=R+Math.imul(Ke,it)|0,r=(r=r+Math.imul(Ke,xe)|0)+Math.imul(pe,it)|0,a=a+Math.imul(pe,xe)|0,R=R+Math.imul(fe,et)|0,r=(r=r+Math.imul(fe,ke)|0)+Math.imul(re,et)|0,a=a+Math.imul(re,ke)|0,R=R+Math.imul(ve,tt)|0,r=(r=r+Math.imul(ve,Se)|0)+Math.imul(ie,tt)|0,a=a+Math.imul(ie,Se)|0;var ot=(C+(R=R+Math.imul(ee,nt)|0)|0)+((8191&(r=(r=r+Math.imul(ee,Ae)|0)+Math.imul(te,nt)|0))<<13)|0;C=((a=a+Math.imul(te,Ae)|0)+(r>>>13)|0)+(ot>>>26)|0,ot&=67108863,R=Math.imul(Ye,Qe),r=(r=Math.imul(Ye,Ee))+Math.imul(we,Qe)|0,a=Math.imul(we,Ee),R=R+Math.imul(Ve,it)|0,r=(r=r+Math.imul(Ve,xe)|0)+Math.imul(be,it)|0,a=a+Math.imul(be,xe)|0,R=R+Math.imul(Ke,et)|0,r=(r=r+Math.imul(Ke,ke)|0)+Math.imul(pe,et)|0,a=a+Math.imul(pe,ke)|0,R=R+Math.imul(fe,tt)|0,r=(r=r+Math.imul(fe,Se)|0)+Math.imul(re,tt)|0,a=a+Math.imul(re,Se)|0;var at=(C+(R=R+Math.imul(ve,nt)|0)|0)+((8191&(r=(r=r+Math.imul(ve,Ae)|0)+Math.imul(ie,nt)|0))<<13)|0;C=((a=a+Math.imul(ie,Ae)|0)+(r>>>13)|0)+(at>>>26)|0,at&=67108863,R=Math.imul(Ye,it),r=(r=Math.imul(Ye,xe))+Math.imul(we,it)|0,a=Math.imul(we,xe),R=R+Math.imul(Ve,et)|0,r=(r=r+Math.imul(Ve,ke)|0)+Math.imul(be,et)|0,a=a+Math.imul(be,ke)|0,R=R+Math.imul(Ke,tt)|0,r=(r=r+Math.imul(Ke,Se)|0)+Math.imul(pe,tt)|0,a=a+Math.imul(pe,Se)|0;var st=(C+(R=R+Math.imul(fe,nt)|0)|0)+((8191&(r=(r=r+Math.imul(fe,Ae)|0)+Math.imul(re,nt)|0))<<13)|0;C=((a=a+Math.imul(re,Ae)|0)+(r>>>13)|0)+(st>>>26)|0,st&=67108863,R=Math.imul(Ye,et),r=(r=Math.imul(Ye,ke))+Math.imul(we,et)|0,a=Math.imul(we,ke),R=R+Math.imul(Ve,tt)|0,r=(r=r+Math.imul(Ve,Se)|0)+Math.imul(be,tt)|0,a=a+Math.imul(be,Se)|0;var ut=(C+(R=R+Math.imul(Ke,nt)|0)|0)+((8191&(r=(r=r+Math.imul(Ke,Ae)|0)+Math.imul(pe,nt)|0))<<13)|0;C=((a=a+Math.imul(pe,Ae)|0)+(r>>>13)|0)+(ut>>>26)|0,ut&=67108863,R=Math.imul(Ye,tt),r=(r=Math.imul(Ye,Se))+Math.imul(we,tt)|0,a=Math.imul(we,Se);var Ze=(C+(R=R+Math.imul(Ve,nt)|0)|0)+((8191&(r=(r=r+Math.imul(Ve,Ae)|0)+Math.imul(be,nt)|0))<<13)|0;C=((a=a+Math.imul(be,Ae)|0)+(r>>>13)|0)+(Ze>>>26)|0,Ze&=67108863;var ct=(C+(R=Math.imul(Ye,nt))|0)+((8191&(r=(r=Math.imul(Ye,Ae))+Math.imul(we,nt)|0))<<13)|0;return C=((a=Math.imul(we,Ae))+(r>>>13)|0)+(ct>>>26)|0,ct&=67108863,E[0]=Ue,E[1]=Y,E[2]=G,E[3]=$,E[4]=ne,E[5]=ce,E[6]=ue,E[7]=Ce,E[8]=Ie,E[9]=De,E[10]=ye,E[11]=ae,E[12]=Je,E[13]=ot,E[14]=at,E[15]=st,E[16]=ut,E[17]=Ze,E[18]=ct,0!==C&&(E[19]=C,x.length++),x};function T(k,p,x){return(new O).mulp(k,p,x)}function O(k,p){this.x=k,this.y=p}Math.imul||(v=_),e.prototype.mulTo=function(k,p){var x=this.length+k.length;return 10===this.length&&10===k.length?v(this,k,p):x<63?_(this,k,p):x<1024?function(R,r,a){a.negative=r.negative^R.negative,a.length=R.length+r.length;for(var g=0,M=0,E=0;E>>26)|0)>>>26,C&=67108863}a.words[E]=U,g=C,C=M}return 0!==g?a.words[E]=g:a.length--,a.strip()}(this,k,p):T(this,k,p)},O.prototype.makeRBT=function(k){for(var p=new Array(k),x=e.prototype._countBits(k)-1,R=0;R>=1;return R},O.prototype.permute=function(k,p,x,R,r,a){for(var g=0;g>>=1)r++;return 1<>>=13),r>>>=13;for(a=2*p;a>=26,p+=R/67108864|0,p+=r>>>26,this.words[x]=67108863&r}return 0!==p&&(this.words[x]=p,this.length++),this},e.prototype.muln=function(k){return this.clone().imuln(k)},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.imul(this.clone())},e.prototype.pow=function(k){var p=function(a){for(var g=new Array(a.bitLength()),M=0;M>>C}return g}(k);if(0===p.length)return new e(1);for(var x=this,R=0;R=0);var p,x=k%26,R=(k-x)/26,r=67108863>>>26-x<<26-x;if(0!==x){var a=0;for(p=0;p>>26-x}a&&(this.words[p]=a,this.length++)}if(0!==R){for(p=this.length-1;p>=0;p--)this.words[p+R]=this.words[p];for(p=0;p=0),R=p?(p-p%26)/26:0;var r=k%26,a=Math.min((k-r)/26,this.length),g=67108863^67108863>>>r<a)for(this.length-=a,E=0;E=0&&(0!==C||E>=R);E--){var U=0|this.words[E];this.words[E]=C<<26-r|U>>>r,C=U&g}return M&&0!==C&&(M.words[M.length++]=C),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},e.prototype.ishrn=function(k,p,x){return n(0===this.negative),this.iushrn(k,p,x)},e.prototype.shln=function(k){return this.clone().ishln(k)},e.prototype.ushln=function(k){return this.clone().iushln(k)},e.prototype.shrn=function(k){return this.clone().ishrn(k)},e.prototype.ushrn=function(k){return this.clone().iushrn(k)},e.prototype.testn=function(k){n("number"==typeof k&&k>=0);var p=k%26,x=(k-p)/26;return!(this.length<=x||!(this.words[x]&1<=0);var p=k%26,x=(k-p)/26;return n(0===this.negative,"imaskn works only with positive numbers"),this.length<=x?this:(0!==p&&x++,this.length=Math.min(x,this.length),0!==p&&(this.words[this.length-1]&=67108863^67108863>>>p<=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},e.prototype.isubn=function(k){if(n("number"==typeof k),n(k<67108864),k<0)return this.iaddn(-k);if(0!==this.negative)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(M/67108864|0),this.words[R+x]=67108863&r}for(;R>26,this.words[R+x]=67108863&r;if(0===g)return this.strip();for(n(-1===g),g=0,R=0;R>26,this.words[R]=67108863&r;return this.negative=1,this.strip()},e.prototype._wordDiv=function(k,p){var x,R=this.clone(),r=k,a=0|r.words[r.length-1];0!=(x=26-this._countBits(a))&&(r=r.ushln(x),R.iushln(x),a=0|r.words[r.length-1]);var g,M=R.length-r.length;if("mod"!==p){(g=new e(null)).length=M+1,g.words=new Array(g.length);for(var E=0;E=0;U--){var V=67108864*(0|R.words[r.length+U])+(0|R.words[r.length+U-1]);for(V=Math.min(V/a|0,67108863),R._ishlnsubmul(r,V,U);0!==R.negative;)V--,R.negative=0,R._ishlnsubmul(r,1,U),R.isZero()||(R.negative^=1);g&&(g.words[U]=V)}return g&&g.strip(),R.strip(),"div"!==p&&0!==x&&R.iushrn(x),{div:g||null,mod:R}},e.prototype.divmod=function(k,p,x){return n(!k.isZero()),this.isZero()?{div:new e(0),mod:new e(0)}:0!==this.negative&&0===k.negative?(a=this.neg().divmod(k,p),"mod"!==p&&(R=a.div.neg()),"div"!==p&&(r=a.mod.neg(),x&&0!==r.negative&&r.iadd(k)),{div:R,mod:r}):0===this.negative&&0!==k.negative?(a=this.divmod(k.neg(),p),"mod"!==p&&(R=a.div.neg()),{div:R,mod:a.mod}):0!=(this.negative&k.negative)?(a=this.neg().divmod(k.neg(),p),"div"!==p&&(r=a.mod.neg(),x&&0!==r.negative&&r.isub(k)),{div:a.div,mod:r}):k.length>this.length||this.cmp(k)<0?{div:new e(0),mod:this}:1===k.length?"div"===p?{div:this.divn(k.words[0]),mod:null}:"mod"===p?{div:null,mod:new e(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new e(this.modn(k.words[0]))}:this._wordDiv(k,p);var R,r,a},e.prototype.div=function(k){return this.divmod(k,"div",!1).div},e.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},e.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},e.prototype.divRound=function(k){var p=this.divmod(k);if(p.mod.isZero())return p.div;var x=0!==p.div.negative?p.mod.isub(k):p.mod,R=k.ushrn(1),r=k.andln(1),a=x.cmp(R);return a<0||1===r&&0===a?p.div:0!==p.div.negative?p.div.isubn(1):p.div.iaddn(1)},e.prototype.modn=function(k){n(k<=67108863);for(var p=(1<<26)%k,x=0,R=this.length-1;R>=0;R--)x=(p*x+(0|this.words[R]))%k;return x},e.prototype.idivn=function(k){n(k<=67108863);for(var p=0,x=this.length-1;x>=0;x--){var R=(0|this.words[x])+67108864*p;this.words[x]=R/k|0,p=R%k}return this.strip()},e.prototype.divn=function(k){return this.clone().idivn(k)},e.prototype.egcd=function(k){n(0===k.negative),n(!k.isZero());var p=this,x=k.clone();p=0!==p.negative?p.umod(k):p.clone();for(var R=new e(1),r=new e(0),a=new e(0),g=new e(1),M=0;p.isEven()&&x.isEven();)p.iushrn(1),x.iushrn(1),++M;for(var E=x.clone(),C=p.clone();!p.isZero();){for(var U=0,V=1;0==(p.words[0]&V)&&U<26;++U,V<<=1);if(U>0)for(p.iushrn(U);U-- >0;)(R.isOdd()||r.isOdd())&&(R.iadd(E),r.isub(C)),R.iushrn(1),r.iushrn(1);for(var I=0,W=1;0==(x.words[0]&W)&&I<26;++I,W<<=1);if(I>0)for(x.iushrn(I);I-- >0;)(a.isOdd()||g.isOdd())&&(a.iadd(E),g.isub(C)),a.iushrn(1),g.iushrn(1);p.cmp(x)>=0?(p.isub(x),R.isub(a),r.isub(g)):(x.isub(p),a.isub(R),g.isub(r))}return{a,b:g,gcd:x.iushln(M)}},e.prototype._invmp=function(k){n(0===k.negative),n(!k.isZero());var p=this,x=k.clone();p=0!==p.negative?p.umod(k):p.clone();for(var R,r=new e(1),a=new e(0),g=x.clone();p.cmpn(1)>0&&x.cmpn(1)>0;){for(var M=0,E=1;0==(p.words[0]&E)&&M<26;++M,E<<=1);if(M>0)for(p.iushrn(M);M-- >0;)r.isOdd()&&r.iadd(g),r.iushrn(1);for(var C=0,U=1;0==(x.words[0]&U)&&C<26;++C,U<<=1);if(C>0)for(x.iushrn(C);C-- >0;)a.isOdd()&&a.iadd(g),a.iushrn(1);p.cmp(x)>=0?(p.isub(x),r.isub(a)):(x.isub(p),a.isub(r))}return(R=0===p.cmpn(1)?r:a).cmpn(0)<0&&R.iadd(k),R},e.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var p=this.clone(),x=k.clone();p.negative=0,x.negative=0;for(var R=0;p.isEven()&&x.isEven();R++)p.iushrn(1),x.iushrn(1);for(;;){for(;p.isEven();)p.iushrn(1);for(;x.isEven();)x.iushrn(1);var r=p.cmp(x);if(r<0){var a=p;p=x,x=a}else if(0===r||0===x.cmpn(1))break;p.isub(x)}return x.iushln(R)},e.prototype.invm=function(k){return this.egcd(k).a.umod(k)},e.prototype.isEven=function(){return 0==(1&this.words[0])},e.prototype.isOdd=function(){return 1==(1&this.words[0])},e.prototype.andln=function(k){return this.words[0]&k},e.prototype.bincn=function(k){n("number"==typeof k);var p=k%26,x=(k-p)/26,R=1<>>26,this.words[a]=g&=67108863}return 0!==r&&(this.words[a]=r,this.length++),this},e.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},e.prototype.cmpn=function(k){var p,x=k<0;if(0!==this.negative&&!x)return-1;if(0===this.negative&&x)return 1;if(this.strip(),this.length>1)p=1;else{x&&(k=-k),n(k<=67108863,"Number is too big");var R=0|this.words[0];p=R===k?0:Rk.length)return 1;if(this.length=0;x--){var R=0|this.words[x],r=0|k.words[x];if(R!==r){Rr&&(p=1);break}}return p},e.prototype.gtn=function(k){return 1===this.cmpn(k)},e.prototype.gt=function(k){return 1===this.cmp(k)},e.prototype.gten=function(k){return this.cmpn(k)>=0},e.prototype.gte=function(k){return this.cmp(k)>=0},e.prototype.ltn=function(k){return-1===this.cmpn(k)},e.prototype.lt=function(k){return-1===this.cmp(k)},e.prototype.lten=function(k){return this.cmpn(k)<=0},e.prototype.lte=function(k){return this.cmp(k)<=0},e.prototype.eqn=function(k){return 0===this.cmpn(k)},e.prototype.eq=function(k){return 0===this.cmp(k)},e.red=function(k){return new D(k)},e.prototype.toRed=function(k){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),k.convertTo(this)._forceRed(k)},e.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(k){return this.red=k,this},e.prototype.forceRed=function(k){return n(!this.red,"Already a number in reduction context"),this._forceRed(k)},e.prototype.redAdd=function(k){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},e.prototype.redIAdd=function(k){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},e.prototype.redSub=function(k){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},e.prototype.redISub=function(k){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},e.prototype.redShl=function(k){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},e.prototype.redMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},e.prototype.redIMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},e.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(k){return n(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var b={k256:null,p224:null,p192:null,p25519:null};function S(k,p){this.name=k,this.p=new e(p,16),this.n=this.p.bitLength(),this.k=new e(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function L(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function H(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function D(k){if("string"==typeof k){var p=e._prime(k);this.m=p.p,this.prime=p}else n(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}function q(k){D.call(this,k),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new e(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)}S.prototype._tmp=function(){var k=new e(null);return k.words=new Array(Math.ceil(this.n/13)),k},S.prototype.ireduce=function(k){var p,x=k;do{this.split(x,this.tmp),p=(x=(x=this.imulK(x)).iadd(this.tmp)).bitLength()}while(p>this.n);var R=p0?x.isub(this.p):x.strip(),x},S.prototype.split=function(k,p){k.iushrn(this.n,0,p)},S.prototype.imulK=function(k){return k.imul(this.k)},o(w,S),w.prototype.split=function(k,p){for(var x=Math.min(k.length,9),R=0;R>>22,r=a}k.words[R-10]=r>>>=22,k.length-=0===r&&k.length>10?10:9},w.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var p=0,x=0;x>>=26,k.words[x]=r,p=R}return 0!==p&&(k.words[k.length++]=p),k},e._prime=function(k){if(b[k])return b[k];var p;if("k256"===k)p=new w;else if("p224"===k)p=new A;else if("p192"===k)p=new L;else{if("p25519"!==k)throw new Error("Unknown prime "+k);p=new H}return b[k]=p,p},D.prototype._verify1=function(k){n(0===k.negative,"red works only with positives"),n(k.red,"red works only with red numbers")},D.prototype._verify2=function(k,p){n(0==(k.negative|p.negative),"red works only with positives"),n(k.red&&k.red===p.red,"red works only with red numbers")},D.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},D.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},D.prototype.add=function(k,p){this._verify2(k,p);var x=k.add(p);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},D.prototype.iadd=function(k,p){this._verify2(k,p);var x=k.iadd(p);return x.cmp(this.m)>=0&&x.isub(this.m),x},D.prototype.sub=function(k,p){this._verify2(k,p);var x=k.sub(p);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},D.prototype.isub=function(k,p){this._verify2(k,p);var x=k.isub(p);return x.cmpn(0)<0&&x.iadd(this.m),x},D.prototype.shl=function(k,p){return this._verify1(k),this.imod(k.ushln(p))},D.prototype.imul=function(k,p){return this._verify2(k,p),this.imod(k.imul(p))},D.prototype.mul=function(k,p){return this._verify2(k,p),this.imod(k.mul(p))},D.prototype.isqr=function(k){return this.imul(k,k.clone())},D.prototype.sqr=function(k){return this.mul(k,k)},D.prototype.sqrt=function(k){if(k.isZero())return k.clone();var p=this.m.andln(3);if(n(p%2==1),3===p){var x=this.m.add(new e(1)).iushrn(2);return this.pow(k,x)}for(var R=this.m.subn(1),r=0;!R.isZero()&&0===R.andln(1);)r++,R.iushrn(1);n(!R.isZero());var a=new e(1).toRed(this),g=a.redNeg(),M=this.m.subn(1).iushrn(1),E=this.m.bitLength();for(E=new e(2*E*E).toRed(this);0!==this.pow(E,M).cmp(g);)E.redIAdd(g);for(var C=this.pow(E,R),U=this.pow(k,R.addn(1).iushrn(1)),V=this.pow(k,R),I=r;0!==V.cmp(a);){for(var W=V,F=0;0!==W.cmp(a);F++)W=W.redSqr();n(F=0;R--){for(var E=p.words[R],C=M-1;C>=0;C--){var U=E>>C&1;r!==x[0]&&(r=this.sqr(r)),0!==U||0!==a?(a<<=1,a|=U,(4==++g||0===R&&0===C)&&(r=this.mul(r,x[a]),g=0,a=0)):g=0}M=26}return r},D.prototype.convertTo=function(k){var p=k.umod(this.m);return p===k?p.clone():p},D.prototype.convertFrom=function(k){var p=k.clone();return p.red=null,p},e.mont=function(k){return new q(k)},o(q,D),q.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},q.prototype.convertFrom=function(k){var p=this.imod(k.mul(this.rinv));return p.red=null,p},q.prototype.imul=function(k,p){if(k.isZero()||p.isZero())return k.words[0]=0,k.length=1,k;var x=k.imul(p),R=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=x.isub(R).iushrn(this.shift),a=r;return r.cmp(this.m)>=0?a=r.isub(this.m):r.cmpn(0)<0&&(a=r.iadd(this.m)),a._forceRed(this)},q.prototype.mul=function(k,p){if(k.isZero()||p.isZero())return new e(0)._forceRed(this);var x=k.mul(p),R=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=x.isub(R).iushrn(this.shift),a=r;return r.cmp(this.m)>=0?a=r.isub(this.m):r.cmpn(0)<0&&(a=r.iadd(this.m)),a._forceRed(this)},q.prototype.invm=function(k){return this.imod(k._invmp(this.m).mul(this.r2))._forceRed(this)}}(s,this)}).call(this,c(25)(z))},function(z,l,c){"use strict";function s(y){let n;return typeof window<"u"&&void 0!==window[y]&&(n=window[y]),n}function m(y){const n=s(y);if(!n)throw new Error(y+" is not defined in Window");return n}Object.defineProperty(l,"__esModule",{value:!0}),l.getLocalStorage=l.getLocalStorageOrThrow=l.getCrypto=l.getCryptoOrThrow=l.getLocation=l.getLocationOrThrow=l.getNavigator=l.getNavigatorOrThrow=l.getDocument=l.getDocumentOrThrow=l.getFromWindowOrThrow=l.getFromWindow=void 0,l.getFromWindow=s,l.getFromWindowOrThrow=m,l.getDocumentOrThrow=function(){return m("document")},l.getDocument=function(){return s("document")},l.getNavigatorOrThrow=function(){return m("navigator")},l.getNavigator=function(){return s("navigator")},l.getLocationOrThrow=function(){return m("location")},l.getLocation=function(){return s("location")},l.getCryptoOrThrow=function(){return m("crypto")},l.getCrypto=function(){return s("crypto")},l.getLocalStorageOrThrow=function(){return m("localStorage")},l.getLocalStorage=function(){return s("localStorage")}},function(z,l,c){"use strict";var s=l,m=c(16),y=c(22),n=c(120);s.assert=y,s.toArray=n.toArray,s.zero2=n.zero2,s.toHex=n.toHex,s.encode=n.encode,s.getNAF=function(o,e,t){var i=new Array(Math.max(o.bitLength(),t)+1);i.fill(0);for(var u=1<(u>>1)-1?(u>>1)-_:_):d=0,i[f]=d,h.iushrn(1)}return i},s.getJSF=function(o,e){var t=[[],[]];o=o.clone(),e=e.clone();for(var i,u=0,h=0;o.cmpn(-u)>0||e.cmpn(-h)>0;){var f,d,_=o.andln(3)+u&3,v=e.andln(3)+h&3;3===_&&(_=-1),3===v&&(v=-1),f=0==(1&_)?0:3!=(i=o.andln(7)+u&7)&&5!==i||2!==v?_:-_,t[0].push(f),d=0==(1&v)?0:3!=(i=e.andln(7)+h&7)&&5!==i||2!==_?v:-v,t[1].push(d),2*u===f+1&&(u=1-u),2*h===d+1&&(h=1-h),o.iushrn(1),e.iushrn(1)}return t},s.cachedProperty=function(o,e,t){var i="_"+e;o.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=t.call(this)}},s.parseBytes=function(o){return"string"==typeof o?s.toArray(o,"hex"):o},s.intFromLE=function(o){return new m(o,"hex","le")}},function(z,l,c){"use strict";var s,m="object"==typeof Reflect?Reflect:null,y=m&&"function"==typeof m.apply?m.apply:function(O,b,S){return Function.prototype.apply.call(O,b,S)};s=m&&"function"==typeof m.ownKeys?m.ownKeys:Object.getOwnPropertySymbols?function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:function(O){return Object.getOwnPropertyNames(O)};var n=Number.isNaN||function(O){return O!=O};function o(){o.init.call(this)}z.exports=o,z.exports.once=function(O,b){return new Promise(function(S,w){function A(H){O.removeListener(b,L),w(H)}function L(){"function"==typeof O.removeListener&&O.removeListener("error",A),S([].slice.call(arguments))}var H;T(O,b,L,{once:!0}),"error"!==b&&("function"==typeof(H=O).on&&T(H,"error",A,{once:!0}))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var e=10;function t(O){if("function"!=typeof O)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof O)}function i(O){return void 0===O._maxListeners?o.defaultMaxListeners:O._maxListeners}function u(O,b,S,w){var A,L,H;if(t(S),void 0===(L=O._events)?(L=O._events=Object.create(null),O._eventsCount=0):(void 0!==L.newListener&&(O.emit("newListener",b,S.listener?S.listener:S),L=O._events),H=L[b]),void 0===H)H=L[b]=S,++O._eventsCount;else if("function"==typeof H?H=L[b]=w?[S,H]:[H,S]:w?H.unshift(S):H.push(S),(A=i(O))>0&&H.length>A&&!H.warned){H.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+H.length+" "+String(b)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=O,q.type=b,q.count=H.length,console&&console.warn&&console.warn(q)}return O}function h(){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 f(O,b,S){var w={fired:!1,wrapFn:void 0,target:O,type:b,listener:S},A=h.bind(w);return A.listener=S,w.wrapFn=A,A}function d(O,b,S){var w=O._events;if(void 0===w)return[];var A=w[b];return void 0===A?[]:"function"==typeof A?S?[A.listener||A]:[A]:S?function(L){for(var H=new Array(L.length),D=0;D0&&(L=b[0]),L instanceof Error)throw L;var H=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw H.context=L,H}var D=A[O];if(void 0===D)return!1;if("function"==typeof D)y(D,this,b);else{var q=D.length,k=v(D,q);for(S=0;S=0;L--)if(S[L]===b||S[L].listener===b){H=S[L].listener,A=L;break}if(A<0)return this;0===A?S.shift():function(D,q){for(;q+1=0;w--)this.removeListener(O,b[w]);return this},o.prototype.listeners=function(O){return d(this,O,!0)},o.prototype.rawListeners=function(O){return d(this,O,!1)},o.listenerCount=function(O,b){return"function"==typeof O.listenerCount?O.listenerCount(b):_.call(O,b)},o.prototype.listenerCount=_,o.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]}},function(z,l,c){var s=c(2),m=s.Buffer;function y(o,e){for(var t in o)e[t]=o[t]}function n(o,e,t){return m(o,e,t)}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?z.exports=s:(y(s,l),l.Buffer=n),n.prototype=Object.create(m.prototype),y(m,n),n.from=function(o,e,t){if("number"==typeof o)throw new TypeError("Argument must not be a number");return m(o,e,t)},n.alloc=function(o,e,t){if("number"!=typeof o)throw new TypeError("Argument must be a number");var i=m(o);return void 0!==e?"string"==typeof t?i.fill(e,t):i.fill(e):i.fill(0),i},n.allocUnsafe=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return m(o)},n.allocUnsafeSlow=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return s.SlowBuffer(o)}},function(z,l,c){"use strict";c.d(l,"b",function(){return o}),c.d(l,"a",function(){return t}),c.d(l,"c",function(){return u}),c.d(l,"d",function(){return f}),c.d(l,"e",function(){return _}),c.d(l,"f",function(){return T});var s=c(8),m=c(4);function y(b){return n.apply(this,arguments)}function n(){return(n=ge(function*(b,S=m.a){return s.getSubtleCrypto().importKey("raw",b,S===m.a?{length:m.b,name:m.a}:{hash:{name:m.f},name:m.e},!0,S===m.a?[m.d,m.c]:[m.k,m.l])})).apply(this,arguments)}function o(b,S,w){return e.apply(this,arguments)}function e(){return(e=ge(function*(b,S,w){const A=s.getSubtleCrypto(),L=yield y(S,m.a),H=yield A.encrypt({iv:b,name:m.a},L,w);return new Uint8Array(H)})).apply(this,arguments)}function t(b,S,w){return i.apply(this,arguments)}function i(){return(i=ge(function*(b,S,w){const A=s.getSubtleCrypto(),L=yield y(S,m.a),H=yield A.decrypt({iv:b,name:m.a},L,w);return new Uint8Array(H)})).apply(this,arguments)}function u(b,S){return h.apply(this,arguments)}function h(){return(h=ge(function*(b,S){const w=s.getSubtleCrypto(),A=yield y(b,m.e),L=yield w.sign({length:m.g,name:m.e},A,S);return new Uint8Array(L)})).apply(this,arguments)}function f(b,S){return d.apply(this,arguments)}function d(){return(d=ge(function*(b,S){const w=s.getSubtleCrypto(),A=yield y(b,m.e),L=yield w.sign({length:m.h,name:m.e},A,S);return new Uint8Array(L)})).apply(this,arguments)}function _(b){return v.apply(this,arguments)}function v(){return(v=ge(function*(b){const S=s.getSubtleCrypto(),w=yield S.digest({name:m.i},b);return new Uint8Array(w)})).apply(this,arguments)}function T(b){return O.apply(this,arguments)}function O(){return(O=ge(function*(b){const S=s.getSubtleCrypto(),w=yield S.digest({name:m.j},b);return new Uint8Array(w)})).apply(this,arguments)}},function(z,l,c){"use strict";var s=c(22),m=c(3);function y(t,i){return 55296==(64512&t.charCodeAt(i))&&!(i<0||i+1>=t.length)&&56320==(64512&t.charCodeAt(i+1))}function n(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function o(t){return 1===t.length?"0"+t:t}function e(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}l.inherits=m,l.toArray=function(t,i){if(Array.isArray(t))return t.slice();if(!t)return[];var u=[];if("string"==typeof t)if(i){if("hex"===i)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),f=0;f>6|192,u[h++]=63&d|128):y(t,f)?(d=65536+((1023&d)<<10)+(1023&t.charCodeAt(++f)),u[h++]=d>>18|240,u[h++]=d>>12&63|128,u[h++]=d>>6&63|128,u[h++]=63&d|128):(u[h++]=d>>12|224,u[h++]=d>>6&63|128,u[h++]=63&d|128)}else for(f=0;f>>0;return d},l.split32=function(t,i){for(var u=new Array(4*t.length),h=0,f=0;h>>24,u[f+1]=d>>>16&255,u[f+2]=d>>>8&255,u[f+3]=255&d):(u[f+3]=d>>>24,u[f+2]=d>>>16&255,u[f+1]=d>>>8&255,u[f]=255&d)}return u},l.rotr32=function(t,i){return t>>>i|t<<32-i},l.rotl32=function(t,i){return t<>>32-i},l.sum32=function(t,i){return t+i>>>0},l.sum32_3=function(t,i,u){return t+i+u>>>0},l.sum32_4=function(t,i,u,h){return t+i+u+h>>>0},l.sum32_5=function(t,i,u,h,f){return t+i+u+h+f>>>0},l.sum64=function(t,i,u,h){var d=h+t[i+1]>>>0;t[i]=(d>>0,t[i+1]=d},l.sum64_hi=function(t,i,u,h){return(i+h>>>0>>0},l.sum64_lo=function(t,i,u,h){return i+h>>>0},l.sum64_4_hi=function(t,i,u,h,f,d,_,v){var T=0,O=i;return T+=(O=O+h>>>0)>>0)>>0)>>0},l.sum64_4_lo=function(t,i,u,h,f,d,_,v){return i+h+d+v>>>0},l.sum64_5_hi=function(t,i,u,h,f,d,_,v,T,O){var b=0,S=i;return b+=(S=S+h>>>0)>>0)>>0)>>0)>>0},l.sum64_5_lo=function(t,i,u,h,f,d,_,v,T,O){return i+h+d+v+O>>>0},l.rotr64_hi=function(t,i,u){return(i<<32-u|t>>>u)>>>0},l.rotr64_lo=function(t,i,u){return(t<<32-u|i>>>u)>>>0},l.shr64_hi=function(t,i,u){return t>>>u},l.shr64_lo=function(t,i,u){return(t<<32-u|i>>>u)>>>0}},function(z,l,c){(function(s){!function(m,y){"use strict";function n(p,x){if(!p)throw new Error(x||"Assertion failed")}function o(p,x){p.super_=x;var R=function(){};R.prototype=x.prototype,p.prototype=new R,p.prototype.constructor=p}function e(p,x,R){if(e.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,null!==p&&("le"!==x&&"be"!==x||(R=x,x=10),this._init(p||0,x||10,R||"be"))}var t;"object"==typeof m?m.exports=e:y.BN=e,e.BN=e,e.wordSize=26;try{t=typeof window<"u"&&void 0!==window.Buffer?window.Buffer:c(245).Buffer}catch{}function i(p,x){var R=p.charCodeAt(x);return R>=65&&R<=70?R-55:R>=97&&R<=102?R-87:R-48&15}function u(p,x,R){var r=i(p,R);return R-1>=x&&(r|=i(p,R-1)<<4),r}function h(p,x,R,r){for(var a=0,g=Math.min(p.length,R),M=x;M=49?E-49+10:E>=17?E-17+10:E}return a}e.isBN=function(p){return p instanceof e||null!==p&&"object"==typeof p&&p.constructor.wordSize===e.wordSize&&Array.isArray(p.words)},e.max=function(p,x){return p.cmp(x)>0?p:x},e.min=function(p,x){return p.cmp(x)<0?p:x},e.prototype._init=function(p,x,R){if("number"==typeof p)return this._initNumber(p,x,R);if("object"==typeof p)return this._initArray(p,x,R);"hex"===x&&(x=16),n(x===(0|x)&&x>=2&&x<=36);var r=0;"-"===(p=p.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)this.words[a]|=(g=p[r]|p[r-1]<<8|p[r-2]<<16)<>>26-M&67108863,(M+=24)>=26&&(M-=26,a++);else if("le"===R)for(r=0,a=0;r>>26-M&67108863,(M+=24)>=26&&(M-=26,a++);return this.strip()},e.prototype._parseHex=function(p,x,R){this.length=Math.ceil((p.length-x)/6),this.words=new Array(this.length);for(var r=0;r=x;r-=2)a=u(p,x,r)<=18?(g-=18,this.words[M+=1]|=a>>>26):g+=8;else for(r=(p.length-x)%2==0?x+1:x;r=18?(g-=18,this.words[M+=1]|=a>>>26):g+=8;this.strip()},e.prototype._parseBase=function(p,x,R){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=x)r++;r--,a=a/x|0;for(var g=p.length-R,M=g%r,E=Math.min(g,g-M)+R,C=0,U=R;U1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},e.prototype.inspect=function(){return(this.red?""};var f=["","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"],d=[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],_=[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 v(p,x,R){R.negative=x.negative^p.negative;var r=p.length+x.length|0;R.length=r,r=r-1|0;var a=0|p.words[0],g=0|x.words[0],M=a*g,C=M/67108864|0;R.words[0]=67108863&M;for(var U=1;U>>26,I=67108863&C,W=Math.min(U,x.length-1),F=Math.max(0,U-p.length+1);F<=W;F++)V+=(M=(a=0|p.words[U-F|0])*(g=0|x.words[F])+I)/67108864|0,I=67108863&M;R.words[U]=0|I,C=0|V}return 0!==C?R.words[U]=0|C:R.length--,R.strip()}e.prototype.toString=function(p,x){var R;if(x=0|x||1,16===(p=p||10)||"hex"===p){R="";for(var r=0,a=0,g=0;g>>24-r&16777215)||g!==this.length-1?f[6-E.length]+E+R:E+R,(r+=2)>=26&&(r-=26,g--)}for(0!==a&&(R=a.toString(16)+R);R.length%x!=0;)R="0"+R;return 0!==this.negative&&(R="-"+R),R}if(p===(0|p)&&p>=2&&p<=36){var C=d[p],U=_[p];R="";var V=this.clone();for(V.negative=0;!V.isZero();){var I=V.modn(U).toString(p);R=(V=V.idivn(U)).isZero()?I+R:f[C-I.length]+I+R}for(this.isZero()&&(R="0"+R);R.length%x!=0;)R="0"+R;return 0!==this.negative&&(R="-"+R),R}n(!1,"Base should be between 2 and 36")},e.prototype.toNumber=function(){var p=this.words[0];return 2===this.length?p+=67108864*this.words[1]:3===this.length&&1===this.words[2]?p+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-p:p},e.prototype.toJSON=function(){return this.toString(16)},e.prototype.toBuffer=function(p,x){return n(void 0!==t),this.toArrayLike(t,p,x)},e.prototype.toArray=function(p,x){return this.toArrayLike(Array,p,x)},e.prototype.toArrayLike=function(p,x,R){var r=this.byteLength(),a=R||Math.max(1,r);n(r<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var g,M,E="le"===x,C=new p(a),U=this.clone();if(E){for(M=0;!U.isZero();M++)g=U.andln(255),U.iushrn(8),C[M]=g;for(;M=4096&&(R+=13,x>>>=13),x>=64&&(R+=7,x>>>=7),x>=8&&(R+=4,x>>>=4),x>=2&&(R+=2,x>>>=2),R+x},e.prototype._zeroBits=function(p){if(0===p)return 26;var x=p,R=0;return 0==(8191&x)&&(R+=13,x>>>=13),0==(127&x)&&(R+=7,x>>>=7),0==(15&x)&&(R+=4,x>>>=4),0==(3&x)&&(R+=2,x>>>=2),0==(1&x)&&R++,R},e.prototype.bitLength=function(){var x=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+x},e.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,x=0;xp.length?this.clone().ior(p):p.clone().ior(this)},e.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},e.prototype.iuand=function(p){var x;x=this.length>p.length?p:this;for(var R=0;Rp.length?this.clone().iand(p):p.clone().iand(this)},e.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},e.prototype.iuxor=function(p){var x,R;this.length>p.length?(x=this,R=p):(x=p,R=this);for(var r=0;rp.length?this.clone().ixor(p):p.clone().ixor(this)},e.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},e.prototype.inotn=function(p){n("number"==typeof p&&p>=0);var x=0|Math.ceil(p/26),R=p%26;this._expand(x),R>0&&x--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-R),this.strip()},e.prototype.notn=function(p){return this.clone().inotn(p)},e.prototype.setn=function(p,x){n("number"==typeof p&&p>=0);var R=p/26|0,r=p%26;return this._expand(R+1),this.words[R]=x?this.words[R]|1<p.length?(R=this,r=p):(R=p,r=this);for(var a=0,g=0;g>>26;for(;0!==a&&g>>26;if(this.length=R.length,0!==a)this.words[this.length]=a,this.length++;else if(R!==this)for(;gp.length?this.clone().iadd(p):p.clone().iadd(this)},e.prototype.isub=function(p){if(0!==p.negative){p.negative=0;var x=this.iadd(p);return p.negative=1,x._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var R,r,a=this.cmp(p);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(R=this,r=p):(R=p,r=this);for(var g=0,M=0;M>26,this.words[M]=67108863&x;for(;0!==g&&M>26,this.words[M]=67108863&x;if(0===g&&M>>13,F=0|M[1],B=8191&F,N=F>>>13,P=0|M[2],j=8191&P,K=P>>>13,Z=0|M[3],J=8191&Z,X=Z>>>13,ee=0|M[4],te=8191&ee,oe=ee>>>13,ve=0|M[5],ie=8191&ve,de=ve>>>13,fe=0|M[6],re=8191&fe,_e=fe>>>13,Ke=0|M[7],pe=8191&Ke,Te=Ke>>>13,Ve=0|M[8],be=8191&Ve,Pe=Ve>>>13,Ye=0|M[9],we=8191&Ye,Be=Ye>>>13,$e=0|E[0],Me=8191&$e,je=$e>>>13,Q=0|E[1],se=8191&Q,le=Q>>>13,Le=0|E[2],he=8191&Le,Oe=Le>>>13,Ge=0|E[3],me=8191&Ge,ze=Ge>>>13,rt=0|E[4],Re=8191&rt,He=rt>>>13,Qe=0|E[5],Ee=8191&Qe,Ne=Qe>>>13,it=0|E[6],xe=8191&it,qe=it>>>13,et=0|E[7],ke=8191&et,We=et>>>13,tt=0|E[8],Se=8191&tt,Fe=tt>>>13,nt=0|E[9],Ae=8191&nt,Ue=nt>>>13;R.negative=p.negative^x.negative,R.length=19;var Y=(U+(r=Math.imul(I,Me))|0)+((8191&(a=(a=Math.imul(I,je))+Math.imul(W,Me)|0))<<13)|0;U=((g=Math.imul(W,je))+(a>>>13)|0)+(Y>>>26)|0,Y&=67108863,r=Math.imul(B,Me),a=(a=Math.imul(B,je))+Math.imul(N,Me)|0,g=Math.imul(N,je);var G=(U+(r=r+Math.imul(I,se)|0)|0)+((8191&(a=(a=a+Math.imul(I,le)|0)+Math.imul(W,se)|0))<<13)|0;U=((g=g+Math.imul(W,le)|0)+(a>>>13)|0)+(G>>>26)|0,G&=67108863,r=Math.imul(j,Me),a=(a=Math.imul(j,je))+Math.imul(K,Me)|0,g=Math.imul(K,je),r=r+Math.imul(B,se)|0,a=(a=a+Math.imul(B,le)|0)+Math.imul(N,se)|0,g=g+Math.imul(N,le)|0;var $=(U+(r=r+Math.imul(I,he)|0)|0)+((8191&(a=(a=a+Math.imul(I,Oe)|0)+Math.imul(W,he)|0))<<13)|0;U=((g=g+Math.imul(W,Oe)|0)+(a>>>13)|0)+($>>>26)|0,$&=67108863,r=Math.imul(J,Me),a=(a=Math.imul(J,je))+Math.imul(X,Me)|0,g=Math.imul(X,je),r=r+Math.imul(j,se)|0,a=(a=a+Math.imul(j,le)|0)+Math.imul(K,se)|0,g=g+Math.imul(K,le)|0,r=r+Math.imul(B,he)|0,a=(a=a+Math.imul(B,Oe)|0)+Math.imul(N,he)|0,g=g+Math.imul(N,Oe)|0;var ne=(U+(r=r+Math.imul(I,me)|0)|0)+((8191&(a=(a=a+Math.imul(I,ze)|0)+Math.imul(W,me)|0))<<13)|0;U=((g=g+Math.imul(W,ze)|0)+(a>>>13)|0)+(ne>>>26)|0,ne&=67108863,r=Math.imul(te,Me),a=(a=Math.imul(te,je))+Math.imul(oe,Me)|0,g=Math.imul(oe,je),r=r+Math.imul(J,se)|0,a=(a=a+Math.imul(J,le)|0)+Math.imul(X,se)|0,g=g+Math.imul(X,le)|0,r=r+Math.imul(j,he)|0,a=(a=a+Math.imul(j,Oe)|0)+Math.imul(K,he)|0,g=g+Math.imul(K,Oe)|0,r=r+Math.imul(B,me)|0,a=(a=a+Math.imul(B,ze)|0)+Math.imul(N,me)|0,g=g+Math.imul(N,ze)|0;var ce=(U+(r=r+Math.imul(I,Re)|0)|0)+((8191&(a=(a=a+Math.imul(I,He)|0)+Math.imul(W,Re)|0))<<13)|0;U=((g=g+Math.imul(W,He)|0)+(a>>>13)|0)+(ce>>>26)|0,ce&=67108863,r=Math.imul(ie,Me),a=(a=Math.imul(ie,je))+Math.imul(de,Me)|0,g=Math.imul(de,je),r=r+Math.imul(te,se)|0,a=(a=a+Math.imul(te,le)|0)+Math.imul(oe,se)|0,g=g+Math.imul(oe,le)|0,r=r+Math.imul(J,he)|0,a=(a=a+Math.imul(J,Oe)|0)+Math.imul(X,he)|0,g=g+Math.imul(X,Oe)|0,r=r+Math.imul(j,me)|0,a=(a=a+Math.imul(j,ze)|0)+Math.imul(K,me)|0,g=g+Math.imul(K,ze)|0,r=r+Math.imul(B,Re)|0,a=(a=a+Math.imul(B,He)|0)+Math.imul(N,Re)|0,g=g+Math.imul(N,He)|0;var ue=(U+(r=r+Math.imul(I,Ee)|0)|0)+((8191&(a=(a=a+Math.imul(I,Ne)|0)+Math.imul(W,Ee)|0))<<13)|0;U=((g=g+Math.imul(W,Ne)|0)+(a>>>13)|0)+(ue>>>26)|0,ue&=67108863,r=Math.imul(re,Me),a=(a=Math.imul(re,je))+Math.imul(_e,Me)|0,g=Math.imul(_e,je),r=r+Math.imul(ie,se)|0,a=(a=a+Math.imul(ie,le)|0)+Math.imul(de,se)|0,g=g+Math.imul(de,le)|0,r=r+Math.imul(te,he)|0,a=(a=a+Math.imul(te,Oe)|0)+Math.imul(oe,he)|0,g=g+Math.imul(oe,Oe)|0,r=r+Math.imul(J,me)|0,a=(a=a+Math.imul(J,ze)|0)+Math.imul(X,me)|0,g=g+Math.imul(X,ze)|0,r=r+Math.imul(j,Re)|0,a=(a=a+Math.imul(j,He)|0)+Math.imul(K,Re)|0,g=g+Math.imul(K,He)|0,r=r+Math.imul(B,Ee)|0,a=(a=a+Math.imul(B,Ne)|0)+Math.imul(N,Ee)|0,g=g+Math.imul(N,Ne)|0;var Ce=(U+(r=r+Math.imul(I,xe)|0)|0)+((8191&(a=(a=a+Math.imul(I,qe)|0)+Math.imul(W,xe)|0))<<13)|0;U=((g=g+Math.imul(W,qe)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(pe,Me),a=(a=Math.imul(pe,je))+Math.imul(Te,Me)|0,g=Math.imul(Te,je),r=r+Math.imul(re,se)|0,a=(a=a+Math.imul(re,le)|0)+Math.imul(_e,se)|0,g=g+Math.imul(_e,le)|0,r=r+Math.imul(ie,he)|0,a=(a=a+Math.imul(ie,Oe)|0)+Math.imul(de,he)|0,g=g+Math.imul(de,Oe)|0,r=r+Math.imul(te,me)|0,a=(a=a+Math.imul(te,ze)|0)+Math.imul(oe,me)|0,g=g+Math.imul(oe,ze)|0,r=r+Math.imul(J,Re)|0,a=(a=a+Math.imul(J,He)|0)+Math.imul(X,Re)|0,g=g+Math.imul(X,He)|0,r=r+Math.imul(j,Ee)|0,a=(a=a+Math.imul(j,Ne)|0)+Math.imul(K,Ee)|0,g=g+Math.imul(K,Ne)|0,r=r+Math.imul(B,xe)|0,a=(a=a+Math.imul(B,qe)|0)+Math.imul(N,xe)|0,g=g+Math.imul(N,qe)|0;var Ie=(U+(r=r+Math.imul(I,ke)|0)|0)+((8191&(a=(a=a+Math.imul(I,We)|0)+Math.imul(W,ke)|0))<<13)|0;U=((g=g+Math.imul(W,We)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(be,Me),a=(a=Math.imul(be,je))+Math.imul(Pe,Me)|0,g=Math.imul(Pe,je),r=r+Math.imul(pe,se)|0,a=(a=a+Math.imul(pe,le)|0)+Math.imul(Te,se)|0,g=g+Math.imul(Te,le)|0,r=r+Math.imul(re,he)|0,a=(a=a+Math.imul(re,Oe)|0)+Math.imul(_e,he)|0,g=g+Math.imul(_e,Oe)|0,r=r+Math.imul(ie,me)|0,a=(a=a+Math.imul(ie,ze)|0)+Math.imul(de,me)|0,g=g+Math.imul(de,ze)|0,r=r+Math.imul(te,Re)|0,a=(a=a+Math.imul(te,He)|0)+Math.imul(oe,Re)|0,g=g+Math.imul(oe,He)|0,r=r+Math.imul(J,Ee)|0,a=(a=a+Math.imul(J,Ne)|0)+Math.imul(X,Ee)|0,g=g+Math.imul(X,Ne)|0,r=r+Math.imul(j,xe)|0,a=(a=a+Math.imul(j,qe)|0)+Math.imul(K,xe)|0,g=g+Math.imul(K,qe)|0,r=r+Math.imul(B,ke)|0,a=(a=a+Math.imul(B,We)|0)+Math.imul(N,ke)|0,g=g+Math.imul(N,We)|0;var De=(U+(r=r+Math.imul(I,Se)|0)|0)+((8191&(a=(a=a+Math.imul(I,Fe)|0)+Math.imul(W,Se)|0))<<13)|0;U=((g=g+Math.imul(W,Fe)|0)+(a>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(we,Me),a=(a=Math.imul(we,je))+Math.imul(Be,Me)|0,g=Math.imul(Be,je),r=r+Math.imul(be,se)|0,a=(a=a+Math.imul(be,le)|0)+Math.imul(Pe,se)|0,g=g+Math.imul(Pe,le)|0,r=r+Math.imul(pe,he)|0,a=(a=a+Math.imul(pe,Oe)|0)+Math.imul(Te,he)|0,g=g+Math.imul(Te,Oe)|0,r=r+Math.imul(re,me)|0,a=(a=a+Math.imul(re,ze)|0)+Math.imul(_e,me)|0,g=g+Math.imul(_e,ze)|0,r=r+Math.imul(ie,Re)|0,a=(a=a+Math.imul(ie,He)|0)+Math.imul(de,Re)|0,g=g+Math.imul(de,He)|0,r=r+Math.imul(te,Ee)|0,a=(a=a+Math.imul(te,Ne)|0)+Math.imul(oe,Ee)|0,g=g+Math.imul(oe,Ne)|0,r=r+Math.imul(J,xe)|0,a=(a=a+Math.imul(J,qe)|0)+Math.imul(X,xe)|0,g=g+Math.imul(X,qe)|0,r=r+Math.imul(j,ke)|0,a=(a=a+Math.imul(j,We)|0)+Math.imul(K,ke)|0,g=g+Math.imul(K,We)|0,r=r+Math.imul(B,Se)|0,a=(a=a+Math.imul(B,Fe)|0)+Math.imul(N,Se)|0,g=g+Math.imul(N,Fe)|0;var ye=(U+(r=r+Math.imul(I,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(I,Ue)|0)+Math.imul(W,Ae)|0))<<13)|0;U=((g=g+Math.imul(W,Ue)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(we,se),a=(a=Math.imul(we,le))+Math.imul(Be,se)|0,g=Math.imul(Be,le),r=r+Math.imul(be,he)|0,a=(a=a+Math.imul(be,Oe)|0)+Math.imul(Pe,he)|0,g=g+Math.imul(Pe,Oe)|0,r=r+Math.imul(pe,me)|0,a=(a=a+Math.imul(pe,ze)|0)+Math.imul(Te,me)|0,g=g+Math.imul(Te,ze)|0,r=r+Math.imul(re,Re)|0,a=(a=a+Math.imul(re,He)|0)+Math.imul(_e,Re)|0,g=g+Math.imul(_e,He)|0,r=r+Math.imul(ie,Ee)|0,a=(a=a+Math.imul(ie,Ne)|0)+Math.imul(de,Ee)|0,g=g+Math.imul(de,Ne)|0,r=r+Math.imul(te,xe)|0,a=(a=a+Math.imul(te,qe)|0)+Math.imul(oe,xe)|0,g=g+Math.imul(oe,qe)|0,r=r+Math.imul(J,ke)|0,a=(a=a+Math.imul(J,We)|0)+Math.imul(X,ke)|0,g=g+Math.imul(X,We)|0,r=r+Math.imul(j,Se)|0,a=(a=a+Math.imul(j,Fe)|0)+Math.imul(K,Se)|0,g=g+Math.imul(K,Fe)|0;var ae=(U+(r=r+Math.imul(B,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(B,Ue)|0)+Math.imul(N,Ae)|0))<<13)|0;U=((g=g+Math.imul(N,Ue)|0)+(a>>>13)|0)+(ae>>>26)|0,ae&=67108863,r=Math.imul(we,he),a=(a=Math.imul(we,Oe))+Math.imul(Be,he)|0,g=Math.imul(Be,Oe),r=r+Math.imul(be,me)|0,a=(a=a+Math.imul(be,ze)|0)+Math.imul(Pe,me)|0,g=g+Math.imul(Pe,ze)|0,r=r+Math.imul(pe,Re)|0,a=(a=a+Math.imul(pe,He)|0)+Math.imul(Te,Re)|0,g=g+Math.imul(Te,He)|0,r=r+Math.imul(re,Ee)|0,a=(a=a+Math.imul(re,Ne)|0)+Math.imul(_e,Ee)|0,g=g+Math.imul(_e,Ne)|0,r=r+Math.imul(ie,xe)|0,a=(a=a+Math.imul(ie,qe)|0)+Math.imul(de,xe)|0,g=g+Math.imul(de,qe)|0,r=r+Math.imul(te,ke)|0,a=(a=a+Math.imul(te,We)|0)+Math.imul(oe,ke)|0,g=g+Math.imul(oe,We)|0,r=r+Math.imul(J,Se)|0,a=(a=a+Math.imul(J,Fe)|0)+Math.imul(X,Se)|0,g=g+Math.imul(X,Fe)|0;var Je=(U+(r=r+Math.imul(j,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(j,Ue)|0)+Math.imul(K,Ae)|0))<<13)|0;U=((g=g+Math.imul(K,Ue)|0)+(a>>>13)|0)+(Je>>>26)|0,Je&=67108863,r=Math.imul(we,me),a=(a=Math.imul(we,ze))+Math.imul(Be,me)|0,g=Math.imul(Be,ze),r=r+Math.imul(be,Re)|0,a=(a=a+Math.imul(be,He)|0)+Math.imul(Pe,Re)|0,g=g+Math.imul(Pe,He)|0,r=r+Math.imul(pe,Ee)|0,a=(a=a+Math.imul(pe,Ne)|0)+Math.imul(Te,Ee)|0,g=g+Math.imul(Te,Ne)|0,r=r+Math.imul(re,xe)|0,a=(a=a+Math.imul(re,qe)|0)+Math.imul(_e,xe)|0,g=g+Math.imul(_e,qe)|0,r=r+Math.imul(ie,ke)|0,a=(a=a+Math.imul(ie,We)|0)+Math.imul(de,ke)|0,g=g+Math.imul(de,We)|0,r=r+Math.imul(te,Se)|0,a=(a=a+Math.imul(te,Fe)|0)+Math.imul(oe,Se)|0,g=g+Math.imul(oe,Fe)|0;var ot=(U+(r=r+Math.imul(J,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(J,Ue)|0)+Math.imul(X,Ae)|0))<<13)|0;U=((g=g+Math.imul(X,Ue)|0)+(a>>>13)|0)+(ot>>>26)|0,ot&=67108863,r=Math.imul(we,Re),a=(a=Math.imul(we,He))+Math.imul(Be,Re)|0,g=Math.imul(Be,He),r=r+Math.imul(be,Ee)|0,a=(a=a+Math.imul(be,Ne)|0)+Math.imul(Pe,Ee)|0,g=g+Math.imul(Pe,Ne)|0,r=r+Math.imul(pe,xe)|0,a=(a=a+Math.imul(pe,qe)|0)+Math.imul(Te,xe)|0,g=g+Math.imul(Te,qe)|0,r=r+Math.imul(re,ke)|0,a=(a=a+Math.imul(re,We)|0)+Math.imul(_e,ke)|0,g=g+Math.imul(_e,We)|0,r=r+Math.imul(ie,Se)|0,a=(a=a+Math.imul(ie,Fe)|0)+Math.imul(de,Se)|0,g=g+Math.imul(de,Fe)|0;var at=(U+(r=r+Math.imul(te,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(te,Ue)|0)+Math.imul(oe,Ae)|0))<<13)|0;U=((g=g+Math.imul(oe,Ue)|0)+(a>>>13)|0)+(at>>>26)|0,at&=67108863,r=Math.imul(we,Ee),a=(a=Math.imul(we,Ne))+Math.imul(Be,Ee)|0,g=Math.imul(Be,Ne),r=r+Math.imul(be,xe)|0,a=(a=a+Math.imul(be,qe)|0)+Math.imul(Pe,xe)|0,g=g+Math.imul(Pe,qe)|0,r=r+Math.imul(pe,ke)|0,a=(a=a+Math.imul(pe,We)|0)+Math.imul(Te,ke)|0,g=g+Math.imul(Te,We)|0,r=r+Math.imul(re,Se)|0,a=(a=a+Math.imul(re,Fe)|0)+Math.imul(_e,Se)|0,g=g+Math.imul(_e,Fe)|0;var st=(U+(r=r+Math.imul(ie,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(ie,Ue)|0)+Math.imul(de,Ae)|0))<<13)|0;U=((g=g+Math.imul(de,Ue)|0)+(a>>>13)|0)+(st>>>26)|0,st&=67108863,r=Math.imul(we,xe),a=(a=Math.imul(we,qe))+Math.imul(Be,xe)|0,g=Math.imul(Be,qe),r=r+Math.imul(be,ke)|0,a=(a=a+Math.imul(be,We)|0)+Math.imul(Pe,ke)|0,g=g+Math.imul(Pe,We)|0,r=r+Math.imul(pe,Se)|0,a=(a=a+Math.imul(pe,Fe)|0)+Math.imul(Te,Se)|0,g=g+Math.imul(Te,Fe)|0;var ut=(U+(r=r+Math.imul(re,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(re,Ue)|0)+Math.imul(_e,Ae)|0))<<13)|0;U=((g=g+Math.imul(_e,Ue)|0)+(a>>>13)|0)+(ut>>>26)|0,ut&=67108863,r=Math.imul(we,ke),a=(a=Math.imul(we,We))+Math.imul(Be,ke)|0,g=Math.imul(Be,We),r=r+Math.imul(be,Se)|0,a=(a=a+Math.imul(be,Fe)|0)+Math.imul(Pe,Se)|0,g=g+Math.imul(Pe,Fe)|0;var Ze=(U+(r=r+Math.imul(pe,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(pe,Ue)|0)+Math.imul(Te,Ae)|0))<<13)|0;U=((g=g+Math.imul(Te,Ue)|0)+(a>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,r=Math.imul(we,Se),a=(a=Math.imul(we,Fe))+Math.imul(Be,Se)|0,g=Math.imul(Be,Fe);var ct=(U+(r=r+Math.imul(be,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(be,Ue)|0)+Math.imul(Pe,Ae)|0))<<13)|0;U=((g=g+Math.imul(Pe,Ue)|0)+(a>>>13)|0)+(ct>>>26)|0,ct&=67108863;var Xe=(U+(r=Math.imul(we,Ae))|0)+((8191&(a=(a=Math.imul(we,Ue))+Math.imul(Be,Ae)|0))<<13)|0;return U=((g=Math.imul(Be,Ue))+(a>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,C[0]=Y,C[1]=G,C[2]=$,C[3]=ne,C[4]=ce,C[5]=ue,C[6]=Ce,C[7]=Ie,C[8]=De,C[9]=ye,C[10]=ae,C[11]=Je,C[12]=ot,C[13]=at,C[14]=st,C[15]=ut,C[16]=Ze,C[17]=ct,C[18]=Xe,0!==U&&(C[19]=U,R.length++),R};function O(p,x,R){return(new b).mulp(p,x,R)}function b(p,x){this.x=p,this.y=x}Math.imul||(T=v),e.prototype.mulTo=function(p,x){var R=this.length+p.length;return 10===this.length&&10===p.length?T(this,p,x):R<63?v(this,p,x):R<1024?function(r,a,g){g.negative=a.negative^r.negative,g.length=r.length+a.length;for(var M=0,E=0,C=0;C>>26)|0)>>>26,U&=67108863}g.words[C]=V,M=U,U=E}return 0!==M?g.words[C]=M:g.length--,g.strip()}(this,p,x):O(this,p,x)},b.prototype.makeRBT=function(p){for(var x=new Array(p),R=e.prototype._countBits(p)-1,r=0;r>=1;return r},b.prototype.permute=function(p,x,R,r,a,g){for(var M=0;M>>=1)a++;return 1<>>=13),a>>>=13;for(g=2*x;g>=26,x+=r/67108864|0,x+=a>>>26,this.words[R]=67108863&a}return 0!==x&&(this.words[R]=x,this.length++),this},e.prototype.muln=function(p){return this.clone().imuln(p)},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.imul(this.clone())},e.prototype.pow=function(p){var x=function(g){for(var M=new Array(g.bitLength()),E=0;E>>U}return M}(p);if(0===x.length)return new e(1);for(var R=this,r=0;r=0);var x,R=p%26,r=(p-R)/26,a=67108863>>>26-R<<26-R;if(0!==R){var g=0;for(x=0;x>>26-R}g&&(this.words[x]=g,this.length++)}if(0!==r){for(x=this.length-1;x>=0;x--)this.words[x+r]=this.words[x];for(x=0;x=0),r=x?(x-x%26)/26:0;var a=p%26,g=Math.min((p-a)/26,this.length),M=67108863^67108863>>>a<g)for(this.length-=g,C=0;C=0&&(0!==U||C>=r);C--){var V=0|this.words[C];this.words[C]=U<<26-a|V>>>a,U=V&M}return E&&0!==U&&(E.words[E.length++]=U),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},e.prototype.ishrn=function(p,x,R){return n(0===this.negative),this.iushrn(p,x,R)},e.prototype.shln=function(p){return this.clone().ishln(p)},e.prototype.ushln=function(p){return this.clone().iushln(p)},e.prototype.shrn=function(p){return this.clone().ishrn(p)},e.prototype.ushrn=function(p){return this.clone().iushrn(p)},e.prototype.testn=function(p){n("number"==typeof p&&p>=0);var x=p%26,R=(p-x)/26;return!(this.length<=R||!(this.words[R]&1<=0);var x=p%26,R=(p-x)/26;return n(0===this.negative,"imaskn works only with positive numbers"),this.length<=R?this:(0!==x&&R++,this.length=Math.min(R,this.length),0!==x&&(this.words[this.length-1]&=67108863^67108863>>>x<=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},e.prototype.isubn=function(p){if(n("number"==typeof p),n(p<67108864),p<0)return this.iaddn(-p);if(0!==this.negative)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x>26)-(E/67108864|0),this.words[r+R]=67108863&a}for(;r>26,this.words[r+R]=67108863&a;if(0===M)return this.strip();for(n(-1===M),M=0,r=0;r>26,this.words[r]=67108863&a;return this.negative=1,this.strip()},e.prototype._wordDiv=function(p,x){var R,r=this.clone(),a=p,g=0|a.words[a.length-1];0!=(R=26-this._countBits(g))&&(a=a.ushln(R),r.iushln(R),g=0|a.words[a.length-1]);var M,E=r.length-a.length;if("mod"!==x){(M=new e(null)).length=E+1,M.words=new Array(M.length);for(var C=0;C=0;V--){var I=67108864*(0|r.words[a.length+V])+(0|r.words[a.length+V-1]);for(I=Math.min(I/g|0,67108863),r._ishlnsubmul(a,I,V);0!==r.negative;)I--,r.negative=0,r._ishlnsubmul(a,1,V),r.isZero()||(r.negative^=1);M&&(M.words[V]=I)}return M&&M.strip(),r.strip(),"div"!==x&&0!==R&&r.iushrn(R),{div:M||null,mod:r}},e.prototype.divmod=function(p,x,R){return n(!p.isZero()),this.isZero()?{div:new e(0),mod:new e(0)}:0!==this.negative&&0===p.negative?(g=this.neg().divmod(p,x),"mod"!==x&&(r=g.div.neg()),"div"!==x&&(a=g.mod.neg(),R&&0!==a.negative&&a.iadd(p)),{div:r,mod:a}):0===this.negative&&0!==p.negative?(g=this.divmod(p.neg(),x),"mod"!==x&&(r=g.div.neg()),{div:r,mod:g.mod}):0!=(this.negative&p.negative)?(g=this.neg().divmod(p.neg(),x),"div"!==x&&(a=g.mod.neg(),R&&0!==a.negative&&a.isub(p)),{div:g.div,mod:a}):p.length>this.length||this.cmp(p)<0?{div:new e(0),mod:this}:1===p.length?"div"===x?{div:this.divn(p.words[0]),mod:null}:"mod"===x?{div:null,mod:new e(this.modn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new e(this.modn(p.words[0]))}:this._wordDiv(p,x);var r,a,g},e.prototype.div=function(p){return this.divmod(p,"div",!1).div},e.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},e.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},e.prototype.divRound=function(p){var x=this.divmod(p);if(x.mod.isZero())return x.div;var R=0!==x.div.negative?x.mod.isub(p):x.mod,r=p.ushrn(1),a=p.andln(1),g=R.cmp(r);return g<0||1===a&&0===g?x.div:0!==x.div.negative?x.div.isubn(1):x.div.iaddn(1)},e.prototype.modn=function(p){n(p<=67108863);for(var x=(1<<26)%p,R=0,r=this.length-1;r>=0;r--)R=(x*R+(0|this.words[r]))%p;return R},e.prototype.idivn=function(p){n(p<=67108863);for(var x=0,R=this.length-1;R>=0;R--){var r=(0|this.words[R])+67108864*x;this.words[R]=r/p|0,x=r%p}return this.strip()},e.prototype.divn=function(p){return this.clone().idivn(p)},e.prototype.egcd=function(p){n(0===p.negative),n(!p.isZero());var x=this,R=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var r=new e(1),a=new e(0),g=new e(0),M=new e(1),E=0;x.isEven()&&R.isEven();)x.iushrn(1),R.iushrn(1),++E;for(var C=R.clone(),U=x.clone();!x.isZero();){for(var V=0,I=1;0==(x.words[0]&I)&&V<26;++V,I<<=1);if(V>0)for(x.iushrn(V);V-- >0;)(r.isOdd()||a.isOdd())&&(r.iadd(C),a.isub(U)),r.iushrn(1),a.iushrn(1);for(var W=0,F=1;0==(R.words[0]&F)&&W<26;++W,F<<=1);if(W>0)for(R.iushrn(W);W-- >0;)(g.isOdd()||M.isOdd())&&(g.iadd(C),M.isub(U)),g.iushrn(1),M.iushrn(1);x.cmp(R)>=0?(x.isub(R),r.isub(g),a.isub(M)):(R.isub(x),g.isub(r),M.isub(a))}return{a:g,b:M,gcd:R.iushln(E)}},e.prototype._invmp=function(p){n(0===p.negative),n(!p.isZero());var x=this,R=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var r,a=new e(1),g=new e(0),M=R.clone();x.cmpn(1)>0&&R.cmpn(1)>0;){for(var E=0,C=1;0==(x.words[0]&C)&&E<26;++E,C<<=1);if(E>0)for(x.iushrn(E);E-- >0;)a.isOdd()&&a.iadd(M),a.iushrn(1);for(var U=0,V=1;0==(R.words[0]&V)&&U<26;++U,V<<=1);if(U>0)for(R.iushrn(U);U-- >0;)g.isOdd()&&g.iadd(M),g.iushrn(1);x.cmp(R)>=0?(x.isub(R),a.isub(g)):(R.isub(x),g.isub(a))}return(r=0===x.cmpn(1)?a:g).cmpn(0)<0&&r.iadd(p),r},e.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var x=this.clone(),R=p.clone();x.negative=0,R.negative=0;for(var r=0;x.isEven()&&R.isEven();r++)x.iushrn(1),R.iushrn(1);for(;;){for(;x.isEven();)x.iushrn(1);for(;R.isEven();)R.iushrn(1);var a=x.cmp(R);if(a<0){var g=x;x=R,R=g}else if(0===a||0===R.cmpn(1))break;x.isub(R)}return R.iushln(r)},e.prototype.invm=function(p){return this.egcd(p).a.umod(p)},e.prototype.isEven=function(){return 0==(1&this.words[0])},e.prototype.isOdd=function(){return 1==(1&this.words[0])},e.prototype.andln=function(p){return this.words[0]&p},e.prototype.bincn=function(p){n("number"==typeof p);var x=p%26,R=(p-x)/26,r=1<>>26,this.words[g]=M&=67108863}return 0!==a&&(this.words[g]=a,this.length++),this},e.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},e.prototype.cmpn=function(p){var x,R=p<0;if(0!==this.negative&&!R)return-1;if(0===this.negative&&R)return 1;if(this.strip(),this.length>1)x=1;else{R&&(p=-p),n(p<=67108863,"Number is too big");var r=0|this.words[0];x=r===p?0:rp.length)return 1;if(this.length=0;R--){var r=0|this.words[R],a=0|p.words[R];if(r!==a){ra&&(x=1);break}}return x},e.prototype.gtn=function(p){return 1===this.cmpn(p)},e.prototype.gt=function(p){return 1===this.cmp(p)},e.prototype.gten=function(p){return this.cmpn(p)>=0},e.prototype.gte=function(p){return this.cmp(p)>=0},e.prototype.ltn=function(p){return-1===this.cmpn(p)},e.prototype.lt=function(p){return-1===this.cmp(p)},e.prototype.lten=function(p){return this.cmpn(p)<=0},e.prototype.lte=function(p){return this.cmp(p)<=0},e.prototype.eqn=function(p){return 0===this.cmpn(p)},e.prototype.eq=function(p){return 0===this.cmp(p)},e.red=function(p){return new q(p)},e.prototype.toRed=function(p){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),p.convertTo(this)._forceRed(p)},e.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(p){return this.red=p,this},e.prototype.forceRed=function(p){return n(!this.red,"Already a number in reduction context"),this._forceRed(p)},e.prototype.redAdd=function(p){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},e.prototype.redIAdd=function(p){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},e.prototype.redSub=function(p){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},e.prototype.redISub=function(p){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},e.prototype.redShl=function(p){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},e.prototype.redMul=function(p){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},e.prototype.redIMul=function(p){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},e.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(p){return n(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var S={k256:null,p224:null,p192:null,p25519:null};function w(p,x){this.name=p,this.p=new e(x,16),this.n=this.p.bitLength(),this.k=new e(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function L(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function H(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function D(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function q(p){if("string"==typeof p){var x=e._prime(p);this.m=x.p,this.prime=x}else n(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}function k(p){q.call(this,p),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new e(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)}w.prototype._tmp=function(){var p=new e(null);return p.words=new Array(Math.ceil(this.n/13)),p},w.prototype.ireduce=function(p){var x,R=p;do{this.split(R,this.tmp),x=(R=(R=this.imulK(R)).iadd(this.tmp)).bitLength()}while(x>this.n);var r=x0?R.isub(this.p):void 0!==R.strip?R.strip():R._strip(),R},w.prototype.split=function(p,x){p.iushrn(this.n,0,x)},w.prototype.imulK=function(p){return p.imul(this.k)},o(A,w),A.prototype.split=function(p,x){for(var R=Math.min(p.length,9),r=0;r>>22,a=g}p.words[r-10]=a>>>=22,p.length-=0===a&&p.length>10?10:9},A.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var x=0,R=0;R>>=26,p.words[R]=a,x=r}return 0!==x&&(p.words[p.length++]=x),p},e._prime=function(p){if(S[p])return S[p];var x;if("k256"===p)x=new A;else if("p224"===p)x=new L;else if("p192"===p)x=new H;else{if("p25519"!==p)throw new Error("Unknown prime "+p);x=new D}return S[p]=x,x},q.prototype._verify1=function(p){n(0===p.negative,"red works only with positives"),n(p.red,"red works only with red numbers")},q.prototype._verify2=function(p,x){n(0==(p.negative|x.negative),"red works only with positives"),n(p.red&&p.red===x.red,"red works only with red numbers")},q.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):p.umod(this.m)._forceRed(this)},q.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},q.prototype.add=function(p,x){this._verify2(p,x);var R=p.add(x);return R.cmp(this.m)>=0&&R.isub(this.m),R._forceRed(this)},q.prototype.iadd=function(p,x){this._verify2(p,x);var R=p.iadd(x);return R.cmp(this.m)>=0&&R.isub(this.m),R},q.prototype.sub=function(p,x){this._verify2(p,x);var R=p.sub(x);return R.cmpn(0)<0&&R.iadd(this.m),R._forceRed(this)},q.prototype.isub=function(p,x){this._verify2(p,x);var R=p.isub(x);return R.cmpn(0)<0&&R.iadd(this.m),R},q.prototype.shl=function(p,x){return this._verify1(p),this.imod(p.ushln(x))},q.prototype.imul=function(p,x){return this._verify2(p,x),this.imod(p.imul(x))},q.prototype.mul=function(p,x){return this._verify2(p,x),this.imod(p.mul(x))},q.prototype.isqr=function(p){return this.imul(p,p.clone())},q.prototype.sqr=function(p){return this.mul(p,p)},q.prototype.sqrt=function(p){if(p.isZero())return p.clone();var x=this.m.andln(3);if(n(x%2==1),3===x){var R=this.m.add(new e(1)).iushrn(2);return this.pow(p,R)}for(var r=this.m.subn(1),a=0;!r.isZero()&&0===r.andln(1);)a++,r.iushrn(1);n(!r.isZero());var g=new e(1).toRed(this),M=g.redNeg(),E=this.m.subn(1).iushrn(1),C=this.m.bitLength();for(C=new e(2*C*C).toRed(this);0!==this.pow(C,E).cmp(M);)C.redIAdd(M);for(var U=this.pow(C,r),V=this.pow(p,r.addn(1).iushrn(1)),I=this.pow(p,r),W=a;0!==I.cmp(g);){for(var F=I,B=0;0!==F.cmp(g);B++)F=F.redSqr();n(B=0;r--){for(var C=x.words[r],U=E-1;U>=0;U--){var V=C>>U&1;a!==R[0]&&(a=this.sqr(a)),0!==V||0!==g?(g<<=1,g|=V,(4==++M||0===r&&0===U)&&(a=this.mul(a,R[g]),M=0,g=0)):M=0}E=26}return a},q.prototype.convertTo=function(p){var x=p.umod(this.m);return x===p?x.clone():x},q.prototype.convertFrom=function(p){var x=p.clone();return x.red=null,x},e.mont=function(p){return new k(p)},o(k,q),k.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},k.prototype.convertFrom=function(p){var x=this.imod(p.mul(this.rinv));return x.red=null,x},k.prototype.imul=function(p,x){if(p.isZero()||x.isZero())return p.words[0]=0,p.length=1,p;var R=p.imul(x),r=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=R.isub(r).iushrn(this.shift),g=a;return a.cmp(this.m)>=0?g=a.isub(this.m):a.cmpn(0)<0&&(g=a.iadd(this.m)),g._forceRed(this)},k.prototype.mul=function(p,x){if(p.isZero()||x.isZero())return new e(0)._forceRed(this);var R=p.mul(x),r=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=R.isub(r).iushrn(this.shift),g=a;return a.cmp(this.m)>=0?g=a.isub(this.m):a.cmpn(0)<0&&(g=a.iadd(this.m)),g._forceRed(this)},k.prototype.invm=function(p){return this.imod(p._invmp(this.m).mul(this.r2))._forceRed(this)}}(s,this)}).call(this,c(25)(z))},function(z,l){var c,s=[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];l.getSymbolSize=function(m){if(!m)throw new Error('"version" cannot be null or undefined');if(m<1||m>40)throw new Error('"version" should be in range from 1 to 40');return 4*m+17},l.getSymbolTotalCodewords=function(m){return s[m]},l.getBCHDigit=function(m){for(var y=0;0!==m;)y++,m>>>=1;return y},l.setToSJISFunction=function(m){if("function"!=typeof m)throw new Error('"toSJISFunc" is not a valid function.');c=m},l.isKanjiModeEnabled=function(){return void 0!==c},l.toSJIS=function(m){return c(m)}},function(z,l,c){var s=c(99),m=c(100);l.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},l.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},l.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},l.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},l.MIXED={bit:-1},l.getCharCountIndicator=function(y,n){if(!y.ccBits)throw new Error("Invalid mode: "+y);if(!s.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?y.ccBits[0]:n<27?y.ccBits[1]:y.ccBits[2]},l.getBestModeForData=function(y){return m.testNumeric(y)?l.NUMERIC:m.testAlphanumeric(y)?l.ALPHANUMERIC:m.testKanji(y)?l.KANJI:l.BYTE},l.toString=function(y){if(y&&y.id)return y.id;throw new Error("Invalid mode")},l.isValid=function(y){return y&&y.bit&&y.ccBits},l.from=function(y,n){if(l.isValid(y))return y;try{return function(o){if("string"!=typeof o)throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return l.NUMERIC;case"alphanumeric":return l.ALPHANUMERIC;case"kanji":return l.KANJI;case"byte":return l.BYTE;default:throw new Error("Unknown mode: "+o)}}(y)}catch{return n}}},function(z,l,c){"use strict";var s=c(43),m=Object.keys||function(d){var _=[];for(var v in d)_.push(v);return _};z.exports=u;var y=Object.create(c(35));y.inherits=c(3);var n=c(105),o=c(53);y.inherits(u,n);for(var e=m(o.prototype),t=0;t>5==6?2:d>>4==14?3:d>>3==30?4:d>>6==2?-1:-2}function o(d){var _=this.lastTotal-this.lastNeed,v=function(T,O,b){if(128!=(192&O[0]))return T.lastNeed=0,"\ufffd";if(T.lastNeed>1&&O.length>1){if(128!=(192&O[1]))return T.lastNeed=1,"\ufffd";if(T.lastNeed>2&&O.length>2&&128!=(192&O[2]))return T.lastNeed=2,"\ufffd"}}(this,d);return void 0!==v?v:this.lastNeed<=d.length?(d.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(d.copy(this.lastChar,_,0,d.length),void(this.lastNeed-=d.length))}function e(d,_){if((d.length-_)%2==0){var v=d.toString("utf16le",_);if(v){var T=v.charCodeAt(v.length-1);if(T>=55296&&T<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=d[d.length-2],this.lastChar[1]=d[d.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=d[d.length-1],d.toString("utf16le",_,d.length-1)}function t(d){var _=d&&d.length?this.write(d):"";return this.lastNeed?_+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):_}function i(d,_){var v=(d.length-_)%3;return 0===v?d.toString("base64",_):(this.lastNeed=3-v,this.lastTotal=3,1===v?this.lastChar[0]=d[d.length-1]:(this.lastChar[0]=d[d.length-2],this.lastChar[1]=d[d.length-1]),d.toString("base64",_,d.length-v))}function u(d){var _=d&&d.length?this.write(d):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function h(d){return d.toString(this.encoding)}function f(d){return d&&d.length?this.write(d):""}l.StringDecoder=y,y.prototype.write=function(d){if(0===d.length)return"";var _,v;if(this.lastNeed){if(void 0===(_=this.fillLast(d)))return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v=0?(A>0&&(O.lastNeed=A-1),A):--w=0?(A>0&&(O.lastNeed=A-2),A):--w=0?(A>0&&(2===A?A=0:O.lastNeed=A-3),A):0}(this,d,_);if(!this.lastNeed)return d.toString("utf8",_);this.lastTotal=v;var T=d.length-(v-this.lastNeed);return d.copy(this.lastChar,0,T),d.toString("utf8",_,T)},y.prototype.fillLast=function(d){if(this.lastNeed<=d.length)return d.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);d.copy(this.lastChar,this.lastTotal-this.lastNeed,0,d.length),this.lastNeed-=d.length}},function(z,l,c){(function(s){var m=Object.getOwnPropertyDescriptors||function(a){for(var g=Object.keys(a),M={},E=0;E=C)return I;switch(I){case"%s":return String(E[M++]);case"%d":return Number(E[M++]);case"%j":try{return JSON.stringify(E[M++])}catch{return"[Circular]"}default:return I}}),V=E[M];M=3&&(M.depth=arguments[2]),arguments.length>=4&&(M.colors=arguments[3]),_(g)?M.showHidden=g:g&&l._extend(M,g),b(M.showHidden)&&(M.showHidden=!1),b(M.depth)&&(M.depth=2),b(M.colors)&&(M.colors=!1),b(M.customInspect)&&(M.customInspect=!0),M.colors&&(M.stylize=t),u(M,a,M.depth)}function t(a,g){var M=e.styles[g];return M?"\x1b["+e.colors[M][0]+"m"+a+"\x1b["+e.colors[M][1]+"m":a}function i(a,g){return a}function u(a,g,M){if(a.customInspect&&g&&H(g.inspect)&&g.inspect!==l.inspect&&(!g.constructor||g.constructor.prototype!==g)){var E=g.inspect(M,a);return O(E)||(E=u(a,E,M)),E}var C=function(P,j){if(b(j))return P.stylize("undefined","undefined");if(O(j)){var K="'"+JSON.stringify(j).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return P.stylize(K,"string")}return T(j)?P.stylize(""+j,"number"):_(j)?P.stylize(""+j,"boolean"):v(j)?P.stylize("null","null"):void 0}(a,g);if(C)return C;var j,U=Object.keys(g),V=(j={},U.forEach(function(K,Z){j[K]=!0}),j);if(a.showHidden&&(U=Object.getOwnPropertyNames(g)),L(g)&&(U.indexOf("message")>=0||U.indexOf("description")>=0))return h(g);if(0===U.length){if(H(g))return a.stylize("[Function"+(g.name?": "+g.name:"")+"]","special");if(S(g))return a.stylize(RegExp.prototype.toString.call(g),"regexp");if(A(g))return a.stylize(Date.prototype.toString.call(g),"date");if(L(g))return h(g)}var W,F="",B=!1,N=["{","}"];return d(g)&&(B=!0,N=["[","]"]),H(g)&&(F=" [Function"+(g.name?": "+g.name:"")+"]"),S(g)&&(F=" "+RegExp.prototype.toString.call(g)),A(g)&&(F=" "+Date.prototype.toUTCString.call(g)),L(g)&&(F=" "+h(g)),0!==U.length||B&&0!=g.length?M<0?S(g)?a.stylize(RegExp.prototype.toString.call(g),"regexp"):a.stylize("[Object]","special"):(a.seen.push(g),W=B?function(P,j,K,Z,J){for(var X=[],ee=0,te=j.length;ee60?K[0]+(""===j?"":j+"\n ")+" "+P.join(",\n ")+" "+K[1]:K[0]+j+" "+P.join(", ")+" "+K[1]}(W,F,N)):N[0]+F+N[1]}function h(a){return"["+Error.prototype.toString.call(a)+"]"}function f(a,g,M,E,C,U){var V,I,W;if((W=Object.getOwnPropertyDescriptor(g,C)||{value:g[C]}).get?I=a.stylize(W.set?"[Getter/Setter]":"[Getter]","special"):W.set&&(I=a.stylize("[Setter]","special")),x(E,C)||(V="["+C+"]"),I||(a.seen.indexOf(W.value)<0?(I=v(M)?u(a,W.value,null):u(a,W.value,M-1)).indexOf("\n")>-1&&(I=U?I.split("\n").map(function(F){return" "+F}).join("\n").substr(2):"\n"+I.split("\n").map(function(F){return" "+F}).join("\n")):I=a.stylize("[Circular]","special")),b(V)){if(U&&C.match(/^\d+$/))return I;(V=JSON.stringify(""+C)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(V=V.substr(1,V.length-2),V=a.stylize(V,"name")):(V=V.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),V=a.stylize(V,"string"))}return V+": "+I}function d(a){return Array.isArray(a)}function _(a){return"boolean"==typeof a}function v(a){return null===a}function T(a){return"number"==typeof a}function O(a){return"string"==typeof a}function b(a){return void 0===a}function S(a){return w(a)&&"[object RegExp]"===D(a)}function w(a){return"object"==typeof a&&null!==a}function A(a){return w(a)&&"[object Date]"===D(a)}function L(a){return w(a)&&("[object Error]"===D(a)||a instanceof Error)}function H(a){return"function"==typeof a}function D(a){return Object.prototype.toString.call(a)}function q(a){return a<10?"0"+a.toString(10):a.toString(10)}l.debuglog=function(a){if(b(n)&&(n=s.env.NODE_DEBUG||""),a=a.toUpperCase(),!o[a])if(new RegExp("\\b"+a+"\\b","i").test(n)){var g=s.pid;o[a]=function(){var M=l.format.apply(l,arguments);console.error("%s %d: %s",a,g,M)}}else o[a]=function(){};return o[a]},l.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},l.isArray=d,l.isBoolean=_,l.isNull=v,l.isNullOrUndefined=function(a){return null==a},l.isNumber=T,l.isString=O,l.isSymbol=function(a){return"symbol"==typeof a},l.isUndefined=b,l.isRegExp=S,l.isObject=w,l.isDate=A,l.isError=L,l.isFunction=H,l.isPrimitive=function(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||void 0===a},l.isBuffer=c(225);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function p(){var a=new Date,g=[q(a.getHours()),q(a.getMinutes()),q(a.getSeconds())].join(":");return[a.getDate(),k[a.getMonth()],g].join(" ")}function x(a,g){return Object.prototype.hasOwnProperty.call(a,g)}l.log=function(){console.log("%s - %s",p(),l.format.apply(l,arguments))},l.inherits=c(226),l._extend=function(a,g){if(!g||!w(g))return a;for(var M=Object.keys(g),E=M.length;E--;)a[M[E]]=g[M[E]];return a};var R=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function r(a,g){if(!a){var M=new Error("Promise was rejected with a falsy value");M.reason=a,a=M}return g(a)}l.promisify=function(a){if("function"!=typeof a)throw new TypeError('The "original" argument must be of type Function');if(R&&a[R]){var g;if("function"!=typeof(g=a[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(g,R,{value:g,enumerable:!1,writable:!1,configurable:!0}),g}function g(){for(var M,E,C=new Promise(function(I,W){M=I,E=W}),U=[],V=0;Vt.code===o)||s.f[s.a]}},function(z,l){z.exports=function(c){return c.webpackPolyfill||(c.deprecate=function(){},c.paths=[],c.children||(c.children=[]),Object.defineProperty(c,"loaded",{enumerable:!0,get:function(){return c.l}}),Object.defineProperty(c,"id",{enumerable:!0,get:function(){return c.i}}),c.webpackPolyfill=1),c}},function(z,l,c){"use strict";var s=c(50),m=(y.TYPED_ARRAY_SUPPORT=function(){try{var h=new Uint8Array(1);return h.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===h.foo()}catch{return!1}}())?2147483647:1073741823;function y(h,f,d){return y.TYPED_ARRAY_SUPPORT||this instanceof y?"number"==typeof h?e(this,h):function(_,v,T,O){if("number"==typeof v)throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&v instanceof ArrayBuffer?function(b,S,w,A){if(w<0||S.byteLength=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return 0|h}function o(h,f){var d;return y.TYPED_ARRAY_SUPPORT?(d=new Uint8Array(f)).__proto__=y.prototype:(null===(d=h)&&(d=new y(f)),d.length=f),d}function e(h,f){var d=o(h,f<0?0:0|n(f));if(!y.TYPED_ARRAY_SUPPORT)for(var _=0;_55295&&d<57344){if(!v){if(d>56319){(f-=3)>-1&&T.push(239,191,189);continue}if(O+1===_){(f-=3)>-1&&T.push(239,191,189);continue}v=d;continue}if(d<56320){(f-=3)>-1&&T.push(239,191,189),v=d;continue}d=65536+(v-55296<<10|d-56320)}else v&&(f-=3)>-1&&T.push(239,191,189);if(v=null,d<128){if((f-=1)<0)break;T.push(d)}else if(d<2048){if((f-=2)<0)break;T.push(d>>6|192,63&d|128)}else if(d<65536){if((f-=3)<0)break;T.push(d>>12|224,d>>6&63|128,63&d|128)}else{if(!(d<1114112))throw new Error("Invalid code point");if((f-=4)<0)break;T.push(d>>18|240,d>>12&63|128,d>>6&63|128,63&d|128)}}return T}function u(h){return y.isBuffer(h)?h.length:typeof ArrayBuffer<"u"&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(h)||h instanceof ArrayBuffer)?h.byteLength:("string"!=typeof h&&(h=""+h),0===h.length?0:i(h).length)}y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&y[Symbol.species]===y&&Object.defineProperty(y,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),y.prototype.write=function(h,f,d){void 0===f||void 0===d&&"string"==typeof f?(d=this.length,f=0):isFinite(f)&&(f|=0,isFinite(d)?d|=0:d=void 0);var O,b,_=this.length-f;if((void 0===d||d>_)&&(d=_),h.length>0&&(d<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");return b=d,function(S,w,A,L){for(var H=0;H=w.length||H>=S.length);++H)w[H+A]=S[H];return H}(i(h,this.length-(O=f)),this,O,b)},y.prototype.slice=function(h,f){var d,_=this.length;if((h=~~h)<0?(h+=_)<0&&(h=0):h>_&&(h=_),(f=void 0===f?_:~~f)<0?(f+=_)<0&&(f=0):f>_&&(f=_),f=h.length&&(f=h.length),f||(f=0),_>0&&_=this.length)throw new RangeError("sourceStart out of bounds");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),h.length-f<_-d&&(_=h.length-f+d);var v,T=_-d;if(this===h&&d=0;--v)h[v+f]=this[v+d];else if(T<1e3||!y.TYPED_ARRAY_SUPPORT)for(v=0;v>>=0,d=void 0===d?this.length:d>>>0,h||(h=0),"number"==typeof h)for(v=f;v2?"one of ".concat(o," ").concat(n.slice(0,e-1).join(", "),", or ")+n[e-1]:2===e?"one of ".concat(o," ").concat(n[0]," or ").concat(n[1]):"of ".concat(o," ").concat(n[0])}return"of ".concat(o," ").concat(String(n))}m("ERR_INVALID_OPT_VALUE",function(n,o){return'The value "'+o+'" is invalid for option "'+n+'"'},TypeError),m("ERR_INVALID_ARG_TYPE",function(n,o,e){var t,h,d,v;if("string"==typeof o&&"not "===o.substr(0,"not ".length)?(t="must not be",o=o.replace(/^not /,"")):t="must be",d=n,(void 0===v||v>d.length)&&(v=d.length)," argument"===d.substring(v-" argument".length,v))h="The ".concat(n," ").concat(t," ").concat(y(o,"type"));else{var f=function(d,_,v){return"number"!=typeof v&&(v=0),!(v+".".length>d.length)&&-1!==d.indexOf(".",v)}(n)?"property":"argument";h='The "'.concat(n,'" ').concat(f," ").concat(t," ").concat(y(o,"type"))}return h+". Received type ".concat(typeof e)},TypeError),m("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),m("ERR_METHOD_NOT_IMPLEMENTED",function(n){return"The "+n+" method is not implemented"}),m("ERR_STREAM_PREMATURE_CLOSE","Premature close"),m("ERR_STREAM_DESTROYED",function(n){return"Cannot call "+n+" after a stream was destroyed"}),m("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),m("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),m("ERR_STREAM_WRITE_AFTER_END","write after end"),m("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),m("ERR_UNKNOWN_ENCODING",function(n){return"Unknown encoding: "+n},TypeError),m("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),z.exports.codes=s},function(z,l,c){"use strict";(function(s){var m=Object.keys||function(f){var d=[];for(var _ in f)d.push(_);return d};z.exports=i;var y=c(112),n=c(116);c(3)(i,y);for(var o=m(n.prototype),e=0;e2?"one of ".concat(o," ").concat(n.slice(0,e-1).join(", "),", or ")+n[e-1]:2===e?"one of ".concat(o," ").concat(n[0]," or ").concat(n[1]):"of ".concat(o," ").concat(n[0])}return"of ".concat(o," ").concat(String(n))}m("ERR_INVALID_OPT_VALUE",function(n,o){return'The value "'+o+'" is invalid for option "'+n+'"'},TypeError),m("ERR_INVALID_ARG_TYPE",function(n,o,e){var t,h,d,v;if("string"==typeof o&&"not "===o.substr(0,"not ".length)?(t="must not be",o=o.replace(/^not /,"")):t="must be",d=n,(void 0===v||v>d.length)&&(v=d.length)," argument"===d.substring(v-" argument".length,v))h="The ".concat(n," ").concat(t," ").concat(y(o,"type"));else{var f=function(d,_,v){return"number"!=typeof v&&(v=0),!(v+".".length>d.length)&&-1!==d.indexOf(".",v)}(n)?"property":"argument";h='The "'.concat(n,'" ').concat(f," ").concat(t," ").concat(y(o,"type"))}return h+". Received type ".concat(typeof e)},TypeError),m("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),m("ERR_METHOD_NOT_IMPLEMENTED",function(n){return"The "+n+" method is not implemented"}),m("ERR_STREAM_PREMATURE_CLOSE","Premature close"),m("ERR_STREAM_DESTROYED",function(n){return"Cannot call "+n+" after a stream was destroyed"}),m("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),m("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),m("ERR_STREAM_WRITE_AFTER_END","write after end"),m("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),m("ERR_UNKNOWN_ENCODING",function(n){return"Unknown encoding: "+n},TypeError),m("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),z.exports.codes=s},function(z,l,c){"use strict";(function(s){var m=Object.keys||function(f){var d=[];for(var _ in f)d.push(_);return d};z.exports=i;var y=c(128),n=c(132);c(3)(i,y);for(var o=m(n.prototype),e=0;e=this._finalSize&&(this._update(this._block),this._block.fill(0));var o=8*this._len;if(o<=4294967295)this._block.writeUInt32BE(o,this._blockSize-4);else{var e=(4294967295&o)>>>0;this._block.writeUInt32BE((o-e)/4294967296,this._blockSize-8),this._block.writeUInt32BE(e,this._blockSize-4)}this._update(this._block);var i=this._hash();return y?i.toString(y):i},m.prototype._update=function(){throw new Error("_update must be implemented by subclass")},z.exports=m},function(z,l,c){"use strict";(function(s){var m=c(136),y=c(293);function n(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function o(e){return"0x"+e.toString(16)}z.exports={arrayContainsArray:function(e,t,i){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(i)?"some":"every"](function(u){return e.indexOf(u)>=0})},intToBuffer:function(e){var t=o(e);return new s(n(t.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return s.byteLength(e,"utf8")},isHexPrefixed:m,stripHexPrefix:y,padToEven:n,intToHex:o,fromAscii:function(e){for(var t="",i=0;i0&&"0"===T.toString();)T=(v=v.slice(1))[0];return v},l.toBuffer=function(v){if(!d.isBuffer(v))if(Array.isArray(v))v=d.from(v);else if("string"==typeof v)v=l.isHexString(v)?d.from(l.padToEven(l.stripHexPrefix(v)),"hex"):d.from(v);else if("number"==typeof v)v=l.intToBuffer(v);else if(null==v)v=d.allocUnsafe(0);else if(h.isBN(v))v=v.toArrayLike(d);else{if(!v.toArray)throw new Error("invalid type");v=d.from(v.toArray())}return v},l.bufferToInt=function(v){return new h(l.toBuffer(v)).toNumber()},l.bufferToHex=function(v){return"0x"+(v=l.toBuffer(v)).toString("hex")},l.fromSigned=function(v){return new h(v).fromTwos(256)},l.toUnsigned=function(v){return d.from(v.toTwos(256).toArray())},l.keccak=function(v,T){switch(v=l.toBuffer(v),T||(T=256),T){case 224:return y(v);case 256:return o(v);case 384:return n(v);case 512:return e(v);default:throw new Error("Invald algorithm: keccak"+T)}},l.keccak256=function(v){return l.keccak(v)},l.sha3=l.keccak,l.sha256=function(v){return v=l.toBuffer(v),f("sha256").update(v).digest()},l.ripemd160=function(v,T){v=l.toBuffer(v);var O=f("rmd160").update(v).digest();return!0===T?l.setLength(O,32):O},l.rlphash=function(v){return l.keccak(u.encode(v))},l.isValidPrivate=function(v){return t.privateKeyVerify(v)},l.isValidPublic=function(v,T){return 64===v.length?t.publicKeyVerify(d.concat([d.from([4]),v])):!!T&&t.publicKeyVerify(v)},l.pubToAddress=l.publicToAddress=function(v,T){return v=l.toBuffer(v),T&&64!==v.length&&(v=t.publicKeyConvert(v,!1).slice(1)),i(64===v.length),l.keccak(v).slice(-20)};var _=l.privateToPublic=function(v){return v=l.toBuffer(v),t.publicKeyCreate(v,!1).slice(1)};l.importPublic=function(v){return 64!==(v=l.toBuffer(v)).length&&(v=t.publicKeyConvert(v,!1).slice(1)),v},l.ecsign=function(v,T){var O=t.sign(v,T),b={};return b.r=O.signature.slice(0,32),b.s=O.signature.slice(32,64),b.v=O.recovery+27,b},l.hashPersonalMessage=function(v){var T=l.toBuffer("\x19Ethereum Signed Message:\n"+v.length.toString());return l.keccak(d.concat([T,v]))},l.ecrecover=function(v,T,O,b){var S=d.concat([l.setLength(O,32),l.setLength(b,32)],64),w=T-27;if(0!==w&&1!==w)throw new Error("Invalid signature v value");var A=t.recover(v,S,w);return t.publicKeyConvert(A,!1).slice(1)},l.toRpcSig=function(v,T,O){if(27!==v&&28!==v)throw new Error("Invalid recovery id");return l.bufferToHex(d.concat([l.setLengthLeft(T,32),l.setLengthLeft(O,32),l.toBuffer(v-27)]))},l.fromRpcSig=function(v){if(65!==(v=l.toBuffer(v)).length)throw new Error("Invalid signature length");var T=v[64];return T<27&&(T+=27),{v:T,r:v.slice(0,32),s:v.slice(32,64)}},l.privateToAddress=function(v){return l.publicToAddress(_(v))},l.isValidAddress=function(v){return/^0x[0-9a-fA-F]{40}$/.test(v)},l.isZeroAddress=function(v){return l.zeroAddress()===l.addHexPrefix(v)},l.toChecksumAddress=function(v){v=l.stripHexPrefix(v).toLowerCase();for(var T=l.keccak(v).toString("hex"),O="0x",b=0;b=8?O+=v[b].toUpperCase():O+=v[b];return O},l.isValidChecksumAddress=function(v){return l.isValidAddress(v)&&l.toChecksumAddress(v)===v},l.generateAddress=function(v,T){return v=l.toBuffer(v),T=(T=new h(T)).isZero()?null:d.from(T.toArray()),l.rlphash([v,T]).slice(-20)},l.isPrecompiled=function(v){var T=l.unpad(v);return 1===T.length&&T[0]>=1&&T[0]<=8},l.addHexPrefix=function(v){return"string"!=typeof v||l.isHexPrefixed(v)?v:"0x"+v},l.isValidSignature=function(v,T,O,b){var S=new h("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),w=new h("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return!(32!==T.length||32!==O.length||27!==v&&28!==v||(T=new h(T),O=new h(O),T.isZero()||T.gt(w)||O.isZero()||O.gt(w)||!1===b&&1===new h(O).cmp(S)))},l.baToJSON=function(v){if(d.isBuffer(v))return"0x"+v.toString("hex");if(v instanceof Array){for(var T=[],O=0;O=H.length,"The field "+S.name+" must not have more "+S.length+" bytes")):S.allowZero&&0===H.length||!S.length||i(S.length===H.length,"The field "+S.name+" must have byte length of "+S.length),v.raw[w]=H}v._fields.push(S.name),Object.defineProperty(v,S.name,{enumerable:!0,configurable:!0,get:A,set:L}),S.default&&(v[S.name]=S.default),S.alias&&Object.defineProperty(v,S.alias,{enumerable:!1,configurable:!0,set:L,get:A})}),O)if("string"==typeof O&&(O=d.from(l.stripHexPrefix(O),"hex")),d.isBuffer(O)&&(O=u.decode(O)),Array.isArray(O)){if(O.length>v._fields.length)throw new Error("wrong number of fields in data");O.forEach(function(S,w){v[v._fields[w]]=l.toBuffer(S)})}else{if("object"!==(void 0===O?"undefined":s(O)))throw new Error("invalid data");var b=Object.keys(O);T.forEach(function(S){-1!==b.indexOf(S.name)&&(v[S.name]=O[S.name]),-1!==b.indexOf(S.alias)&&(v[S.alias]=O[S.alias])})}}},function(z,l,c){"use strict";var s=c(15),m=c(22);function y(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}l.BlockHash=y,y.prototype.update=function(n,o){if(n=s.toArray(n,o),this.pending=this.pending?this.pending.concat(n):n,this.pendingTotal+=n.length,this.pending.length>=this._delta8){var e=(n=this.pending).length%this._delta8;this.pending=n.slice(n.length-e,n.length),0===this.pending.length&&(this.pending=null),n=s.join32(n,0,n.length-e,this.endian);for(var t=0;t>>24&255,t[i++]=n>>>16&255,t[i++]=n>>>8&255,t[i++]=255&n}else for(t[i++]=255&n,t[i++]=n>>>8&255,t[i++]=n>>>16&255,t[i++]=n>>>24&255,t[i++]=0,t[i++]=0,t[i++]=0,t[i++]=0,u=8;u"latest"===o||"earliest"===e?1:"latest"===e||"earliest"===o?-1:s(o)-s(e))}function s(n){return null==n?n:Number.parseInt(n,16)}function m(n){if(null==n)return n;let o=n.toString(16);return o.length%2&&(o="0"+o),"0x"+o}function y(){return Math.floor(16*Math.random()).toString(16)}z.exports={minBlockRef:function(...n){return c(n)[0]},maxBlockRef:function(...n){const o=c(n);return o[o.length-1]},sortBlockRefs:c,bnToHex:function(n){return"0x"+n.toString(16)},blockRefIsNumber:function(n){return n&&!["earliest","latest","pending"].includes(n)},hexToInt:s,incrementHexInt:function(n){return null==n?n:m(s(n)+1)},intToHex:m,unsafeRandomBytes:function(n){let o="0x";for(let e=0;e0&&"0"===o.toString();)o=(n=n.slice(1))[0];return n},l.stripZeros=l.unpad,l.toBuffer=function(n){if(!s.isBuffer(n))if(Array.isArray(n))n=s.from(n);else if("string"==typeof n){if(!m.isHexString(n))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+n);n=s.from(m.padToEven(m.stripHexPrefix(n)),"hex")}else if("number"==typeof n)n=m.intToBuffer(n);else if(null==n)n=s.allocUnsafe(0);else if(y.isBN(n))n=n.toArrayLike(s);else{if(!n.toArray)throw new Error("invalid type");n=s.from(n.toArray())}return n},l.bufferToInt=function(n){return new y(l.toBuffer(n)).toNumber()},l.bufferToHex=function(n){return"0x"+(n=l.toBuffer(n)).toString("hex")},l.fromSigned=function(n){return new y(n).fromTwos(256)},l.toUnsigned=function(n){return s.from(n.toTwos(256).toArray())},l.addHexPrefix=function(n){return"string"!=typeof n||m.isHexPrefixed(n)?n:"0x"+n},l.baToJSON=function(n){if(s.isBuffer(n))return"0x"+n.toString("hex");if(n instanceof Array){for(var o=[],e=0;e0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function t(i,u){this.curve=i,this.type=u,this.precomputed=null}z.exports=e,e.prototype.point=function(){throw new Error("Not implemented")},e.prototype.validate=function(){throw new Error("Not implemented")},e.prototype._fixedNafMul=function(i,u){o(i.precomputed);var h=i._getDoubles(),f=y(u,1,this._bitLength),d=(1<=_;O--)v=(v<<1)+f[O];T.push(v)}for(var b=this.jpoint(null,null,null),S=this.jpoint(null,null,null),w=d;w>0;w--){for(_=0;_=0;T--){for(var O=0;T>=0&&0===_[T];T--)O++;if(T>=0&&O++,v=v.dblp(O),T<0)break;var b=_[T];o(0!==b),v="affine"===i.type?v.mixedAdd(b>0?d[b-1>>1]:d[-b-1>>1].neg()):v.add(b>0?d[b-1>>1]:d[-b-1>>1].neg())}return"affine"===i.type?v.toP():v},e.prototype._wnafMulAdd=function(i,u,h,f,d){var _,v,T,O=this._wnafT1,b=this._wnafT2,S=this._wnafT3,w=0;for(_=0;_=1;_-=2){var L=_-1,H=_;if(1===O[L]&&1===O[H]){var D=[u[L],null,null,u[H]];0===u[L].y.cmp(u[H].y)?(D[1]=u[L].add(u[H]),D[2]=u[L].toJ().mixedAdd(u[H].neg())):0===u[L].y.cmp(u[H].y.redNeg())?(D[1]=u[L].toJ().mixedAdd(u[H]),D[2]=u[L].add(u[H].neg())):(D[1]=u[L].toJ().mixedAdd(u[H]),D[2]=u[L].toJ().mixedAdd(u[H].neg()));var q=[-3,-1,-5,-7,0,7,5,1,3],k=n(h[L],h[H]);for(w=Math.max(k[0].length,w),S[L]=new Array(w),S[H]=new Array(w),v=0;v=0;_--){for(var a=0;_>=0;){var g=!0;for(v=0;v=0&&a++,R=R.dblp(a),_<0)break;for(v=0;v0?T=b[v][M-1>>1]:M<0&&(T=b[v][-M-1>>1].neg()),R="affine"===T.type?R.mixedAdd(T):R.add(T))}}for(_=0;_=Math.ceil((i.bitLength()+1)/u.step)},t.prototype._getDoubles=function(i,u){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var h=[this],f=this,d=0;d_.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(b=_.slice(T,L)).length)throw new Error("invalid rlp, List has a invalid length");for(;b.length;)S=d(b),w.push(S.data),b=S.remainder;return{data:w,remainder:_.slice(L)}}(i(u));if(h)return f;if(0!==f.remainder.length)throw new Error("invalid remainder");return f.data},l.getLength=function(u){if(!u||0===u.length)return s.from([]);var h=i(u),f=h[0];if(f<=127)return h.length;if(f<=183)return f-127;if(f<=191)return f-182;if(f<=247)return f-191;var d=f-246;return d+n(h.slice(1,d).toString("hex"),16)}}).call(this,c(2).Buffer)},function(z,l,c){var s=c(300),m=c(144);z.exports=function(y){return null!=y&&m(y.length)&&!s(y)}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(s,m){m|=0;for(var y=Math.max(s.length-m,0),n=Array(y),o=0;o=0&&c.bit<4},l.from=function(c,s){if(l.isValid(c))return c;try{return function(m){if("string"!=typeof m)throw new Error("Param is not a string");switch(m.toLowerCase()){case"l":case"low":return l.L;case"m":case"medium":return l.M;case"q":case"quartile":return l.Q;case"h":case"high":return l.H;default:throw new Error("Unknown EC Level: "+m)}}(c)}catch{return s}}},function(z,l,c){var s=c(2),m=s.Buffer;function y(o,e){for(var t in o)e[t]=o[t]}function n(o,e,t){return m(o,e,t)}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?z.exports=s:(y(s,l),l.Buffer=n),y(m,n),n.from=function(o,e,t){if("number"==typeof o)throw new TypeError("Argument must not be a number");return m(o,e,t)},n.alloc=function(o,e,t){if("number"!=typeof o)throw new TypeError("Argument must be a number");var i=m(o);return void 0!==e?"string"==typeof t?i.fill(e,t):i.fill(e):i.fill(0),i},n.allocUnsafe=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return m(o)},n.allocUnsafeSlow=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return s.SlowBuffer(o)}},function(z,l,c){"use strict";(function(s,m,y){var n=c(43);function o(q){var k=this;this.next=null,this.entry=null,this.finish=function(){!function(p,x,R){var r=p.entry;for(p.entry=null;r;){var a=r.callback;x.pendingcb--,a(undefined),r=r.next}x.corkedRequestsFree?x.corkedRequestsFree.next=p:x.corkedRequestsFree=p}(k,q)}}z.exports=b;var e,t=!s.browser&&["v0.10","v0.9."].indexOf(s.version.slice(0,5))>-1?m:n.nextTick;b.WritableState=O;var i=Object.create(c(35));i.inherits=c(3);var _,u={deprecate:c(54)},h=c(106),f=c(52).Buffer,d=y.Uint8Array||function(){},v=c(107);function T(){}function O(q,k){e=e||c(19);var p=k instanceof e;this.objectMode=!!(q=q||{}).objectMode,p&&(this.objectMode=this.objectMode||!!q.writableObjectMode);var x=q.highWaterMark,R=q.writableHighWaterMark;this.highWaterMark=x||0===x?x:p&&(R||0===R)?R:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===q.decodeStrings),this.defaultEncoding=q.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(g){!function(M,E){var W,C=M._writableState,U=C.sync,V=C.writecb;if((W=C).writing=!1,W.writecb=null,W.length-=W.writelen,W.writelen=0,E)!function(W,F,B,N,P){--F.pendingcb,B?(n.nextTick(P,N),n.nextTick(D,W,F),W._writableState.errorEmitted=!0,W.emit("error",N)):(P(N),W._writableState.errorEmitted=!0,W.emit("error",N),D(W,F))}(M,C,U,E,V);else{var I=L(C);I||C.corked||C.bufferProcessing||!C.bufferedRequest||A(M,C),U?t(w,M,C,I,V):w(M,C,I,V)}}(k,g)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(q){if(e=e||c(19),!(_.call(b,this)||this instanceof e))return new b(q);this._writableState=new O(q,this),this.writable=!0,q&&("function"==typeof q.write&&(this._write=q.write),"function"==typeof q.writev&&(this._writev=q.writev),"function"==typeof q.destroy&&(this._destroy=q.destroy),"function"==typeof q.final&&(this._final=q.final)),h.call(this)}function S(q,k,p,x,R,r,a){k.writelen=x,k.writecb=a,k.writing=!0,k.sync=!0,p?q._writev(R,k.onwrite):q._write(R,r,k.onwrite),k.sync=!1}function w(q,k,p,x){var R,r;p||(R=q,0===(r=k).length&&r.needDrain&&(r.needDrain=!1,R.emit("drain"))),k.pendingcb--,x(),D(q,k)}function A(q,k){k.bufferProcessing=!0;var p=k.bufferedRequest;if(q._writev&&p&&p.next){var R=new Array(k.bufferedRequestCount),r=k.corkedRequestsFree;r.entry=p;for(var a=0,g=!0;p;)R[a]=p,p.isBuf||(g=!1),p=p.next,a+=1;R.allBuffers=g,S(q,k,!0,k.length,R,"",r.finish),k.pendingcb++,k.lastBufferedRequest=null,r.next?(k.corkedRequestsFree=r.next,r.next=null):k.corkedRequestsFree=new o(k),k.bufferedRequestCount=0}else{for(;p;){var M=p.chunk;if(S(q,k,!1,k.objectMode?1:M.length,M,p.encoding,p.callback),p=p.next,k.bufferedRequestCount--,k.writing)break}null===p&&(k.lastBufferedRequest=null)}k.bufferedRequest=p,k.bufferProcessing=!1}function L(q){return q.ending&&0===q.length&&null===q.bufferedRequest&&!q.finished&&!q.writing}function H(q,k){q._final(function(p){k.pendingcb--,p&&q.emit("error",p),k.prefinished=!0,q.emit("prefinish"),D(q,k)})}function D(q,k){var x,R,p=L(k);return p&&(x=q,(R=k).prefinished||R.finalCalled||("function"==typeof x._final?(R.pendingcb++,R.finalCalled=!0,n.nextTick(H,x,R)):(R.prefinished=!0,x.emit("prefinish"))),0===k.pendingcb&&(k.finished=!0,q.emit("finish"))),p}i.inherits(b,h),O.prototype.getBuffer=function(){for(var q=this.bufferedRequest,k=[];q;)k.push(q),q=q.next;return k},function(){try{Object.defineProperty(O.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(_=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(q){return!!_.call(this,q)||this===b&&q&&q._writableState instanceof O}})):_=function(q){return q instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(q,k,p){var x,g,M,E,R=this._writableState,r=!1,a=!R.objectMode&&(f.isBuffer(x=q)||x instanceof d);return a&&!f.isBuffer(q)&&(q=f.from(q)),"function"==typeof k&&(p=k,k=null),a?k="buffer":k||(k=R.defaultEncoding),"function"!=typeof p&&(p=T),R.ended?(g=this,M=p,E=new Error("write after end"),g.emit("error",E),n.nextTick(M,E)):(a||function(g,M,E,C){var U=!0,V=!1;return null===E?V=new TypeError("May not write null values to stream"):"string"==typeof E||void 0===E||M.objectMode||(V=new TypeError("Invalid non-string/buffer chunk")),V&&(g.emit("error",V),n.nextTick(C,V),U=!1),U}(this,R,q,p))&&(R.pendingcb++,r=function(g,M,E,C,U,V){if(!E){var I=(P=C,(N=M).objectMode||!1===N.decodeStrings||"string"!=typeof P||(P=f.from(P,U)),P);C!==I&&(E=!0,U="buffer",C=I)}var N,P,W=M.objectMode?1:C.length;M.length+=W;var F=M.length-1))throw new TypeError("Unknown encoding: "+q);return this._writableState.defaultEncoding=q,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(q,k,p){p(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(q,k,p){var R,r,a,x=this._writableState;"function"==typeof q?(p=q,q=null,k=null):"function"==typeof k&&(p=k,k=null),null!=q&&this.write(q,k),x.corked&&(x.corked=1,this.uncork()),x.ending||x.finished||(R=this,a=p,(r=x).ending=!0,D(R,r),a&&(r.finished?n.nextTick(a):R.once("finish",a)),r.ended=!0,R.writable=!1)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(q){this._writableState&&(this._writableState.destroyed=q)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(q,k){this.end(),k(q)}}).call(this,c(5),c(108).setImmediate,c(6))},function(z,l,c){(function(s){function m(y){try{if(!s.localStorage)return!1}catch{return!1}var n=s.localStorage[y];return null!=n&&"true"===String(n).toLowerCase()}z.exports=function(y,n){if(m("noDeprecation"))return y;var o=!1;return function(){if(!o){if(m("throwDeprecation"))throw new Error(n);m("traceDeprecation")?console.trace(n):console.warn(n),o=!0}return y.apply(this,arguments)}}}).call(this,c(6))},function(z,l,c){"use strict";var s=c(213),m=c(214);function y(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}l.parse=b,l.resolve=function(S,w){return b(S,!1,!0).resolve(w)},l.resolveObject=function(S,w){return S?b(S,!1,!0).resolveObject(w):w},l.format=function(S){return m.isString(S)&&(S=b(S)),S instanceof y?S.format():y.prototype.format.call(S)},l.Url=y;var n=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,e=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,t=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),i=["'"].concat(t),u=["%","/","?",";","#"].concat(i),h=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},T={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=c(215);function b(S,w,A){if(S&&m.isObject(S)&&S instanceof y)return S;var L=new y;return L.parse(S,w,A),L}y.prototype.parse=function(S,w,A){if(!m.isString(S))throw new TypeError("Parameter 'url' must be a string, not "+typeof S);var L=S.indexOf("?"),H=-1!==L&&L127?W+="x":W+=I[F];if(!W.match(f)){var N=U.slice(0,M),P=U.slice(M+1),j=I.match(d);j&&(N.push(j[1]),P.unshift(j[2])),P.length&&(q="/"+P.join(".")+q),this.hostname=N.join(".");break}}}this.hostname=this.hostname.length>255?"":this.hostname.toLowerCase(),C||(this.hostname=s.toASCII(this.hostname));var K=this.port?":"+this.port:"";this.host=(this.hostname||"")+K,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==q[0]&&(q="/"+q))}if(!_[x])for(M=0,V=i.length;M0)&&A.host.split("@"))&&(A.auth=j.shift(),A.host=A.hostname=j.shift())),A.search=S.search,A.query=S.query,m.isNull(A.pathname)&&m.isNull(A.search)||(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.href=A.format(),A;if(!I.length)return A.pathname=null,A.path=A.search?"/"+A.search:null,A.href=A.format(),A;for(var F=I.slice(-1)[0],B=(A.host||S.host||I.length>1)&&("."===F||".."===F)||""===F,N=0,P=I.length;P>=0;P--)"."===(F=I[P])?I.splice(P,1):".."===F?(I.splice(P,1),N++):N&&(I.splice(P,1),N--);if(!U&&!V)for(;N--;N)I.unshift("..");!U||""===I[0]||I[0]&&"/"===I[0].charAt(0)||I.unshift(""),B&&"/"!==I.join("/").substr(-1)&&I.push("");var j,K=""===I[0]||I[0]&&"/"===I[0].charAt(0);return W&&(A.hostname=A.host=K?"":I.length?I.shift():"",(j=!!(A.host&&A.host.indexOf("@")>0)&&A.host.split("@"))&&(A.auth=j.shift(),A.host=A.hostname=j.shift())),(U=U||A.host&&I.length)&&!K&&I.unshift(""),I.length?A.pathname=I.join("/"):(A.pathname=null,A.path=null),m.isNull(A.pathname)&&m.isNull(A.search)||(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.auth=S.auth||A.auth,A.slashes=A.slashes||S.slashes,A.href=A.format(),A},y.prototype.parseHost=function(){var S=this.host,w=o.exec(S);w&&(":"!==(w=w[0])&&(this.port=w.substr(1)),S=S.substr(0,S.length-w.length)),S&&(this.hostname=S)}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var s=function(){function m(){this.listeners={}}return m.prototype.addEventListener=function(y,n){y=y.toLowerCase(),this.listeners[y]=this.listeners[y]||[],this.listeners[y].push(n.handleEvent||n)},m.prototype.removeEventListener=function(y,n){if(y=y.toLowerCase(),this.listeners[y]){var o=this.listeners[y].indexOf(n.handleEvent||n);o<0||this.listeners[y].splice(o,1)}},m.prototype.dispatchEvent=function(y){var n=y.type.toLowerCase();if(y.target=this,this.listeners[n])for(var o=0,e=this.listeners[n];o=0;U--)if(V[U]!==I[U])return!1;for(U=V.length-1;U>=0;U--)if(!S(R[C=V[U]],r[C],a,g))return!1;return!0}(D,q,k,p))}return k?D===q:D==q}function w(D){return"[object Arguments]"==Object.prototype.toString.call(D)}function A(D,q){if(!D||!q)return!1;if("[object RegExp]"==Object.prototype.toString.call(q))return q.test(D);try{if(D instanceof q)return!0}catch{}return!Error.isPrototypeOf(q)&&!0===q.call({},D)}function L(D,q,k,p){var x;if("function"!=typeof q)throw new TypeError('"block" argument must be a function');"string"==typeof k&&(p=k,k=null),x=function(a){var g;try{a()}catch(M){g=M}return g}(q),p=(k&&k.name?" ("+k.name+").":".")+(p?" "+p:"."),D&&!x&&O(x,k,"Missing expected exception"+p);var R="string"==typeof p,r=!D&&x&&!k;if((!D&&o.isError(x)&&R&&A(x,k)||r)&&O(x,k,"Got unwanted exception"+p),D&&x&&k&&!A(x,k)||!D&&x)throw x}f.AssertionError=function(D){this.name="AssertionError",this.actual=D.actual,this.expected=D.expected,this.operator=D.operator,D.message?(this.message=D.message,this.generatedMessage=!1):(this.message=v(T(this.actual),128)+" "+this.operator+" "+v(T(this.expected),128),this.generatedMessage=!0);var q=D.stackStartFunction||O;if(Error.captureStackTrace)Error.captureStackTrace(this,q);else{var k=new Error;if(k.stack){var p=k.stack,x=_(q),R=p.indexOf("\n"+x);if(R>=0){var r=p.indexOf("\n",R+1);p=p.substring(r+1)}this.stack=p}}},o.inherits(f.AssertionError,Error),f.fail=O,f.ok=b,f.equal=function(D,q,k){D!=q&&O(D,q,k,"==",f.equal)},f.notEqual=function(D,q,k){D==q&&O(D,q,k,"!=",f.notEqual)},f.deepEqual=function(D,q,k){S(D,q,!1)||O(D,q,k,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(D,q,k){S(D,q,!0)||O(D,q,k,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(D,q,k){S(D,q,!1)&&O(D,q,k,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function D(q,k,p){S(q,k,!0)&&O(q,k,p,"notDeepStrictEqual",D)},f.strictEqual=function(D,q,k){D!==q&&O(D,q,k,"===",f.strictEqual)},f.notStrictEqual=function(D,q,k){D===q&&O(D,q,k,"!==",f.notStrictEqual)},f.throws=function(D,q,k){L(!0,D,q,k)},f.doesNotThrow=function(D,q,k){L(!1,D,q,k)},f.ifError=function(D){if(D)throw D},f.strict=m(function D(q,k){q||O(q,!0,k,"==",D)},f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var H=Object.keys||function(D){var q=[];for(var k in D)e.call(D,k)&&q.push(k);return q}}).call(this,c(6))},function(z,l,c){"use strict";var s=c(29).codes.ERR_STREAM_PREMATURE_CLOSE;function m(){}z.exports=function y(n,o,e){if("function"==typeof o)return y(n,null,o);var b,S;o||(o={}),b=e||m,S=!1,e=function(){if(!S){S=!0;for(var w=arguments.length,A=new Array(w),L=0;L{t?(delete o.result,o.error={message:t.message||t}):o.result=i,e?e(u):u()})},function(e){if(e)return n(e);n(null,o.result)})}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0});const s=c(12);function m(n,o,e){try{Reflect.apply(n,o,e)}catch(t){setTimeout(()=>{throw t})}}l.default=class y extends s.EventEmitter{emit(o,...e){let t="error"===o;const i=this._events;if(void 0!==i)t=t&&void 0===i.error;else if(!t)return!1;if(t){let h;if(e.length>0&&([h]=e),h instanceof Error)throw h;const f=new Error("Unhandled error."+(h?` (${h.message})`:""));throw f.context=h,f}const u=i[o];if(void 0===u)return!1;if("function"==typeof u)m(u,this,e);else{const h=u.length,f=function(d){const _=d.length,v=new Array(_);for(let T=0;T<_;T+=1)v[T]=d[T];return v}(u);for(let d=0;d=1e3&&t<=4999))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');var t;super(n,o,e)}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.errorValues=l.errorCodes=void 0,l.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},l.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},function(z,l,c){const s=c(69).default;z.exports=class extends s{constructor(){super(),this.updates=[]}initialize(){return ge(function*(){})()}update(){return ge(function*(){throw new Error("BaseFilter - no update method specified")})()}addResults(m){this.updates=this.updates.concat(m),m.forEach(y=>this.emit("update",y))}addInitialResults(m){}getChangesAndClear(){const m=this.updates;return this.updates=[],m}}},function(z,l){function c(m){return null==m?m:Number.parseInt(m,16)}function s(m){return null==m?m:"0x"+m.toString(16)}z.exports=function(){var m=ge(function*({provider:y,fromBlock:n,toBlock:o}){n||(n=o);const e=c(n),t=c(o),i=Array(t-e+1).fill().map((u,h)=>e+h).map(s);return yield Promise.all(i.map(u=>{return h=y,"eth_getBlockByNumber",d=[u,!1],new Promise((_,v)=>{h.sendAsync({id:1,jsonrpc:"2.0",method:"eth_getBlockByNumber",params:d},(T,O)=>{if(T)return v(T);_(O.result)})});var h,d}))});return function(y){return m.apply(this,arguments)}}()},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.ecdhUnsafe=l.ecdh=l.recover=l.verify=l.sign=l.signatureImportLax=l.signatureImport=l.signatureExport=l.signatureNormalize=l.publicKeyCombine=l.publicKeyTweakMul=l.publicKeyTweakAdd=l.publicKeyVerify=l.publicKeyConvert=l.publicKeyCreate=l.privateKeyTweakMul=l.privateKeyTweakAdd=l.privateKeyModInverse=l.privateKeyNegate=l.privateKeyImport=l.privateKeyExport=l.privateKeyVerify=void 0;var m=c(118),y=c(361),n=c(362);l.privateKeyVerify=function(o){return 32===o.length&&m.privateKeyVerify(Uint8Array.from(o))},l.privateKeyExport=function(o,e){if(32!==o.length)throw new RangeError("private key length is invalid");var t=y.privateKeyExport(o,e);return n.privateKeyExport(o,t,e)},l.privateKeyImport=function(o){if(null!==(o=n.privateKeyImport(o))&&32===o.length&&l.privateKeyVerify(o))return o;throw new Error("couldn't import from DER format")},l.privateKeyNegate=function(o){return s.from(m.privateKeyNegate(Uint8Array.from(o)))},l.privateKeyModInverse=function(o){if(32!==o.length)throw new Error("private key length is invalid");return s.from(y.privateKeyModInverse(Uint8Array.from(o)))},l.privateKeyTweakAdd=function(o,e){return s.from(m.privateKeyTweakAdd(Uint8Array.from(o),e))},l.privateKeyTweakMul=function(o,e){return s.from(m.privateKeyTweakMul(Uint8Array.from(o),Uint8Array.from(e)))},l.publicKeyCreate=function(o,e){return s.from(m.publicKeyCreate(Uint8Array.from(o),e))},l.publicKeyConvert=function(o,e){return s.from(m.publicKeyConvert(Uint8Array.from(o),e))},l.publicKeyVerify=function(o){return(33===o.length||65===o.length)&&m.publicKeyVerify(Uint8Array.from(o))},l.publicKeyTweakAdd=function(o,e,t){return s.from(m.publicKeyTweakAdd(Uint8Array.from(o),Uint8Array.from(e),t))},l.publicKeyTweakMul=function(o,e,t){return s.from(m.publicKeyTweakMul(Uint8Array.from(o),Uint8Array.from(e),t))},l.publicKeyCombine=function(o,e){var t=[];return o.forEach(function(i){t.push(Uint8Array.from(i))}),s.from(m.publicKeyCombine(t,e))},l.signatureNormalize=function(o){return s.from(m.signatureNormalize(Uint8Array.from(o)))},l.signatureExport=function(o){return s.from(m.signatureExport(Uint8Array.from(o)))},l.signatureImport=function(o){return s.from(m.signatureImport(Uint8Array.from(o)))},l.signatureImportLax=function(o){if(0===o.length)throw new RangeError("signature length is invalid");var e=n.signatureImportLax(o);if(null===e)throw new Error("couldn't parse DER signature");return y.signatureImport(e)},l.sign=function(o,e,t){if(null===t)throw new TypeError("options should be an Object");var i=void 0;if(t){if(i={},null===t.data)throw new TypeError("options.data should be a Buffer");if(t.data){if(32!=t.data.length)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(t.data)}if(null===t.noncefn)throw new TypeError("options.noncefn should be a Function");t.noncefn&&(i.noncefn=function(h,f,d,_,v){var T=null!=d?s.from(d):null,O=null!=_?s.from(_):null,b=s.from("");return t.noncefn&&(b=t.noncefn(s.from(h),s.from(f),T,O,v)),new Uint8Array(b)})}var u=m.ecdsaSign(Uint8Array.from(o),Uint8Array.from(e),i);return{signature:s.from(u.signature),recovery:u.recid}},l.verify=function(o,e,t){return m.ecdsaVerify(Uint8Array.from(e),Uint8Array.from(o),t)},l.recover=function(o,e,t,i){return s.from(m.ecdsaRecover(Uint8Array.from(e),t,Uint8Array.from(o),i))},l.ecdh=function(o,e){return s.from(m.ecdh(Uint8Array.from(o),Uint8Array.from(e),{}))},l.ecdhUnsafe=function(o,e,t){if(33!==o.length&&65!==o.length)throw new RangeError("public key length is invalid");if(32!==e.length)throw new RangeError("private key length is invalid");return s.from(y.ecdhUnsafe(Uint8Array.from(o),Uint8Array.from(e),t))}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.rlphash=l.ripemd160=l.sha256=l.keccak256=l.keccak=void 0;var m=c(110),y=m.keccak224,n=m.keccak384,o=m.keccak256,e=m.keccak512,t=c(126),i=c(32),u=c(46),h=c(40);l.keccak=function(f,d){switch(void 0===d&&(d=256),f="string"!=typeof f||i.isHexString(f)?h.toBuffer(f):s.from(f,"utf8"),d||(d=256),d){case 224:return y(f);case 256:return o(f);case 384:return n(f);case 512:return e(f);default:throw new Error("Invald algorithm: keccak"+d)}},l.keccak256=function(f){return l.keccak(f)},l.sha256=function(f){return f=h.toBuffer(f),t("sha256").update(f).digest()},l.ripemd160=function(f,d){f=h.toBuffer(f);var _=t("rmd160").update(f).digest();return!0===d?h.setLength(_,32):_},l.rlphash=function(f){return l.keccak(u.encode(f))}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";c.r(l);var s=c(157),m=c(10),y=c(158);function n(W){return Object(y.a)(W)}function o(){const W=n();return W&&W.os?W.os:void 0}function e(){const W=o();return!!W&&W.toLowerCase().includes("android")}function t(){const W=o();return!!W&&(W.toLowerCase().includes("ios")||W.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}function i(){return!!o()&&(e()||t())}function u(){const W=n();return!(!W||!W.name)&&"node"===W.name.toLowerCase()}function h(){return!u()&&!!O()}const f=m.getFromWindow,d=m.getFromWindowOrThrow,_=m.getDocumentOrThrow,v=m.getDocument,T=m.getNavigatorOrThrow,O=m.getNavigator,b=m.getLocationOrThrow,S=m.getLocation,w=m.getCryptoOrThrow,A=m.getCrypto,L=m.getLocalStorageOrThrow,H=m.getLocalStorage;function D(){return s.getWindowMetadata()}const q=function(W){if("string"!=typeof W)throw new Error("Cannot safe json parse value of type "+typeof W);try{return JSON.parse(W)}catch{return W}},k=function(W){return"string"==typeof W?W:JSON.stringify(W)};function p(W,F){const B=k(F),N=H();N&&N.setItem(W,B)}function x(W){let F=null,B=null;const N=H();return N&&(B=N.getItem(W)),F=B&&q(B),F}function R(W){const F=H();F&&F.removeItem(W)}function r(W,F){const B=encodeURIComponent(W);return F.universalLink?`${F.universalLink}/wc?uri=${B}`:F.deepLink?`${F.deepLink}${F.deepLink.endsWith(":")?"//":"/"}wc?uri=${B}`:""}function a(W){const F=W.href.split("?")[0];p("WALLETCONNECT_DEEPLINK_CHOICE",Object.assign(Object.assign({},W),{href:F}))}function g(W,F){return W.filter(B=>B.name.toLowerCase().includes(F.toLowerCase()))[0]}function M(W,F){let B=W;return F&&(B=F.map(N=>g(W,N)).filter(Boolean)),B}const E="https://registry.walletconnect.com";function C(){return E+"/api/v2/wallets"}function U(){return E+"/api/v2/dapps"}function V(W,F="mobile"){var B;return{name:W.name||"",shortName:W.metadata.shortName||"",color:W.metadata.colors.primary||"",logo:null!==(B=W.image_url.sm)&&void 0!==B?B:"",universalLink:W[F].universal||"",deepLink:W[F].native||""}}function I(W,F="mobile"){return Object.values(W).filter(B=>!!B[F].universal||!!B[F].native).map(B=>V(B,F))}c.d(l,"detectEnv",function(){return n}),c.d(l,"detectOS",function(){return o}),c.d(l,"isAndroid",function(){return e}),c.d(l,"isIOS",function(){return t}),c.d(l,"isMobile",function(){return i}),c.d(l,"isNode",function(){return u}),c.d(l,"isBrowser",function(){return h}),c.d(l,"getFromWindow",function(){return f}),c.d(l,"getFromWindowOrThrow",function(){return d}),c.d(l,"getDocumentOrThrow",function(){return _}),c.d(l,"getDocument",function(){return v}),c.d(l,"getNavigatorOrThrow",function(){return T}),c.d(l,"getNavigator",function(){return O}),c.d(l,"getLocationOrThrow",function(){return b}),c.d(l,"getLocation",function(){return S}),c.d(l,"getCryptoOrThrow",function(){return w}),c.d(l,"getCrypto",function(){return A}),c.d(l,"getLocalStorageOrThrow",function(){return L}),c.d(l,"getLocalStorage",function(){return H}),c.d(l,"getClientMeta",function(){return D}),c.d(l,"safeJsonParse",function(){return q}),c.d(l,"safeJsonStringify",function(){return k}),c.d(l,"setLocal",function(){return p}),c.d(l,"getLocal",function(){return x}),c.d(l,"removeLocal",function(){return R}),c.d(l,"mobileLinkChoiceKey",function(){return"WALLETCONNECT_DEEPLINK_CHOICE"}),c.d(l,"formatIOSMobile",function(){return r}),c.d(l,"saveMobileLinkInfo",function(){return a}),c.d(l,"getMobileRegistryEntry",function(){return g}),c.d(l,"getMobileLinkRegistry",function(){return M}),c.d(l,"getWalletRegistryUrl",function(){return C}),c.d(l,"getDappRegistryUrl",function(){return U}),c.d(l,"formatMobileRegistryEntry",function(){return V}),c.d(l,"formatMobileRegistry",function(){return I})},function(z,l){z.exports=m,m.strict=y,m.loose=n;var c=Object.prototype.toString,s={"[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 m(o){return y(o)||n(o)}function y(o){return o instanceof Int8Array||o instanceof Int16Array||o instanceof Int32Array||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Uint16Array||o instanceof Uint32Array||o instanceof Float32Array||o instanceof Float64Array}function n(o){return s[c.call(o)]}},function(z,l,c){"use strict";const s=c(174),m=c(175),y=c(176);function n(f){if("string"!=typeof f||1!==f.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(f,d){return d.encode?d.strict?s(f):encodeURIComponent(f):f}function e(f,d){return d.decode?m(f):f}function t(f){const d=f.indexOf("#");return-1!==d&&(f=f.slice(0,d)),f}function i(f){const d=(f=t(f)).indexOf("?");return-1===d?"":f.slice(d+1)}function u(f,d){return d.parseNumbers&&!Number.isNaN(Number(f))&&"string"==typeof f&&""!==f.trim()?f=Number(f):!d.parseBooleans||null===f||"true"!==f.toLowerCase()&&"false"!==f.toLowerCase()||(f="true"===f.toLowerCase()),f}function h(f,d){n((d=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},d)).arrayFormatSeparator);const _=function(T){let O;switch(T.arrayFormat){case"index":return(b,S,w)=>{O=/\[(\d*)\]$/.exec(b),b=b.replace(/\[\d*\]$/,""),O?(void 0===w[b]&&(w[b]={}),w[b][O[1]]=S):w[b]=S};case"bracket":return(b,S,w)=>{O=/(\[\])$/.exec(b),w[b=b.replace(/\[\]$/,"")]=O?void 0!==w[b]?[].concat(w[b],S):[S]:S};case"comma":case"separator":return(b,S,w)=>{const A="string"==typeof S&&S.split("").indexOf(T.arrayFormatSeparator)>-1?S.split(T.arrayFormatSeparator).map(L=>e(L,T)):null===S?S:e(S,T);w[b]=A};default:return(b,S,w)=>{w[b]=void 0!==w[b]?[].concat(w[b],S):S}}}(d),v=Object.create(null);if("string"!=typeof f||!(f=f.trim().replace(/^[?#&]/,"")))return v;for(const T of f.split("&")){let[O,b]=y(d.decode?T.replace(/\+/g," "):T,"=");b=void 0===b?null:["comma","separator"].includes(d.arrayFormat)?b:e(b,d),_(e(O,d),b,v)}for(const T of Object.keys(v)){const O=v[T];if("object"==typeof O&&null!==O)for(const b of Object.keys(O))O[b]=u(O[b],d);else v[T]=u(O,d)}return!1===d.sort?v:(!0===d.sort?Object.keys(v).sort():Object.keys(v).sort(d.sort)).reduce((T,O)=>{const b=v[O];return T[O]=Boolean(b)&&"object"==typeof b&&!Array.isArray(b)?function S(w){return Array.isArray(w)?w.sort():"object"==typeof w?S(Object.keys(w)).sort((A,L)=>Number(A)-Number(L)).map(A=>w[A]):w}(b):b,T},Object.create(null))}l.extract=i,l.parse=h,l.stringify=(f,d)=>{if(!f)return"";n((d=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},d)).arrayFormatSeparator);const _=b=>d.skipNull&&null==f[b]||d.skipEmptyString&&""===f[b],v=function(b){switch(b.arrayFormat){case"index":return S=>(w,A)=>{const L=w.length;return void 0===A||b.skipNull&&null===A||b.skipEmptyString&&""===A?w:null===A?[...w,[o(S,b),"[",L,"]"].join("")]:[...w,[o(S,b),"[",o(L,b),"]=",o(A,b)].join("")]};case"bracket":return S=>(w,A)=>void 0===A||b.skipNull&&null===A||b.skipEmptyString&&""===A?w:null===A?[...w,[o(S,b),"[]"].join("")]:[...w,[o(S,b),"[]=",o(A,b)].join("")];case"comma":case"separator":return S=>(w,A)=>null==A||0===A.length?w:0===w.length?[[o(S,b),"=",o(A,b)].join("")]:[[w,o(A,b)].join(b.arrayFormatSeparator)];default:return S=>(w,A)=>void 0===A||b.skipNull&&null===A||b.skipEmptyString&&""===A?w:null===A?[...w,o(S,b)]:[...w,[o(S,b),"=",o(A,b)].join("")]}}(d),T={};for(const b of Object.keys(f))_(b)||(T[b]=f[b]);const O=Object.keys(T);return!1!==d.sort&&O.sort(d.sort),O.map(b=>{const S=f[b];return void 0===S?"":null===S?o(b,d):Array.isArray(S)?S.reduce(v(b),[]).join("&"):o(b,d)+"="+o(S,d)}).filter(b=>b.length>0).join("&")},l.parseUrl=(f,d)=>{d=Object.assign({decode:!0},d);const[_,v]=y(f,"#");return Object.assign({url:_.split("?")[0]||"",query:h(i(f),d)},d&&d.parseFragmentIdentifier&&v?{fragmentIdentifier:e(v,d)}:{})},l.stringifyUrl=(f,d)=>{d=Object.assign({encode:!0,strict:!0},d);const _=t(f.url).split("?")[0]||"",v=l.extract(f.url),T=l.parse(v,{sort:!1}),O=Object.assign(T,f.query);let b=l.stringify(O,d);b&&(b="?"+b);let S=function(w){let A="";const L=w.indexOf("#");return-1!==L&&(A=w.slice(L)),A}(f.url);return f.fragmentIdentifier&&(S="#"+o(f.fragmentIdentifier,d)),`${_}${b}${S}`}},function(z,l){var c={}.toString;z.exports=Array.isArray||function(s){return"[object Array]"==c.call(s)}},function(z,l,c){"use strict";var s=c(8);c.o(s,"payloadId")&&c.d(l,"payloadId",function(){return s.payloadId})},function(z,l,c){"use strict";function s(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}c.d(l,"a",function(){return s}),c(24),c(7)},function(z,l,c){},function(z,l,c){"use strict";c(84)},function(z,l,c){"use strict";c(85),c(41),c(86),c(87)},function(z,l){},function(z,l,c){"use strict";c(41)},function(z,l){},function(z,l,c){},function(z,l,c){},function(z,l,c){"use strict";c.d(l,"a",function(){return m});var s=c(8);function m(y){return s.getBrowerCrypto().getRandomValues(new Uint8Array(y))}},function(z,l,c){"use strict";c.d(l,"b",function(){return m}),c.d(l,"a",function(){return y});var s=c(14);function m(n,o,e){return Object(s.b)(n,o,e)}function y(n,o,e){return Object(s.a)(n,o,e)}},function(z,l,c){"use strict";c.d(l,"a",function(){return m});var s=c(14);function m(n,o){return y.apply(this,arguments)}function y(){return(y=ge(function*(n,o){return yield Object(s.c)(n,o)})).apply(this,arguments)}c(42)},function(z,l,c){"use strict";var s=c(8);c.o(s,"isConstantTime")&&c.d(l,"isConstantTime",function(){return s.isConstantTime})},function(z,l,c){},function(z,l){},function(z,l,c){"use strict";function s(m,y){if(m.length!==y.length)return!1;let n=0;for(let o=0;o=1&&c<=40}},function(z,l){var c="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",s="(?:(?![A-Z0-9 $%*+\\-./:]|"+(c=c.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";l.KANJI=new RegExp(c,"g"),l.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),l.BYTE=new RegExp(s,"g"),l.NUMERIC=new RegExp("[0-9]+","g"),l.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var m=new RegExp("^"+c+"$"),y=new RegExp("^[0-9]+$"),n=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");l.testKanji=function(o){return m.test(o)},l.testNumeric=function(o){return y.test(o)},l.testAlphanumeric=function(o){return n.test(o)}},function(z,l){function c(s){if("number"==typeof s&&(s=s.toString()),"string"!=typeof s)throw new Error("Color should be defined as hex string");var m=s.slice().replace("#","").split("");if(m.length<3||5===m.length||m.length>8)throw new Error("Invalid hex color: "+s);3!==m.length&&4!==m.length||(m=Array.prototype.concat.apply([],m.map(function(n){return[n,n]}))),6===m.length&&m.push("F","F");var y=parseInt(m.join(""),16);return{r:y>>24&255,g:y>>16&255,b:y>>8&255,a:255&y,hex:"#"+m.slice(0,6).join("")}}l.getOptions=function(s){s||(s={}),s.color||(s.color={});var y=s.width&&s.width>=21?s.width:void 0;return{width:y,scale:y?4:s.scale||4,margin:null==s.margin||s.margin<0?4:s.margin,color:{dark:c(s.color.dark||"#000000ff"),light:c(s.color.light||"#ffffffff")},type:s.type,rendererOpts:s.rendererOpts||{}}},l.getScale=function(s,m){return m.width&&m.width>=s+2*m.margin?m.width/(s+2*m.margin):m.scale},l.getImageWidth=function(s,m){var y=l.getScale(s,m);return Math.floor((s+2*m.margin)*y)},l.qrToImageData=function(s,m,y){for(var n=m.modules.size,o=m.modules.data,e=l.getScale(n,y),t=Math.floor((n+2*y.margin)*e),i=y.margin*e,u=[y.color.light,y.color.dark],h=0;h=i&&f>=i&&hu._pos){var d=f.substr(u._pos);if("x-user-defined"===u._charset){for(var _=new m(d.length),v=0;vu._pos&&(u.push(new m(new Uint8Array(T.result.slice(u._pos)))),u._pos=T.result.byteLength)},T.onload=function(){u.push(null)},T.readAsArrayBuffer(f)}u._xhr.readyState===t.DONE&&"ms-stream"!==u._mode&&u.push(null)}}).call(this,c(5),c(2).Buffer,c(6))},function(z,l,c){"use strict";(function(s,m){var y=c(43);z.exports=S;var n,o=c(79);S.ReadableState=b,c(12);var e=function(E,C){return E.listeners(C).length},t=c(106),i=c(52).Buffer,u=s.Uint8Array||function(){},h=Object.create(c(35));h.inherits=c(3);var f=c(205),d=void 0;d=f&&f.debuglog?f.debuglog("stream"):function(){};var _,v=c(206),T=c(107);h.inherits(S,t);var O=["error","close","destroy","pause","resume"];function b(E,C){E=E||{};var U=C instanceof(n=n||c(19));this.objectMode=!!E.objectMode,U&&(this.objectMode=this.objectMode||!!E.readableObjectMode);var V=E.highWaterMark,I=E.readableHighWaterMark;this.highWaterMark=V||0===V?V:U&&(I||0===I)?I:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new v,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=E.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,E.encoding&&(_||(_=c(20).StringDecoder),this.decoder=new _(E.encoding),this.encoding=E.encoding)}function S(E){if(n=n||c(19),!(this instanceof S))return new S(E);this._readableState=new b(E,this),this.readable=!0,E&&("function"==typeof E.read&&(this._read=E.read),"function"==typeof E.destroy&&(this._destroy=E.destroy)),t.call(this)}function w(E,C,U,V,I){var W,B,N,P,j,F=E._readableState;return null===C?(F.reading=!1,function(B,N){if(!N.ended){if(N.decoder){var P=N.decoder.end();P&&P.length&&(N.buffer.push(P),N.length+=N.objectMode?1:P.length)}N.ended=!0,H(B)}}(E,F)):(I||(B=F,i.isBuffer(j=N=C)||j instanceof u||"string"==typeof N||void 0===N||B.objectMode||(P=new TypeError("Invalid non-string/buffer chunk")),W=P),W?E.emit("error",W):F.objectMode||C&&C.length>0?("string"==typeof C||F.objectMode||Object.getPrototypeOf(C)===i.prototype||(C=function(B){return i.from(B)}(C)),V?F.endEmitted?E.emit("error",new Error("stream.unshift() after end event")):A(E,F,C,!0):F.ended?E.emit("error",new Error("stream.push() after EOF")):(F.reading=!1,F.decoder&&!U?(C=F.decoder.write(C),F.objectMode||0!==C.length?A(E,F,C,!1):q(E,F)):A(E,F,C,!1))):V||(F.reading=!1)),function(B){return!B.ended&&(B.needReadable||B.lengthC.highWaterMark&&(C.highWaterMark=((U=E)>=8388608?U=8388608:(U--,U|=U>>>1,U|=U>>>2,U|=U>>>4,U|=U>>>8,U|=U>>>16,U++),U)),E<=C.length?E:C.ended?C.length:(C.needReadable=!0,0));var U}function H(E){var C=E._readableState;C.needReadable=!1,C.emittedReadable||(d("emitReadable",C.flowing),C.emittedReadable=!0,C.sync?y.nextTick(D,E):D(E))}function D(E){d("emit readable"),E.emit("readable"),R(E)}function q(E,C){C.readingMore||(C.readingMore=!0,y.nextTick(k,E,C))}function k(E,C){for(var U=C.length;!C.reading&&!C.flowing&&!C.ended&&C.length=C.length?(U=C.decoder?C.buffer.join(""):1===C.buffer.length?C.buffer.head.data:C.buffer.concat(C.length),C.buffer.clear()):(W=C.decoder,(V=E)<(I=C.buffer).head.data.length?(F=I.head.data.slice(0,V),I.head.data=I.head.data.slice(V)):F=V===I.head.data.length?I.shift():W?function(B,N){var P=N.head,j=1,K=P.data;for(B-=K.length;P=P.next;){var Z=P.data,J=B>Z.length?Z.length:B;if(K+=J===Z.length?Z:Z.slice(0,B),0==(B-=J)){J===Z.length?(++j,N.head=P.next?P.next:N.tail=null):(N.head=P,P.data=Z.slice(J));break}++j}return N.length-=j,K}(V,I):function(B,N){var P=i.allocUnsafe(B),j=N.head,K=1;for(j.data.copy(P),B-=j.data.length;j=j.next;){var Z=j.data,J=B>Z.length?Z.length:B;if(Z.copy(P,P.length-B,0,J),0==(B-=J)){J===Z.length?(++K,N.head=j.next?j.next:N.tail=null):(N.head=j,j.data=Z.slice(J));break}++K}return N.length-=K,P}(V,I),U=F),U);var V,I,W,F,U}function a(E){var C=E._readableState;if(C.length>0)throw new Error('"endReadable()" called on non-empty stream');C.endEmitted||(C.ended=!0,y.nextTick(g,C,E))}function g(E,C){E.endEmitted||0!==E.length||(E.endEmitted=!0,C.readable=!1,C.emit("end"))}function M(E,C){for(var U=0,V=E.length;U=C.highWaterMark||C.ended))return d("read: emitReadable",C.length,C.ended),0===C.length&&C.ended?a(this):H(this),null;if(0===(E=L(E,C))&&C.ended)return 0===C.length&&a(this),null;var V,I=C.needReadable;return d("need readable",I),(0===C.length||C.length-E0?r(E,C):null)?(C.needReadable=!0,E=0):C.length-=E,0===C.length&&(C.ended||(C.needReadable=!0),U!==E&&C.ended&&a(this)),null!==V&&this.emit("data",V),V},S.prototype._read=function(E){this.emit("error",new Error("_read() is not implemented"))},S.prototype.pipe=function(E,C){var U=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=E;break;case 1:V.pipes=[V.pipes,E];break;default:V.pipes.push(E)}V.pipesCount+=1,d("pipe count=%d opts=%j",V.pipesCount,C);var I=C&&!1===C.end||E===m.stdout||E===m.stderr?X:F;function F(){d("onend"),E.end()}V.endEmitted?y.nextTick(I):U.once("end",I),E.on("unpipe",function W(ee,te){d("onunpipe"),ee===U&&te&&!1===te.hasUnpiped&&(te.hasUnpiped=!0,d("cleanup"),E.removeListener("close",Z),E.removeListener("finish",J),E.removeListener("drain",B),E.removeListener("error",K),E.removeListener("unpipe",W),U.removeListener("end",F),U.removeListener("end",X),U.removeListener("data",j),N=!0,!V.awaitDrain||E._writableState&&!E._writableState.needDrain||B())});var ee,B=(ee=U,function(){var te=ee._readableState;d("pipeOnDrain",te.awaitDrain),te.awaitDrain&&te.awaitDrain--,0===te.awaitDrain&&e(ee,"data")&&(te.flowing=!0,R(ee))});E.on("drain",B);var N=!1,P=!1;function j(ee){d("ondata"),P=!1,!1!==E.write(ee)||P||((1===V.pipesCount&&V.pipes===E||V.pipesCount>1&&-1!==M(V.pipes,E))&&!N&&(d("false write response, pause",U._readableState.awaitDrain),U._readableState.awaitDrain++,P=!0),U.pause())}function K(ee){d("onerror",ee),X(),E.removeListener("error",K),0===e(E,"error")&&E.emit("error",ee)}function Z(){E.removeListener("finish",J),X()}function J(){d("onfinish"),E.removeListener("close",Z),X()}function X(){d("unpipe"),U.unpipe(E)}return U.on("data",j),function(ee,te,oe){if("function"==typeof ee.prependListener)return ee.prependListener(te,oe);ee._events&&ee._events[te]?o(ee._events[te])?ee._events[te].unshift(oe):ee._events[te]=[oe,ee._events[te]]:ee.on(te,oe)}(E,"error",K),E.once("close",Z),E.once("finish",J),E.emit("pipe",U),V.flowing||(d("pipe resume"),U.resume()),E},S.prototype.unpipe=function(E){var C=this._readableState,U={hasUnpiped:!1};if(0===C.pipesCount)return this;if(1===C.pipesCount)return E&&E!==C.pipes||(E||(E=C.pipes),C.pipes=null,C.pipesCount=0,C.flowing=!1,E&&E.emit("unpipe",this,U)),this;if(!E){var V=C.pipes,I=C.pipesCount;C.pipes=null,C.pipesCount=0,C.flowing=!1;for(var W=0;W=0&&(o._idleTimeoutId=setTimeout(function(){o._onTimeout&&o._onTimeout()},e))},c(208),l.setImmediate=typeof self<"u"&&self.setImmediate||void 0!==s&&s.setImmediate||this&&this.setImmediate,l.clearImmediate=typeof self<"u"&&self.clearImmediate||void 0!==s&&s.clearImmediate||this&&this.clearImmediate}).call(this,c(6))},function(z,l,c){"use strict";z.exports=n;var s=c(19),m=Object.create(c(35));function y(t,i){var u=this._transformState;u.transforming=!1;var h=u.writecb;if(!h)return this.emit("error",new Error("write callback called multiple times"));u.writechunk=null,u.writecb=null,null!=i&&this.push(i),h(t);var f=this._readableState;f.reading=!1,(f.needReadable||f.length0)if("string"==typeof N||J.objectMode||Object.getPrototypeOf(N)===e.prototype||(N=function(X){return e.from(X)}(N)),j)J.endEmitted?L(B,new A):p(B,J,N,!0);else if(J.ended)L(B,new S);else{if(J.destroyed)return!1;J.reading=!1,J.decoder&&!P?(N=J.decoder.write(N),J.objectMode||0!==N.length?p(B,J,N,!1):a(B,J)):p(B,J,N,!1)}else j||(J.reading=!1,a(B,J));return!J.ended&&(J.lengthN.highWaterMark&&(N.highWaterMark=((P=B)>=1073741824?P=1073741824:(P--,P|=P>>>1,P|=P>>>2,P|=P>>>4,P|=P>>>8,P|=P>>>16,P++),P)),B<=N.length?B:N.ended?N.length:(N.needReadable=!0,0));var P}function R(B){var N=B._readableState;i("emitReadable",N.needReadable,N.emittedReadable),N.needReadable=!1,N.emittedReadable||(i("emitReadable",N.flowing),N.emittedReadable=!0,m.nextTick(r,B))}function r(B){var N=B._readableState;i("emitReadable_",N.destroyed,N.length,N.ended),N.destroyed||!N.length&&!N.ended||(B.emit("readable"),N.emittedReadable=!1),N.needReadable=!N.flowing&&!N.ended&&N.length<=N.highWaterMark,U(B)}function a(B,N){N.readingMore||(N.readingMore=!0,m.nextTick(g,B,N))}function g(B,N){for(;!N.reading&&!N.ended&&(N.length0,N.resumeScheduled&&!N.paused?N.flowing=!0:B.listenerCount("data")>0&&B.resume()}function E(B){i("readable nexttick read 0"),B.read(0)}function C(B,N){i("resume",N.reading),N.reading||B.read(0),N.resumeScheduled=!1,B.emit("resume"),U(B),N.flowing&&!N.reading&&B.read(0)}function U(B){var N=B._readableState;for(i("flow",N.flowing);N.flowing&&null!==B.read(););}function V(B,N){return 0===N.length?null:(N.objectMode?P=N.buffer.shift():!B||B>=N.length?(P=N.decoder?N.buffer.join(""):1===N.buffer.length?N.buffer.first():N.buffer.concat(N.length),N.buffer.clear()):P=N.buffer.consume(B,N.decoder),P);var P}function I(B){var N=B._readableState;i("endReadable",N.endEmitted),N.endEmitted||(N.ended=!0,m.nextTick(W,N,B))}function W(B,N){if(i("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&0===B.length&&(B.endEmitted=!0,N.readable=!1,N.emit("end"),B.autoDestroy)){var P=N._writableState;(!P||P.autoDestroy&&P.finished)&&N.destroy()}}function F(B,N){for(var P=0,j=B.length;P=N.highWaterMark:N.length>0)||N.ended))return i("read: emitReadable",N.length,N.ended),0===N.length&&N.ended?I(this):R(this),null;if(0===(B=x(B,N))&&N.ended)return 0===N.length&&I(this),null;var j,K=N.needReadable;return i("need readable",K),(0===N.length||N.length-B0?V(B,N):null)?(N.needReadable=N.length<=N.highWaterMark,B=0):(N.length-=B,N.awaitDrain=0),0===N.length&&(N.ended||(N.needReadable=!0),P!==B&&N.ended&&I(this)),null!==j&&this.emit("data",j),j},q.prototype._read=function(B){L(this,new w("_read()"))},q.prototype.pipe=function(B,N){var P=this,j=this._readableState;switch(j.pipesCount){case 0:j.pipes=B;break;case 1:j.pipes=[j.pipes,B];break;default:j.pipes.push(B)}j.pipesCount+=1,i("pipe count=%d opts=%j",j.pipesCount,N);var K=N&&!1===N.end||B===m.stdout||B===m.stderr?de:J;function J(){i("onend"),B.end()}j.endEmitted?m.nextTick(K):P.once("end",K),B.on("unpipe",function Z(fe,re){i("onunpipe"),fe===P&&re&&!1===re.hasUnpiped&&(re.hasUnpiped=!0,i("cleanup"),B.removeListener("close",ve),B.removeListener("finish",ie),B.removeListener("drain",X),B.removeListener("error",oe),B.removeListener("unpipe",Z),P.removeListener("end",J),P.removeListener("end",de),P.removeListener("data",te),ee=!0,!j.awaitDrain||B._writableState&&!B._writableState.needDrain||X())});var fe,X=(fe=P,function(){var re=fe._readableState;i("pipeOnDrain",re.awaitDrain),re.awaitDrain&&re.awaitDrain--,0===re.awaitDrain&&n(fe,"data")&&(re.flowing=!0,U(fe))});B.on("drain",X);var ee=!1;function te(fe){i("ondata");var re=B.write(fe);i("dest.write",re),!1===re&&((1===j.pipesCount&&j.pipes===B||j.pipesCount>1&&-1!==F(j.pipes,B))&&!ee&&(i("false write response, pause",j.awaitDrain),j.awaitDrain++),P.pause())}function oe(fe){i("onerror",fe),de(),B.removeListener("error",oe),0===n(B,"error")&&L(B,fe)}function ve(){B.removeListener("finish",ie),de()}function ie(){i("onfinish"),B.removeListener("close",ve),de()}function de(){i("unpipe"),P.unpipe(B)}return P.on("data",te),function(fe,re,_e){if("function"==typeof fe.prependListener)return fe.prependListener(re,_e);fe._events&&fe._events[re]?Array.isArray(fe._events[re])?fe._events[re].unshift(_e):fe._events[re]=[_e,fe._events[re]]:fe.on(re,_e)}(B,"error",oe),B.once("close",ve),B.once("finish",ie),B.emit("pipe",P),j.flowing||(i("pipe resume"),P.resume()),B},q.prototype.unpipe=function(B){var N=this._readableState,P={hasUnpiped:!1};if(0===N.pipesCount)return this;if(1===N.pipesCount)return B&&B!==N.pipes||(B||(B=N.pipes),N.pipes=null,N.pipesCount=0,N.flowing=!1,B&&B.emit("unpipe",this,P)),this;if(!B){var j=N.pipes,K=N.pipesCount;N.pipes=null,N.pipesCount=0,N.flowing=!1;for(var Z=0;Z0,!1!==j.flowing&&this.resume()):"readable"===B&&(j.endEmitted||j.readableListening||(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,i("on readable",j.length,j.reading),j.length?R(this):j.reading||m.nextTick(E,this))),P},q.prototype.removeListener=function(B,N){var P=o.prototype.removeListener.call(this,B,N);return"readable"===B&&m.nextTick(M,this),P},q.prototype.removeAllListeners=function(B){var N=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==B&&void 0!==B||m.nextTick(M,this),N},q.prototype.resume=function(){var P,B=this._readableState;return B.flowing||(i("resume"),B.flowing=!B.readableListening,this,(P=B).resumeScheduled||(P.resumeScheduled=!0,m.nextTick(C,this,P))),B.paused=!1,this},q.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},q.prototype.wrap=function(B){var N=this,P=this._readableState,j=!1;for(var K in B.on("end",function(){if(i("wrapped end"),P.decoder&&!P.ended){var J=P.decoder.end();J&&J.length&&N.push(J)}N.push(null)}),B.on("data",function(J){i("wrapped data"),P.decoder&&(J=P.decoder.write(J)),P.objectMode&&null==J||(P.objectMode||J&&J.length)&&(N.push(J)||(j=!0,B.pause()))}),B)void 0===this[K]&&"function"==typeof B[K]&&(this[K]=function(J){return function(){return B[J].apply(B,arguments)}}(K));for(var Z=0;Z-1))throw new A(g);return this._writableState.defaultEncoding=g,this},Object.defineProperty(q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),q.prototype._write=function(g,M,E){E(new v("_write()"))},q.prototype._writev=null,q.prototype.end=function(g,M,E){var U,V,I,C=this._writableState;return"function"==typeof g?(E=g,g=null,M=null):"function"==typeof M&&(E=M,M=null),null!=g&&this.write(g,M),C.corked&&(C.corked=1,this.uncork()),C.ending||(U=this,I=E,(V=C).ending=!0,a(U,V),I&&(V.finished?m.nextTick(I):U.once("finish",I)),V.ended=!0,U.writable=!1),this},Object.defineProperty(q.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(q.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(g){this._writableState&&(this._writableState.destroyed=g)}}),q.prototype.destroy=h.destroy,q.prototype._undestroy=h.undestroy,q.prototype._destroy=function(g,M){M(g)}}).call(this,c(6),c(5))},function(z,l,c){"use strict";z.exports=i;var s=c(27).codes,m=s.ERR_METHOD_NOT_IMPLEMENTED,y=s.ERR_MULTIPLE_CALLBACK,n=s.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=s.ERR_TRANSFORM_WITH_LENGTH_0,e=c(28);function t(f,d){var _=this._transformState;_.transforming=!1;var v=_.writecb;if(null===v)return this.emit("error",new y);_.writechunk=null,_.writecb=null,null!=d&&this.push(d),v(f);var T=this._readableState;T.reading=!1,(T.needReadable||T.length0&&u[u.length-1])||6!==T[0]&&2!==T[0])){f=0;continue}if(3===T[0]&&(!u||T[1]>u[0]&&T[1]>8,h=255&i;u?e.push(u,h):e.push(h)}return e},s.zero2=m,s.toHex=y,s.encode=function(n,o){return"hex"===o?y(n):n}},function(z,l,c){var s;function m(n){this.rand=n}if(z.exports=function(n){return s||(s=new m(null)),s.generate(n)},z.exports.Rand=m,m.prototype.generate=function(n){return this._rand(n)},m.prototype._rand=function(n){if(this.rand.getBytes)return this.rand.getBytes(n);for(var o=new Uint8Array(n),e=0;e>>3},l.g1_256=function(o){return s(o,17)^s(o,19)^o>>>10}},function(z,l,c){"use strict";var s=c(15),m=c(37),y=c(123),n=c(22),o=s.sum32,e=s.sum32_4,t=s.sum32_5,i=y.ch32,u=y.maj32,h=y.s0_256,f=y.s1_256,d=y.g0_256,_=y.g1_256,v=m.BlockHash,T=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function O(){if(!(this instanceof O))return new O;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=T,this.W=new Array(64)}s.inherits(O,v),z.exports=O,O.blockSize=512,O.outSize=256,O.hmacStrength=192,O.padLength=64,O.prototype._update=function(b,S){for(var w=this.W,A=0;A<16;A++)w[A]=b[S+A];for(;A=this._blockSize;){for(var i=this._blockOffset;i0;++u)this._length[u]+=h,(h=this._length[u]/4294967296|0)>0&&(this._length[u]-=4294967296*h);return this},y.prototype._update=function(){throw new Error("_update is not implemented")},y.prototype.digest=function(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var o=this._digest();void 0!==n&&(o=o.toString(n)),this._block.fill(0),this._blockOffset=0;for(var e=0;e<4;++e)this._length[e]=0;return o},y.prototype._digest=function(){throw new Error("_digest is not implemented")},z.exports=y},function(z,l,c){"use strict";(function(s,m){var y;z.exports=q,q.ReadableState=D,c(12);var i,n=function(B,N){return B.listeners(N).length},o=c(129),e=c(2).Buffer,t=s.Uint8Array||function(){},u=c(273);i=u&&u.debuglog?u.debuglog("stream"):function(){};var h,f,d,_=c(274),v=c(130),T=c(131).getHighWaterMark,O=c(29).codes,b=O.ERR_INVALID_ARG_TYPE,S=O.ERR_STREAM_PUSH_AFTER_EOF,w=O.ERR_METHOD_NOT_IMPLEMENTED,A=O.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;c(3)(q,o);var L=v.errorOrDestroy,H=["error","close","destroy","pause","resume"];function D(B,N,P){y=y||c(30),"boolean"!=typeof P&&(P=N instanceof y),this.objectMode=!!(B=B||{}).objectMode,P&&(this.objectMode=this.objectMode||!!B.readableObjectMode),this.highWaterMark=T(this,B,"readableHighWaterMark",P),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==B.emitClose,this.autoDestroy=!!B.autoDestroy,this.destroyed=!1,this.defaultEncoding=B.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,B.encoding&&(h||(h=c(20).StringDecoder),this.decoder=new h(B.encoding),this.encoding=B.encoding)}function q(B){if(y=y||c(30),!(this instanceof q))return new q(B);this._readableState=new D(B,this,this instanceof y),this.readable=!0,B&&("function"==typeof B.read&&(this._read=B.read),"function"==typeof B.destroy&&(this._destroy=B.destroy)),o.call(this)}function k(B,N,P,j,K){i("readableAddChunk",N);var Z,X,ee,te,oe,J=B._readableState;if(null===N)J.reading=!1,function(X,ee){if(i("onEofChunk"),!ee.ended){if(ee.decoder){var te=ee.decoder.end();te&&te.length&&(ee.buffer.push(te),ee.length+=ee.objectMode?1:te.length)}ee.ended=!0,ee.sync?R(X):(ee.needReadable=!1,ee.emittedReadable||(ee.emittedReadable=!0,r(X)))}}(B,J);else if(K||(X=J,e.isBuffer(oe=ee=N)||oe instanceof t||"string"==typeof ee||void 0===ee||X.objectMode||(te=new b("chunk",["string","Buffer","Uint8Array"],ee)),Z=te),Z)L(B,Z);else if(J.objectMode||N&&N.length>0)if("string"==typeof N||J.objectMode||Object.getPrototypeOf(N)===e.prototype||(N=function(X){return e.from(X)}(N)),j)J.endEmitted?L(B,new A):p(B,J,N,!0);else if(J.ended)L(B,new S);else{if(J.destroyed)return!1;J.reading=!1,J.decoder&&!P?(N=J.decoder.write(N),J.objectMode||0!==N.length?p(B,J,N,!1):a(B,J)):p(B,J,N,!1)}else j||(J.reading=!1,a(B,J));return!J.ended&&(J.lengthN.highWaterMark&&(N.highWaterMark=((P=B)>=1073741824?P=1073741824:(P--,P|=P>>>1,P|=P>>>2,P|=P>>>4,P|=P>>>8,P|=P>>>16,P++),P)),B<=N.length?B:N.ended?N.length:(N.needReadable=!0,0));var P}function R(B){var N=B._readableState;i("emitReadable",N.needReadable,N.emittedReadable),N.needReadable=!1,N.emittedReadable||(i("emitReadable",N.flowing),N.emittedReadable=!0,m.nextTick(r,B))}function r(B){var N=B._readableState;i("emitReadable_",N.destroyed,N.length,N.ended),N.destroyed||!N.length&&!N.ended||(B.emit("readable"),N.emittedReadable=!1),N.needReadable=!N.flowing&&!N.ended&&N.length<=N.highWaterMark,U(B)}function a(B,N){N.readingMore||(N.readingMore=!0,m.nextTick(g,B,N))}function g(B,N){for(;!N.reading&&!N.ended&&(N.length0,N.resumeScheduled&&!N.paused?N.flowing=!0:B.listenerCount("data")>0&&B.resume()}function E(B){i("readable nexttick read 0"),B.read(0)}function C(B,N){i("resume",N.reading),N.reading||B.read(0),N.resumeScheduled=!1,B.emit("resume"),U(B),N.flowing&&!N.reading&&B.read(0)}function U(B){var N=B._readableState;for(i("flow",N.flowing);N.flowing&&null!==B.read(););}function V(B,N){return 0===N.length?null:(N.objectMode?P=N.buffer.shift():!B||B>=N.length?(P=N.decoder?N.buffer.join(""):1===N.buffer.length?N.buffer.first():N.buffer.concat(N.length),N.buffer.clear()):P=N.buffer.consume(B,N.decoder),P);var P}function I(B){var N=B._readableState;i("endReadable",N.endEmitted),N.endEmitted||(N.ended=!0,m.nextTick(W,N,B))}function W(B,N){if(i("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&0===B.length&&(B.endEmitted=!0,N.readable=!1,N.emit("end"),B.autoDestroy)){var P=N._writableState;(!P||P.autoDestroy&&P.finished)&&N.destroy()}}function F(B,N){for(var P=0,j=B.length;P=N.highWaterMark:N.length>0)||N.ended))return i("read: emitReadable",N.length,N.ended),0===N.length&&N.ended?I(this):R(this),null;if(0===(B=x(B,N))&&N.ended)return 0===N.length&&I(this),null;var j,K=N.needReadable;return i("need readable",K),(0===N.length||N.length-B0?V(B,N):null)?(N.needReadable=N.length<=N.highWaterMark,B=0):(N.length-=B,N.awaitDrain=0),0===N.length&&(N.ended||(N.needReadable=!0),P!==B&&N.ended&&I(this)),null!==j&&this.emit("data",j),j},q.prototype._read=function(B){L(this,new w("_read()"))},q.prototype.pipe=function(B,N){var P=this,j=this._readableState;switch(j.pipesCount){case 0:j.pipes=B;break;case 1:j.pipes=[j.pipes,B];break;default:j.pipes.push(B)}j.pipesCount+=1,i("pipe count=%d opts=%j",j.pipesCount,N);var K=N&&!1===N.end||B===m.stdout||B===m.stderr?de:J;function J(){i("onend"),B.end()}j.endEmitted?m.nextTick(K):P.once("end",K),B.on("unpipe",function Z(fe,re){i("onunpipe"),fe===P&&re&&!1===re.hasUnpiped&&(re.hasUnpiped=!0,i("cleanup"),B.removeListener("close",ve),B.removeListener("finish",ie),B.removeListener("drain",X),B.removeListener("error",oe),B.removeListener("unpipe",Z),P.removeListener("end",J),P.removeListener("end",de),P.removeListener("data",te),ee=!0,!j.awaitDrain||B._writableState&&!B._writableState.needDrain||X())});var fe,X=(fe=P,function(){var re=fe._readableState;i("pipeOnDrain",re.awaitDrain),re.awaitDrain&&re.awaitDrain--,0===re.awaitDrain&&n(fe,"data")&&(re.flowing=!0,U(fe))});B.on("drain",X);var ee=!1;function te(fe){i("ondata");var re=B.write(fe);i("dest.write",re),!1===re&&((1===j.pipesCount&&j.pipes===B||j.pipesCount>1&&-1!==F(j.pipes,B))&&!ee&&(i("false write response, pause",j.awaitDrain),j.awaitDrain++),P.pause())}function oe(fe){i("onerror",fe),de(),B.removeListener("error",oe),0===n(B,"error")&&L(B,fe)}function ve(){B.removeListener("finish",ie),de()}function ie(){i("onfinish"),B.removeListener("close",ve),de()}function de(){i("unpipe"),P.unpipe(B)}return P.on("data",te),function(fe,re,_e){if("function"==typeof fe.prependListener)return fe.prependListener(re,_e);fe._events&&fe._events[re]?Array.isArray(fe._events[re])?fe._events[re].unshift(_e):fe._events[re]=[_e,fe._events[re]]:fe.on(re,_e)}(B,"error",oe),B.once("close",ve),B.once("finish",ie),B.emit("pipe",P),j.flowing||(i("pipe resume"),P.resume()),B},q.prototype.unpipe=function(B){var N=this._readableState,P={hasUnpiped:!1};if(0===N.pipesCount)return this;if(1===N.pipesCount)return B&&B!==N.pipes||(B||(B=N.pipes),N.pipes=null,N.pipesCount=0,N.flowing=!1,B&&B.emit("unpipe",this,P)),this;if(!B){var j=N.pipes,K=N.pipesCount;N.pipes=null,N.pipesCount=0,N.flowing=!1;for(var Z=0;Z0,!1!==j.flowing&&this.resume()):"readable"===B&&(j.endEmitted||j.readableListening||(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,i("on readable",j.length,j.reading),j.length?R(this):j.reading||m.nextTick(E,this))),P},q.prototype.removeListener=function(B,N){var P=o.prototype.removeListener.call(this,B,N);return"readable"===B&&m.nextTick(M,this),P},q.prototype.removeAllListeners=function(B){var N=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==B&&void 0!==B||m.nextTick(M,this),N},q.prototype.resume=function(){var P,B=this._readableState;return B.flowing||(i("resume"),B.flowing=!B.readableListening,this,(P=B).resumeScheduled||(P.resumeScheduled=!0,m.nextTick(C,this,P))),B.paused=!1,this},q.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},q.prototype.wrap=function(B){var N=this,P=this._readableState,j=!1;for(var K in B.on("end",function(){if(i("wrapped end"),P.decoder&&!P.ended){var J=P.decoder.end();J&&J.length&&N.push(J)}N.push(null)}),B.on("data",function(J){i("wrapped data"),P.decoder&&(J=P.decoder.write(J)),P.objectMode&&null==J||(P.objectMode||J&&J.length)&&(N.push(J)||(j=!0,B.pause()))}),B)void 0===this[K]&&"function"==typeof B[K]&&(this[K]=function(J){return function(){return B[J].apply(B,arguments)}}(K));for(var Z=0;Z-1))throw new A(g);return this._writableState.defaultEncoding=g,this},Object.defineProperty(q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),q.prototype._write=function(g,M,E){E(new v("_write()"))},q.prototype._writev=null,q.prototype.end=function(g,M,E){var U,V,I,C=this._writableState;return"function"==typeof g?(E=g,g=null,M=null):"function"==typeof M&&(E=M,M=null),null!=g&&this.write(g,M),C.corked&&(C.corked=1,this.uncork()),C.ending||(U=this,I=E,(V=C).ending=!0,a(U,V),I&&(V.finished?m.nextTick(I):U.once("finish",I)),V.ended=!0,U.writable=!1),this},Object.defineProperty(q.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(q.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(g){this._writableState&&(this._writableState.destroyed=g)}}),q.prototype.destroy=h.destroy,q.prototype._undestroy=h.undestroy,q.prototype._destroy=function(g,M){M(g)}}).call(this,c(6),c(5))},function(z,l,c){"use strict";z.exports=i;var s=c(29).codes,m=s.ERR_METHOD_NOT_IMPLEMENTED,y=s.ERR_MULTIPLE_CALLBACK,n=s.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=s.ERR_TRANSFORM_WITH_LENGTH_0,e=c(30);function t(f,d){var _=this._transformState;_.transforming=!1;var v=_.writecb;if(null===v)return this.emit("error",new y);_.writechunk=null,_.writecb=null,null!=d&&this.push(d),v(f);var T=this._readableState;T.reading=!1,(T.needReadable||T.length>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10)}function h(d){return(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7)}function f(d){return(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3}s(e,m),e.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},e.prototype._update=function(d){for(var _,v=this._w,T=0|this._a,O=0|this._b,b=0|this._c,S=0|this._d,w=0|this._e,A=0|this._f,L=0|this._g,H=0|this._h,D=0;D<16;++D)v[D]=d.readInt32BE(4*D);for(;D<64;++D)v[D]=0|(((_=v[D-2])>>>17|_<<15)^(_>>>19|_<<13)^_>>>10)+v[D-7]+f(v[D-15])+v[D-16];for(var q=0;q<64;++q){var k=H+h(w)+t(w,A,L)+n[q]+v[q]|0,p=u(T)+i(T,O,b)|0;H=L,L=A,A=w,w=S+k|0,S=b,b=O,O=T,T=k+p|0}this._a=T+this._a|0,this._b=O+this._b|0,this._c=b+this._c|0,this._d=S+this._d|0,this._e=w+this._e|0,this._f=A+this._f|0,this._g=L+this._g|0,this._h=H+this._h|0},e.prototype._hash=function(){var d=y.allocUnsafe(32);return d.writeInt32BE(this._a,0),d.writeInt32BE(this._b,4),d.writeInt32BE(this._c,8),d.writeInt32BE(this._d,12),d.writeInt32BE(this._e,16),d.writeInt32BE(this._f,20),d.writeInt32BE(this._g,24),d.writeInt32BE(this._h,28),d},z.exports=e},function(z,l,c){var s=c(3),m=c(31),y=c(13).Buffer,n=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],o=new Array(160);function e(){this.init(),this._w=o,m.call(this,128,112)}function t(O,b,S){return S^O&(b^S)}function i(O,b,S){return O&b|S&(O|b)}function u(O,b){return(O>>>28|b<<4)^(b>>>2|O<<30)^(b>>>7|O<<25)}function h(O,b){return(O>>>14|b<<18)^(O>>>18|b<<14)^(b>>>9|O<<23)}function f(O,b){return(O>>>1|b<<31)^(O>>>8|b<<24)^O>>>7}function d(O,b){return(O>>>1|b<<31)^(O>>>8|b<<24)^(O>>>7|b<<25)}function _(O,b){return(O>>>19|b<<13)^(b>>>29|O<<3)^O>>>6}function v(O,b){return(O>>>19|b<<13)^(b>>>29|O<<3)^(O>>>6|b<<26)}function T(O,b){return O>>>0>>0?1:0}s(e,m),e.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},e.prototype._update=function(O){for(var b=this._w,S=0|this._ah,w=0|this._bh,A=0|this._ch,L=0|this._dh,H=0|this._eh,D=0|this._fh,q=0|this._gh,k=0|this._hh,p=0|this._al,x=0|this._bl,R=0|this._cl,r=0|this._dl,a=0|this._el,g=0|this._fl,M=0|this._gl,E=0|this._hl,C=0;C<32;C+=2)b[C]=O.readInt32BE(4*C),b[C+1]=O.readInt32BE(4*C+4);for(;C<160;C+=2){var U=b[C-30],V=b[C-30+1],I=f(U,V),W=d(V,U),F=_(U=b[C-4],V=b[C-4+1]),B=v(V,U),j=b[C-32],K=b[C-32+1],Z=W+b[C-14+1]|0,J=I+b[C-14]+T(Z,W)|0;J=(J=J+F+T(Z=Z+B|0,B)|0)+j+T(Z=Z+K|0,K)|0,b[C]=J,b[C+1]=Z}for(var X=0;X<160;X+=2){J=b[X],Z=b[X+1];var ee=i(S,w,A),te=i(p,x,R),oe=u(S,p),ve=u(p,S),ie=h(H,a),de=h(a,H),fe=n[X],re=n[X+1],_e=t(H,D,q),Ke=t(a,g,M),pe=E+de|0,Te=k+ie+T(pe,E)|0;Te=(Te=(Te=Te+_e+T(pe=pe+Ke|0,Ke)|0)+fe+T(pe=pe+re|0,re)|0)+J+T(pe=pe+Z|0,Z)|0;var Ve=ve+te|0,be=oe+ee+T(Ve,ve)|0;k=q,E=M,q=D,M=g,D=H,g=a,H=L+Te+T(a=r+pe|0,r)|0,L=A,r=R,A=w,R=x,w=S,x=p,S=Te+be+T(p=pe+Ve|0,pe)|0}this._al=this._al+p|0,this._bl=this._bl+x|0,this._cl=this._cl+R|0,this._dl=this._dl+r|0,this._el=this._el+a|0,this._fl=this._fl+g|0,this._gl=this._gl+M|0,this._hl=this._hl+E|0,this._ah=this._ah+S+T(this._al,p)|0,this._bh=this._bh+w+T(this._bl,x)|0,this._ch=this._ch+A+T(this._cl,R)|0,this._dh=this._dh+L+T(this._dl,r)|0,this._eh=this._eh+H+T(this._el,a)|0,this._fh=this._fh+D+T(this._fl,g)|0,this._gh=this._gh+q+T(this._gl,M)|0,this._hh=this._hh+k+T(this._hl,E)|0},e.prototype._hash=function(){var O=y.allocUnsafe(64);function b(S,w,A){O.writeInt32BE(S,A),O.writeInt32BE(w,A+4)}return b(this._ah,this._al,0),b(this._bh,this._bl,8),b(this._ch,this._cl,16),b(this._dh,this._dl,24),b(this._eh,this._el,32),b(this._fh,this._fl,40),b(this._gh,this._gl,48),b(this._hh,this._hl,56),O},z.exports=e},function(z,l){z.exports=function(c){if("string"!=typeof c)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof c+", while checking isHexPrefixed.");return"0x"===c.slice(0,2)}},function(z,l,c){"use strict";const s=(m,y)=>function(){const n=y.promiseModule,o=new Array(arguments.length);for(let e=0;e{o.push(y.errorFirst?function(i,u){if(y.multiArgs){const h=new Array(arguments.length-1);for(let f=1;f{y=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},y);const n=e=>{const t=i=>"string"==typeof i?e===i:i.test(e);return y.include?y.include.some(t):!y.exclude.some(t)};let o;o="function"==typeof m?function(){return y.excludeMain?m.apply(this,arguments):s(m,y).apply(this,arguments)}:Object.create(Object.getPrototypeOf(m));for(const e in m){const t=m[e];o[e]="function"==typeof t&&n(e)?s(t,y):t}return o}},function(z,l,c){const s=c(44),m=c(296)();function y(e){this.currentProvider=e}function n(e){return function(){const t=this;var i=[].slice.call(arguments),u=i.pop();t.sendAsync({method:e,params:i},u)}}function o(e,t){return function(){const i=this;var u=[].slice.call(arguments),h=u.pop();u.length-1&&c%1==0&&c<=9007199254740991}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default={},z.exports=l.default},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(t){return function(i,u,h){if(h=(0,m.default)(h||s.default),t<=0||!i)return h(null);var f=(0,y.default)(i),d=!1,_=0,v=!1;function T(b,S){if(_-=1,b)d=!0,h(b);else{if(S===o.default||d&&_<=0)return d=!0,h(null);v||O()}}function O(){for(v=!0;_=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function n(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function o(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}z.exports={cacheIdentifierForPayload:function(e,t={}){if(!m(e))return null;const{includeBlockRef:i}=t,u=i?e.params:y(e);return e.method+":"+s(u)},canCache:m,blockTagForPayload:function(e){var t=n(e);return t>=e.params.length?null:e.params[t]},paramsWithoutBlockTag:y,blockTagParamIndex:n,cacheTypeForPayload:o}},function(z,l,c){var s=typeof JSON<"u"?JSON:c(330);z.exports=function(n,o){o||(o={}),"function"==typeof o&&(o={cmp:o});var e=o.space||"";"number"==typeof e&&(e=Array(e+1).join(" "));var t,i="boolean"==typeof o.cycles&&o.cycles,u=o.replacer||function(d,_){return _},h=o.cmp&&(t=o.cmp,function(d){return function(_,v){return t({key:_,value:d[_]},{key:v,value:d[v]})}}),f=[];return function d(_,v,T,O){var b=e?"\n"+new Array(O+1).join(e):"",S=e?": ":":";if(T&&T.toJSON&&"function"==typeof T.toJSON&&(T=T.toJSON()),void 0!==(T=u.call(_,v,T))){if("object"!=typeof T||null===T)return s.stringify(T);if(m(T)){for(var w=[],A=0;Afunction(){var I=ge(function*(W,F,B,N){(yield U.acquire())(),V(W,F,B,N)});return function(W,F,B,N){return I.apply(this,arguments)}}()}({mutex:O}),S=y({eth_newFilter:b(u(A)),eth_newBlockFilter:b(u(H)),eth_newPendingTransactionFilter:b(u(q)),eth_uninstallFilter:b(h(a)),eth_getFilterChanges:b(h(p)),eth_getFilterLogs:b(h(R))}),w=function(){var U=ge(function*({oldBlock:V,newBlock:I}){if(0===T.length)return;const W=yield O.acquire();try{yield Promise.all(f(T).map(function(){var F=ge(function*(B){try{yield B.update({oldBlock:V,newBlock:I})}catch(N){console.error(N)}});return function(B){return F.apply(this,arguments)}}()))}catch(F){console.error(F)}W()});return function(I){return U.apply(this,arguments)}}();return S.newLogFilter=A,S.newBlockFilter=H,S.newPendingTransactionFilter=q,S.uninstallFilter=a,S.getFilterChanges=p,S.getFilterLogs=R,S.destroy=()=>{ge(function*(){const U=f(T).length;T={},C({prevFilterCount:U,newFilterCount:0})})()},S;function A(U){return L.apply(this,arguments)}function L(){return(L=ge(function*(U){const V=new n({provider:_,params:U});return yield M(V),V})).apply(this,arguments)}function H(){return D.apply(this,arguments)}function D(){return(D=ge(function*(){const U=new o({provider:_});return yield M(U),U})).apply(this,arguments)}function q(){return k.apply(this,arguments)}function k(){return(k=ge(function*(){const U=new e({provider:_});return yield M(U),U})).apply(this,arguments)}function p(U){return x.apply(this,arguments)}function x(){return(x=ge(function*(U){const V=i(U),I=T[V];if(!I)throw new Error(`No filter for index "${V}"`);return I.getChangesAndClear()})).apply(this,arguments)}function R(U){return r.apply(this,arguments)}function r(){return(r=ge(function*(U){const V=i(U),I=T[V];if(!I)throw new Error(`No filter for index "${V}"`);return results="log"===I.type?I.getAllResults():[],results})).apply(this,arguments)}function a(U){return g.apply(this,arguments)}function g(){return g=ge(function*(U){const V=i(U),W=Boolean(T[V]);return W&&(yield(F=ge(function*(B){const N=f(T).length;delete T[B],C({prevFilterCount:N,newFilterCount:f(T).length})}),function(B){return F.apply(this,arguments)})(V)),W;var F}),g.apply(this,arguments)}function M(U){return E.apply(this,arguments)}function E(){return(E=ge(function*(U){const V=f(T).length,I=yield d.getLatestBlock();return yield U.initialize({currentBlock:I}),v++,T[v]=U,U.id=v,U.idHex=t(v),C({prevFilterCount:V,newFilterCount:f(T).length}),v})).apply(this,arguments)}function C({prevFilterCount:U,newFilterCount:V}){0===U&&V>0?d.on("sync",w):U>0&&0===V&&d.removeListener("sync",w)}}},function(z,l,c){"use strict";var s=this&&this.__createBinding||(Object.create?function(y,n,o,e){void 0===e&&(e=o),Object.defineProperty(y,e,{enumerable:!0,get:function(){return n[o]}})}:function(y,n,o,e){void 0===e&&(e=o),y[e]=n[o]}),m=this&&this.__exportStar||function(y,n){for(var o in y)"default"===o||Object.prototype.hasOwnProperty.call(n,o)||s(n,y,o)};Object.defineProperty(l,"__esModule",{value:!0}),m(c(340),l),m(c(341),l),m(c(342),l),m(c(153),l),m(c(154),l),m(c(346),l)},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.getUniqueId=void 0;let s=Math.floor(4294967295*Math.random());l.getUniqueId=function(){return s=(s+1)%4294967295,s}},function(z,l,c){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l,"__esModule",{value:!0}),l.JsonRpcEngine=void 0;const m=s(c(69)),y=c(343);class n extends m.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,i){if(i&&"function"!=typeof i)throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?i?this._handleBatch(t,i):this._handleBatch(t):i?this._handle(t,i):this._promiseHandle(t)}asMiddleware(){var t=this;return function(){var i=ge(function*(u,h,f,d){try{const[_,v,T]=yield n._runAllMiddleware(u,h,t._middleware);return v?(yield n._runReturnHandlers(T),d(_)):f(function(){var O=ge(function*(b){try{yield n._runReturnHandlers(T)}catch(S){return b(S)}return b()});return function(b){return O.apply(this,arguments)}}())}catch(_){return d(_)}});return function(u,h,f,d){return i.apply(this,arguments)}}()}_handleBatch(t,i){var u=this;return ge(function*(){try{const h=yield Promise.all(t.map(u._promiseHandle.bind(u)));return i?i(null,h):h}catch(h){if(i)return i(h);throw h}})()}_promiseHandle(t){return new Promise(i=>{this._handle(t,(u,h)=>{i(h)})})}_handle(t,i){var u=this;return ge(function*(){if(!t||Array.isArray(t)||"object"!=typeof t){const _=new y.EthereumRpcError(y.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof t,{request:t});return i(_,{id:void 0,jsonrpc:"2.0",error:_})}if("string"!=typeof t.method){const _=new y.EthereumRpcError(y.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof t.method,{request:t});return i(_,{id:t.id,jsonrpc:"2.0",error:_})}const h=Object.assign({},t),f={id:h.id,jsonrpc:h.jsonrpc};let d=null;try{yield u._processRequest(h,f)}catch(_){d=_}return d&&(delete f.result,f.error||(f.error=y.serializeError(d))),i(d,f)})()}_processRequest(t,i){var u=this;return ge(function*(){const[h,f,d]=yield n._runAllMiddleware(t,i,u._middleware);if(n._checkForCompletion(t,i,f),yield n._runReturnHandlers(d),h)throw h})()}static _runAllMiddleware(t,i,u){return ge(function*(){const h=[];let f=null,d=!1;for(const _ of u)if([f,d]=yield n._runMiddleware(t,i,_,h),d)break;return[f,d,h.reverse()]})()}static _runMiddleware(t,i,u,h){return new Promise(f=>{const d=v=>{const T=v||i.error;T&&(i.error=y.serializeError(T)),f([T,!0])},_=v=>{i.error?d(i.error):(v&&("function"!=typeof v&&d(new y.EthereumRpcError(y.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof v}" for request:\n${o(t)}`,{request:t})),h.push(v)),f([null,!1]))};try{u(t,i,_,d)}catch(v){d(v)}})}static _runReturnHandlers(t){return ge(function*(){for(const i of t)yield new Promise((u,h)=>{i(f=>f?h(f):u())})})()}static _checkForCompletion(t,i,u){if(!("result"in i)&&!("error"in i))throw new y.EthereumRpcError(y.errorCodes.rpc.internal,"JsonRpcEngine: Response has no error or result for request:\n"+o(t),{request:t});if(!u)throw new y.EthereumRpcError(y.errorCodes.rpc.internal,"JsonRpcEngine: Nothing ended request:\n"+o(t),{request:t})}}function o(e){return JSON.stringify(e,null,2)}l.JsonRpcEngine=n},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.serializeError=l.isValidCode=l.getMessageFromCode=l.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const s=c(71),m=c(70),y=s.errorCodes.rpc.internal,n={code:y,message:o(y)};function o(h,f="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(h)){const d=h.toString();if(u(s.errorValues,d))return s.errorValues[d].message;if(t(h))return l.JSON_RPC_SERVER_ERROR_MESSAGE}return f}function e(h){if(!Number.isInteger(h))return!1;const f=h.toString();return!!s.errorValues[f]||!!t(h)}function t(h){return h>=-32099&&h<=-32e3}function i(h){return h&&"object"==typeof h&&!Array.isArray(h)?Object.assign({},h):h}function u(h,f){return Object.prototype.hasOwnProperty.call(h,f)}l.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",l.getMessageFromCode=o,l.isValidCode=e,l.serializeError=function(h,{fallbackError:f=n,shouldIncludeStack:d=!1}={}){var _,v;if(!f||!Number.isInteger(f.code)||"string"!=typeof f.message)throw new Error("Must provide fallback error with integer number code and string message.");if(h instanceof m.EthereumRpcError)return h.serialize();const T={};if(h&&"object"==typeof h&&!Array.isArray(h)&&u(h,"code")&&e(h.code)){const b=h;T.code=b.code,b.message&&"string"==typeof b.message?(T.message=b.message,u(b,"data")&&(T.data=b.data)):(T.message=o(T.code),T.data={originalError:i(h)})}else{T.code=f.code;const b=null===(_=h)||void 0===_?void 0:_.message;T.message=b&&"string"==typeof b?b:f.message,T.data={originalError:i(h)}}const O=null===(v=h)||void 0===v?void 0:v.stack;return d&&h&&O&&"string"==typeof O&&(T.stack=O),T}},function(z,l,c){z.exports=c(347)},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.getWindowMetadata=void 0;const s=c(10);l.getWindowMetadata=function(){let m,y;try{m=s.getDocumentOrThrow(),y=s.getLocationOrThrow()}catch{return null}function n(...e){const t=m.getElementsByTagName("meta");for(let i=0;iu.getAttribute(f)).filter(f=>!!f&&e.includes(f));if(h.length&&h){const f=u.getAttribute("content");if(f)return f}}return""}const o=function(){let e=n("name","og:site_name","og:title","twitter:title");return e||(e=m.title),e}();return{description:n("description","og:description","twitter:description","keywords"),url:y.origin,icons:function(){const e=m.getElementsByTagName("link"),t=[];for(let i=0;i-1){const f=u.getAttribute("href");if(f)if(-1===f.toLowerCase().indexOf("https:")&&-1===f.toLowerCase().indexOf("http:")&&0!==f.indexOf("//")){let d=y.protocol+"//"+y.host;if(0===f.indexOf("/"))d+=f;else{const _=y.pathname.split("/");_.pop(),d+=_.join("/")+"/"+f}t.push(d)}else 0===f.indexOf("//")?t.push(y.protocol+f):t.push(f)}}return t}(),name:o}}},function(z,l,c){"use strict";(function(s){c.d(l,"a",function(){return f});var y=function(v,T,O){this.name=v,this.version=T,this.os=O,this.type="browser"},n=function(v){this.version=v,this.type="node",this.name="node",this.os=s.platform},o=function(v,T,O,b){this.name=v,this.version=T,this.os=O,this.bot=b,this.type="bot-device"},e=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},t=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},i=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,u=[["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(v){return v?_(v):typeof document>"u"&&typeof navigator<"u"&&"ReactNative"===navigator.product?new t:typeof navigator<"u"?_(navigator.userAgent):void 0!==s&&s.version?new n(s.version.slice(1)):null}function _(v){var T=function d(v){return""!==v&&u.reduce(function(T,O){var b=O[0];if(T)return T;var w=O[1].exec(v);return!!w&&[b,w]},!1)}(v);if(!T)return null;var O=T[0],b=T[1];if("searchbot"===O)return new e;var S=b[1]&&b[1].split(/[._]/).slice(0,3);S?S.length<3&&(S=function(){for(var v=0,T=0,O=arguments.length;T>5,this.byteCount=this.blockCount<<2,this.outputBlocks=F>>5,this.extraBytes=(31&F)>>3;for(var B=0;B<50;++B)this.s[B]=0}function U(I,W,F){C.call(this,I,W,F)}C.prototype.update=function(I){if(this.finalized)throw new Error("finalize already called");var W,F=typeof I;if("string"!==F){if("object"!==F)throw new Error(n);if(null===I)throw new Error(n);if(h&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!(Array.isArray(I)||h&&ArrayBuffer.isView(I)))throw new Error(n);W=!0}for(var B,N,P=this.blocks,j=this.byteCount,K=I.length,Z=this.blockCount,J=0,X=this.s;J>2]|=I[J]<<_[3&B++];else for(B=this.start;J>2]|=N<<_[3&B++]:N<2048?(P[B>>2]|=(192|N>>6)<<_[3&B++],P[B>>2]|=(128|63&N)<<_[3&B++]):N<55296||N>=57344?(P[B>>2]|=(224|N>>12)<<_[3&B++],P[B>>2]|=(128|N>>6&63)<<_[3&B++],P[B>>2]|=(128|63&N)<<_[3&B++]):(N=65536+((1023&N)<<10|1023&I.charCodeAt(++J)),P[B>>2]|=(240|N>>18)<<_[3&B++],P[B>>2]|=(128|N>>12&63)<<_[3&B++],P[B>>2]|=(128|N>>6&63)<<_[3&B++],P[B>>2]|=(128|63&N)<<_[3&B++]);if(this.lastByteIndex=B,B>=j){for(this.start=B-j,this.block=P[Z],B=0;B>=8);F>0;)N.unshift(F),F=255&(I>>=8),++B;return W?N.push(B):N.unshift(B),this.update(N),N.length},C.prototype.encodeString=function(I){var W,F=typeof I;if("string"!==F){if("object"!==F)throw new Error(n);if(null===I)throw new Error(n);if(h&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!(Array.isArray(I)||h&&ArrayBuffer.isView(I)))throw new Error(n);W=!0}var B=0;if(W)B=I.length;else for(var P=0;P=57344?B+=3:(j=65536+((1023&j)<<10|1023&I.charCodeAt(++P)),B+=4)}return B+=this.encode(8*B),this.update(I),B},C.prototype.bytepad=function(I,W){for(var F=this.encode(W),B=0;B>2]|=this.padding[3&W],this.lastByteIndex===this.byteCount)for(I[0]=I[F],W=1;W>4&15]+f[15&I]+f[I>>12&15]+f[I>>8&15]+f[I>>20&15]+f[I>>16&15]+f[I>>28&15]+f[I>>24&15];j%W==0&&(V(F),P=0)}return N&&(K+=f[(I=F[P])>>4&15]+f[15&I],N>1&&(K+=f[I>>12&15]+f[I>>8&15]),N>2&&(K+=f[I>>20&15]+f[I>>16&15])),K},C.prototype.buffer=C.prototype.arrayBuffer=function(){this.finalize();var I,W=this.blockCount,F=this.s,B=this.outputBlocks,N=this.extraBytes,P=0,j=0,K=this.outputBits>>3;I=N?new ArrayBuffer(B+1<<2):new ArrayBuffer(K);for(var Z=new Uint32Array(I);j>8&255,Z[I+2]=W>>16&255,Z[I+3]=W>>24&255;K%F==0&&V(B)}return P&&(Z[I=K<<2]=255&(W=B[j]),P>1&&(Z[I+1]=W>>8&255),P>2&&(Z[I+2]=W>>16&255)),Z},(U.prototype=new C).finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var V=function(I){var W,F,B,N,P,j,K,Z,J,X,ee,te,oe,ve,ie,de,fe,re,_e,Ke,pe,Te,Ve,be,Pe,Ye,we,Be,$e,Me,je,Q,se,le,Le,he,Oe,Ge,me,ze,rt,Re,He,Qe,Ee,Ne,it,xe,qe,et,ke,We,tt,Se,Fe,nt,Ae,Ue,Y,G,$,ne,ce;for(B=0;B<48;B+=2)N=I[0]^I[10]^I[20]^I[30]^I[40],P=I[1]^I[11]^I[21]^I[31]^I[41],Z=I[4]^I[14]^I[24]^I[34]^I[44],J=I[5]^I[15]^I[25]^I[35]^I[45],X=I[6]^I[16]^I[26]^I[36]^I[46],ee=I[7]^I[17]^I[27]^I[37]^I[47],W=(te=I[8]^I[18]^I[28]^I[38]^I[48])^((j=I[2]^I[12]^I[22]^I[32]^I[42])<<1|(K=I[3]^I[13]^I[23]^I[33]^I[43])>>>31),F=(oe=I[9]^I[19]^I[29]^I[39]^I[49])^(K<<1|j>>>31),I[0]^=W,I[1]^=F,I[10]^=W,I[11]^=F,I[20]^=W,I[21]^=F,I[30]^=W,I[31]^=F,I[40]^=W,I[41]^=F,F=P^(J<<1|Z>>>31),I[2]^=W=N^(Z<<1|J>>>31),I[3]^=F,I[12]^=W,I[13]^=F,I[22]^=W,I[23]^=F,I[32]^=W,I[33]^=F,I[42]^=W,I[43]^=F,F=K^(ee<<1|X>>>31),I[4]^=W=j^(X<<1|ee>>>31),I[5]^=F,I[14]^=W,I[15]^=F,I[24]^=W,I[25]^=F,I[34]^=W,I[35]^=F,I[44]^=W,I[45]^=F,F=J^(oe<<1|te>>>31),I[6]^=W=Z^(te<<1|oe>>>31),I[7]^=F,I[16]^=W,I[17]^=F,I[26]^=W,I[27]^=F,I[36]^=W,I[37]^=F,I[46]^=W,I[47]^=F,F=ee^(P<<1|N>>>31),I[8]^=W=X^(N<<1|P>>>31),I[9]^=F,I[18]^=W,I[19]^=F,I[28]^=W,I[29]^=F,I[38]^=W,I[39]^=F,I[48]^=W,I[49]^=F,ie=I[1],Ne=I[11]<<4|I[10]>>>28,it=I[10]<<4|I[11]>>>28,Be=I[20]<<3|I[21]>>>29,$e=I[21]<<3|I[20]>>>29,G=I[31]<<9|I[30]>>>23,$=I[30]<<9|I[31]>>>23,Re=I[40]<<18|I[41]>>>14,He=I[41]<<18|I[40]>>>14,le=I[2]<<1|I[3]>>>31,Le=I[3]<<1|I[2]>>>31,fe=I[12]<<12|I[13]>>>20,xe=I[22]<<10|I[23]>>>22,qe=I[23]<<10|I[22]>>>22,Me=I[33]<<13|I[32]>>>19,je=I[32]<<13|I[33]>>>19,ne=I[42]<<2|I[43]>>>30,ce=I[43]<<2|I[42]>>>30,Se=I[5]<<30|I[4]>>>2,Fe=I[4]<<30|I[5]>>>2,he=I[14]<<6|I[15]>>>26,Oe=I[15]<<6|I[14]>>>26,_e=I[24]<<11|I[25]>>>21,et=I[34]<<15|I[35]>>>17,ke=I[35]<<15|I[34]>>>17,Q=I[45]<<29|I[44]>>>3,se=I[44]<<29|I[45]>>>3,be=I[6]<<28|I[7]>>>4,Pe=I[7]<<28|I[6]>>>4,nt=I[17]<<23|I[16]>>>9,Ae=I[16]<<23|I[17]>>>9,Ge=I[26]<<25|I[27]>>>7,me=I[27]<<25|I[26]>>>7,Ke=I[36]<<21|I[37]>>>11,pe=I[37]<<21|I[36]>>>11,We=I[47]<<24|I[46]>>>8,tt=I[46]<<24|I[47]>>>8,Qe=I[8]<<27|I[9]>>>5,Ee=I[9]<<27|I[8]>>>5,Ye=I[18]<<20|I[19]>>>12,we=I[19]<<20|I[18]>>>12,Ue=I[29]<<7|I[28]>>>25,Y=I[28]<<7|I[29]>>>25,ze=I[38]<<8|I[39]>>>24,rt=I[39]<<8|I[38]>>>24,Te=I[48]<<14|I[49]>>>18,Ve=I[49]<<14|I[48]>>>18,I[0]=(ve=I[0])^~(de=I[13]<<12|I[12]>>>20)&(re=I[25]<<11|I[24]>>>21),I[1]=ie^~fe&_e,I[10]=be^~Ye&Be,I[11]=Pe^~we&$e,I[20]=le^~he&Ge,I[21]=Le^~Oe&me,I[30]=Qe^~Ne&xe,I[31]=Ee^~it&qe,I[40]=Se^~nt&Ue,I[41]=Fe^~Ae&Y,I[2]=de^~re&Ke,I[3]=fe^~_e&pe,I[12]=Ye^~Be&Me,I[13]=we^~$e&je,I[22]=he^~Ge&ze,I[23]=Oe^~me&rt,I[32]=Ne^~xe&et,I[33]=it^~qe&ke,I[42]=nt^~Ue&G,I[43]=Ae^~Y&$,I[4]=re^~Ke&Te,I[5]=_e^~pe&Ve,I[14]=Be^~Me&Q,I[15]=$e^~je&se,I[24]=Ge^~ze&Re,I[25]=me^~rt&He,I[34]=xe^~et&We,I[35]=qe^~ke&tt,I[44]=Ue^~G&ne,I[45]=Y^~$&ce,I[6]=Ke^~Te&ve,I[7]=pe^~Ve&ie,I[16]=Me^~Q&be,I[17]=je^~se&Pe,I[26]=ze^~Re&le,I[27]=rt^~He&Le,I[36]=et^~We&Qe,I[37]=ke^~tt&Ee,I[46]=G^~ne&Se,I[47]=$^~ce&Fe,I[8]=Te^~ve&de,I[9]=Ve^~ie&fe,I[18]=Q^~be&Ye,I[19]=se^~Pe&we,I[28]=Re^~le&he,I[29]=He^~Le&Oe,I[38]=We^~Qe&Ne,I[39]=tt^~Ee&it,I[48]=ne^~Se&nt,I[49]=ce^~Fe&Ae,I[0]^=v[B],I[1]^=v[B+1]};if(i)z.exports=p;else{for(R=0;Rthis._socketCreate())}set readyState(o){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(o){}get connecting(){return 0===this.readyState}set connected(o){}get connected(){return 1===this.readyState}set closing(o){}get closing(){return 2===this.readyState}set closed(o){}get closed(){return 3===this.readyState}open(){this._socketCreate()}close(){this._socketClose()}send(o,e,t){if(!e||"string"!=typeof e)throw new Error("Missing or invalid topic field");this._socketSend({topic:e,type:"pub",payload:o,silent:!!t})}subscribe(o){this._socketSend({topic:o,type:"sub",payload:"",silent:!0})}on(o,e){this._events.push({event:o,callback:e})}_socketCreate(){if(this._nextSocket)return;const o=function(e,t,i){var u,h;const f=(e.startsWith("https")?e.replace("https","wss"):e.startsWith("http")?e.replace("http","ws"):e).split("?"),d=Object(m.isBrowser)()?{protocol:t,version:i,env:"browser",host:(null===(u=Object(m.getLocation)())||void 0===u?void 0:u.host)||""}:{protocol:t,version:i,env:(null===(h=Object(m.detectEnv)())||void 0===h?void 0:h.name)||""},_=Object(m.appendToQueryString)(Object(m.getQueryString)(f[1]||""),d);return f[0]+"?"+_}(this._url,this._protocol,this._version);if(this._nextSocket=new n(o),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=e=>this._socketReceive(e),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=e=>this._socketError(e),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(o){const e=JSON.stringify(o);this._socket&&1===this._socket.readyState?this._socket.send(e):(this._setToQueue(o),this._socketCreate())}_socketReceive(o){var e=this;return ge(function*(){let t;try{t=JSON.parse(o.data)}catch{return}if(e._socketSend({topic:t.topic,type:"ack",payload:"",silent:!0}),e._socket&&1===e._socket.readyState){const i=e._events.filter(u=>"message"===u.event);i&&i.length&&i.forEach(u=>u.callback(t))}})()}_socketError(o){const e=this._events.filter(t=>"error"===t.event);e&&e.length&&e.forEach(t=>t.callback(o))}_queueSubscriptions(){this._subscriptions.forEach(o=>this._queue.push({topic:o,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(o){this._queue.push(o)}_pushQueue(){this._queue.forEach(o=>this._socketSend(o)),this._queue=[]}}}).call(this,c(6))},function(z,l,c){"use strict";l.a=class{constructor(){this._eventEmitters=[],typeof window<"u"&&void 0!==window.addEventListener&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(s,m){this._eventEmitters.push({event:s,callback:m})}trigger(s){let m=[];s&&(m=this._eventEmitters.filter(y=>y.event===s)),m.forEach(y=>{y.callback()})}}},function(z,l,c){"use strict";var s=Object.prototype.hasOwnProperty,m="~";function y(){}function n(i,u,h){this.fn=i,this.context=u,this.once=h||!1}function o(i,u,h,f,d){if("function"!=typeof h)throw new TypeError("The listener must be a function");var _=new n(h,f||i,d),v=m?m+u:u;return i._events[v]?i._events[v].fn?i._events[v]=[i._events[v],_]:i._events[v].push(_):(i._events[v]=_,i._eventsCount++),i}function e(i,u){0==--i._eventsCount?i._events=new y:delete i._events[u]}function t(){this._events=new y,this._eventsCount=0}Object.create&&(y.prototype=Object.create(null),(new y).__proto__||(m=!1)),t.prototype.eventNames=function(){var i,u,h=[];if(0===this._eventsCount)return h;for(u in i=this._events)s.call(i,u)&&h.push(m?u.slice(1):u);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(i)):h},t.prototype.listeners=function(i){var h=this._events[m?m+i:i];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,d=h.length,_=new Array(d);fs.__awaiter(this,void 0,void 0,function*(){const v=yield this.getWalletConnector();if(v)return this.start(),this.subscribeWalletConnector(),v.accounts;throw new Error("Failed to connect to WalleConnect")}),this.request=v=>s.__awaiter(this,void 0,void 0,function*(){return this.send(v)}),this.send=(v,T)=>s.__awaiter(this,void 0,void 0,function*(){var O;if("string"==typeof v){const b=v;let S=T;return"personal_sign"===b&&(S=(0,o.parsePersonalSign)(S)),this.sendAsyncPromise(b,S)}if("personal_sign"===(v=Object.assign({id:(0,o.payloadId)(),jsonrpc:"2.0"},v)).method&&(v.params=(0,o.parsePersonalSign)(v.params)),!T){if("eth_signTypedData_v4"===v.method&&"MetaMask"===(null===(O=this.walletMeta)||void 0===O?void 0:O.name)){const{result:b}=yield this.handleOtherRequests(v);return b}return this.sendAsyncPromise(v.method,v.params)}this.sendAsync(v,T)}),this.onConnect=v=>{this.connectCallbacks.push(v)},this.triggerConnect=v=>{this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach(T=>T(v))},this.bridge=_.connector?_.connector.bridge:_.bridge||"https://bridge.walletconnect.org",this.qrcode=void 0===_.qrcode||!1!==_.qrcode,this.qrcodeModal=_.qrcodeModal||this.qrcodeModal,this.qrcodeModalOptions=_.qrcodeModalOptions,this.wc=_.connector||new m.default({bridge:this.bridge,qrcodeModal:this.qrcode?this.qrcodeModal:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:null==_?void 0:_.storageId,signingMethods:null==_?void 0:_.signingMethods,clientMeta:null==_?void 0:_.clientMeta}),this.rpc=_.rpc||null,!(this.rpc||_.infuraId&&"string"==typeof _.infuraId&&_.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");this.infuraId=_.infuraId||"",this.chainId=(null==_?void 0:_.chainId)||this.chainId,this.initialize()}get isWalletConnect(){return!0}get connector(){return this.wc}get walletMeta(){return this.wc.peerMeta}disconnect(){return s.__awaiter(this,void 0,void 0,function*(){this.close()})}close(){return s.__awaiter(this,void 0,void 0,function*(){yield(yield this.getWalletConnector({disableSessionCreation:!0})).killSession(),yield this.onDisconnect()})}handleRequest(_){return s.__awaiter(this,void 0,void 0,function*(){try{let v,T=null;const O=yield this.getWalletConnector();switch(_.method){case"wc_killSession":yield this.close(),T=null;break;case"eth_accounts":T=O.accounts;break;case"eth_coinbase":T=O.accounts[0];break;case"eth_chainId":case"net_version":T=O.chainId;break;case"eth_uninstallFilter":this.sendAsync(_,b=>b),T=!0;break;default:v=yield this.handleOtherRequests(_)}return v||this.formatResponse(_,T)}catch(v){throw this.emit("error",v),v}})}handleOtherRequests(_){return s.__awaiter(this,void 0,void 0,function*(){if(!o.signingMethods.includes(_.method)&&_.method.startsWith("eth_"))return this.handleReadRequests(_);const v=yield this.getWalletConnector(),T=yield v.sendCustomRequest(_);return this.formatResponse(_,T)})}handleReadRequests(_){return s.__awaiter(this,void 0,void 0,function*(){if(!this.http){const v=new Error("HTTP Connection not available");throw this.emit("error",v),v}return this.http.send(_)})}formatResponse(_,v){return{id:_.id,jsonrpc:_.jsonrpc,result:v}}getWalletConnector(_={}){const{disableSessionCreation:v=!1}=_;return new Promise((T,O)=>{const b=this.wc;this.isConnecting?this.onConnect(S=>T(S)):b.connected||v?(this.connected||(this.connected=!0,this.updateState(b.session)),T(b)):(this.isConnecting=!0,b.on("modal_closed",()=>{O(new Error("User closed modal"))}),b.createSession({chainId:this.chainId}).then(()=>{b.on("connect",(S,w)=>{if(S)return this.isConnecting=!1,O(S);this.isConnecting=!1,this.connected=!0,w&&this.updateState(w.params[0]),this.emit("connect"),this.triggerConnect(b),T(b)})}).catch(S=>{this.isConnecting=!1,O(S)}))})}subscribeWalletConnector(){return s.__awaiter(this,void 0,void 0,function*(){const _=yield this.getWalletConnector();_.on("disconnect",v=>{v?this.emit("error",v):this.onDisconnect()}),_.on("session_update",(v,T)=>{v?this.emit("error",v):this.updateState(T.params[0])})})}onDisconnect(){return s.__awaiter(this,void 0,void 0,function*(){yield this.stop(),this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected"),this.connected=!1})}updateState(_){return s.__awaiter(this,void 0,void 0,function*(){const{accounts:v,chainId:T,networkId:O,rpcUrl:b}=_;(!this.accounts||v&&this.accounts!==v)&&(this.accounts=v,this.emit("accountsChanged",v)),(!this.chainId||T&&this.chainId!==T)&&(this.chainId=T,this.emit("chainChanged",T)),(!this.networkId||O&&this.networkId!==O)&&(this.networkId=O,this.emit("networkChanged",O)),this.updateRpcUrl(this.chainId,b||"")})}updateRpcUrl(_,v=""){(v=v||(0,o.getRpcUrl)(_,{infuraId:this.infuraId,custom:this.rpc||void 0}))?(this.rpcUrl=v,this.updateHttpConnection()):this.emit("error",new Error("No RPC Url available for chainId: "+_))}updateHttpConnection(){this.rpcUrl&&(this.http=new n.default(this.rpcUrl),this.http.on("payload",_=>this.emit("payload",_)),this.http.on("error",_=>this.emit("error",_)))}sendAsyncPromise(_,v){return new Promise((T,O)=>{this.sendAsync({id:(0,o.payloadId)(),jsonrpc:"2.0",method:_,params:v||[]},(b,S)=>{b?O(b):T(S.result)})})}initialize(){this.updateRpcUrl(this.chainId),this.addProvider(new i({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),this.addProvider(new t),this.addProvider(new d),this.addProvider(new u),this.addProvider(new f),this.addProvider(new h(this.configWallet())),this.addProvider({handleRequest:(_,v,T)=>s.__awaiter(this,void 0,void 0,function*(){try{const{error:O,result:b}=yield this.handleRequest(_);T(O,b)}catch(O){T(O)}}),setEngine:_=>_})}configWallet(){return{getAccounts:_=>s.__awaiter(this,void 0,void 0,function*(){try{const v=(yield this.getWalletConnector()).accounts;v&&v.length?_(null,v):_(new Error("Failed to get accounts"))}catch(v){_(v)}}),processMessage:(_,v)=>s.__awaiter(this,void 0,void 0,function*(){try{const T=yield this.getWalletConnector(),O=yield T.signMessage([_.from,_.data]);v(null,O)}catch(T){v(T)}}),processPersonalMessage:(_,v)=>s.__awaiter(this,void 0,void 0,function*(){try{const T=yield this.getWalletConnector(),O=yield T.signPersonalMessage([_.data,_.from]);v(null,O)}catch(T){v(T)}}),processSignTransaction:(_,v)=>s.__awaiter(this,void 0,void 0,function*(){try{const T=yield this.getWalletConnector(),O=yield T.signTransaction(_);v(null,O)}catch(T){v(T)}}),processTransaction:(_,v)=>s.__awaiter(this,void 0,void 0,function*(){try{const T=yield this.getWalletConnector(),O=yield T.sendTransaction(_);v(null,O)}catch(T){v(T)}}),processTypedMessage:(_,v)=>s.__awaiter(this,void 0,void 0,function*(){try{const T=yield this.getWalletConnector(),O=yield T.signTypedData([_.from,_.data]);v(null,O)}catch(T){v(T)}})}}}},function(z,l,c){"use strict";c.r(l),c.d(l,"__extends",function(){return m}),c.d(l,"__assign",function(){return y}),c.d(l,"__rest",function(){return n}),c.d(l,"__decorate",function(){return o}),c.d(l,"__param",function(){return e}),c.d(l,"__metadata",function(){return t}),c.d(l,"__awaiter",function(){return i}),c.d(l,"__generator",function(){return u}),c.d(l,"__exportStar",function(){return h}),c.d(l,"__values",function(){return f}),c.d(l,"__read",function(){return d}),c.d(l,"__spread",function(){return _}),c.d(l,"__await",function(){return v}),c.d(l,"__asyncGenerator",function(){return T}),c.d(l,"__asyncDelegator",function(){return O}),c.d(l,"__asyncValues",function(){return b}),c.d(l,"__makeTemplateObject",function(){return S}),c.d(l,"__importStar",function(){return w}),c.d(l,"__importDefault",function(){return A});var s=function(L,H){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,q){D.__proto__=q}||function(D,q){for(var k in q)q.hasOwnProperty(k)&&(D[k]=q[k])})(L,H)};function m(L,H){function D(){this.constructor=L}s(L,H),L.prototype=null===H?Object.create(H):(D.prototype=H.prototype,new D)}var y=function(){return(y=Object.assign||function(L){for(var H,D=1,q=arguments.length;D=0;R--)(k=L[R])&&(x=(p<3?k(x):p>3?k(H,D,x):k(H,D))||x);return p>3&&x&&Object.defineProperty(H,D,x),x}function e(L,H){return function(D,q){H(D,q,L)}}function t(L,H){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(L,H)}function i(L,H,D,q){return new(D||(D=Promise))(function(k,p){function x(a){try{r(q.next(a))}catch(g){p(g)}}function R(a){try{r(q.throw(a))}catch(g){p(g)}}function r(a){a.done?k(a.value):new D(function(g){g(a.value)}).then(x,R)}r((q=q.apply(L,H||[])).next())})}function u(L,H){var D,q,k,p,x={label:0,sent:function(){if(1&k[0])throw k[1];return k[1]},trys:[],ops:[]};return p={next:R(0),throw:R(1),return:R(2)},"function"==typeof Symbol&&(p[Symbol.iterator]=function(){return this}),p;function R(r){return function(a){return function(g){if(D)throw new TypeError("Generator is already executing.");for(;x;)try{if(D=1,q&&(k=2&g[0]?q.return:g[0]?q.throw||((k=q.return)&&k.call(q),0):q.next)&&!(k=k.call(q,g[1])).done)return k;switch(q=0,k&&(g=[2&g[0],k.value]),g[0]){case 0:case 1:k=g;break;case 4:return x.label++,{value:g[1],done:!1};case 5:x.label++,q=g[1],g=[0];continue;case 7:g=x.ops.pop(),x.trys.pop();continue;default:if(!((k=(k=x.trys).length>0&&k[k.length-1])||6!==g[0]&&2!==g[0])){x=0;continue}if(3===g[0]&&(!k||g[1]>k[0]&&g[1]=L.length&&(L=void 0),{value:L&&L[D++],done:!L}}}}function d(L,H){var D="function"==typeof Symbol&&L[Symbol.iterator];if(!D)return L;var q,k,p=D.call(L),x=[];try{for(;(void 0===H||H-- >0)&&!(q=p.next()).done;)x.push(q.value)}catch(R){k={error:R}}finally{try{q&&!q.done&&(D=p.return)&&D.call(p)}finally{if(k)throw k.error}}return x}function _(){for(var L=[],H=0;H1||R(M,E)})})}function R(M,E){try{(C=k[M](E)).value instanceof v?Promise.resolve(C.value.v).then(r,a):g(p[0][2],C)}catch(U){g(p[0][3],U)}var C}function r(M){R("next",M)}function a(M){R("throw",M)}function g(M,E){M(E),p.shift(),p.length&&R(p[0][0],p[0][1])}}function O(L){var H,D;return H={},q("next"),q("throw",function(k){throw k}),q("return"),H[Symbol.iterator]=function(){return this},H;function q(k,p){H[k]=L[k]?function(x){return(D=!D)?{value:v(L[k](x)),done:"return"===k}:p?p(x):x}:p}}function b(L){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var H,D=L[Symbol.asyncIterator];return D?D.call(L):(L=f(L),H={},q("next"),q("throw"),q("return"),H[Symbol.asyncIterator]=function(){return this},H);function q(k){H[k]=L[k]&&function(p){return new Promise(function(x,R){var r,a,g;r=x,a=R,g=(p=L[k](p)).done,Promise.resolve(p.value).then(function(E){r({value:E,done:g})},a)})}}}function S(L,H){return Object.defineProperty?Object.defineProperty(L,"raw",{value:H}):L.raw=H,L}function w(L){if(L&&L.__esModule)return L;var H={};if(null!=L)for(var D in L)Object.hasOwnProperty.call(L,D)&&(H[D]=L[D]);return H.default=L,H}function A(L){return L&&L.__esModule?L:{default:L}}},function(z,l){},function(z,l,c){"use strict";l.byteLength=function(u){var h=t(u),d=h[1];return 3*(h[0]+d)/4-d},l.toByteArray=function(u){var h,f,A,d=t(u),_=d[0],v=d[1],T=new y(3*(_+(A=v))/4-A),O=0,b=v>0?_-4:_;for(f=0;f>16&255,T[O++]=h>>8&255,T[O++]=255&h;return 2===v&&(h=m[u.charCodeAt(f)]<<2|m[u.charCodeAt(f+1)]>>4,T[O++]=255&h),1===v&&(h=m[u.charCodeAt(f)]<<10|m[u.charCodeAt(f+1)]<<4|m[u.charCodeAt(f+2)]>>2,T[O++]=h>>8&255,T[O++]=255&h),T},l.fromByteArray=function(u){for(var h,f=u.length,d=f%3,_=[],v=0,T=f-d;vT?T:v+16383));return 1===d?_.push(s[(h=u[f-1])>>2]+s[h<<4&63]+"=="):2===d&&_.push(s[(h=(u[f-2]<<8)+u[f-1])>>10]+s[h>>4&63]+s[h<<2&63]+"="),_.join("")};for(var s=[],m=[],y=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,e=n.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var f=u.indexOf("=");return-1===f&&(f=h),[f,f===h?0:4-f%4]}function i(u,h,f){for(var _,v=[],T=h;T>18&63]+s[_>>12&63]+s[_>>6&63]+s[63&_]);return v.join("")}m["-".charCodeAt(0)]=62,m["_".charCodeAt(0)]=63},function(z,l){l.read=function(c,s,m,y,n){var o,e,t=8*n-y-1,i=(1<>1,h=-7,f=m?n-1:0,d=m?-1:1,_=c[s+f];for(f+=d,o=_&(1<<-h)-1,_>>=-h,h+=t;h>0;o=256*o+c[s+f],f+=d,h-=8);for(e=o&(1<<-h)-1,o>>=-h,h+=y;h>0;e=256*e+c[s+f],f+=d,h-=8);if(0===o)o=1-u;else{if(o===i)return e?NaN:1/0*(_?-1:1);e+=Math.pow(2,y),o-=u}return(_?-1:1)*e*Math.pow(2,o-y)},l.write=function(c,s,m,y,n,o){var e,t,i,u=8*o-n-1,h=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,_=y?0:o-1,v=y?1:-1,T=s<0||0===s&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(t=isNaN(s)?1:0,e=h):(e=Math.floor(Math.log(s)/Math.LN2),s*(i=Math.pow(2,-e))<1&&(e--,i*=2),(s+=e+f>=1?d/i:d*Math.pow(2,1-f))*i>=2&&(e++,i/=2),e+f>=h?(t=0,e=h):e+f>=1?(t=(s*i-1)*Math.pow(2,n),e+=f):(t=s*Math.pow(2,f-1)*Math.pow(2,n),e=0));n>=8;c[m+_]=255&t,_+=v,t/=256,n-=8);for(e=e<0;c[m+_]=255&e,_+=v,e/=256,u-=8);c[m+_-v]|=128*T}},function(z,l){(function(c){z.exports=c}).call(this,{})},function(z,l,c){"use strict";(function(s){function m(){return(null==s?void 0:s.crypto)||(null==s?void 0:s.msCrypto)||{}}function y(){const n=m();return n.subtle||n.webkitSubtle}Object.defineProperty(l,"__esModule",{value:!0}),l.isBrowserCryptoAvailable=l.getSubtleCrypto=l.getBrowerCrypto=void 0,l.getBrowerCrypto=m,l.getSubtleCrypto=y,l.isBrowserCryptoAvailable=function(){return!!m()&&!!y()}}).call(this,c(6))},function(z,l,c){"use strict";(function(s){function m(){return typeof document>"u"&&typeof navigator<"u"&&"ReactNative"===navigator.product}function y(){return void 0!==s&&void 0!==s.versions&&void 0!==s.versions.node}Object.defineProperty(l,"__esModule",{value:!0}),l.isBrowser=l.isNode=l.isReactNative=void 0,l.isReactNative=m,l.isNode=y,l.isBrowser=function(){return!m()&&!y()}}).call(this,c(5))},function(z,l,c){"use strict";z.exports=s=>encodeURIComponent(s).replace(/[!'()*]/g,m=>"%"+m.charCodeAt(0).toString(16).toUpperCase())},function(z,l,c){"use strict";var s=new RegExp("%[a-f0-9]{2}","gi"),m=new RegExp("(%[a-f0-9]{2})+","gi");function y(o,e){try{return decodeURIComponent(o.join(""))}catch{}if(1===o.length)return o;var t=o.slice(0,e=e||1),i=o.slice(e);return Array.prototype.concat.call([],y(t),y(i))}function n(o){try{return decodeURIComponent(o)}catch{for(var e=o.match(s),t=1;t{if("string"!=typeof s||"string"!=typeof m)throw new TypeError("Expected the arguments to be of type `string`");if(""===m)return[s];const y=s.indexOf(m);return-1===y?[s]:[s.slice(0,y),s.slice(y+m.length)]}},function(z,l,c){"use strict";z.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(z,l,c){(function(s){function m(L){return L&&"object"==typeof L&&"default"in L?L.default:L}var y=c(76),n=m(c(179)),o=m(c(200)),e=c(376);function t(L){return e.createElement("div",{className:"walletconnect-modal__header"},e.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"}),e.createElement("p",null,"WalletConnect"),e.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:L.onClose},e.createElement("div",{id:"walletconnect-qrcode-close",className:"walletconnect-modal__close__icon"},e.createElement("div",{className:"walletconnect-modal__close__line1"}),e.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function i(L){return e.createElement("a",{className:"walletconnect-connect__button",href:L.href,id:"walletconnect-connect-button-"+L.name,onClick:L.onClick,rel:"noopener noreferrer",style:{backgroundColor:L.color},target:"_blank"},L.name)}function u(L){var H=L.color,k=L.logo;return e.createElement("a",{className:"walletconnect-modal__base__row",href:L.href,onClick:L.onClick,rel:"noopener noreferrer",target:"_blank"},e.createElement("h3",{className:"walletconnect-modal__base__row__h3"},L.name),e.createElement("div",{className:"walletconnect-modal__base__row__right"},e.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+k+"') "+H,backgroundSize:"100%"}}),e.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(L){var q=L.name,x=window.innerWidth<768?(q.length>8?2.5:2.7)+"vw":"inherit";return e.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:L.href,onClick:L.onClick,rel:"noopener noreferrer",target:"_blank"},e.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+L.logo+"') "+L.color,backgroundSize:"100%"}}),e.createElement("div",{style:{fontSize:x},className:"walletconnect-connect__button__text"},q))}function f(L){var H=y.isAndroid(),D=e.useState(""),q=D[0],k=D[1],p=e.useState(""),x=p[0],R=p[1],r=e.useState(1),a=r[0],g=r[1],M=x?L.links.filter(function(B){return B.name.toLowerCase().includes(x.toLowerCase())}):L.links,E=L.errorMessage,C=x||M.length>5,U=Math.ceil(M.length/12),V=[12*(a-1)+1,12*a],I=M.length?M.filter(function(B,N){return N+1>=V[0]&&N+1<=V[1]}):[],W=!(H||!(U>1)),F=void 0;return e.createElement("div",null,e.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},H?L.text.connect_mobile_wallet:L.text.choose_preferred_wallet),!H&&e.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:q,onChange:function(B){k(B.target.value),clearTimeout(F),B.target.value?F=setTimeout(function(){R(B.target.value),g(1)},1e3):(k(""),R(""),g(1))}}),e.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(H?"__android":C&&M.length?"__wrap":"")},H?e.createElement(i,{name:L.text.connect,color:"rgb(64, 153, 255)",href:L.uri,onClick:e.useCallback(function(){y.saveMobileLinkInfo({name:"Unknown",href:L.uri})},[])}):I.length?I.map(function(B){var N=B.color,P=B.name,j=B.shortName,K=B.logo,Z=y.formatIOSMobile(L.uri,B),J=e.useCallback(function(){y.saveMobileLinkInfo({name:P,href:Z})},[I]);return C?e.createElement(h,{color:N,href:Z,name:j||P,logo:K,onClick:J}):e.createElement(u,{color:N,href:Z,name:P,logo:K,onClick:J})}):e.createElement(e.Fragment,null,e.createElement("p",null,E.length?L.errorMessage:L.links.length&&!M.length?L.text.no_wallets_found:L.text.loading))),W&&e.createElement("div",{className:"walletconnect-modal__footer"},Array(U).fill(0).map(function(B,N){var P=N+1;return e.createElement("a",{style:{margin:"auto 10px",fontWeight:a===P?"bold":"normal"},onClick:function(){return g(P)}},P)})))}function d(L){var H=!!L.message.trim();return e.createElement("div",{className:"walletconnect-qrcode__notification"+(H?" notification__show":"")},L.message)}function _(L){var H=e.useState(""),D=H[0],q=H[1],k=e.useState(""),p=k[0],x=k[1];return e.useEffect(function(){try{return Promise.resolve(function(R){try{var r="";return Promise.resolve(n.toString(R,{margin:0,type:"svg"})).then(function(a){return"string"==typeof a&&(r=a.replace("0||e.useEffect(function(){!function(){try{if(H)return Promise.resolve();x(!0);var te=function(oe,ve){try{var ie=function(){var oe=L.qrcodeModalOptions&&L.qrcodeModalOptions.registryUrl?L.qrcodeModalOptions.registryUrl:y.getWalletRegistryUrl();return Promise.resolve(fetch(oe)).then(function(ve){return Promise.resolve(ve.json()).then(function(ie){var re=y.getMobileLinkRegistry(y.formatMobileRegistry(ie.listings,D?"mobile":"desktop"),q);x(!1),a(!0),J(re.length?"":L.text.no_supported_wallets),j(re);var _e=1===re.length;_e&&(I(y.formatIOSMobile(L.uri,re[0])),E(!0)),B(_e)})})}()}catch(de){return ve(de)}return ie&&ie.then?ie.then(void 0,ve):ie}(0,function(oe){x(!1),a(!0),J(L.text.something_went_wrong),console.error(oe)});Promise.resolve(te&&te.then?te.then(function(){}):void 0)}catch(oe){return Promise.reject(oe)}}()})};X();var ee=D?M:!M;return e.createElement("div",{id:"walletconnect-qrcode-modal",className:"walletconnect-qrcode__base animated fadeIn"},e.createElement("div",{className:"walletconnect-modal__base"},e.createElement(t,{onClose:L.onClose}),F&&M?e.createElement("div",{className:"walletconnect-modal__single_wallet"},e.createElement("a",{onClick:function(){return y.saveMobileLinkInfo({name:P[0].name,href:V})},href:V,rel:"noopener noreferrer",target:"_blank"},L.text.connect_with+" "+(F?P[0].name:"")+" \u203a")):H||p||!p&&P.length?e.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(ee?" right__selected":"")},e.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),D?e.createElement(e.Fragment,null,e.createElement("a",{onClick:function(){return E(!1),X()}},L.text.mobile),e.createElement("a",{onClick:function(){return E(!0)}},L.text.qrcode)):e.createElement(e.Fragment,null,e.createElement("a",{onClick:function(){return E(!0)}},L.text.qrcode),e.createElement("a",{onClick:function(){return E(!1),X()}},L.text.desktop))):null,e.createElement("div",null,M||!H&&!p&&!P.length?e.createElement(_,Object.assign({},C)):e.createElement(f,Object.assign({},C,{links:P,errorMessage:Z})))))}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var T={de:{choose_preferred_wallet:"W\xe4hle 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\xfctzten 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\xf3vil",scan_qrcode_with_wallet:"Escanea el c\xf3digo QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"C\xf3digo QR",mobile:"M\xf3vil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo sali\xf3 mal",no_supported_wallets:"Todav\xeda no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},fr:{choose_preferred_wallet:"Choisissez votre portefeuille pr\xe9f\xe9r\xe9",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\xe9!",connect_with:"Connectez-vous \xe0 l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourn\xe9",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouv\xe9"},ko:{choose_preferred_wallet:"\uc6d0\ud558\ub294 \uc9c0\uac11\uc744 \uc120\ud0dd\ud558\uc138\uc694",connect_mobile_wallet:"\ubaa8\ubc14\uc77c \uc9c0\uac11\uacfc \uc5f0\uacb0",scan_qrcode_with_wallet:"WalletConnect \uc9c0\uc6d0 \uc9c0\uac11\uc5d0\uc11c QR\ucf54\ub4dc\ub97c \uc2a4\uce94\ud558\uc138\uc694",connect:"\uc5f0\uacb0",qrcode:"QR \ucf54\ub4dc",mobile:"\ubaa8\ubc14\uc77c",desktop:"\ub370\uc2a4\ud06c\ud0d1",copy_to_clipboard:"\ud074\ub9bd\ubcf4\ub4dc\uc5d0 \ubcf5\uc0ac",copied_to_clipboard:"\ud074\ub9bd\ubcf4\ub4dc\uc5d0 \ubcf5\uc0ac\ub418\uc5c8\uc2b5\ub2c8\ub2e4!",connect_with:"\uc640 \uc5f0\uacb0\ud558\ub2e4",loading:"\ub85c\ub4dc \uc911...",something_went_wrong:"\ubb38\uc81c\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4.",no_supported_wallets:"\uc544\uc9c1 \uc9c0\uc6d0\ub418\ub294 \uc9c0\uac11\uc774 \uc5c6\uc2b5\ub2c8\ub2e4",no_wallets_found:"\uc9c0\uac11\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4"},pt:{choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se \xe0 carteira m\xf3vel",scan_qrcode_with_wallet:"Ler o c\xf3digo QR com uma carteira compat\xedvel com WalletConnect",connect:"Conectar",qrcode:"C\xf3digo QR",mobile:"M\xf3vel",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\xe3o h\xe1 carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},zh:{choose_preferred_wallet:"\u9009\u62e9\u4f60\u7684\u94b1\u5305",connect_mobile_wallet:"\u8fde\u63a5\u81f3\u79fb\u52a8\u7aef\u94b1\u5305",scan_qrcode_with_wallet:"\u4f7f\u7528\u517c\u5bb9 WalletConnect \u7684\u94b1\u5305\u626b\u63cf\u4e8c\u7ef4\u7801",connect:"\u8fde\u63a5",qrcode:"\u4e8c\u7ef4\u7801",mobile:"\u79fb\u52a8",desktop:"\u684c\u9762",copy_to_clipboard:"\u590d\u5236\u5230\u526a\u8d34\u677f",copied_to_clipboard:"\u590d\u5236\u5230\u526a\u8d34\u677f\u6210\u529f\uff01",connect_with:"\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u8fde\u63a5",loading:"\u6b63\u5728\u52a0\u8f7d...",something_went_wrong:"\u51fa\u4e86\u95ee\u9898",no_supported_wallets:"\u76ee\u524d\u8fd8\u6ca1\u6709\u652f\u6301\u7684\u94b1\u5305",no_wallets_found:"\u6ca1\u6709\u627e\u5230\u94b1\u5305"},fa:{choose_preferred_wallet:"\u06a9\u06cc\u0641 \u067e\u0648\u0644 \u0645\u0648\u0631\u062f \u0646\u0638\u0631 \u062e\u0648\u062f \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f",connect_mobile_wallet:"\u0628\u0647 \u06a9\u06cc\u0641 \u067e\u0648\u0644 \u0645\u0648\u0628\u0627\u06cc\u0644 \u0648\u0635\u0644 \u0634\u0648\u06cc\u062f",scan_qrcode_with_wallet:"\u06a9\u062f QR \u0631\u0627 \u0628\u0627 \u06cc\u06a9 \u06a9\u06cc\u0641 \u067e\u0648\u0644 \u0633\u0627\u0632\u06af\u0627\u0631 \u0628\u0627 WalletConnect \u0627\u0633\u06a9\u0646 \u06a9\u0646\u06cc\u062f",connect:"\u0627\u062a\u0635\u0627\u0644",qrcode:"\u06a9\u062f QR",mobile:"\u0633\u06cc\u0627\u0631",desktop:"\u062f\u0633\u06a9\u062a\u0627\u067e",copy_to_clipboard:"\u06a9\u067e\u06cc \u0628\u0647 \u06a9\u0644\u06cc\u067e \u0628\u0648\u0631\u062f",copied_to_clipboard:"\u062f\u0631 \u06a9\u0644\u06cc\u067e \u0628\u0648\u0631\u062f \u06a9\u067e\u06cc \u0634\u062f!",connect_with:"\u0627\u0631\u062a\u0628\u0627\u0637 \u0628\u0627",loading:"...\u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc",something_went_wrong:"\u0645\u0634\u06a9\u0644\u06cc \u067e\u06cc\u0634 \u0622\u0645\u062f",no_supported_wallets:"\u0647\u0646\u0648\u0632 \u0647\u06cc\u0686 \u06a9\u06cc\u0641 \u067e\u0648\u0644 \u067e\u0634\u062a\u06cc\u0628\u0627\u0646\u06cc \u0634\u062f\u0647 \u0627\u06cc \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f",no_wallets_found:"\u0647\u06cc\u0686 \u06a9\u06cc\u0641 \u067e\u0648\u0644\u06cc \u067e\u06cc\u062f\u0627 \u0646\u0634\u062f"}};function O(){var L=y.getDocumentOrThrow(),H=L.getElementById("walletconnect-qrcode-modal");H&&(H.className=H.className.replace("fadeIn","fadeOut"),setTimeout(function(){var D=L.getElementById("walletconnect-wrapper");D&&L.body.removeChild(D)},300))}function b(L){return function(){O(),L&&L()}}var w=function(){return void 0!==s&&void 0!==s.versions&&void 0!==s.versions.node};z.exports={open:function(L,H,D){console.log(L),w()?n.toString(L,{type:"terminal"}).then(console.log):function S(L,H,D){!function(){var p=y.getDocumentOrThrow(),x=p.getElementById("walletconnect-style-sheet");x&&p.head.removeChild(x);var R=p.createElement("style");R.setAttribute("id","walletconnect-style-sheet"),R.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',p.head.appendChild(R)}();var q,p,x,k=((x=(p=y.getDocumentOrThrow()).createElement("div")).setAttribute("id","walletconnect-wrapper"),p.body.appendChild(x),x);e.render(e.createElement(v,{text:(q=y.getNavigatorOrThrow().language.split("-")[0]||"en",T[q]||T.en),uri:L,onClose:b(H),qrcodeModalOptions:D}),k)}(L,H,D)},close:function(){w()||O()}}}).call(this,c(5))},function(z,l,c){var s=c(180),m=c(181),y=c(198),n=c(199);function o(e,t,i,u,h){var f=[].slice.call(arguments,1),d=f.length,_="function"==typeof f[d-1];if(!_&&!s())throw new Error("Callback required as last argument");if(!_){if(d<1)throw new Error("Too few arguments provided");return 1===d?(i=t,t=u=void 0):2!==d||t.getContext||(u=i,i=t,t=void 0),new Promise(function(T,O){try{var b=m.create(i,u);T(e(b,t,u))}catch(S){O(S)}})}if(d<2)throw new Error("Too few arguments provided");2===d?(h=i,i=t,t=u=void 0):3===d&&(t.getContext&&void 0===h?(h=u,u=void 0):(h=u,u=i,i=t,t=void 0));try{var v=m.create(i,u);h(null,e(v,t,u))}catch(T){h(T)}}l.create=m.create,l.toCanvas=o.bind(null,y.render),l.toDataURL=o.bind(null,y.renderToDataURL),l.toString=o.bind(null,function(e,t,i){return n.render(e,i)})},function(z,l){z.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},function(z,l,c){var s=c(26),m=c(17),y=c(51),n=c(182),o=c(183),e=c(184),t=c(185),i=c(186),u=c(98),h=c(187),f=c(190),d=c(191),_=c(18),v=c(192),T=c(50);function O(w,A,L){var H,D,q=w.size,k=d.getEncodedBits(A,L);for(H=0;H<15;H++)w.set(H<6?H:H<8?H+1:q-15+H,8,D=1==(k>>H&1),!0),w.set(8,H<8?q-H-1:H<9?15-H-1+1:15-H-1,D,!0);w.set(q-8,8,1,!0)}function S(w,A,L,H){var D;if(T(w))D=v.fromArray(w);else{if("string"!=typeof w)throw new Error("Invalid data");var q=A;if(!q){var k=v.rawSplit(w);q=f.getBestVersionForData(k,L)}D=v.fromString(w,q||40)}var p=f.getBestVersionForData(D,L);if(!p)throw new Error("The amount of data is too big to be stored in a QR Code");if(A){if(A=0&&I<=6&&(0===W||6===W)||W>=0&&W<=6&&(0===I||6===I)||I>=2&&I<=4&&W>=2&&W<=4,!0)}(r,A),function(a){for(var g=a.size,M=8;M=7&&function(a,g){for(var M,E,C,U=a.size,V=f.getEncodedBits(g),I=0;I<18;I++)M=Math.floor(I/3),a.set(M,E=I%3+U-8-3,C=1==(V>>I&1),!0),a.set(E,M,C,!0)}(r,A),function(a,g){for(var M=a.size,E=-1,C=M-1,U=7,V=0,I=M-1;I>0;I-=2)for(6===I&&I--;;){for(var W=0;W<2;W++)if(!a.isReserved(C,I-W)){var F=!1;V>>U&1)),a.set(C,I-W,F),-1==--U&&(V++,U=7)}if((C+=E)<0||M<=C){C-=E,E=-E;break}}}(r,x),isNaN(H)&&(H=i.getBestMask(r,O.bind(null,r,L))),i.applyMask(H,r),O(r,L,H),{modules:r,version:A,errorCorrectionLevel:L,maskPattern:H,segments:D}}l.create=function(w,A){if(void 0===w||""===w)throw new Error("No input text");var L,H,D=y.M;return void 0!==A&&(D=y.from(A.errorCorrectionLevel,y.M),L=f.from(A.version),H=i.from(A.maskPattern),A.toSJISFunc&&m.setToSJISFunction(A.toSJISFunc)),S(w,L,D,H)}},function(z,l){function c(){this.buffer=[],this.length=0}c.prototype={get:function(s){var m=Math.floor(s/8);return 1==(this.buffer[m]>>>7-s%8&1)},put:function(s,m){for(var y=0;y>>m-y-1&1))},getLengthInBits:function(){return this.length},putBit:function(s){var m=Math.floor(this.length/8);this.buffer.length<=m&&this.buffer.push(0),s&&(this.buffer[m]|=128>>>this.length%8),this.length++}},z.exports=c},function(z,l,c){var s=c(26);function m(y){if(!y||y<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=y,this.data=s.alloc(y*y),this.reservedBit=s.alloc(y*y)}m.prototype.set=function(y,n,o,e){var t=y*this.size+n;this.data[t]=o,e&&(this.reservedBit[t]=!0)},m.prototype.get=function(y,n){return this.data[y*this.size+n]},m.prototype.xor=function(y,n,o){this.data[y*this.size+n]^=o},m.prototype.isReserved=function(y,n){return this.reservedBit[y*this.size+n]},z.exports=m},function(z,l,c){var s=c(17).getSymbolSize;l.getRowColCoords=function(m){if(1===m)return[];for(var y=Math.floor(m/7)+2,n=s(m),o=145===n?26:2*Math.ceil((n-13)/(2*y-2)),e=[n-7],t=1;t=0&&o<=7},l.from=function(o){return l.isValid(o)?parseInt(o,10):void 0},l.getPenaltyN1=function(o){for(var e=o.size,t=0,i=0,u=0,h=null,f=null,d=0;d=5&&(t+=i-5+3),h=v,i=1),(v=o.get(_,d))===f?u++:(u>=5&&(t+=u-5+3),f=v,u=1)}i>=5&&(t+=i-5+3),u>=5&&(t+=u-5+3)}return t},l.getPenaltyN2=function(o){for(var e=o.size,t=0,i=0;i=10&&(1488===i||93===i)&&t++,u=u<<1&2047|o.get(f,h),f>=10&&(1488===u||93===u)&&t++}return 40*t},l.getPenaltyN4=function(o){for(var e=0,t=o.data.length,i=0;i0){var h=s.alloc(this.degree);return i.copy(h,u),h}return i},z.exports=n},function(z,l,c){var s=c(26),m=c(189);l.mul=function(y,n){for(var o=s.alloc(y.length+n.length-1),e=0;e=0;){for(var e=o[0],t=0;t1)return function(v,T){for(var O=1;O<=40;O++)if(u(v,O)<=l.getCapacity(O,T,n.MIXED))return O}(h,_);if(0===h.length)return 1;d=h[0]}else d=h;return function(v,T,O){for(var b=1;b<=40;b++)if(T<=l.getCapacity(b,O,v))return b}(d.mode,d.getLength(),_)},l.getEncodedBits=function(h){if(!o.isValid(h)||h<7)throw new Error("Invalid QR Code version");for(var f=h<<12;s.getBCHDigit(f)-t>=0;)f^=7973<=0;)e^=1335<=0?L[L.length-1]:null;return D&&D.mode===H.mode?(L[L.length-1].data+=H.data,L):(L.push(H),L)},[]))},l.rawSplit=function(v){return l.fromArray(f(v,t.isKanjiModeEnabled()))}},function(z,l,c){var s=c(18);function m(y){this.mode=s.NUMERIC,this.data=y.toString()}m.getBitsLength=function(y){return 10*Math.floor(y/3)+(y%3?y%3*3+1:0)},m.prototype.getLength=function(){return this.data.length},m.prototype.getBitsLength=function(){return m.getBitsLength(this.data.length)},m.prototype.write=function(y){var n,o,e;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),e=parseInt(o,10),y.put(e,10);var t=this.data.length-n;t>0&&(o=this.data.substr(n),e=parseInt(o,10),y.put(e,3*t+1))},z.exports=m},function(z,l,c){var s=c(18),m=["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 y(n){this.mode=s.ALPHANUMERIC,this.data=n}y.getBitsLength=function(n){return 11*Math.floor(n/2)+n%2*6},y.prototype.getLength=function(){return this.data.length},y.prototype.getBitsLength=function(){return y.getBitsLength(this.data.length)},y.prototype.write=function(n){var o;for(o=0;o+2<=this.data.length;o+=2){var e=45*m.indexOf(this.data[o]);e+=m.indexOf(this.data[o+1]),n.put(e,11)}this.data.length%2&&n.put(m.indexOf(this.data[o]),6)},z.exports=y},function(z,l,c){var s=c(26),m=c(18);function y(n){this.mode=m.BYTE,this.data=s.from(n)}y.getBitsLength=function(n){return 8*n},y.prototype.getLength=function(){return this.data.length},y.prototype.getBitsLength=function(){return y.getBitsLength(this.data.length)},y.prototype.write=function(n){for(var o=0,e=this.data.length;o=33088&&e<=40956)e-=33088;else{if(!(e>=57408&&e<=60351))throw new Error("Invalid SJIS character: "+this.data[o]+"\nMake sure your charset is UTF-8");e-=49472}n.put(e=192*(e>>>8&255)+(255&e),13)}},z.exports=y},function(z,l,c){"use strict";var s={single_source_shortest_paths:function(m,y,n){var o={},e={};e[y]=0;var t,i,u,h,f,d,v=s.PriorityQueue.make();for(v.push(y,0);!v.empty();)for(u in i=(t=v.pop()).value,h=t.cost,f=m[i]||{})f.hasOwnProperty(u)&&(d=h+f[u],(void 0===e[u]||e[u]>d)&&(e[u]=d,v.push(u,d),o[u]=i));if(void 0!==n&&void 0===e[n]){var T=["Could not find a path from ",y," to ",n,"."].join("");throw new Error(T)}return o},extract_shortest_path_from_predecessor_list:function(m,y){for(var n=[],o=y;o;)n.push(o),o=m[o];return n.reverse(),n},find_path:function(m,y,n){var o=s.single_source_shortest_paths(m,y,n);return s.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(m){var y,n=s.PriorityQueue,o={};for(y in m=m||{},n)n.hasOwnProperty(y)&&(o[y]=n[y]);return o.queue=[],o.sorter=m.sorter||n.default_sorter,o},default_sorter:function(m,y){return m.cost-y.cost},push:function(m,y){this.queue.push({value:m,cost:y}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};z.exports=s},function(z,l,c){var s=c(101);l.render=function(m,y,n){var o=n,e=y;void 0!==o||y&&y.getContext||(o=y,y=void 0),y||(e=function(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}()),o=s.getOptions(o);var f,d,t=s.getImageWidth(m.modules.size,o),i=e.getContext("2d"),u=i.createImageData(t,t);return s.qrToImageData(u.data,m,o),d=t,i.clearRect(0,0,(f=e).width,f.height),f.style||(f.style={}),f.height=d,f.width=d,f.style.height=d+"px",f.style.width=d+"px",i.putImageData(u,0,0),e},l.renderToDataURL=function(m,y,n){var o=n;return void 0!==o||y&&y.getContext||(o=y,y=void 0),o||(o={}),l.render(m,y,o).toDataURL(o.type||"image/png",(o.rendererOpts||{}).quality)}},function(z,l,c){var s=c(101);function m(n,o){var e=n.a/255,t=o+'="'+n.hex+'"';return e<1?t+" "+o+'-opacity="'+e.toFixed(2).slice(1)+'"':t}function y(n,o,e){var t=n+o;return void 0!==e&&(t+=" "+e),t}l.render=function(n,o,e){var t=s.getOptions(o),i=n.modules.size,u=n.modules.data,h=i+2*t.margin,f=t.color.light.a?"':"",d="0&&D>0&&T[H-1]||(S+=A?y("M",D+b,.5+q+b):y("m",w,0),w=0,A=!1),D+1',v=''+f+d+"\n";return"function"==typeof e&&e(null,v),v}},function(z,l,c){"use strict";var s=c(201),m={"text/plain":"Text","text/html":"Url",default:"Text"};z.exports=function(y,n){var o,e,t,i,u,h,v,T,f=!1;n||(n={}),o=n.debug||!1;try{if(t=s(),i=document.createRange(),u=document.getSelection(),(h=document.createElement("span")).textContent=y,h.style.all="unset",h.style.position="fixed",h.style.top=0,h.style.clip="rect(0, 0, 0, 0)",h.style.whiteSpace="pre",h.style.webkitUserSelect="text",h.style.MozUserSelect="text",h.style.msUserSelect="text",h.style.userSelect="text",h.addEventListener("copy",function(d){d.stopPropagation(),n.format&&(d.preventDefault(),void 0===d.clipboardData?(o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData(),window.clipboardData.setData(m[n.format]||m.default,y)):(d.clipboardData.clearData(),d.clipboardData.setData(n.format,y))),n.onCopy&&(d.preventDefault(),n.onCopy(d.clipboardData))}),document.body.appendChild(h),i.selectNodeContents(h),u.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");f=!0}catch(d){o&&console.error("unable to copy using execCommand: ",d),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",y),n.onCopy&&n.onCopy(window.clipboardData),f=!0}catch(_){o&&console.error("unable to copy using clipboardData: ",_),o&&console.error("falling back to prompt"),v="message"in n?n.message:"Copy to clipboard: #{key}, Enter",T=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C",e=v.replace(/#{\s*key\s*}/g,T),window.prompt(e,y)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(i):u.removeAllRanges()),h&&document.body.removeChild(h),t()}return f}},function(z,l){z.exports=function(){var c=document.getSelection();if(!c.rangeCount)return function(){};for(var s=document.activeElement,m=[],y=0;y{if("eth_subscribe"===i.method){const v=this.formatError(i,"Subscriptions are not supported by this HTTP endpoint");return this.emit("error",v),h(v)}const f=new o;let d=!1;const _=(v,T)=>{if(!d)if(f.abort(),d=!0,u)u(v,T);else{const{id:O,jsonrpc:b}=i,S=v?{id:O,jsonrpc:b,error:{message:v.message,code:v.code}}:{id:O,jsonrpc:b,result:T};this.emit("payload",S),h(S)}};f.open("POST",this.url,!0),f.setRequestHeader("Content-Type","application/json"),f.timeout=6e4,f.onerror=_,f.ontimeout=_,f.onreadystatechange=()=>{if(4===f.readyState)try{const v=JSON.parse(f.responseText);_(v.error,v.result)}catch(v){_(v)}},f.send(JSON.stringify(i))})}}},function(z,l,c){"use strict";(function(s,m){var y,n=this&&this.__extends||(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,b){O.__proto__=b}||function(O,b){for(var S in b)b.hasOwnProperty(S)&&(O[S]=b[S])},function(O,b){function S(){this.constructor=O}y(O,b),O.prototype=null===b?Object.create(b):(S.prototype=b.prototype,new S)}),o=this&&this.__assign||Object.assign||function(O){for(var b,S=1,w=arguments.length;S=0)return this._url=this._parseUrl(w.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=w,this._response.on("data",function(H){return A._onHttpResponseData(w,H)}),this._response.on("end",function(){return A._onHttpResponseEnd(w)}),this._response.on("close",function(){return A._onHttpResponseClose(w)}),this.responseUrl=this._url.href.split("#")[0],this.status=w.statusCode,this.statusText=e.STATUS_CODES[this.status],this._parseResponseHeaders(w);var L=this._responseHeaders["content-length"]||"";this._totalBytes=+L,this._lengthComputable=!!L,this._setReadyState(b.HEADERS_RECEIVED)}},b.prototype._onHttpResponseData=function(S,w){this._response===S&&(this._responseParts.push(new m(w)),this._loadedBytes+=w.length,this.readyState!==b.LOADING&&this._setReadyState(b.LOADING),this._dispatchProgress("progress"))},b.prototype._onHttpResponseEnd=function(S){this._response===S&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(b.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},b.prototype._onHttpResponseClose=function(S){if(this._response===S){var w=this._request;this._setError(),w.abort(),this._setReadyState(b.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},b.prototype._onHttpTimeout=function(S){this._request===S&&(this._setError(),S.abort(),this._setReadyState(b.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},b.prototype._onHttpRequestError=function(S,w){this._request===S&&(this._setError(),S.abort(),this._setReadyState(b.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},b.prototype._dispatchProgress=function(S){var w=new b.ProgressEvent(S);w.lengthComputable=this._lengthComputable,w.loaded=this._loadedBytes,w.total=this._totalBytes,this.dispatchEvent(w)},b.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},b.prototype._parseUrl=function(S,w,A){var L=null==this.nodejsBaseUrl?S:u.resolve(this.nodejsBaseUrl,S),H=u.parse(L,!1,!0);H.hash=null;var D=(H.auth||"").split(":"),q=D[0],k=D[1];return(q||k||w||A)&&(H.auth=(w||q||"")+":"+(A||k||"")),H},b.prototype._parseResponseHeaders=function(S){for(var w in this._responseHeaders={},S.headers){var A=w.toLowerCase();this._privateHeaders[A]||(this._responseHeaders[A]=S.headers[w])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},b.prototype._parseResponse=function(){var S=m.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(S.toString("utf-8"))}catch{this.response=null}return;case"buffer":return this.responseText=null,void(this.response=S);case"arraybuffer":this.responseText=null;for(var w=new ArrayBuffer(S.length),A=new Uint8Array(w),L=0;L0?this.tail.next=o:this.head=o,this.tail=o,++this.length},y.prototype.unshift=function(n){var o={data:n,next:this.head};0===this.length&&(this.tail=o),this.head=o,++this.length},y.prototype.shift=function(){if(0!==this.length){var n=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,n}},y.prototype.clear=function(){this.head=this.tail=null,this.length=0},y.prototype.join=function(n){if(0===this.length)return"";for(var o=this.head,e=""+o.data;o=o.next;)e+=n+o.data;return e},y.prototype.concat=function(n){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var i=s.allocUnsafe(n>>>0),u=this.head,h=0;u;)u.data.copy(i,h),h+=u.data.length,u=u.next;return i},y}(),m&&m.inspect&&m.inspect.custom&&(z.exports.prototype[m.inspect.custom]=function(){var y=m.inspect({length:this.length});return this.constructor.name+" "+y})},function(z,l){},function(z,l,c){(function(s,m){!function(y,n){"use strict";if(!y.setImmediate){var o,e,t,i,u,h=1,f={},d=!1,_=y.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(y);v=v&&v.setTimeout?v:y,"[object process]"==={}.toString.call(y.process)?o=function(b){m.nextTick(function(){O(b)})}:function(){if(y.postMessage&&!y.importScripts){var b=!0,S=y.onmessage;return y.onmessage=function(){b=!1},y.postMessage("","*"),y.onmessage=S,b}}()?(i="setImmediate$"+Math.random()+"$",u=function(b){b.source===y&&"string"==typeof b.data&&0===b.data.indexOf(i)&&O(+b.data.slice(i.length))},y.addEventListener?y.addEventListener("message",u,!1):y.attachEvent("onmessage",u),o=function(b){y.postMessage(i+b,"*")}):y.MessageChannel?((t=new MessageChannel).port1.onmessage=function(b){O(b.data)},o=function(b){t.port2.postMessage(b)}):_&&"onreadystatechange"in _.createElement("script")?(e=_.documentElement,o=function(b){var S=_.createElement("script");S.onreadystatechange=function(){O(b),S.onreadystatechange=null,e.removeChild(S),S=null},e.appendChild(S)}):o=function(b){setTimeout(O,0,b)},v.setImmediate=function(b){"function"!=typeof b&&(b=new Function(""+b));for(var S=new Array(arguments.length-1),w=0;w"u"?void 0===s?this:s:self)}).call(this,c(6),c(5))},function(z,l,c){var s=c(2),m=s.Buffer;function y(o,e){for(var t in o)e[t]=o[t]}function n(o,e,t){return m(o,e,t)}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?z.exports=s:(y(s,l),l.Buffer=n),y(m,n),n.from=function(o,e,t){if("number"==typeof o)throw new TypeError("Argument must not be a number");return m(o,e,t)},n.alloc=function(o,e,t){if("number"!=typeof o)throw new TypeError("Argument must be a number");var i=m(o);return void 0!==e?"string"==typeof t?i.fill(e,t):i.fill(e):i.fill(0),i},n.allocUnsafe=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return m(o)},n.allocUnsafeSlow=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return s.SlowBuffer(o)}},function(z,l,c){"use strict";z.exports=y;var s=c(109),m=Object.create(c(35));function y(n){if(!(this instanceof y))return new y(n);s.call(this,n)}m.inherits=c(3),m.inherits(y,s),y.prototype._transform=function(n,o,e){e(null,n)}},function(z,l,c){var s=c(2).Buffer;z.exports=function(m){if(m instanceof Uint8Array){if(0===m.byteOffset&&m.byteLength===m.buffer.byteLength)return m.buffer;if("function"==typeof m.buffer.slice)return m.buffer.slice(m.byteOffset,m.byteOffset+m.byteLength)}if(s.isBuffer(m)){for(var y=new Uint8Array(m.length),n=m.length,o=0;o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,_=String.fromCharCode;function v(D){throw new RangeError(f[D])}function T(D,q){for(var k=D.length,p=[];k--;)p[k]=q(D[k]);return p}function O(D,q){var k=D.split("@"),p="";return k.length>1&&(p=k[0]+"@",D=k[1]),p+T((D=D.replace(h,".")).split("."),q).join(".")}function b(D){for(var q,k,p=[],x=0,R=D.length;x=55296&&q<=56319&&x65535&&(k+=_((q-=65536)>>>10&1023|55296),q=56320|1023&q),k+_(q)}).join("")}function w(D,q){return D+22+75*(D<26)-((0!=q)<<5)}function A(D,q,k){var p=0;for(D=k?d(D/700):D>>1,D+=d(D/q);D>455;p+=36)D=d(D/35);return d(p+36*D/(D+38))}function L(D){var q,k,p,x,R,r,a,g,M,E,C,U=[],V=D.length,I=0,W=128,F=72;for((k=D.lastIndexOf("-"))<0&&(k=0),p=0;p=128&&v("not-basic"),U.push(D.charCodeAt(p));for(x=k>0?k+1:0;x=V&&v("invalid-input"),((g=(C=D.charCodeAt(x++))-48<10?C-22:C-65<26?C-65:C-97<26?C-97:36)>=36||g>d((t-I)/r))&&v("overflow"),I+=g*r,!(g<(M=a<=F?1:a>=F+26?26:a-F));a+=36)r>d(t/(E=36-M))&&v("overflow"),r*=E;F=A(I-R,q=U.length+1,0==R),d(I/q)>t-W&&v("overflow"),W+=d(I/q),I%=q,U.splice(I++,0,W)}return S(U)}function H(D){var q,k,p,x,R,r,a,g,M,E,C,U,V,I,W,F=[];for(U=(D=b(D)).length,q=128,k=0,R=72,r=0;r=q&&Cd((t-k)/(V=p+1))&&v("overflow"),k+=(a-q)*V,q=a,r=0;rt&&v("overflow"),C==q){for(g=k,M=36;!(g<(E=M<=R?1:M>=R+26?26:M-R));M+=36)F.push(_(w(E+(W=g-E)%(I=36-E),0))),g=d(W/I);F.push(_(w(g,0))),R=A(k,V,p==x),k=0,++p}++k,++q}return F.join("")}e={version:"1.4.1",ucs2:{decode:b,encode:S},decode:L,encode:H,toASCII:function(D){return O(D,function(q){return u.test(q)?"xn--"+H(q):q})},toUnicode:function(D){return O(D,function(q){return i.test(q)?L(q.slice(4).toLowerCase()):q})}},void 0===(y=function(){return e}.call(l,c,l,s))||(s.exports=y)}()}).call(this,c(25)(z),c(6))},function(z,l,c){"use strict";z.exports={isString:function(s){return"string"==typeof s},isObject:function(s){return"object"==typeof s&&null!==s},isNull:function(s){return null===s},isNullOrUndefined:function(s){return null==s}}},function(z,l,c){"use strict";l.decode=l.parse=c(216),l.encode=l.stringify=c(217)},function(z,l,c){"use strict";function s(y,n){return Object.prototype.hasOwnProperty.call(y,n)}z.exports=function(y,n,o,e){o=o||"=";var t={};if("string"!=typeof y||0===y.length)return t;var i=/\+/g;y=y.split(n=n||"&");var u=1e3;e&&"number"==typeof e.maxKeys&&(u=e.maxKeys);var h=y.length;u>0&&h>u&&(h=u);for(var f=0;f=0?(d=O.substr(0,b),_=O.substr(b+1)):(d=O,_=""),v=decodeURIComponent(d),T=decodeURIComponent(_),s(t,v)?m(t[v])?t[v].push(T):t[v]=[t[v],T]:t[v]=T}return t};var m=Array.isArray||function(y){return"[object Array]"===Object.prototype.toString.call(y)}},function(z,l,c){"use strict";var s=function(o){switch(typeof o){case"string":return o;case"boolean":return o?"true":"false";case"number":return isFinite(o)?o:"";default:return""}};z.exports=function(o,e,t,i){return e=e||"&",t=t||"=",null===o&&(o=void 0),"object"==typeof o?y(n(o),function(u){var h=encodeURIComponent(s(u))+t;return m(o[u])?y(o[u],function(f){return h+encodeURIComponent(s(f))}).join(e):h+encodeURIComponent(s(o[u]))}).join(e):i?encodeURIComponent(s(i))+t+encodeURIComponent(s(o)):""};var m=Array.isArray||function(o){return"[object Array]"===Object.prototype.toString.call(o)};function y(o,e){if(o.map)return o.map(e);for(var t=[],i=0;i{d._getBlockByNumberWithRetry(_,(v,T)=>{if(v)return void this.emit("error",v);if(!T)return console.log(T),void this.emit("error",new Error("Could not find block"));const O={number:y.toBuffer((b=T).number),hash:y.toBuffer(b.hash),parentHash:y.toBuffer(b.parentHash),nonce:y.toBuffer(b.nonce),mixHash:y.toBuffer(b.mixHash),sha3Uncles:y.toBuffer(b.sha3Uncles),logsBloom:y.toBuffer(b.logsBloom),transactionsRoot:y.toBuffer(b.transactionsRoot),stateRoot:y.toBuffer(b.stateRoot),receiptsRoot:y.toBuffer(b.receiptRoot||b.receiptsRoot),miner:y.toBuffer(b.miner),difficulty:y.toBuffer(b.difficulty),totalDifficulty:y.toBuffer(b.totalDifficulty),size:y.toBuffer(b.size),extraData:y.toBuffer(b.extraData),gasLimit:y.toBuffer(b.gasLimit),gasUsed:y.toBuffer(b.gasUsed),timestamp:y.toBuffer(b.timestamp),transactions:b.transactions};var b;d._setCurrentBlock(O),d.emit("rawBlock",T),d.emit("latest",T)})}),d._blockTracker.on("sync",d.emit.bind(d,"sync")),d._blockTracker.on("error",d.emit.bind(d,"error")),d._running=!0,d.emit("start")},h.prototype.stop=function(){this._blockTracker.removeAllListeners(),this._running=!1,this.emit("stop")},h.prototype.isRunning=function(){return this._running},h.prototype.addProvider=function(f,d){"number"==typeof d?this._providers.splice(d,0,f):this._providers.push(f),f.setEngine(this)},h.prototype.removeProvider=function(f){const d=this._providers.indexOf(f);if(d<0)throw new Error("Provider not found.");this._providers.splice(d,1)},h.prototype.send=function(f){throw new Error("Web3ProviderEngine does not support synchronous requests.")},h.prototype.sendAsync=function(f,d){const _=this;_._ready.await(function(){Array.isArray(f)?o(f,_._handleAsync.bind(_),d):_._handleAsync(f,d)})},h.prototype._getBlockByNumberWithRetry=function(f,d){const _=this;let v=5;return void T();function T(){_._getBlockByNumber(f,O)}function O(b,S){return b?d(b):S?void d(null,S):v>0?(v--,void setTimeout(function(){T()},1e3)):void d(null,null)}},h.prototype._getBlockByNumber=function(f,d){const _=i({method:"eth_getBlockByNumber",params:[f,!1],skipCache:!0});this._handleAsync(_,(v,T)=>v?d(v):d(null,T.result))},h.prototype._handleAsync=function(f,d){var _=this,v=-1,T=null,O=null,b=[];function S(w,A){O=w,T=A,e(b,function(L,H){L?L(O,T,H):H()},function(){var L={id:f.id,jsonrpc:f.jsonrpc,result:T};null!=O?(L.error={message:O.stack||O.message||O,code:-32e3},d(O,L)):d(null,L)})}!function w(A){if(v+=1,b.unshift(A),v>=_._providers.length)S(new Error('Request for method "'+f.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{_._providers[v].handleRequest(f,w,S)}catch(L){S(L)}}()},h.prototype._setCurrentBlock=function(f){this.currentBlock=f,this.emit("block",f)}},function(z,l){z.exports=function(c){return c&&"object"==typeof c&&"function"==typeof c.copy&&"function"==typeof c.fill&&"function"==typeof c.readUInt8}},function(z,l){z.exports="function"==typeof Object.create?function(c,s){c.super_=s,c.prototype=Object.create(s.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}})}:function(c,s){c.super_=s;var m=function(){};m.prototype=s.prototype,c.prototype=new m,c.prototype.constructor=c}},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.createHashFunction=function(m){return function(y){var n=m();return n.update(y),s.from(n.digest())}}}).call(this,c(2).Buffer)},function(z,l,c){z.exports=c(229)(c(239))},function(z,l,c){const s=c(230),m=c(238);z.exports=function(y){const n=s(y),o=m(y);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new n(1152,448,null,224,t);case"keccak256":return new n(1088,512,null,256,t);case"keccak384":return new n(832,768,null,384,t);case"keccak512":return new n(576,1024,null,512,t);case"sha3-224":return new n(1152,448,6,224,t);case"sha3-256":return new n(1088,512,6,256,t);case"sha3-384":return new n(832,768,6,384,t);case"sha3-512":return new n(576,1024,6,512,t);case"shake128":return new o(1344,256,31,t);case"shake256":return new o(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},function(z,l,c){(function(s){const{Transform:m}=c(111);z.exports=y=>class gt extends m{constructor(o,e,t,i,u){super(u),this._rate=o,this._capacity=e,this._delimitedSuffix=t,this._hashBitLength=i,this._options=u,this._state=new y,this._state.initialize(o,e),this._finalized=!1}_transform(o,e,t){let i=null;try{this.update(o,e)}catch(u){i=u}t(i)}_flush(o){let e=null;try{this.push(this.digest())}catch(t){e=t}o(e)}update(o,e){if(!s.isBuffer(o)&&"string"!=typeof o)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return s.isBuffer(o)||(o=s.from(o,e)),this._state.absorb(o),this}digest(o){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let e=this._state.squeeze(this._hashBitLength/8);return void 0!==o&&(e=e.toString(o)),this._resetState(),e}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const o=new gt(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(o._state),o._finalized=this._finalized,o}}}).call(this,c(2).Buffer)},function(z,l){},function(z,l,c){"use strict";function s(t,i){var u=Object.keys(t);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(t);i&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(t,f).enumerable})),u.push.apply(u,h)}return u}function m(t,i,u){return i in t?Object.defineProperty(t,i,{value:u,enumerable:!0,configurable:!0,writable:!0}):t[i]=u,t}function y(t,i){for(var u=0;u0?this.tail.next=d:this.head=d,this.tail=d,++this.length}},{key:"unshift",value:function(f){var d={data:f,next:this.head};0===this.length&&(this.tail=d),this.head=d,++this.length}},{key:"shift",value:function(){if(0!==this.length){var f=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(0===this.length)return"";for(var d=this.head,_=""+d.data;d=d.next;)_+=f+d.data;return _}},{key:"concat",value:function(f){if(0===this.length)return n.alloc(0);for(var T=n.allocUnsafe(f>>>0),O=this.head,b=0;O;)n.prototype.copy.call(O.data,T,b),b+=O.data.length,O=O.next;return T}},{key:"consume",value:function(f,d){var _;return fT.length?T.length:f;if(v+=O===T.length?T:T.slice(0,f),0==(f-=O)){O===T.length?(++_,this.head=d.next?d.next:this.tail=null):(this.head=d,d.data=T.slice(O));break}++_}return this.length-=_,v}},{key:"_getBuffer",value:function(f){var d=n.allocUnsafe(f),_=this.head,v=1;for(_.data.copy(d),f-=_.data.length;_=_.next;){var T=_.data,O=f>T.length?T.length:f;if(T.copy(d,d.length-f,0,O),0==(f-=O)){O===T.length?(++v,this.head=_.next?_.next:this.tail=null):(this.head=_,_.data=T.slice(O));break}++v}return this.length-=v,d}},{key:e,value:function(f,d){return o(this,function(_){for(var v=1;v0,function(w){_||(_=w),w&&T.forEach(t),S||(T.forEach(t),v(_))})});return f.reduce(i)}},function(z,l,c){(function(s){const{Transform:m}=c(111);z.exports=y=>class bt extends m{constructor(o,e,t,i){super(i),this._rate=o,this._capacity=e,this._delimitedSuffix=t,this._options=i,this._state=new y,this._state.initialize(o,e),this._finalized=!1}_transform(o,e,t){let i=null;try{this.update(o,e)}catch(u){i=u}t(i)}_flush(){}_read(o){this.push(this.squeeze(o))}update(o,e){if(!s.isBuffer(o)&&"string"!=typeof o)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return s.isBuffer(o)||(o=s.from(o,e)),this._state.absorb(o),this}squeeze(o,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let t=this._state.squeeze(o);return void 0!==e&&(t=t.toString(e)),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const o=new bt(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(o._state),o._finalized=this._finalized,o}}}).call(this,c(2).Buffer)},function(z,l,c){(function(s){const m=c(240);function y(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}y.prototype.initialize=function(n,o){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=n/8,this.count=0,this.squeezing=!1},y.prototype.absorb=function(n){for(let o=0;o>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(m.p1600(this.state),this.count=0);return o},y.prototype.copy=function(n){for(let o=0;o<50;++o)n.state[o]=this.state[o];n.blockSize=this.blockSize,n.count=this.count,n.squeezing=this.squeezing},z.exports=y}).call(this,c(2).Buffer)},function(z,l){const c=[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];l.p1600=function(s){for(let m=0;m<24;++m){const y=s[0]^s[10]^s[20]^s[30]^s[40],n=s[1]^s[11]^s[21]^s[31]^s[41],o=s[2]^s[12]^s[22]^s[32]^s[42],e=s[3]^s[13]^s[23]^s[33]^s[43],t=s[4]^s[14]^s[24]^s[34]^s[44],i=s[5]^s[15]^s[25]^s[35]^s[45],u=s[6]^s[16]^s[26]^s[36]^s[46],h=s[7]^s[17]^s[27]^s[37]^s[47],f=s[8]^s[18]^s[28]^s[38]^s[48],d=s[9]^s[19]^s[29]^s[39]^s[49];let _=f^(o<<1|e>>>31),v=d^(e<<1|o>>>31);const T=s[0]^_,O=s[1]^v,b=s[10]^_,S=s[11]^v,w=s[20]^_,A=s[21]^v,L=s[30]^_,H=s[31]^v,D=s[40]^_,q=s[41]^v;_=y^(t<<1|i>>>31),v=n^(i<<1|t>>>31);const k=s[2]^_,p=s[3]^v,x=s[12]^_,R=s[13]^v,r=s[22]^_,a=s[23]^v,g=s[32]^_,M=s[33]^v,E=s[42]^_,C=s[43]^v;_=o^(u<<1|h>>>31),v=e^(h<<1|u>>>31);const U=s[4]^_,V=s[5]^v,I=s[14]^_,W=s[15]^v,F=s[24]^_,B=s[25]^v,N=s[34]^_,P=s[35]^v,j=s[44]^_,K=s[45]^v;_=t^(f<<1|d>>>31),v=i^(d<<1|f>>>31);const Z=s[6]^_,J=s[7]^v,X=s[16]^_,ee=s[17]^v,te=s[26]^_,oe=s[27]^v,ve=s[36]^_,ie=s[37]^v,de=s[46]^_,fe=s[47]^v;_=u^(y<<1|n>>>31),v=h^(n<<1|y>>>31);const re=s[8]^_,_e=s[9]^v,Ke=s[18]^_,pe=s[19]^v,Te=s[28]^_,Ve=s[29]^v,be=s[38]^_,Pe=s[39]^v,Ye=s[48]^_,we=s[49]^v,Be=T,$e=O,Me=S<<4|b>>>28,je=b<<4|S>>>28,Q=w<<3|A>>>29,se=A<<3|w>>>29,le=H<<9|L>>>23,Le=L<<9|H>>>23,he=D<<18|q>>>14,Oe=q<<18|D>>>14,Ge=k<<1|p>>>31,me=p<<1|k>>>31,ze=R<<12|x>>>20,rt=x<<12|R>>>20,Re=r<<10|a>>>22,He=a<<10|r>>>22,Qe=M<<13|g>>>19,Ee=g<<13|M>>>19,Ne=E<<2|C>>>30,it=C<<2|E>>>30,xe=V<<30|U>>>2,qe=U<<30|V>>>2,et=I<<6|W>>>26,ke=W<<6|I>>>26,We=B<<11|F>>>21,tt=F<<11|B>>>21,Se=N<<15|P>>>17,Fe=P<<15|N>>>17,nt=K<<29|j>>>3,Ae=j<<29|K>>>3,Ue=Z<<28|J>>>4,Y=J<<28|Z>>>4,G=ee<<23|X>>>9,$=X<<23|ee>>>9,ne=te<<25|oe>>>7,ce=oe<<25|te>>>7,ue=ve<<21|ie>>>11,Ce=ie<<21|ve>>>11,Ie=fe<<24|de>>>8,De=de<<24|fe>>>8,ye=re<<27|_e>>>5,ae=_e<<27|re>>>5,Je=Ke<<20|pe>>>12,ot=pe<<20|Ke>>>12,at=Ve<<7|Te>>>25,st=Te<<7|Ve>>>25,ut=be<<8|Pe>>>24,Ze=Pe<<8|be>>>24,ct=Ye<<14|we>>>18,Xe=we<<14|Ye>>>18;s[0]=Be^~ze&We,s[1]=$e^~rt&tt,s[10]=Ue^~Je&Q,s[11]=Y^~ot&se,s[20]=Ge^~et&ne,s[21]=me^~ke&ce,s[30]=ye^~Me&Re,s[31]=ae^~je&He,s[40]=xe^~G&at,s[41]=qe^~$&st,s[2]=ze^~We&ue,s[3]=rt^~tt&Ce,s[12]=Je^~Q&Qe,s[13]=ot^~se&Ee,s[22]=et^~ne&ut,s[23]=ke^~ce&Ze,s[32]=Me^~Re&Se,s[33]=je^~He&Fe,s[42]=G^~at&le,s[43]=$^~st&Le,s[4]=We^~ue&ct,s[5]=tt^~Ce&Xe,s[14]=Q^~Qe&nt,s[15]=se^~Ee&Ae,s[24]=ne^~ut&he,s[25]=ce^~Ze&Oe,s[34]=Re^~Se&Ie,s[35]=He^~Fe&De,s[44]=at^~le&Ne,s[45]=st^~Le&it,s[6]=ue^~ct&Be,s[7]=Ce^~Xe&$e,s[16]=Qe^~nt&Ue,s[17]=Ee^~Ae&Y,s[26]=ut^~he&Ge,s[27]=Ze^~Oe&me,s[36]=Se^~Ie&ye,s[37]=Fe^~De&ae,s[46]=le^~Ne&xe,s[47]=Le^~it&qe,s[8]=ct^~Be&ze,s[9]=Xe^~$e&rt,s[18]=nt^~Ue&Je,s[19]=Ae^~Y&ot,s[28]=he^~Ge&et,s[29]=Oe^~me&ke,s[38]=Ie^~ye&Me,s[39]=De^~ae&je,s[48]=Ne^~xe&G,s[49]=it^~qe&$,s[0]^=c[2*m],s[1]^=c[2*m+1]}}},function(z,l,c){"use strict";(function(s){var m=c(118),y=c(266),n=c(267),o=function(e){return 32===e.length&&m.privateKeyVerify(Uint8Array.from(e))};z.exports={privateKeyVerify:o,privateKeyExport:function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var i=y.privateKeyExport(e,t);return n.privateKeyExport(e,i,t)},privateKeyImport:function(e){if(null!==(e=n.privateKeyImport(e))&&32===e.length&&o(e))return e;throw new Error("couldn't import from DER format")},privateKeyNegate:function(e){return s.from(m.privateKeyNegate(Uint8Array.from(e)))},privateKeyModInverse:function(e){if(32!==e.length)throw new Error("private key length is invalid");return s.from(y.privateKeyModInverse(Uint8Array.from(e)))},privateKeyTweakAdd:function(e,t){return s.from(m.privateKeyTweakAdd(Uint8Array.from(e),t))},privateKeyTweakMul:function(e,t){return s.from(m.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t)))},publicKeyCreate:function(e,t){return s.from(m.publicKeyCreate(Uint8Array.from(e),t))},publicKeyConvert:function(e,t){return s.from(m.publicKeyConvert(Uint8Array.from(e),t))},publicKeyVerify:function(e){return(33===e.length||65===e.length)&&m.publicKeyVerify(Uint8Array.from(e))},publicKeyTweakAdd:function(e,t,i){return s.from(m.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(t),i))},publicKeyTweakMul:function(e,t,i){return s.from(m.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t),i))},publicKeyCombine:function(e,t){var i=[];return e.forEach(function(u){i.push(Uint8Array.from(u))}),s.from(m.publicKeyCombine(i,t))},signatureNormalize:function(e){return s.from(m.signatureNormalize(Uint8Array.from(e)))},signatureExport:function(e){return s.from(m.signatureExport(Uint8Array.from(e)))},signatureImport:function(e){return s.from(m.signatureImport(Uint8Array.from(e)))},signatureImportLax:function(e){if(0===e.length)throw new RangeError("signature length is invalid");var t=n.signatureImportLax(e);if(null===t)throw new Error("couldn't parse DER signature");return y.signatureImport(t)},sign:function(e,t,i){if(null===i)throw new TypeError("options should be an Object");var u=void 0;if(i){if(u={},null===i.data)throw new TypeError("options.data should be a Buffer");if(i.data){if(32!==i.data.length)throw new RangeError("options.data length is invalid");u.data=new Uint8Array(i.data)}if(null===i.noncefn)throw new TypeError("options.noncefn should be a Function");i.noncefn&&(u.noncefn=function(f,d,_,v,T){var O=null!=_?s.from(_):null,b=null!=v?s.from(v):null,S=s.from("");return i.noncefn&&(S=i.noncefn(s.from(f),s.from(d),O,b,T)),Uint8Array.from(S)})}var h=m.ecdsaSign(Uint8Array.from(e),Uint8Array.from(t),u);return{signature:s.from(h.signature),recovery:h.recid}},verify:function(e,t,i){return m.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),i)},recover:function(e,t,i,u){return s.from(m.ecdsaRecover(Uint8Array.from(t),i,Uint8Array.from(e),u))},ecdh:function(e,t){return s.from(m.ecdh(Uint8Array.from(e),Uint8Array.from(t),{}))},ecdhUnsafe:function(e,t,i){if(33!==e.length&&65!==e.length)throw new RangeError("public key length is invalid");if(32!==t.length)throw new RangeError("private key length is invalid");return s.from(y.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(t),i))}}}).call(this,c(2).Buffer)},function(z,l){const c="Impossible case. Please create issue.",s="The tweak was out of range or the resulted private key is invalid",m="The tweak was out of range or equal to zero",o="Public Key could not be parsed",e="Public Key serialization error",i="Signature could not be parsed";function d(b,S){if(!b)throw new Error(S)}function _(b,S,w){if(d(S instanceof Uint8Array,`Expected ${b} to be an Uint8Array`),void 0!==w)if(Array.isArray(w)){const A=`Expected ${b} to be an Uint8Array with length [${w.join(", ")}]`;d(w.includes(S.length),A)}else d(S.length===w,`Expected ${b} to be an Uint8Array with length ${w}`)}function v(b){d("Boolean"===O(b),"Expected compressed to be a Boolean")}function T(b=(w=>new Uint8Array(w)),S){return"function"==typeof b&&(b=b(S)),_("output",b,S),b}function O(b){return Object.prototype.toString.call(b).slice(8,-1)}z.exports=b=>({contextRandomize(S){if(1===(d(null===S||S instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==S&&_("seed",S,32),b.contextRandomize(S)))throw new Error("Unknow error on context randomization")},privateKeyVerify:S=>(_("private key",S,32),0===b.privateKeyVerify(S)),privateKeyNegate(S){switch(_("private key",S,32),b.privateKeyNegate(S)){case 0:return S;case 1:throw new Error(c)}},privateKeyTweakAdd(S,w){switch(_("private key",S,32),_("tweak",w,32),b.privateKeyTweakAdd(S,w)){case 0:return S;case 1:throw new Error(s)}},privateKeyTweakMul(S,w){switch(_("private key",S,32),_("tweak",w,32),b.privateKeyTweakMul(S,w)){case 0:return S;case 1:throw new Error(m)}},publicKeyVerify:S=>(_("public key",S,[33,65]),0===b.publicKeyVerify(S)),publicKeyCreate(S,w=!0,A){switch(_("private key",S,32),v(w),A=T(A,w?33:65),b.publicKeyCreate(A,S)){case 0:return A;case 1:throw new Error("Private Key is invalid");case 2:throw new Error(e)}},publicKeyConvert(S,w=!0,A){switch(_("public key",S,[33,65]),v(w),A=T(A,w?33:65),b.publicKeyConvert(A,S)){case 0:return A;case 1:throw new Error(o);case 2:throw new Error(e)}},publicKeyNegate(S,w=!0,A){switch(_("public key",S,[33,65]),v(w),A=T(A,w?33:65),b.publicKeyNegate(A,S)){case 0:return A;case 1:throw new Error(o);case 2:throw new Error(c);case 3:throw new Error(e)}},publicKeyCombine(S,w=!0,A){d(Array.isArray(S),"Expected public keys to be an Array"),d(S.length>0,"Expected public keys array will have more than zero items");for(const L of S)_("public key",L,[33,65]);switch(v(w),A=T(A,w?33:65),b.publicKeyCombine(A,S)){case 0:return A;case 1:throw new Error(o);case 2:throw new Error("The sum of the public keys is not valid");case 3:throw new Error(e)}},publicKeyTweakAdd(S,w,A=!0,L){switch(_("public key",S,[33,65]),_("tweak",w,32),v(A),L=T(L,A?33:65),b.publicKeyTweakAdd(L,S,w)){case 0:return L;case 1:throw new Error(o);case 2:throw new Error(s)}},publicKeyTweakMul(S,w,A=!0,L){switch(_("public key",S,[33,65]),_("tweak",w,32),v(A),L=T(L,A?33:65),b.publicKeyTweakMul(L,S,w)){case 0:return L;case 1:throw new Error(o);case 2:throw new Error(m)}},signatureNormalize(S){switch(_("signature",S,64),b.signatureNormalize(S)){case 0:return S;case 1:throw new Error(i)}},signatureExport(S,w){_("signature",S,64);const A={output:w=T(w,72),outputlen:72};switch(b.signatureExport(A,S)){case 0:return w.slice(0,A.outputlen);case 1:throw new Error(i);case 2:throw new Error(c)}},signatureImport(S,w){switch(_("signature",S),w=T(w,64),b.signatureImport(w,S)){case 0:return w;case 1:throw new Error(i);case 2:throw new Error(c)}},ecdsaSign(S,w,A={},L){_("message",S,32),_("private key",w,32),d("Object"===O(A),"Expected options to be an Object"),void 0!==A.data&&_("options.data",A.data),void 0!==A.noncefn&&d("Function"===O(A.noncefn),"Expected options.noncefn to be a Function");const H={signature:L=T(L,64),recid:null};switch(b.ecdsaSign(H,S,w,A.data,A.noncefn)){case 0:return H;case 1:throw new Error("The nonce generation function failed, or the private key was invalid");case 2:throw new Error(c)}},ecdsaVerify(S,w,A){switch(_("signature",S,64),_("message",w,32),_("public key",A,[33,65]),b.ecdsaVerify(S,w,A)){case 0:return!0;case 3:return!1;case 1:throw new Error(i);case 2:throw new Error(o)}},ecdsaRecover(S,w,A,L=!0,H){switch(_("signature",S,64),d("Number"===O(w)&&w>=0&&w<=3,"Expected recovery id to be a Number within interval [0, 3]"),_("message",A,32),v(L),H=T(H,L?33:65),b.ecdsaRecover(H,S,w,A)){case 0:return H;case 1:throw new Error(i);case 2:throw new Error("Public key could not be recover");case 3:throw new Error(c)}},ecdh(S,w,A={},L){switch(_("public key",S,[33,65]),_("private key",w,32),d("Object"===O(A),"Expected options to be an Object"),void 0!==A.data&&_("options.data",A.data),void 0!==A.hashfn?(d("Function"===O(A.hashfn),"Expected options.hashfn to be a Function"),void 0!==A.xbuf&&_("options.xbuf",A.xbuf,32),void 0!==A.ybuf&&_("options.ybuf",A.ybuf,32),_("output",L)):L=T(L,32),b.ecdh(L,S,w,A.data,A.hashfn,A.xbuf,A.ybuf)){case 0:return L;case 1:throw new Error(o);case 2:throw new Error("Scalar was invalid (zero or overflow)")}}})},function(z,l,c){const s=new(c(58).ec)("secp256k1"),m=s.curve,y=m.n.constructor;function n(e){const t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(i,u){let h=new y(u);if(h.cmp(m.p)>=0)return null;h=h.toRed(m.red);let f=h.redSqr().redIMul(h).redIAdd(m.b).redSqrt();return 3===i!==f.isOdd()&&(f=f.redNeg()),s.keyPair({pub:{x:h,y:f}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(i,u,h){let f=new y(u),d=new y(h);if(f.cmp(m.p)>=0||d.cmp(m.p)>=0||(f=f.toRed(m.red),d=d.toRed(m.red),(6===i||7===i)&&d.isOdd()!==(7===i)))return null;const _=f.redSqr().redIMul(f);return d.redSqr().redISub(_.redIAdd(m.b)).isZero()?s.keyPair({pub:{x:f,y:d}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function o(e,t){const i=t.encode(null,33===e.length);for(let u=0;u0,privateKeyVerify(e){const t=new y(e);return t.cmp(m.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new y(e),i=m.n.sub(t).umod(m.n).toArrayLike(Uint8Array,"be",32);return e.set(i),0},privateKeyTweakAdd(e,t){const i=new y(t);if(i.cmp(m.n)>=0||(i.iadd(new y(e)),i.cmp(m.n)>=0&&i.isub(m.n),i.isZero()))return 1;const u=i.toArrayLike(Uint8Array,"be",32);return e.set(u),0},privateKeyTweakMul(e,t){let i=new y(t);if(i.cmp(m.n)>=0||i.isZero())return 1;i.imul(new y(e)),i.cmp(m.n)>=0&&(i=i.umod(m.n));const u=i.toArrayLike(Uint8Array,"be",32);return e.set(u),0},publicKeyVerify:e=>null===n(e)?1:0,publicKeyCreate(e,t){const i=new y(t);return i.cmp(m.n)>=0||i.isZero()?1:(o(e,s.keyFromPrivate(t).getPublic()),0)},publicKeyConvert(e,t){const i=n(t);return null===i?1:(o(e,i.getPublic()),0)},publicKeyNegate(e,t){const i=n(t);if(null===i)return 1;const u=i.getPublic();return u.y=u.y.redNeg(),o(e,u),0},publicKeyCombine(e,t){const i=new Array(t.length);for(let h=0;h=0)return 2;const h=u.getPublic().add(m.g.mul(i));return h.isInfinity()?2:(o(e,h),0)},publicKeyTweakMul(e,t,i){const u=n(t);return null===u?1:(i=new y(i)).cmp(m.n)>=0||i.isZero()?2:(o(e,u.getPublic().mul(i)),0)},signatureNormalize(e){const t=new y(e.subarray(0,32)),i=new y(e.subarray(32,64));return t.cmp(m.n)>=0||i.cmp(m.n)>=0?1:(1===i.cmp(s.nh)&&e.set(m.n.sub(i).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const i=t.subarray(0,32),u=t.subarray(32,64);if(new y(i).cmp(m.n)>=0||new y(u).cmp(m.n)>=0)return 1;const{output:h}=e;let f=h.subarray(4,37);f[0]=0,f.set(i,1);let d=33,_=0;for(;d>1&&0===f[_]&&!(128&f[_+1]);--d,++_);if(f=f.subarray(_),128&f[0]||d>1&&0===f[0]&&!(128&f[1]))return 1;let v=h.subarray(39,72);v[0]=0,v.set(u,1);let T=33,O=0;for(;T>1&&0===v[O]&&!(128&v[O+1]);--T,++O);return v=v.subarray(O),128&v[0]||T>1&&0===v[0]&&!(128&v[1])?1:(e.outputlen=6+d+T,h[0]=48,h[1]=e.outputlen-2,h[2]=2,h[3]=f.length,h.set(f,4),h[4+d]=2,h[5+d]=v.length,h.set(v,6+d),0)},signatureImport(e,t){if(t.length<8||t.length>72||48!==t[0]||t[1]!==t.length-2||2!==t[2])return 1;const i=t[3];if(0===i||5+i>=t.length||2!==t[4+i])return 1;const u=t[5+i];if(0===u||6+i+u!==t.length||128&t[4]||i>1&&0===t[4]&&!(128&t[5])||128&t[i+6]||u>1&&0===t[i+6]&&!(128&t[i+7]))return 1;let h=t.subarray(4,4+i);if(33===h.length&&0===h[0]&&(h=h.subarray(1)),h.length>32)return 1;let f=t.subarray(6+i);if(33===f.length&&0===f[0]&&(f=f.slice(1)),f.length>32)throw new Error("S length is too long");let d=new y(h);d.cmp(m.n)>=0&&(d=new y(0));let _=new y(t.subarray(6+i));return _.cmp(m.n)>=0&&(_=new y(0)),e.set(d.toArrayLike(Uint8Array,"be",32),0),e.set(_.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,i,u,h){if(h){const _=h;h=v=>{const T=_(t,i,null,u,v);if(!(T instanceof Uint8Array&&32===T.length))throw new Error("This is the way");return new y(T)}}const f=new y(i);if(f.cmp(m.n)>=0||f.isZero())return 1;let d;try{d=s.sign(t,i,{canonical:!0,k:h,pers:u})}catch{return 1}return e.signature.set(d.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(d.s.toArrayLike(Uint8Array,"be",32),32),e.recid=d.recoveryParam,0},ecdsaVerify(e,t,i){const u={r:e.subarray(0,32),s:e.subarray(32,64)},h=new y(u.r),f=new y(u.s);if(h.cmp(m.n)>=0||f.cmp(m.n)>=0)return 1;if(1===f.cmp(s.nh)||h.isZero()||f.isZero())return 3;const d=n(i);if(null===d)return 2;const _=d.getPublic();return s.verify(t,u,_)?0:3},ecdsaRecover(e,t,i,u){const h={r:t.slice(0,32),s:t.slice(32,64)},f=new y(h.r),d=new y(h.s);if(f.cmp(m.n)>=0||d.cmp(m.n)>=0)return 1;if(f.isZero()||d.isZero())return 2;let _;try{_=s.recoverPubKey(u,h,i)}catch{return 2}return o(e,_),0},ecdh(e,t,i,u,h,f,d){const _=n(t);if(null===_)return 1;const v=new y(i);if(v.cmp(m.n)>=0||v.isZero())return 2;const T=_.getPublic().mul(v);if(void 0===h){const O=T.encode(null,!0),b=s.hash().update(O).digest();for(let S=0;S<32;++S)e[S]=b[S]}else{f||(f=new Uint8Array(32));const O=T.getX().toArray("be",32);for(let w=0;w<32;++w)f[w]=O[w];d||(d=new Uint8Array(32));const b=T.getY().toArray("be",32);for(let w=0;w<32;++w)d[w]=b[w];const S=h(f,d,u);if(!(S instanceof Uint8Array&&S.length===e.length))return 2;e.set(S)}return 0}}},function(z){z.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny ","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(z,l){},function(z,l){},function(z,l,c){"use strict";var s=c(11),m=c(16),y=c(3),n=c(45),o=s.assert;function e(u){n.call(this,"short",u),this.a=new m(u.a,16).toRed(this.red),this.b=new m(u.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(u),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function t(u,h,f,d){n.BasePoint.call(this,u,"affine"),null===h&&null===f?(this.x=null,this.y=null,this.inf=!0):(this.x=new m(h,16),this.y=new m(f,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function i(u,h,f,d){n.BasePoint.call(this,u,"jacobian"),null===h&&null===f&&null===d?(this.x=this.curve.one,this.y=this.curve.one,this.z=new m(0)):(this.x=new m(h,16),this.y=new m(f,16),this.z=new m(d,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}y(e,n),z.exports=e,e.prototype._getEndomorphism=function(u){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var h,f;if(u.beta)h=new m(u.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);h=(h=d[0].cmp(d[1])<0?d[0]:d[1]).toRed(this.red)}if(u.lambda)f=new m(u.lambda,16);else{var _=this._getEndoRoots(this.n);0===this.g.mul(_[0]).x.cmp(this.g.x.redMul(h))?f=_[0]:o(0===this.g.mul(f=_[1]).x.cmp(this.g.x.redMul(h)))}return{beta:h,lambda:f,basis:u.basis?u.basis.map(function(v){return{a:new m(v.a,16),b:new m(v.b,16)}}):this._getEndoBasis(f)}}},e.prototype._getEndoRoots=function(u){var h=u===this.p?this.red:m.mont(u),f=new m(2).toRed(h).redInvm(),d=f.redNeg(),_=new m(3).toRed(h).redNeg().redSqrt().redMul(f);return[d.redAdd(_).fromRed(),d.redSub(_).fromRed()]},e.prototype._getEndoBasis=function(u){for(var h,f,d,_,v,T,O,b,S,w=this.n.ushrn(Math.floor(this.n.bitLength()/2)),A=u,L=this.n.clone(),H=new m(1),D=new m(0),q=new m(0),k=new m(1),p=0;0!==A.cmpn(0);){var x=L.div(A);b=L.sub(x.mul(A)),S=q.sub(x.mul(H));var R=k.sub(x.mul(D));if(!d&&b.cmp(w)<0)h=O.neg(),f=H,d=b.neg(),_=S;else if(d&&2==++p)break;O=b,L=A,A=b,q=H,H=S,k=D,D=R}v=b.neg(),T=S;var r=d.sqr().add(_.sqr());return v.sqr().add(T.sqr()).cmp(r)>=0&&(v=h,T=f),d.negative&&(d=d.neg(),_=_.neg()),v.negative&&(v=v.neg(),T=T.neg()),[{a:d,b:_},{a:v,b:T}]},e.prototype._endoSplit=function(u){var h=this.endo.basis,f=h[0],d=h[1],_=d.b.mul(u).divRound(this.n),v=f.b.neg().mul(u).divRound(this.n),T=_.mul(f.a),O=v.mul(d.a),b=_.mul(f.b),S=v.mul(d.b);return{k1:u.sub(T).sub(O),k2:b.add(S).neg()}},e.prototype.pointFromX=function(u,h){(u=new m(u,16)).red||(u=u.toRed(this.red));var f=u.redSqr().redMul(u).redIAdd(u.redMul(this.a)).redIAdd(this.b),d=f.redSqrt();if(0!==d.redSqr().redSub(f).cmp(this.zero))throw new Error("invalid point");var _=d.fromRed().isOdd();return(h&&!_||!h&&_)&&(d=d.redNeg()),this.point(u,d)},e.prototype.validate=function(u){if(u.inf)return!0;var h=u.x,f=u.y,d=this.a.redMul(h),_=h.redSqr().redMul(h).redIAdd(d).redIAdd(this.b);return 0===f.redSqr().redISub(_).cmpn(0)},e.prototype._endoWnafMulAdd=function(u,h,f){for(var d=this._endoWnafT1,_=this._endoWnafT2,v=0;v":""},t.prototype.isInfinity=function(){return this.inf},t.prototype.add=function(u){if(this.inf)return u;if(u.inf)return this;if(this.eq(u))return this.dbl();if(this.neg().eq(u))return this.curve.point(null,null);if(0===this.x.cmp(u.x))return this.curve.point(null,null);var h=this.y.redSub(u.y);0!==h.cmpn(0)&&(h=h.redMul(this.x.redSub(u.x).redInvm()));var f=h.redSqr().redISub(this.x).redISub(u.x),d=h.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,d)},t.prototype.dbl=function(){if(this.inf)return this;var u=this.y.redAdd(this.y);if(0===u.cmpn(0))return this.curve.point(null,null);var h=this.curve.a,f=this.x.redSqr(),d=u.redInvm(),_=f.redAdd(f).redIAdd(f).redIAdd(h).redMul(d),v=_.redSqr().redISub(this.x.redAdd(this.x)),T=_.redMul(this.x.redSub(v)).redISub(this.y);return this.curve.point(v,T)},t.prototype.getX=function(){return this.x.fromRed()},t.prototype.getY=function(){return this.y.fromRed()},t.prototype.mul=function(u){return u=new m(u,16),this.isInfinity()?this:this._hasDoubles(u)?this.curve._fixedNafMul(this,u):this.curve.endo?this.curve._endoWnafMulAdd([this],[u]):this.curve._wnafMul(this,u)},t.prototype.mulAdd=function(u,h,f){var d=[this,h],_=[u,f];return this.curve.endo?this.curve._endoWnafMulAdd(d,_):this.curve._wnafMulAdd(1,d,_,2)},t.prototype.jmulAdd=function(u,h,f){var d=[this,h],_=[u,f];return this.curve.endo?this.curve._endoWnafMulAdd(d,_,!0):this.curve._wnafMulAdd(1,d,_,2,!0)},t.prototype.eq=function(u){return this===u||this.inf===u.inf&&(this.inf||0===this.x.cmp(u.x)&&0===this.y.cmp(u.y))},t.prototype.neg=function(u){if(this.inf)return this;var h=this.curve.point(this.x,this.y.redNeg());if(u&&this.precomputed){var f=this.precomputed,d=function(_){return _.neg()};h.precomputed={naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(d)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(d)}}}return h},t.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(i,n.BasePoint),e.prototype.jpoint=function(u,h,f){return new i(this,u,h,f)},i.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var u=this.z.redInvm(),h=u.redSqr(),f=this.x.redMul(h),d=this.y.redMul(h).redMul(u);return this.curve.point(f,d)},i.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},i.prototype.add=function(u){if(this.isInfinity())return u;if(u.isInfinity())return this;var h=u.z.redSqr(),f=this.z.redSqr(),d=this.x.redMul(h),_=u.x.redMul(f),v=this.y.redMul(h.redMul(u.z)),T=u.y.redMul(f.redMul(this.z)),O=d.redSub(_),b=v.redSub(T);if(0===O.cmpn(0))return 0!==b.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var S=O.redSqr(),w=S.redMul(O),A=d.redMul(S),L=b.redSqr().redIAdd(w).redISub(A).redISub(A),H=b.redMul(A.redISub(L)).redISub(v.redMul(w)),D=this.z.redMul(u.z).redMul(O);return this.curve.jpoint(L,H,D)},i.prototype.mixedAdd=function(u){if(this.isInfinity())return u.toJ();if(u.isInfinity())return this;var h=this.z.redSqr(),f=this.x,d=u.x.redMul(h),_=this.y,v=u.y.redMul(h).redMul(this.z),T=f.redSub(d),O=_.redSub(v);if(0===T.cmpn(0))return 0!==O.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var b=T.redSqr(),S=b.redMul(T),w=f.redMul(b),A=O.redSqr().redIAdd(S).redISub(w).redISub(w),L=O.redMul(w.redISub(A)).redISub(_.redMul(S)),H=this.z.redMul(T);return this.curve.jpoint(A,L,H)},i.prototype.dblp=function(u){if(0===u)return this;if(this.isInfinity())return this;if(!u)return this.dbl();var h;if(this.curve.zeroA||this.curve.threeA){var f=this;for(h=0;h=0)return!1;if(f.redIAdd(_),0===this.x.cmp(f))return!0}},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(z,l,c){"use strict";var s=c(16),m=c(3),y=c(45),n=c(11);function o(t){y.call(this,"mont",t),this.a=new s(t.a,16).toRed(this.red),this.b=new s(t.b,16).toRed(this.red),this.i4=new s(4).toRed(this.red).redInvm(),this.two=new s(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function e(t,i,u){y.BasePoint.call(this,t,"projective"),null===i&&null===u?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new s(i,16),this.z=new s(u,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}m(o,y),z.exports=o,o.prototype.validate=function(t){var i=t.normalize().x,u=i.redSqr(),h=u.redMul(i).redAdd(u.redMul(this.a)).redAdd(i);return 0===h.redSqrt().redSqr().cmp(h)},m(e,y.BasePoint),o.prototype.decodePoint=function(t,i){return this.point(n.toArray(t,i),1)},o.prototype.point=function(t,i){return new e(this,t,i)},o.prototype.pointFromJSON=function(t){return e.fromJSON(this,t)},e.prototype.precompute=function(){},e.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},e.fromJSON=function(t,i){return new e(t,i[0],i[1]||t.one)},e.prototype.inspect=function(){return this.isInfinity()?"":""},e.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},e.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),i=this.x.redSub(this.z).redSqr(),u=t.redSub(i),h=t.redMul(i),f=u.redMul(i.redAdd(this.curve.a24.redMul(u)));return this.curve.point(h,f)},e.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},e.prototype.diffAdd=function(t,i){var u=this.x.redAdd(this.z),h=this.x.redSub(this.z),f=t.x.redAdd(t.z),d=t.x.redSub(t.z).redMul(u),_=f.redMul(h),v=i.z.redMul(d.redAdd(_).redSqr()),T=i.x.redMul(d.redISub(_).redSqr());return this.curve.point(v,T)},e.prototype.mul=function(t){for(var i=t.clone(),u=this,h=this.curve.point(null,null),f=[];0!==i.cmpn(0);i.iushrn(1))f.push(i.andln(1));for(var d=f.length-1;d>=0;d--)0===f[d]?(u=u.diffAdd(h,this),h=h.dbl()):(h=u.diffAdd(h,this),u=u.dbl());return h},e.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},e.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},e.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},e.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},e.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(z,l,c){"use strict";var s=c(11),m=c(16),y=c(3),n=c(45),o=s.assert;function e(i){this.twisted=1!=(0|i.a),this.mOneA=this.twisted&&-1==(0|i.a),this.extended=this.mOneA,n.call(this,"edwards",i),this.a=new m(i.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new m(i.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new m(i.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|i.c)}function t(i,u,h,f,d){n.BasePoint.call(this,i,"projective"),null===u&&null===h&&null===f?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new m(u,16),this.y=new m(h,16),this.z=f?new m(f,16):this.curve.one,this.t=d&&new m(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}y(e,n),z.exports=e,e.prototype._mulA=function(i){return this.mOneA?i.redNeg():this.a.redMul(i)},e.prototype._mulC=function(i){return this.oneC?i:this.c.redMul(i)},e.prototype.jpoint=function(i,u,h,f){return this.point(i,u,h,f)},e.prototype.pointFromX=function(i,u){(i=new m(i,16)).red||(i=i.toRed(this.red));var h=i.redSqr(),f=this.c2.redSub(this.a.redMul(h)),d=this.one.redSub(this.c2.redMul(this.d).redMul(h)),_=f.redMul(d.redInvm()),v=_.redSqrt();if(0!==v.redSqr().redSub(_).cmp(this.zero))throw new Error("invalid point");var T=v.fromRed().isOdd();return(u&&!T||!u&&T)&&(v=v.redNeg()),this.point(i,v)},e.prototype.pointFromY=function(i,u){(i=new m(i,16)).red||(i=i.toRed(this.red));var h=i.redSqr(),f=h.redSub(this.c2),d=h.redMul(this.d).redMul(this.c2).redSub(this.a),_=f.redMul(d.redInvm());if(0===_.cmp(this.zero)){if(u)throw new Error("invalid point");return this.point(this.zero,i)}var v=_.redSqrt();if(0!==v.redSqr().redSub(_).cmp(this.zero))throw new Error("invalid point");return v.fromRed().isOdd()!==u&&(v=v.redNeg()),this.point(v,i)},e.prototype.validate=function(i){if(i.isInfinity())return!0;i.normalize();var u=i.x.redSqr(),h=i.y.redSqr(),f=u.redMul(this.a).redAdd(h),d=this.c2.redMul(this.one.redAdd(this.d.redMul(u).redMul(h)));return 0===f.cmp(d)},y(t,n.BasePoint),e.prototype.pointFromJSON=function(i){return t.fromJSON(this,i)},e.prototype.point=function(i,u,h,f){return new t(this,i,u,h,f)},t.fromJSON=function(i,u){return new t(i,u[0],u[1],u[2])},t.prototype.inspect=function(){return this.isInfinity()?"":""},t.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},t.prototype._extDbl=function(){var i=this.x.redSqr(),u=this.y.redSqr(),h=this.z.redSqr();h=h.redIAdd(h);var f=this.curve._mulA(i),d=this.x.redAdd(this.y).redSqr().redISub(i).redISub(u),_=f.redAdd(u),v=_.redSub(h),T=f.redSub(u),O=d.redMul(v),b=_.redMul(T),S=d.redMul(T),w=v.redMul(_);return this.curve.point(O,b,w,S)},t.prototype._projDbl=function(){var i,u,h,f,d,_,v=this.x.redAdd(this.y).redSqr(),T=this.x.redSqr(),O=this.y.redSqr();if(this.curve.twisted){var b=(f=this.curve._mulA(T)).redAdd(O);this.zOne?(i=v.redSub(T).redSub(O).redMul(b.redSub(this.curve.two)),u=b.redMul(f.redSub(O)),h=b.redSqr().redSub(b).redSub(b)):(d=this.z.redSqr(),_=b.redSub(d).redISub(d),i=v.redSub(T).redISub(O).redMul(_),u=b.redMul(f.redSub(O)),h=b.redMul(_))}else f=T.redAdd(O),d=this.curve._mulC(this.z).redSqr(),_=f.redSub(d).redSub(d),i=this.curve._mulC(v.redISub(f)).redMul(_),u=this.curve._mulC(f).redMul(T.redISub(O)),h=f.redMul(_);return this.curve.point(i,u,h)},t.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},t.prototype._extAdd=function(i){var u=this.y.redSub(this.x).redMul(i.y.redSub(i.x)),h=this.y.redAdd(this.x).redMul(i.y.redAdd(i.x)),f=this.t.redMul(this.curve.dd).redMul(i.t),d=this.z.redMul(i.z.redAdd(i.z)),_=h.redSub(u),v=d.redSub(f),T=d.redAdd(f),O=h.redAdd(u),b=_.redMul(v),S=T.redMul(O),w=_.redMul(O),A=v.redMul(T);return this.curve.point(b,S,A,w)},t.prototype._projAdd=function(i){var u,h,f=this.z.redMul(i.z),d=f.redSqr(),_=this.x.redMul(i.x),v=this.y.redMul(i.y),T=this.curve.d.redMul(_).redMul(v),O=d.redSub(T),b=d.redAdd(T),S=this.x.redAdd(this.y).redMul(i.x.redAdd(i.y)).redISub(_).redISub(v),w=f.redMul(O).redMul(S);return this.curve.twisted?(u=f.redMul(b).redMul(v.redSub(this.curve._mulA(_))),h=O.redMul(b)):(u=f.redMul(b).redMul(v.redSub(_)),h=this.curve._mulC(O).redMul(b)),this.curve.point(w,u,h)},t.prototype.add=function(i){return this.isInfinity()?i:i.isInfinity()?this:this.curve.extended?this._extAdd(i):this._projAdd(i)},t.prototype.mul=function(i){return this._hasDoubles(i)?this.curve._fixedNafMul(this,i):this.curve._wnafMul(this,i)},t.prototype.mulAdd=function(i,u,h){return this.curve._wnafMulAdd(1,[this,u],[i,h],2,!1)},t.prototype.jmulAdd=function(i,u,h){return this.curve._wnafMulAdd(1,[this,u],[i,h],2,!0)},t.prototype.normalize=function(){if(this.zOne)return this;var i=this.z.redInvm();return this.x=this.x.redMul(i),this.y=this.y.redMul(i),this.t&&(this.t=this.t.redMul(i)),this.z=this.curve.one,this.zOne=!0,this},t.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},t.prototype.getX=function(){return this.normalize(),this.x.fromRed()},t.prototype.getY=function(){return this.normalize(),this.y.fromRed()},t.prototype.eq=function(i){return this===i||0===this.getX().cmp(i.getX())&&0===this.getY().cmp(i.getY())},t.prototype.eqXToP=function(i){var u=i.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(u))return!0;for(var h=i.clone(),f=this.curve.redN.redMul(this.z);;){if(h.iadd(this.curve.n),h.cmp(this.curve.p)>=0)return!1;if(u.redIAdd(f),0===this.x.cmp(u))return!0}},t.prototype.toP=t.prototype.normalize,t.prototype.mixedAdd=t.prototype.add},function(z,l,c){"use strict";l.sha1=c(251),l.sha224=c(252),l.sha256=c(124),l.sha384=c(253),l.sha512=c(125)},function(z,l,c){"use strict";var s=c(15),m=c(37),y=c(123),n=s.rotl32,o=s.sum32,e=s.sum32_5,t=y.ft_1,i=m.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;i.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}s.inherits(h,i),z.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(f,d){for(var _=this.W,v=0;v<16;v++)_[v]=f[d+v];for(;v<_.length;v++)_[v]=n(_[v-3]^_[v-8]^_[v-14]^_[v-16],1);var T=this.h[0],O=this.h[1],b=this.h[2],S=this.h[3],w=this.h[4];for(v=0;v<_.length;v++){var A=~~(v/20),L=e(n(T,5),t(A,O,b,S),w,_[v],u[A]);w=S,S=b,b=n(O,30),O=T,T=L}this.h[0]=o(this.h[0],T),this.h[1]=o(this.h[1],O),this.h[2]=o(this.h[2],b),this.h[3]=o(this.h[3],S),this.h[4]=o(this.h[4],w)},h.prototype._digest=function(f){return"hex"===f?s.toHex32(this.h,"big"):s.split32(this.h,"big")}},function(z,l,c){"use strict";var s=c(15),m=c(124);function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}s.inherits(y,m),z.exports=y,y.blockSize=512,y.outSize=224,y.hmacStrength=192,y.padLength=64,y.prototype._digest=function(n){return"hex"===n?s.toHex32(this.h.slice(0,7),"big"):s.split32(this.h.slice(0,7),"big")}},function(z,l,c){"use strict";var s=c(15),m=c(125);function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}s.inherits(y,m),z.exports=y,y.blockSize=1024,y.outSize=384,y.hmacStrength=192,y.padLength=128,y.prototype._digest=function(n){return"hex"===n?s.toHex32(this.h.slice(0,12),"big"):s.split32(this.h.slice(0,12),"big")}},function(z,l,c){"use strict";var s=c(15),m=c(37),y=s.rotl32,n=s.sum32,o=s.sum32_3,e=s.sum32_4,t=m.BlockHash;function i(){if(!(this instanceof i))return new i;t.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(O,b,S,w){return O<=15?b^S^w:O<=31?b&S|~b&w:O<=47?(b|~S)^w:O<=63?b&w|S&~w:b^(S|~w)}function h(O){return O<=15?0:O<=31?1518500249:O<=47?1859775393:O<=63?2400959708:2840853838}function f(O){return O<=15?1352829926:O<=31?1548603684:O<=47?1836072691:O<=63?2053994217:0}s.inherits(i,t),l.ripemd160=i,i.blockSize=512,i.outSize=160,i.hmacStrength=192,i.padLength=64,i.prototype._update=function(O,b){for(var S=this.h[0],w=this.h[1],A=this.h[2],L=this.h[3],H=this.h[4],D=S,q=w,k=A,p=L,x=H,R=0;R<80;R++){var r=n(y(e(S,u(R,w,A,L),O[d[R]+b],h(R)),v[R]),H);S=H,H=L,L=y(A,10),A=w,w=r,r=n(y(e(D,u(79-R,q,k,p),O[_[R]+b],f(R)),T[R]),x),D=x,x=p,p=y(k,10),k=q,q=r}r=o(this.h[1],A,p),this.h[1]=o(this.h[2],L,x),this.h[2]=o(this.h[3],H,D),this.h[3]=o(this.h[4],S,q),this.h[4]=o(this.h[0],w,k),this.h[0]=r},i.prototype._digest=function(O){return"hex"===O?s.toHex32(this.h,"little"):s.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],_=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],v=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],T=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(z,l,c){"use strict";var s=c(15),m=c(22);function y(n,o,e){if(!(this instanceof y))return new y(n,o,e);this.Hash=n,this.blockSize=n.blockSize/8,this.outSize=n.outSize/8,this.inner=null,this.outer=null,this._init(s.toArray(o,e))}z.exports=y,y.prototype._init=function(n){n.length>this.blockSize&&(n=(new this.Hash).update(n).digest()),m(n.length<=this.blockSize);for(var o=n.length;o0))return v.iaddn(1),this.keyFromPrivate(v)}},u.prototype._truncateToN=function(h,f){var d=8*h.byteLength()-this.n.bitLength();return d>0&&(h=h.ushrn(d)),!f&&h.cmp(this.n)>=0?h.sub(this.n):h},u.prototype.sign=function(h,f,d,_){"object"==typeof d&&(_=d,d=null),_||(_={}),f=this.keyFromPrivate(f,d),h=this._truncateToN(new s(h,16));for(var v=this.n.byteLength(),T=f.getPrivate().toArray("be",v),O=h.toArray("be",v),b=new m({hash:this.hash,entropy:T,nonce:O,pers:_.pers,persEnc:_.persEnc||"utf8"}),S=this.n.sub(new s(1)),w=0;;w++){var A=_.k?_.k(w):new s(b.generate(this.n.byteLength()));if(!((A=this._truncateToN(A,!0)).cmpn(1)<=0||A.cmp(S)>=0)){var L=this.g.mul(A);if(!L.isInfinity()){var H=L.getX(),D=H.umod(this.n);if(0!==D.cmpn(0)){var q=A.invm(this.n).mul(D.mul(f.getPrivate()).iadd(h));if(0!==(q=q.umod(this.n)).cmpn(0)){var k=(L.getY().isOdd()?1:0)|(0!==H.cmp(D)?2:0);return _.canonical&&q.cmp(this.nh)>0&&(q=this.n.sub(q),k^=1),new i({r:D,s:q,recoveryParam:k})}}}}}},u.prototype.verify=function(h,f,d,_){h=this._truncateToN(new s(h,16)),d=this.keyFromPublic(d,_);var v=(f=new i(f,"hex")).r,T=f.s;if(v.cmpn(1)<0||v.cmp(this.n)>=0||T.cmpn(1)<0||T.cmp(this.n)>=0)return!1;var O,b=T.invm(this.n),S=b.mul(h).umod(this.n),w=b.mul(v).umod(this.n);return this.curve._maxwellTrick?!(O=this.g.jmulAdd(S,d.getPublic(),w)).isInfinity()&&O.eqXToP(v):!(O=this.g.mulAdd(S,d.getPublic(),w)).isInfinity()&&0===O.getX().umod(this.n).cmp(v)},u.prototype.recoverPubKey=function(h,f,d,_){e((3&d)===d,"The recovery param is more than two bits"),f=new i(f,_);var v=this.n,T=new s(h),O=f.r,b=f.s,S=1&d,w=d>>1;if(O.cmp(this.curve.p.umod(this.curve.n))>=0&&w)throw new Error("Unable to find sencond key candinate");O=this.curve.pointFromX(w?O.add(this.curve.n):O,S);var A=f.r.invm(v),L=v.sub(T).mul(A).umod(v),H=b.mul(A).umod(v);return this.g.mulAdd(L,O,H)},u.prototype.getKeyRecoveryParam=function(h,f,d,_){if(null!==(f=new i(f,_)).recoveryParam)return f.recoveryParam;for(var v=0;v<4;v++){var T;try{T=this.recoverPubKey(h,f,v)}catch{continue}if(T.eq(d))return v}throw new Error("Unable to find valid recovery factor")}},function(z,l,c){"use strict";var s=c(60),m=c(120),y=c(22);function n(o){if(!(this instanceof n))return new n(o);this.hash=o.hash,this.predResist=!!o.predResist,this.outLen=this.hash.outSize,this.minEntropy=o.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=m.toArray(o.entropy,o.entropyEnc||"hex"),t=m.toArray(o.nonce,o.nonceEnc||"hex"),i=m.toArray(o.pers,o.persEnc||"hex");y(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}z.exports=n,n.prototype._init=function(o,e,t){var i=o.concat(e).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var u=0;u=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(o.concat(t||[])),this._reseed=1},n.prototype.generate=function(o,e,t,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=t,t=e,e=null),t&&(t=m.toArray(t,i||"hex"),this._update(t));for(var u=[];u.length"}},function(z,l,c){"use strict";var s=c(16),m=c(11),y=m.assert;function n(u,h){if(u instanceof n)return u;this._importDER(u,h)||(y(u.r&&u.s,"Signature without r or s"),this.r=new s(u.r,16),this.s=new s(u.s,16),this.recoveryParam=void 0===u.recoveryParam?null:u.recoveryParam)}function o(){this.place=0}function e(u,h){var f=u[h.place++];if(!(128&f))return f;var d=15&f;if(0===d||d>4)return!1;for(var _=0,v=0,T=h.place;v>>=0;return!(_<=127)&&(h.place=T,_)}function t(u){for(var h=0,f=u.length-1;!u[h]&&!(128&u[h+1])&&h>>3);for(u.push(128|f);--f;)u.push(h>>>(f<<3)&255);u.push(h)}}z.exports=n,n.prototype._importDER=function(u,h){u=m.toArray(u,h);var f=new o;if(48!==u[f.place++])return!1;var d=e(u,f);if(!1===d||d+f.place!==u.length||2!==u[f.place++])return!1;var _=e(u,f);if(!1===_)return!1;var v=u.slice(f.place,_+f.place);if(f.place+=_,2!==u[f.place++])return!1;var T=e(u,f);if(!1===T||u.length!==T+f.place)return!1;var O=u.slice(f.place,T+f.place);if(0===v[0]){if(!(128&v[1]))return!1;v=v.slice(1)}if(0===O[0]){if(!(128&O[1]))return!1;O=O.slice(1)}return this.r=new s(v),this.s=new s(O),this.recoveryParam=null,!0},n.prototype.toDER=function(u){var h=this.r.toArray(),f=this.s.toArray();for(128&h[0]&&(h=[0].concat(h)),128&f[0]&&(f=[0].concat(f)),h=t(h),f=t(f);!(f[0]||128&f[1]);)f=f.slice(1);var d=[2];i(d,h.length),(d=d.concat(h)).push(2),i(d,f.length);var _=d.concat(f),v=[48];return i(v,_.length),v=v.concat(_),m.encode(v,u)}},function(z,l,c){"use strict";var s=c(60),m=c(59),y=c(11),n=y.assert,o=y.parseBytes,e=c(262),t=c(263);function i(u){if(n("ed25519"===u,"only tested with ed25519 so far"),!(this instanceof i))return new i(u);this.curve=u=m[u].curve,this.g=u.g,this.g.precompute(u.n.bitLength()+1),this.pointClass=u.point().constructor,this.encodingLength=Math.ceil(u.n.bitLength()/8),this.hash=s.sha512}z.exports=i,i.prototype.sign=function(u,h){u=o(u);var f=this.keyFromSecret(h),d=this.hashInt(f.messagePrefix(),u),_=this.g.mul(d),v=this.encodePoint(_),T=this.hashInt(v,f.pubBytes(),u).mul(f.priv()),O=d.add(T).umod(this.curve.n);return this.makeSignature({R:_,S:O,Rencoded:v})},i.prototype.verify=function(u,h,f){u=o(u),h=this.makeSignature(h);var d=this.keyFromPublic(f),_=this.hashInt(h.Rencoded(),d.pubBytes(),u),v=this.g.mul(h.S());return h.R().add(d.pub().mul(_)).eq(v)},i.prototype.hashInt=function(){for(var u=this.hash(),h=0;h4294967295)throw new RangeError("requested too many random bytes");var t=y.allocUnsafe(o);if(o>0)if(o>65536)for(var i=0;i=0)throw new Error("couldn't export to DER format");var u=y.g.mul(i);return o(u.getX(),u.getY(),t)},l.privateKeyModInverse=function(e){var t=new m(e);if(t.ucmp(n.n)>=0||t.isZero())throw new Error("private key range is invalid");return t.invm(n.n).toArrayLike(s,"be",32)},l.signatureImport=function(e){var t=new m(e.r);t.ucmp(n.n)>=0&&(t=new m(0));var i=new m(e.s);return i.ucmp(n.n)>=0&&(i=new m(0)),s.concat([t.toArrayLike(s,"be",32),i.toArrayLike(s,"be",32)])},l.ecdhUnsafe=function(e,t,i){var u=y.keyFromPublic(e),h=new m(t);if(h.ucmp(n.n)>=0||h.isZero())throw new Error("scalar was invalid (zero or overflow)");var f=u.pub.mul(h);return o(f.getX(),f.getY(),i)};var o=function(e,t,i){var u=void 0;return i?((u=s.alloc(33))[0]=t.isOdd()?3:2,e.toArrayLike(s,"be",32).copy(u,1)):((u=s.alloc(65))[0]=4,e.toArrayLike(s,"be",32).copy(u,1),t.toArrayLike(s,"be",32).copy(u,33)),u}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){var m=s.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),y=s.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);l.privateKeyExport=function(n,o,e){var t=s.from(e?m:y);return n.copy(t,e?8:9),o.copy(t,e?181:214),t},l.privateKeyImport=function(n){var o=n.length,e=0;if(o2||o<(e+=1)+t)return null;var i=n[e+t-1]|(t>1?n[e+t-2]<<8:0);return o<(e+=t)+i||o32||ot||2!==n[i++])return null;var h=n[i++];if(128&h){if(i+(u=h-128)>t)return null;for(;u>0&&0===n[i];i+=1,u-=1);for(h=0;u>0;i+=1,u-=1)h=(h<<8)+n[i]}if(h>t-i)return null;var f=i;if(i+=h,2!==n[i++])return null;var d=n[i++];if(128&d){if(i+(u=d-128)>t)return null;for(;u>0&&0===n[i];i+=1,u-=1);for(d=0;u>0;i+=1,u-=1)d=(d<<8)+n[i]}if(d>t-i)return null;var _=i;for(i+=d;h>0&&0===n[f];h-=1,f+=1);if(h>32)return null;var v=n.slice(f,f+h);for(v.copy(o,32-v.length);d>0&&0===n[_];d-=1,_+=1);if(d>32)return null;var T=n.slice(_,_+d);return T.copy(e,32-T.length),{r:o,s:e}}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";var s=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;function n(o){if(null==o)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}z.exports=function(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de","5"===Object.getOwnPropertyNames(o)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(u){return e[u]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(u){i[u]=u}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch{return!1}}()?Object.assign:function(o,e){for(var t,i,u=n(o),h=1;h=48&&g<=57?g-48:g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:void n(!1,"Invalid character in "+r)}function u(r,a,g){var M=i(r,g);return g-1>=a&&(M|=i(r,g-1)<<4),M}function h(r,a,g,M){for(var E=0,C=0,U=Math.min(r.length,g),V=a;V=49?I-49+10:I>=17?I-17+10:I,n(I>=0&&C0?r:a},e.min=function(r,a){return r.cmp(a)<0?r:a},e.prototype._init=function(r,a,g){if("number"==typeof r)return this._initNumber(r,a,g);if("object"==typeof r)return this._initArray(r,a,g);"hex"===a&&(a=16),n(a===(0|a)&&a>=2&&a<=36);var M=0;"-"===(r=r.toString().replace(/\s+/g,""))[0]&&(M++,this.negative=1),M=0;M-=3)this.words[E]|=(C=r[M]|r[M-1]<<8|r[M-2]<<16)<>>26-U&67108863,(U+=24)>=26&&(U-=26,E++);else if("le"===g)for(M=0,E=0;M>>26-U&67108863,(U+=24)>=26&&(U-=26,E++);return this._strip()},e.prototype._parseHex=function(r,a,g){this.length=Math.ceil((r.length-a)/6),this.words=new Array(this.length);for(var M=0;M=a;M-=2)E=u(r,a,M)<=18?(C-=18,this.words[U+=1]|=E>>>26):C+=8;else for(M=(r.length-a)%2==0?a+1:a;M=18?(C-=18,this.words[U+=1]|=E>>>26):C+=8;this._strip()},e.prototype._parseBase=function(r,a,g){this.words=[0],this.length=1;for(var M=0,E=1;E<=67108863;E*=a)M++;M--,E=E/a|0;for(var C=r.length-g,U=C%M,V=Math.min(C,C-U)+g,I=0,W=g;W1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},typeof Symbol<"u"&&"function"==typeof Symbol.for)try{e.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch{e.prototype.inspect=d}else e.prototype.inspect=d;function d(){return(this.red?""}var _=["","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"],v=[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],T=[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 O(r,a,g){g.negative=a.negative^r.negative;var M=r.length+a.length|0;g.length=M,M=M-1|0;var E=0|r.words[0],C=0|a.words[0],U=E*C,I=U/67108864|0;g.words[0]=67108863&U;for(var W=1;W>>26,B=67108863&I,N=Math.min(W,a.length-1),P=Math.max(0,W-r.length+1);P<=N;P++)F+=(U=(E=0|r.words[W-P|0])*(C=0|a.words[P])+B)/67108864|0,B=67108863&U;g.words[W]=0|B,I=0|F}return 0!==I?g.words[W]=0|I:g.length--,g._strip()}e.prototype.toString=function(r,a){var g;if(a=0|a||1,16===(r=r||10)||"hex"===r){g="";for(var M=0,E=0,C=0;C>>24-M&16777215,(M+=2)>=26&&(M-=26,C--),g=0!==E||C!==this.length-1?_[6-V.length]+V+g:V+g}for(0!==E&&(g=E.toString(16)+g);g.length%a!=0;)g="0"+g;return 0!==this.negative&&(g="-"+g),g}if(r===(0|r)&&r>=2&&r<=36){var I=v[r],W=T[r];g="";var F=this.clone();for(F.negative=0;!F.isZero();){var B=F.modrn(W).toString(r);g=(F=F.idivn(W)).isZero()?B+g:_[I-B.length]+B+g}for(this.isZero()&&(g="0"+g);g.length%a!=0;)g="0"+g;return 0!==this.negative&&(g="-"+g),g}n(!1,"Base should be between 2 and 36")},e.prototype.toNumber=function(){var r=this.words[0];return 2===this.length?r+=67108864*this.words[1]:3===this.length&&1===this.words[2]?r+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-r:r},e.prototype.toJSON=function(){return this.toString(16,2)},t&&(e.prototype.toBuffer=function(r,a){return this.toArrayLike(t,r,a)}),e.prototype.toArray=function(r,a){return this.toArrayLike(Array,r,a)},e.prototype.toArrayLike=function(r,a,g){this._strip();var M=this.byteLength(),E=g||Math.max(1,M);n(M<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var U,V,C=(V=E,(U=r).allocUnsafe?U.allocUnsafe(V):new U(V));return this["_toArrayLike"+("le"===a?"LE":"BE")](C,M),C},e.prototype._toArrayLikeLE=function(r,a){for(var g=0,M=0,E=0,C=0;E>8&255),g>16&255),6===C?(g>24&255),M=0,C=0):(M=U>>>24,C+=2)}if(g=0&&(r[g--]=U>>8&255),g>=0&&(r[g--]=U>>16&255),6===C?(g>=0&&(r[g--]=U>>24&255),M=0,C=0):(M=U>>>24,C+=2)}if(g>=0)for(r[g--]=M;g>=0;)r[g--]=0},e.prototype._countBits=Math.clz32?function(r){return 32-Math.clz32(r)}:function(r){var a=r,g=0;return a>=4096&&(g+=13,a>>>=13),a>=64&&(g+=7,a>>>=7),a>=8&&(g+=4,a>>>=4),a>=2&&(g+=2,a>>>=2),g+a},e.prototype._zeroBits=function(r){if(0===r)return 26;var a=r,g=0;return 0==(8191&a)&&(g+=13,a>>>=13),0==(127&a)&&(g+=7,a>>>=7),0==(15&a)&&(g+=4,a>>>=4),0==(3&a)&&(g+=2,a>>>=2),0==(1&a)&&g++,g},e.prototype.bitLength=function(){var a=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+a},e.prototype.zeroBits=function(){if(this.isZero())return 0;for(var r=0,a=0;ar.length?this.clone().ior(r):r.clone().ior(this)},e.prototype.uor=function(r){return this.length>r.length?this.clone().iuor(r):r.clone().iuor(this)},e.prototype.iuand=function(r){var a;a=this.length>r.length?r:this;for(var g=0;gr.length?this.clone().iand(r):r.clone().iand(this)},e.prototype.uand=function(r){return this.length>r.length?this.clone().iuand(r):r.clone().iuand(this)},e.prototype.iuxor=function(r){var a,g;this.length>r.length?(a=this,g=r):(a=r,g=this);for(var M=0;Mr.length?this.clone().ixor(r):r.clone().ixor(this)},e.prototype.uxor=function(r){return this.length>r.length?this.clone().iuxor(r):r.clone().iuxor(this)},e.prototype.inotn=function(r){n("number"==typeof r&&r>=0);var a=0|Math.ceil(r/26),g=r%26;this._expand(a),g>0&&a--;for(var M=0;M0&&(this.words[M]=~this.words[M]&67108863>>26-g),this._strip()},e.prototype.notn=function(r){return this.clone().inotn(r)},e.prototype.setn=function(r,a){n("number"==typeof r&&r>=0);var g=r/26|0,M=r%26;return this._expand(g+1),this.words[g]=a?this.words[g]|1<r.length?(g=this,M=r):(g=r,M=this);for(var E=0,C=0;C>>26;for(;0!==E&&C>>26;if(this.length=g.length,0!==E)this.words[this.length]=E,this.length++;else if(g!==this)for(;Cr.length?this.clone().iadd(r):r.clone().iadd(this)},e.prototype.isub=function(r){if(0!==r.negative){r.negative=0;var a=this.iadd(r);return r.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(r),this.negative=1,this._normSign();var g,M,E=this.cmp(r);if(0===E)return this.negative=0,this.length=1,this.words[0]=0,this;E>0?(g=this,M=r):(g=r,M=this);for(var C=0,U=0;U>26,this.words[U]=67108863&a;for(;0!==C&&U>26,this.words[U]=67108863&a;if(0===C&&U>>13,P=0|U[1],j=8191&P,K=P>>>13,Z=0|U[2],J=8191&Z,X=Z>>>13,ee=0|U[3],te=8191&ee,oe=ee>>>13,ve=0|U[4],ie=8191&ve,de=ve>>>13,fe=0|U[5],re=8191&fe,_e=fe>>>13,Ke=0|U[6],pe=8191&Ke,Te=Ke>>>13,Ve=0|U[7],be=8191&Ve,Pe=Ve>>>13,Ye=0|U[8],we=8191&Ye,Be=Ye>>>13,$e=0|U[9],Me=8191&$e,je=$e>>>13,Q=0|V[0],se=8191&Q,le=Q>>>13,Le=0|V[1],he=8191&Le,Oe=Le>>>13,Ge=0|V[2],me=8191&Ge,ze=Ge>>>13,rt=0|V[3],Re=8191&rt,He=rt>>>13,Qe=0|V[4],Ee=8191&Qe,Ne=Qe>>>13,it=0|V[5],xe=8191&it,qe=it>>>13,et=0|V[6],ke=8191&et,We=et>>>13,tt=0|V[7],Se=8191&tt,Fe=tt>>>13,nt=0|V[8],Ae=8191&nt,Ue=nt>>>13,Y=0|V[9],G=8191&Y,$=Y>>>13;g.negative=r.negative^a.negative,g.length=19;var ne=(W+(M=Math.imul(B,se))|0)+((8191&(E=(E=Math.imul(B,le))+Math.imul(N,se)|0))<<13)|0;W=((C=Math.imul(N,le))+(E>>>13)|0)+(ne>>>26)|0,ne&=67108863,M=Math.imul(j,se),E=(E=Math.imul(j,le))+Math.imul(K,se)|0,C=Math.imul(K,le);var ce=(W+(M=M+Math.imul(B,he)|0)|0)+((8191&(E=(E=E+Math.imul(B,Oe)|0)+Math.imul(N,he)|0))<<13)|0;W=((C=C+Math.imul(N,Oe)|0)+(E>>>13)|0)+(ce>>>26)|0,ce&=67108863,M=Math.imul(J,se),E=(E=Math.imul(J,le))+Math.imul(X,se)|0,C=Math.imul(X,le),M=M+Math.imul(j,he)|0,E=(E=E+Math.imul(j,Oe)|0)+Math.imul(K,he)|0,C=C+Math.imul(K,Oe)|0;var ue=(W+(M=M+Math.imul(B,me)|0)|0)+((8191&(E=(E=E+Math.imul(B,ze)|0)+Math.imul(N,me)|0))<<13)|0;W=((C=C+Math.imul(N,ze)|0)+(E>>>13)|0)+(ue>>>26)|0,ue&=67108863,M=Math.imul(te,se),E=(E=Math.imul(te,le))+Math.imul(oe,se)|0,C=Math.imul(oe,le),M=M+Math.imul(J,he)|0,E=(E=E+Math.imul(J,Oe)|0)+Math.imul(X,he)|0,C=C+Math.imul(X,Oe)|0,M=M+Math.imul(j,me)|0,E=(E=E+Math.imul(j,ze)|0)+Math.imul(K,me)|0,C=C+Math.imul(K,ze)|0;var Ce=(W+(M=M+Math.imul(B,Re)|0)|0)+((8191&(E=(E=E+Math.imul(B,He)|0)+Math.imul(N,Re)|0))<<13)|0;W=((C=C+Math.imul(N,He)|0)+(E>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,M=Math.imul(ie,se),E=(E=Math.imul(ie,le))+Math.imul(de,se)|0,C=Math.imul(de,le),M=M+Math.imul(te,he)|0,E=(E=E+Math.imul(te,Oe)|0)+Math.imul(oe,he)|0,C=C+Math.imul(oe,Oe)|0,M=M+Math.imul(J,me)|0,E=(E=E+Math.imul(J,ze)|0)+Math.imul(X,me)|0,C=C+Math.imul(X,ze)|0,M=M+Math.imul(j,Re)|0,E=(E=E+Math.imul(j,He)|0)+Math.imul(K,Re)|0,C=C+Math.imul(K,He)|0;var Ie=(W+(M=M+Math.imul(B,Ee)|0)|0)+((8191&(E=(E=E+Math.imul(B,Ne)|0)+Math.imul(N,Ee)|0))<<13)|0;W=((C=C+Math.imul(N,Ne)|0)+(E>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,M=Math.imul(re,se),E=(E=Math.imul(re,le))+Math.imul(_e,se)|0,C=Math.imul(_e,le),M=M+Math.imul(ie,he)|0,E=(E=E+Math.imul(ie,Oe)|0)+Math.imul(de,he)|0,C=C+Math.imul(de,Oe)|0,M=M+Math.imul(te,me)|0,E=(E=E+Math.imul(te,ze)|0)+Math.imul(oe,me)|0,C=C+Math.imul(oe,ze)|0,M=M+Math.imul(J,Re)|0,E=(E=E+Math.imul(J,He)|0)+Math.imul(X,Re)|0,C=C+Math.imul(X,He)|0,M=M+Math.imul(j,Ee)|0,E=(E=E+Math.imul(j,Ne)|0)+Math.imul(K,Ee)|0,C=C+Math.imul(K,Ne)|0;var De=(W+(M=M+Math.imul(B,xe)|0)|0)+((8191&(E=(E=E+Math.imul(B,qe)|0)+Math.imul(N,xe)|0))<<13)|0;W=((C=C+Math.imul(N,qe)|0)+(E>>>13)|0)+(De>>>26)|0,De&=67108863,M=Math.imul(pe,se),E=(E=Math.imul(pe,le))+Math.imul(Te,se)|0,C=Math.imul(Te,le),M=M+Math.imul(re,he)|0,E=(E=E+Math.imul(re,Oe)|0)+Math.imul(_e,he)|0,C=C+Math.imul(_e,Oe)|0,M=M+Math.imul(ie,me)|0,E=(E=E+Math.imul(ie,ze)|0)+Math.imul(de,me)|0,C=C+Math.imul(de,ze)|0,M=M+Math.imul(te,Re)|0,E=(E=E+Math.imul(te,He)|0)+Math.imul(oe,Re)|0,C=C+Math.imul(oe,He)|0,M=M+Math.imul(J,Ee)|0,E=(E=E+Math.imul(J,Ne)|0)+Math.imul(X,Ee)|0,C=C+Math.imul(X,Ne)|0,M=M+Math.imul(j,xe)|0,E=(E=E+Math.imul(j,qe)|0)+Math.imul(K,xe)|0,C=C+Math.imul(K,qe)|0;var ye=(W+(M=M+Math.imul(B,ke)|0)|0)+((8191&(E=(E=E+Math.imul(B,We)|0)+Math.imul(N,ke)|0))<<13)|0;W=((C=C+Math.imul(N,We)|0)+(E>>>13)|0)+(ye>>>26)|0,ye&=67108863,M=Math.imul(be,se),E=(E=Math.imul(be,le))+Math.imul(Pe,se)|0,C=Math.imul(Pe,le),M=M+Math.imul(pe,he)|0,E=(E=E+Math.imul(pe,Oe)|0)+Math.imul(Te,he)|0,C=C+Math.imul(Te,Oe)|0,M=M+Math.imul(re,me)|0,E=(E=E+Math.imul(re,ze)|0)+Math.imul(_e,me)|0,C=C+Math.imul(_e,ze)|0,M=M+Math.imul(ie,Re)|0,E=(E=E+Math.imul(ie,He)|0)+Math.imul(de,Re)|0,C=C+Math.imul(de,He)|0,M=M+Math.imul(te,Ee)|0,E=(E=E+Math.imul(te,Ne)|0)+Math.imul(oe,Ee)|0,C=C+Math.imul(oe,Ne)|0,M=M+Math.imul(J,xe)|0,E=(E=E+Math.imul(J,qe)|0)+Math.imul(X,xe)|0,C=C+Math.imul(X,qe)|0,M=M+Math.imul(j,ke)|0,E=(E=E+Math.imul(j,We)|0)+Math.imul(K,ke)|0,C=C+Math.imul(K,We)|0;var ae=(W+(M=M+Math.imul(B,Se)|0)|0)+((8191&(E=(E=E+Math.imul(B,Fe)|0)+Math.imul(N,Se)|0))<<13)|0;W=((C=C+Math.imul(N,Fe)|0)+(E>>>13)|0)+(ae>>>26)|0,ae&=67108863,M=Math.imul(we,se),E=(E=Math.imul(we,le))+Math.imul(Be,se)|0,C=Math.imul(Be,le),M=M+Math.imul(be,he)|0,E=(E=E+Math.imul(be,Oe)|0)+Math.imul(Pe,he)|0,C=C+Math.imul(Pe,Oe)|0,M=M+Math.imul(pe,me)|0,E=(E=E+Math.imul(pe,ze)|0)+Math.imul(Te,me)|0,C=C+Math.imul(Te,ze)|0,M=M+Math.imul(re,Re)|0,E=(E=E+Math.imul(re,He)|0)+Math.imul(_e,Re)|0,C=C+Math.imul(_e,He)|0,M=M+Math.imul(ie,Ee)|0,E=(E=E+Math.imul(ie,Ne)|0)+Math.imul(de,Ee)|0,C=C+Math.imul(de,Ne)|0,M=M+Math.imul(te,xe)|0,E=(E=E+Math.imul(te,qe)|0)+Math.imul(oe,xe)|0,C=C+Math.imul(oe,qe)|0,M=M+Math.imul(J,ke)|0,E=(E=E+Math.imul(J,We)|0)+Math.imul(X,ke)|0,C=C+Math.imul(X,We)|0,M=M+Math.imul(j,Se)|0,E=(E=E+Math.imul(j,Fe)|0)+Math.imul(K,Se)|0,C=C+Math.imul(K,Fe)|0;var Je=(W+(M=M+Math.imul(B,Ae)|0)|0)+((8191&(E=(E=E+Math.imul(B,Ue)|0)+Math.imul(N,Ae)|0))<<13)|0;W=((C=C+Math.imul(N,Ue)|0)+(E>>>13)|0)+(Je>>>26)|0,Je&=67108863,M=Math.imul(Me,se),E=(E=Math.imul(Me,le))+Math.imul(je,se)|0,C=Math.imul(je,le),M=M+Math.imul(we,he)|0,E=(E=E+Math.imul(we,Oe)|0)+Math.imul(Be,he)|0,C=C+Math.imul(Be,Oe)|0,M=M+Math.imul(be,me)|0,E=(E=E+Math.imul(be,ze)|0)+Math.imul(Pe,me)|0,C=C+Math.imul(Pe,ze)|0,M=M+Math.imul(pe,Re)|0,E=(E=E+Math.imul(pe,He)|0)+Math.imul(Te,Re)|0,C=C+Math.imul(Te,He)|0,M=M+Math.imul(re,Ee)|0,E=(E=E+Math.imul(re,Ne)|0)+Math.imul(_e,Ee)|0,C=C+Math.imul(_e,Ne)|0,M=M+Math.imul(ie,xe)|0,E=(E=E+Math.imul(ie,qe)|0)+Math.imul(de,xe)|0,C=C+Math.imul(de,qe)|0,M=M+Math.imul(te,ke)|0,E=(E=E+Math.imul(te,We)|0)+Math.imul(oe,ke)|0,C=C+Math.imul(oe,We)|0,M=M+Math.imul(J,Se)|0,E=(E=E+Math.imul(J,Fe)|0)+Math.imul(X,Se)|0,C=C+Math.imul(X,Fe)|0,M=M+Math.imul(j,Ae)|0,E=(E=E+Math.imul(j,Ue)|0)+Math.imul(K,Ae)|0,C=C+Math.imul(K,Ue)|0;var ot=(W+(M=M+Math.imul(B,G)|0)|0)+((8191&(E=(E=E+Math.imul(B,$)|0)+Math.imul(N,G)|0))<<13)|0;W=((C=C+Math.imul(N,$)|0)+(E>>>13)|0)+(ot>>>26)|0,ot&=67108863,M=Math.imul(Me,he),E=(E=Math.imul(Me,Oe))+Math.imul(je,he)|0,C=Math.imul(je,Oe),M=M+Math.imul(we,me)|0,E=(E=E+Math.imul(we,ze)|0)+Math.imul(Be,me)|0,C=C+Math.imul(Be,ze)|0,M=M+Math.imul(be,Re)|0,E=(E=E+Math.imul(be,He)|0)+Math.imul(Pe,Re)|0,C=C+Math.imul(Pe,He)|0,M=M+Math.imul(pe,Ee)|0,E=(E=E+Math.imul(pe,Ne)|0)+Math.imul(Te,Ee)|0,C=C+Math.imul(Te,Ne)|0,M=M+Math.imul(re,xe)|0,E=(E=E+Math.imul(re,qe)|0)+Math.imul(_e,xe)|0,C=C+Math.imul(_e,qe)|0,M=M+Math.imul(ie,ke)|0,E=(E=E+Math.imul(ie,We)|0)+Math.imul(de,ke)|0,C=C+Math.imul(de,We)|0,M=M+Math.imul(te,Se)|0,E=(E=E+Math.imul(te,Fe)|0)+Math.imul(oe,Se)|0,C=C+Math.imul(oe,Fe)|0,M=M+Math.imul(J,Ae)|0,E=(E=E+Math.imul(J,Ue)|0)+Math.imul(X,Ae)|0,C=C+Math.imul(X,Ue)|0;var at=(W+(M=M+Math.imul(j,G)|0)|0)+((8191&(E=(E=E+Math.imul(j,$)|0)+Math.imul(K,G)|0))<<13)|0;W=((C=C+Math.imul(K,$)|0)+(E>>>13)|0)+(at>>>26)|0,at&=67108863,M=Math.imul(Me,me),E=(E=Math.imul(Me,ze))+Math.imul(je,me)|0,C=Math.imul(je,ze),M=M+Math.imul(we,Re)|0,E=(E=E+Math.imul(we,He)|0)+Math.imul(Be,Re)|0,C=C+Math.imul(Be,He)|0,M=M+Math.imul(be,Ee)|0,E=(E=E+Math.imul(be,Ne)|0)+Math.imul(Pe,Ee)|0,C=C+Math.imul(Pe,Ne)|0,M=M+Math.imul(pe,xe)|0,E=(E=E+Math.imul(pe,qe)|0)+Math.imul(Te,xe)|0,C=C+Math.imul(Te,qe)|0,M=M+Math.imul(re,ke)|0,E=(E=E+Math.imul(re,We)|0)+Math.imul(_e,ke)|0,C=C+Math.imul(_e,We)|0,M=M+Math.imul(ie,Se)|0,E=(E=E+Math.imul(ie,Fe)|0)+Math.imul(de,Se)|0,C=C+Math.imul(de,Fe)|0,M=M+Math.imul(te,Ae)|0,E=(E=E+Math.imul(te,Ue)|0)+Math.imul(oe,Ae)|0,C=C+Math.imul(oe,Ue)|0;var st=(W+(M=M+Math.imul(J,G)|0)|0)+((8191&(E=(E=E+Math.imul(J,$)|0)+Math.imul(X,G)|0))<<13)|0;W=((C=C+Math.imul(X,$)|0)+(E>>>13)|0)+(st>>>26)|0,st&=67108863,M=Math.imul(Me,Re),E=(E=Math.imul(Me,He))+Math.imul(je,Re)|0,C=Math.imul(je,He),M=M+Math.imul(we,Ee)|0,E=(E=E+Math.imul(we,Ne)|0)+Math.imul(Be,Ee)|0,C=C+Math.imul(Be,Ne)|0,M=M+Math.imul(be,xe)|0,E=(E=E+Math.imul(be,qe)|0)+Math.imul(Pe,xe)|0,C=C+Math.imul(Pe,qe)|0,M=M+Math.imul(pe,ke)|0,E=(E=E+Math.imul(pe,We)|0)+Math.imul(Te,ke)|0,C=C+Math.imul(Te,We)|0,M=M+Math.imul(re,Se)|0,E=(E=E+Math.imul(re,Fe)|0)+Math.imul(_e,Se)|0,C=C+Math.imul(_e,Fe)|0,M=M+Math.imul(ie,Ae)|0,E=(E=E+Math.imul(ie,Ue)|0)+Math.imul(de,Ae)|0,C=C+Math.imul(de,Ue)|0;var ut=(W+(M=M+Math.imul(te,G)|0)|0)+((8191&(E=(E=E+Math.imul(te,$)|0)+Math.imul(oe,G)|0))<<13)|0;W=((C=C+Math.imul(oe,$)|0)+(E>>>13)|0)+(ut>>>26)|0,ut&=67108863,M=Math.imul(Me,Ee),E=(E=Math.imul(Me,Ne))+Math.imul(je,Ee)|0,C=Math.imul(je,Ne),M=M+Math.imul(we,xe)|0,E=(E=E+Math.imul(we,qe)|0)+Math.imul(Be,xe)|0,C=C+Math.imul(Be,qe)|0,M=M+Math.imul(be,ke)|0,E=(E=E+Math.imul(be,We)|0)+Math.imul(Pe,ke)|0,C=C+Math.imul(Pe,We)|0,M=M+Math.imul(pe,Se)|0,E=(E=E+Math.imul(pe,Fe)|0)+Math.imul(Te,Se)|0,C=C+Math.imul(Te,Fe)|0,M=M+Math.imul(re,Ae)|0,E=(E=E+Math.imul(re,Ue)|0)+Math.imul(_e,Ae)|0,C=C+Math.imul(_e,Ue)|0;var Ze=(W+(M=M+Math.imul(ie,G)|0)|0)+((8191&(E=(E=E+Math.imul(ie,$)|0)+Math.imul(de,G)|0))<<13)|0;W=((C=C+Math.imul(de,$)|0)+(E>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,M=Math.imul(Me,xe),E=(E=Math.imul(Me,qe))+Math.imul(je,xe)|0,C=Math.imul(je,qe),M=M+Math.imul(we,ke)|0,E=(E=E+Math.imul(we,We)|0)+Math.imul(Be,ke)|0,C=C+Math.imul(Be,We)|0,M=M+Math.imul(be,Se)|0,E=(E=E+Math.imul(be,Fe)|0)+Math.imul(Pe,Se)|0,C=C+Math.imul(Pe,Fe)|0,M=M+Math.imul(pe,Ae)|0,E=(E=E+Math.imul(pe,Ue)|0)+Math.imul(Te,Ae)|0,C=C+Math.imul(Te,Ue)|0;var ct=(W+(M=M+Math.imul(re,G)|0)|0)+((8191&(E=(E=E+Math.imul(re,$)|0)+Math.imul(_e,G)|0))<<13)|0;W=((C=C+Math.imul(_e,$)|0)+(E>>>13)|0)+(ct>>>26)|0,ct&=67108863,M=Math.imul(Me,ke),E=(E=Math.imul(Me,We))+Math.imul(je,ke)|0,C=Math.imul(je,We),M=M+Math.imul(we,Se)|0,E=(E=E+Math.imul(we,Fe)|0)+Math.imul(Be,Se)|0,C=C+Math.imul(Be,Fe)|0,M=M+Math.imul(be,Ae)|0,E=(E=E+Math.imul(be,Ue)|0)+Math.imul(Pe,Ae)|0,C=C+Math.imul(Pe,Ue)|0;var Xe=(W+(M=M+Math.imul(pe,G)|0)|0)+((8191&(E=(E=E+Math.imul(pe,$)|0)+Math.imul(Te,G)|0))<<13)|0;W=((C=C+Math.imul(Te,$)|0)+(E>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,M=Math.imul(Me,Se),E=(E=Math.imul(Me,Fe))+Math.imul(je,Se)|0,C=Math.imul(je,Fe),M=M+Math.imul(we,Ae)|0,E=(E=E+Math.imul(we,Ue)|0)+Math.imul(Be,Ae)|0,C=C+Math.imul(Be,Ue)|0;var ht=(W+(M=M+Math.imul(be,G)|0)|0)+((8191&(E=(E=E+Math.imul(be,$)|0)+Math.imul(Pe,G)|0))<<13)|0;W=((C=C+Math.imul(Pe,$)|0)+(E>>>13)|0)+(ht>>>26)|0,ht&=67108863,M=Math.imul(Me,Ae),E=(E=Math.imul(Me,Ue))+Math.imul(je,Ae)|0,C=Math.imul(je,Ue);var ft=(W+(M=M+Math.imul(we,G)|0)|0)+((8191&(E=(E=E+Math.imul(we,$)|0)+Math.imul(Be,G)|0))<<13)|0;W=((C=C+Math.imul(Be,$)|0)+(E>>>13)|0)+(ft>>>26)|0,ft&=67108863;var pt=(W+(M=Math.imul(Me,G))|0)+((8191&(E=(E=Math.imul(Me,$))+Math.imul(je,G)|0))<<13)|0;return W=((C=Math.imul(je,$))+(E>>>13)|0)+(pt>>>26)|0,pt&=67108863,I[0]=ne,I[1]=ce,I[2]=ue,I[3]=Ce,I[4]=Ie,I[5]=De,I[6]=ye,I[7]=ae,I[8]=Je,I[9]=ot,I[10]=at,I[11]=st,I[12]=ut,I[13]=Ze,I[14]=ct,I[15]=Xe,I[16]=ht,I[17]=ft,I[18]=pt,0!==W&&(I[19]=W,g.length++),g};function S(r,a,g){g.negative=a.negative^r.negative,g.length=r.length+a.length;for(var M=0,E=0,C=0;C>>26)|0)>>>26,U&=67108863}g.words[C]=V,M=U,U=E}return 0!==M?g.words[C]=M:g.length--,g._strip()}function w(r,a,g){return S(r,a,g)}function A(r,a){this.x=r,this.y=a}Math.imul||(b=O),e.prototype.mulTo=function(r,a){var g=this.length+r.length;return 10===this.length&&10===r.length?b(this,r,a):g<63?O(this,r,a):g<1024?S(this,r,a):w(this,r,a)},A.prototype.makeRBT=function(r){for(var a=new Array(r),g=e.prototype._countBits(r)-1,M=0;M>=1;return M},A.prototype.permute=function(r,a,g,M,E,C){for(var U=0;U>>=1)E++;return 1<>>=13),E>>>=13;for(C=2*a;C>=26,g+=E/67108864|0,g+=C>>>26,this.words[M]=67108863&C}return 0!==g&&(this.words[M]=g,this.length++),a?this.ineg():this},e.prototype.muln=function(r){return this.clone().imuln(r)},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.imul(this.clone())},e.prototype.pow=function(r){var a=function(C){for(var U=new Array(C.bitLength()),V=0;V>>V%26&1;return U}(r);if(0===a.length)return new e(1);for(var g=this,M=0;M=0);var a,g=r%26,M=(r-g)/26,E=67108863>>>26-g<<26-g;if(0!==g){var C=0;for(a=0;a>>26-g}C&&(this.words[a]=C,this.length++)}if(0!==M){for(a=this.length-1;a>=0;a--)this.words[a+M]=this.words[a];for(a=0;a=0),M=a?(a-a%26)/26:0;var E=r%26,C=Math.min((r-E)/26,this.length),U=67108863^67108863>>>E<C)for(this.length-=C,I=0;I=0&&(0!==W||I>=M);I--){var F=0|this.words[I];this.words[I]=W<<26-E|F>>>E,W=F&U}return V&&0!==W&&(V.words[V.length++]=W),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},e.prototype.ishrn=function(r,a,g){return n(0===this.negative),this.iushrn(r,a,g)},e.prototype.shln=function(r){return this.clone().ishln(r)},e.prototype.ushln=function(r){return this.clone().iushln(r)},e.prototype.shrn=function(r){return this.clone().ishrn(r)},e.prototype.ushrn=function(r){return this.clone().iushrn(r)},e.prototype.testn=function(r){n("number"==typeof r&&r>=0);var a=r%26,g=(r-a)/26;return!(this.length<=g||!(this.words[g]&1<=0);var a=r%26,g=(r-a)/26;return n(0===this.negative,"imaskn works only with positive numbers"),this.length<=g?this:(0!==a&&g++,this.length=Math.min(g,this.length),0!==a&&(this.words[this.length-1]&=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},e.prototype.isubn=function(r){if(n("number"==typeof r),n(r<67108864),r<0)return this.iaddn(-r);if(0!==this.negative)return this.negative=0,this.iaddn(r),this.negative=1,this;if(this.words[0]-=r,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(V/67108864|0),this.words[M+g]=67108863&E}for(;M>26,this.words[M+g]=67108863&E;if(0===U)return this._strip();for(n(-1===U),U=0,M=0;M>26,this.words[M]=67108863&E;return this.negative=1,this._strip()},e.prototype._wordDiv=function(r,a){var g,M=this.clone(),E=r,C=0|E.words[E.length-1];0!=(g=26-this._countBits(C))&&(E=E.ushln(g),M.iushln(g),C=0|E.words[E.length-1]);var U,V=M.length-E.length;if("mod"!==a){(U=new e(null)).length=V+1,U.words=new Array(U.length);for(var I=0;I=0;F--){var B=67108864*(0|M.words[E.length+F])+(0|M.words[E.length+F-1]);for(B=Math.min(B/C|0,67108863),M._ishlnsubmul(E,B,F);0!==M.negative;)B--,M.negative=0,M._ishlnsubmul(E,1,F),M.isZero()||(M.negative^=1);U&&(U.words[F]=B)}return U&&U._strip(),M._strip(),"div"!==a&&0!==g&&M.iushrn(g),{div:U||null,mod:M}},e.prototype.divmod=function(r,a,g){return n(!r.isZero()),this.isZero()?{div:new e(0),mod:new e(0)}:0!==this.negative&&0===r.negative?(C=this.neg().divmod(r,a),"mod"!==a&&(M=C.div.neg()),"div"!==a&&(E=C.mod.neg(),g&&0!==E.negative&&E.iadd(r)),{div:M,mod:E}):0===this.negative&&0!==r.negative?(C=this.divmod(r.neg(),a),"mod"!==a&&(M=C.div.neg()),{div:M,mod:C.mod}):0!=(this.negative&r.negative)?(C=this.neg().divmod(r.neg(),a),"div"!==a&&(E=C.mod.neg(),g&&0!==E.negative&&E.isub(r)),{div:C.div,mod:E}):r.length>this.length||this.cmp(r)<0?{div:new e(0),mod:this}:1===r.length?"div"===a?{div:this.divn(r.words[0]),mod:null}:"mod"===a?{div:null,mod:new e(this.modrn(r.words[0]))}:{div:this.divn(r.words[0]),mod:new e(this.modrn(r.words[0]))}:this._wordDiv(r,a);var M,E,C},e.prototype.div=function(r){return this.divmod(r,"div",!1).div},e.prototype.mod=function(r){return this.divmod(r,"mod",!1).mod},e.prototype.umod=function(r){return this.divmod(r,"mod",!0).mod},e.prototype.divRound=function(r){var a=this.divmod(r);if(a.mod.isZero())return a.div;var g=0!==a.div.negative?a.mod.isub(r):a.mod,M=r.ushrn(1),E=r.andln(1),C=g.cmp(M);return C<0||1===E&&0===C?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},e.prototype.modrn=function(r){var a=r<0;a&&(r=-r),n(r<=67108863);for(var g=(1<<26)%r,M=0,E=this.length-1;E>=0;E--)M=(g*M+(0|this.words[E]))%r;return a?-M:M},e.prototype.modn=function(r){return this.modrn(r)},e.prototype.idivn=function(r){var a=r<0;a&&(r=-r),n(r<=67108863);for(var g=0,M=this.length-1;M>=0;M--){var E=(0|this.words[M])+67108864*g;this.words[M]=E/r|0,g=E%r}return this._strip(),a?this.ineg():this},e.prototype.divn=function(r){return this.clone().idivn(r)},e.prototype.egcd=function(r){n(0===r.negative),n(!r.isZero());var a=this,g=r.clone();a=0!==a.negative?a.umod(r):a.clone();for(var M=new e(1),E=new e(0),C=new e(0),U=new e(1),V=0;a.isEven()&&g.isEven();)a.iushrn(1),g.iushrn(1),++V;for(var I=g.clone(),W=a.clone();!a.isZero();){for(var F=0,B=1;0==(a.words[0]&B)&&F<26;++F,B<<=1);if(F>0)for(a.iushrn(F);F-- >0;)(M.isOdd()||E.isOdd())&&(M.iadd(I),E.isub(W)),M.iushrn(1),E.iushrn(1);for(var N=0,P=1;0==(g.words[0]&P)&&N<26;++N,P<<=1);if(N>0)for(g.iushrn(N);N-- >0;)(C.isOdd()||U.isOdd())&&(C.iadd(I),U.isub(W)),C.iushrn(1),U.iushrn(1);a.cmp(g)>=0?(a.isub(g),M.isub(C),E.isub(U)):(g.isub(a),C.isub(M),U.isub(E))}return{a:C,b:U,gcd:g.iushln(V)}},e.prototype._invmp=function(r){n(0===r.negative),n(!r.isZero());var a=this,g=r.clone();a=0!==a.negative?a.umod(r):a.clone();for(var M,E=new e(1),C=new e(0),U=g.clone();a.cmpn(1)>0&&g.cmpn(1)>0;){for(var V=0,I=1;0==(a.words[0]&I)&&V<26;++V,I<<=1);if(V>0)for(a.iushrn(V);V-- >0;)E.isOdd()&&E.iadd(U),E.iushrn(1);for(var W=0,F=1;0==(g.words[0]&F)&&W<26;++W,F<<=1);if(W>0)for(g.iushrn(W);W-- >0;)C.isOdd()&&C.iadd(U),C.iushrn(1);a.cmp(g)>=0?(a.isub(g),E.isub(C)):(g.isub(a),C.isub(E))}return(M=0===a.cmpn(1)?E:C).cmpn(0)<0&&M.iadd(r),M},e.prototype.gcd=function(r){if(this.isZero())return r.abs();if(r.isZero())return this.abs();var a=this.clone(),g=r.clone();a.negative=0,g.negative=0;for(var M=0;a.isEven()&&g.isEven();M++)a.iushrn(1),g.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;g.isEven();)g.iushrn(1);var E=a.cmp(g);if(E<0){var C=a;a=g,g=C}else if(0===E||0===g.cmpn(1))break;a.isub(g)}return g.iushln(M)},e.prototype.invm=function(r){return this.egcd(r).a.umod(r)},e.prototype.isEven=function(){return 0==(1&this.words[0])},e.prototype.isOdd=function(){return 1==(1&this.words[0])},e.prototype.andln=function(r){return this.words[0]&r},e.prototype.bincn=function(r){n("number"==typeof r);var a=r%26,g=(r-a)/26,M=1<>>26,this.words[C]=U&=67108863}return 0!==E&&(this.words[C]=E,this.length++),this},e.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},e.prototype.cmpn=function(r){var a,g=r<0;if(0!==this.negative&&!g)return-1;if(0===this.negative&&g)return 1;if(this._strip(),this.length>1)a=1;else{g&&(r=-r),n(r<=67108863,"Number is too big");var M=0|this.words[0];a=M===r?0:Mr.length)return 1;if(this.length=0;g--){var M=0|this.words[g],E=0|r.words[g];if(M!==E){ME&&(a=1);break}}return a},e.prototype.gtn=function(r){return 1===this.cmpn(r)},e.prototype.gt=function(r){return 1===this.cmp(r)},e.prototype.gten=function(r){return this.cmpn(r)>=0},e.prototype.gte=function(r){return this.cmp(r)>=0},e.prototype.ltn=function(r){return-1===this.cmpn(r)},e.prototype.lt=function(r){return-1===this.cmp(r)},e.prototype.lten=function(r){return this.cmpn(r)<=0},e.prototype.lte=function(r){return this.cmp(r)<=0},e.prototype.eqn=function(r){return 0===this.cmpn(r)},e.prototype.eq=function(r){return 0===this.cmp(r)},e.red=function(r){return new x(r)},e.prototype.toRed=function(r){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),r.convertTo(this)._forceRed(r)},e.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(r){return this.red=r,this},e.prototype.forceRed=function(r){return n(!this.red,"Already a number in reduction context"),this._forceRed(r)},e.prototype.redAdd=function(r){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,r)},e.prototype.redIAdd=function(r){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,r)},e.prototype.redSub=function(r){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,r)},e.prototype.redISub=function(r){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,r)},e.prototype.redShl=function(r){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,r)},e.prototype.redMul=function(r){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,r),this.red.mul(this,r)},e.prototype.redIMul=function(r){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,r),this.red.imul(this,r)},e.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(r){return n(this.red&&!r.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,r)};var L={k256:null,p224:null,p192:null,p25519:null};function H(r,a){this.name=r,this.p=new e(a,16),this.n=this.p.bitLength(),this.k=new e(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function D(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function q(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function p(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(r){if("string"==typeof r){var a=e._prime(r);this.m=a.p,this.prime=a}else n(r.gtn(1),"modulus must be greater than 1"),this.m=r,this.prime=null}function R(r){x.call(this,r),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new e(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)}H.prototype._tmp=function(){var r=new e(null);return r.words=new Array(Math.ceil(this.n/13)),r},H.prototype.ireduce=function(r){var a,g=r;do{this.split(g,this.tmp),a=(g=(g=this.imulK(g)).iadd(this.tmp)).bitLength()}while(a>this.n);var M=a0?g.isub(this.p):void 0!==g.strip?g.strip():g._strip(),g},H.prototype.split=function(r,a){r.iushrn(this.n,0,a)},H.prototype.imulK=function(r){return r.imul(this.k)},o(D,H),D.prototype.split=function(r,a){for(var g=Math.min(r.length,9),M=0;M>>22,E=C}r.words[M-10]=E>>>=22,r.length-=0===E&&r.length>10?10:9},D.prototype.imulK=function(r){r.words[r.length]=0,r.words[r.length+1]=0,r.length+=2;for(var a=0,g=0;g>>=26,r.words[g]=E,a=M}return 0!==a&&(r.words[r.length++]=a),r},e._prime=function(r){if(L[r])return L[r];var a;if("k256"===r)a=new D;else if("p224"===r)a=new q;else if("p192"===r)a=new k;else{if("p25519"!==r)throw new Error("Unknown prime "+r);a=new p}return L[r]=a,a},x.prototype._verify1=function(r){n(0===r.negative,"red works only with positives"),n(r.red,"red works only with red numbers")},x.prototype._verify2=function(r,a){n(0==(r.negative|a.negative),"red works only with positives"),n(r.red&&r.red===a.red,"red works only with red numbers")},x.prototype.imod=function(r){return this.prime?this.prime.ireduce(r)._forceRed(this):(f(r,r.umod(this.m)._forceRed(this)),r)},x.prototype.neg=function(r){return r.isZero()?r.clone():this.m.sub(r)._forceRed(this)},x.prototype.add=function(r,a){this._verify2(r,a);var g=r.add(a);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},x.prototype.iadd=function(r,a){this._verify2(r,a);var g=r.iadd(a);return g.cmp(this.m)>=0&&g.isub(this.m),g},x.prototype.sub=function(r,a){this._verify2(r,a);var g=r.sub(a);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},x.prototype.isub=function(r,a){this._verify2(r,a);var g=r.isub(a);return g.cmpn(0)<0&&g.iadd(this.m),g},x.prototype.shl=function(r,a){return this._verify1(r),this.imod(r.ushln(a))},x.prototype.imul=function(r,a){return this._verify2(r,a),this.imod(r.imul(a))},x.prototype.mul=function(r,a){return this._verify2(r,a),this.imod(r.mul(a))},x.prototype.isqr=function(r){return this.imul(r,r.clone())},x.prototype.sqr=function(r){return this.mul(r,r)},x.prototype.sqrt=function(r){if(r.isZero())return r.clone();var a=this.m.andln(3);if(n(a%2==1),3===a){var g=this.m.add(new e(1)).iushrn(2);return this.pow(r,g)}for(var M=this.m.subn(1),E=0;!M.isZero()&&0===M.andln(1);)E++,M.iushrn(1);n(!M.isZero());var C=new e(1).toRed(this),U=C.redNeg(),V=this.m.subn(1).iushrn(1),I=this.m.bitLength();for(I=new e(2*I*I).toRed(this);0!==this.pow(I,V).cmp(U);)I.redIAdd(U);for(var W=this.pow(I,M),F=this.pow(r,M.addn(1).iushrn(1)),B=this.pow(r,M),N=E;0!==B.cmp(C);){for(var P=B,j=0;0!==P.cmp(C);j++)P=P.redSqr();n(j=0;M--){for(var I=a.words[M],W=V-1;W>=0;W--){var F=I>>W&1;E!==g[0]&&(E=this.sqr(E)),0!==F||0!==C?(C<<=1,C|=F,(4==++U||0===M&&0===W)&&(E=this.mul(E,g[C]),U=0,C=0)):U=0}V=26}return E},x.prototype.convertTo=function(r){var a=r.umod(this.m);return a===r?a.clone():a},x.prototype.convertFrom=function(r){var a=r.clone();return a.red=null,a},e.mont=function(r){return new R(r)},o(R,x),R.prototype.convertTo=function(r){return this.imod(r.ushln(this.shift))},R.prototype.convertFrom=function(r){var a=this.imod(r.mul(this.rinv));return a.red=null,a},R.prototype.imul=function(r,a){if(r.isZero()||a.isZero())return r.words[0]=0,r.length=1,r;var g=r.imul(a),M=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=g.isub(M).iushrn(this.shift),C=E;return E.cmp(this.m)>=0?C=E.isub(this.m):E.cmpn(0)<0&&(C=E.iadd(this.m)),C._forceRed(this)},R.prototype.mul=function(r,a){if(r.isZero()||a.isZero())return new e(0)._forceRed(this);var g=r.mul(a),M=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=g.isub(M).iushrn(this.shift),C=E;return E.cmp(this.m)>=0?C=E.isub(this.m):E.cmpn(0)<0&&(C=E.iadd(this.m)),C._forceRed(this)},R.prototype.invm=function(r){return this.imod(r._invmp(this.m).mul(this.r2))._forceRed(this)}}(s,this)}).call(this,c(25)(z))},function(z,l){},function(z,l,c){"use strict";var s=c(3),m=c(127),y=c(13).Buffer,n=new Array(16);function o(){m.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function e(f,d){return f<>>32-d}function t(f,d,_,v,T,O,b){return e(f+(d&_|~d&v)+T+O|0,b)+d|0}function i(f,d,_,v,T,O,b){return e(f+(d&v|_&~v)+T+O|0,b)+d|0}function u(f,d,_,v,T,O,b){return e(f+(d^_^v)+T+O|0,b)+d|0}function h(f,d,_,v,T,O,b){return e(f+(_^(d|~v))+T+O|0,b)+d|0}s(o,m),o.prototype._update=function(){for(var f=n,d=0;d<16;++d)f[d]=this._block.readInt32LE(4*d);var _=this._a,v=this._b,T=this._c,O=this._d;_=t(_,v,T,O,f[0],3614090360,7),O=t(O,_,v,T,f[1],3905402710,12),T=t(T,O,_,v,f[2],606105819,17),v=t(v,T,O,_,f[3],3250441966,22),_=t(_,v,T,O,f[4],4118548399,7),O=t(O,_,v,T,f[5],1200080426,12),T=t(T,O,_,v,f[6],2821735955,17),v=t(v,T,O,_,f[7],4249261313,22),_=t(_,v,T,O,f[8],1770035416,7),O=t(O,_,v,T,f[9],2336552879,12),T=t(T,O,_,v,f[10],4294925233,17),v=t(v,T,O,_,f[11],2304563134,22),_=t(_,v,T,O,f[12],1804603682,7),O=t(O,_,v,T,f[13],4254626195,12),T=t(T,O,_,v,f[14],2792965006,17),_=i(_,v=t(v,T,O,_,f[15],1236535329,22),T,O,f[1],4129170786,5),O=i(O,_,v,T,f[6],3225465664,9),T=i(T,O,_,v,f[11],643717713,14),v=i(v,T,O,_,f[0],3921069994,20),_=i(_,v,T,O,f[5],3593408605,5),O=i(O,_,v,T,f[10],38016083,9),T=i(T,O,_,v,f[15],3634488961,14),v=i(v,T,O,_,f[4],3889429448,20),_=i(_,v,T,O,f[9],568446438,5),O=i(O,_,v,T,f[14],3275163606,9),T=i(T,O,_,v,f[3],4107603335,14),v=i(v,T,O,_,f[8],1163531501,20),_=i(_,v,T,O,f[13],2850285829,5),O=i(O,_,v,T,f[2],4243563512,9),T=i(T,O,_,v,f[7],1735328473,14),_=u(_,v=i(v,T,O,_,f[12],2368359562,20),T,O,f[5],4294588738,4),O=u(O,_,v,T,f[8],2272392833,11),T=u(T,O,_,v,f[11],1839030562,16),v=u(v,T,O,_,f[14],4259657740,23),_=u(_,v,T,O,f[1],2763975236,4),O=u(O,_,v,T,f[4],1272893353,11),T=u(T,O,_,v,f[7],4139469664,16),v=u(v,T,O,_,f[10],3200236656,23),_=u(_,v,T,O,f[13],681279174,4),O=u(O,_,v,T,f[0],3936430074,11),T=u(T,O,_,v,f[3],3572445317,16),v=u(v,T,O,_,f[6],76029189,23),_=u(_,v,T,O,f[9],3654602809,4),O=u(O,_,v,T,f[12],3873151461,11),T=u(T,O,_,v,f[15],530742520,16),_=h(_,v=u(v,T,O,_,f[2],3299628645,23),T,O,f[0],4096336452,6),O=h(O,_,v,T,f[7],1126891415,10),T=h(T,O,_,v,f[14],2878612391,15),v=h(v,T,O,_,f[5],4237533241,21),_=h(_,v,T,O,f[12],1700485571,6),O=h(O,_,v,T,f[3],2399980690,10),T=h(T,O,_,v,f[10],4293915773,15),v=h(v,T,O,_,f[1],2240044497,21),_=h(_,v,T,O,f[8],1873313359,6),O=h(O,_,v,T,f[15],4264355552,10),T=h(T,O,_,v,f[6],2734768916,15),v=h(v,T,O,_,f[13],1309151649,21),_=h(_,v,T,O,f[4],4149444226,6),O=h(O,_,v,T,f[11],3174756917,10),T=h(T,O,_,v,f[2],718787259,15),v=h(v,T,O,_,f[9],3951481745,21),this._a=this._a+_|0,this._b=this._b+v|0,this._c=this._c+T|0,this._d=this._d+O|0},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var f=y.allocUnsafe(16);return f.writeInt32LE(this._a,0),f.writeInt32LE(this._b,4),f.writeInt32LE(this._c,8),f.writeInt32LE(this._d,12),f},z.exports=o},function(z,l,c){(l=z.exports=c(128)).Stream=l,l.Readable=l,l.Writable=c(132),l.Duplex=c(30),l.Transform=c(133),l.PassThrough=c(278),l.finished=c(62),l.pipeline=c(279)},function(z,l){},function(z,l,c){"use strict";function s(t,i){var u=Object.keys(t);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(t);i&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(t,f).enumerable})),u.push.apply(u,h)}return u}function m(t,i,u){return i in t?Object.defineProperty(t,i,{value:u,enumerable:!0,configurable:!0,writable:!0}):t[i]=u,t}function y(t,i){for(var u=0;u0?this.tail.next=d:this.head=d,this.tail=d,++this.length}},{key:"unshift",value:function(f){var d={data:f,next:this.head};0===this.length&&(this.tail=d),this.head=d,++this.length}},{key:"shift",value:function(){if(0!==this.length){var f=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(0===this.length)return"";for(var d=this.head,_=""+d.data;d=d.next;)_+=f+d.data;return _}},{key:"concat",value:function(f){if(0===this.length)return n.alloc(0);for(var T=n.allocUnsafe(f>>>0),O=this.head,b=0;O;)n.prototype.copy.call(O.data,T,b),b+=O.data.length,O=O.next;return T}},{key:"consume",value:function(f,d){var _;return fT.length?T.length:f;if(v+=O===T.length?T:T.slice(0,f),0==(f-=O)){O===T.length?(++_,this.head=d.next?d.next:this.tail=null):(this.head=d,d.data=T.slice(O));break}++_}return this.length-=_,v}},{key:"_getBuffer",value:function(f){var d=n.allocUnsafe(f),_=this.head,v=1;for(_.data.copy(d),f-=_.data.length;_=_.next;){var T=_.data,O=f>T.length?T.length:f;if(T.copy(d,d.length-f,0,O),0==(f-=O)){O===T.length?(++v,this.head=_.next?_.next:this.tail=null):(this.head=_,_.data=T.slice(O));break}++v}return this.length-=v,d}},{key:e,value:function(f,d){return o(this,function(_){for(var v=1;v0,function(w){_||(_=w),w&&T.forEach(t),S||(T.forEach(t),v(_))})});return f.reduce(i)}},function(z,l,c){"use strict";var s=c(2).Buffer,m=c(3),y=c(127),n=new Array(16),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],e=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],t=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],i=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],u=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function f(){y.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function d(S,w){return S<>>32-w}function _(S,w,A,L,H,D,q,k){return d(S+(w^A^L)+D+q|0,k)+H|0}function v(S,w,A,L,H,D,q,k){return d(S+(w&A|~w&L)+D+q|0,k)+H|0}function T(S,w,A,L,H,D,q,k){return d(S+((w|~A)^L)+D+q|0,k)+H|0}function O(S,w,A,L,H,D,q,k){return d(S+(w&L|A&~L)+D+q|0,k)+H|0}function b(S,w,A,L,H,D,q,k){return d(S+(w^(A|~L))+D+q|0,k)+H|0}m(f,y),f.prototype._update=function(){for(var S=n,w=0;w<16;++w)S[w]=this._block.readInt32LE(4*w);for(var A=0|this._a,L=0|this._b,H=0|this._c,D=0|this._d,q=0|this._e,k=0|this._a,p=0|this._b,x=0|this._c,R=0|this._d,r=0|this._e,a=0;a<80;a+=1){var g,M;a<16?(g=_(A,L,H,D,q,S[o[a]],u[0],t[a]),M=b(k,p,x,R,r,S[e[a]],h[0],i[a])):a<32?(g=v(A,L,H,D,q,S[o[a]],u[1],t[a]),M=O(k,p,x,R,r,S[e[a]],h[1],i[a])):a<48?(g=T(A,L,H,D,q,S[o[a]],u[2],t[a]),M=T(k,p,x,R,r,S[e[a]],h[2],i[a])):a<64?(g=O(A,L,H,D,q,S[o[a]],u[3],t[a]),M=v(k,p,x,R,r,S[e[a]],h[3],i[a])):(g=b(A,L,H,D,q,S[o[a]],u[4],t[a]),M=_(k,p,x,R,r,S[e[a]],h[4],i[a])),A=q,q=D,D=d(H,10),H=L,L=g,k=r,r=R,R=d(x,10),x=p,p=M}var E=this._b+H+R|0;this._b=this._c+D+r|0,this._c=this._d+q+k|0,this._d=this._e+A+p|0,this._e=this._a+L+x|0,this._a=E},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var S=s.alloc?s.alloc(20):new s(20);return S.writeInt32LE(this._a,0),S.writeInt32LE(this._b,4),S.writeInt32LE(this._c,8),S.writeInt32LE(this._d,12),S.writeInt32LE(this._e,16),S},z.exports=f},function(z,l,c){(l=z.exports=function(s){s=s.toLowerCase();var m=l[s];if(!m)throw new Error(s+" is not supported (we accept pull requests)");return new m}).sha=c(282),l.sha1=c(283),l.sha224=c(284),l.sha256=c(134),l.sha384=c(285),l.sha512=c(135)},function(z,l,c){var s=c(3),m=c(31),y=c(13).Buffer,n=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function e(){this.init(),this._w=o,m.call(this,64,56)}function t(u){return u<<30|u>>>2}function i(u,h,f,d){return 0===u?h&f|~h&d:2===u?h&f|h&d|f&d:h^f^d}s(e,m),e.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},e.prototype._update=function(u){for(var h,f=this._w,d=0|this._a,_=0|this._b,v=0|this._c,T=0|this._d,O=0|this._e,b=0;b<16;++b)f[b]=u.readInt32BE(4*b);for(;b<80;++b)f[b]=f[b-3]^f[b-8]^f[b-14]^f[b-16];for(var S=0;S<80;++S){var w=~~(S/20),A=0|((h=d)<<5|h>>>27)+i(w,_,v,T)+O+f[S]+n[w];O=T,T=v,v=t(_),_=d,d=A}this._a=d+this._a|0,this._b=_+this._b|0,this._c=v+this._c|0,this._d=T+this._d|0,this._e=O+this._e|0},e.prototype._hash=function(){var u=y.allocUnsafe(20);return u.writeInt32BE(0|this._a,0),u.writeInt32BE(0|this._b,4),u.writeInt32BE(0|this._c,8),u.writeInt32BE(0|this._d,12),u.writeInt32BE(0|this._e,16),u},z.exports=e},function(z,l,c){var s=c(3),m=c(31),y=c(13).Buffer,n=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function e(){this.init(),this._w=o,m.call(this,64,56)}function t(h){return h<<5|h>>>27}function i(h){return h<<30|h>>>2}function u(h,f,d,_){return 0===h?f&d|~f&_:2===h?f&d|f&_|d&_:f^d^_}s(e,m),e.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},e.prototype._update=function(h){for(var f,d=this._w,_=0|this._a,v=0|this._b,T=0|this._c,O=0|this._d,b=0|this._e,S=0;S<16;++S)d[S]=h.readInt32BE(4*S);for(;S<80;++S)d[S]=(f=d[S-3]^d[S-8]^d[S-14]^d[S-16])<<1|f>>>31;for(var w=0;w<80;++w){var A=~~(w/20),L=t(_)+u(A,v,T,O)+b+d[w]+n[A]|0;b=O,O=T,T=i(v),v=_,_=L}this._a=_+this._a|0,this._b=v+this._b|0,this._c=T+this._c|0,this._d=O+this._d|0,this._e=b+this._e|0},e.prototype._hash=function(){var h=y.allocUnsafe(20);return h.writeInt32BE(0|this._a,0),h.writeInt32BE(0|this._b,4),h.writeInt32BE(0|this._c,8),h.writeInt32BE(0|this._d,12),h.writeInt32BE(0|this._e,16),h},z.exports=e},function(z,l,c){var s=c(3),m=c(134),y=c(31),n=c(13).Buffer,o=new Array(64);function e(){this.init(),this._w=o,y.call(this,64,56)}s(e,m),e.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},e.prototype._hash=function(){var t=n.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},z.exports=e},function(z,l,c){var s=c(3),m=c(135),y=c(31),n=c(13).Buffer,o=new Array(160);function e(){this.init(),this._w=o,y.call(this,128,112)}s(e,m),e.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},e.prototype._hash=function(){var t=n.allocUnsafe(48);function i(u,h,f){t.writeInt32BE(u,f),t.writeInt32BE(h,f+4)}return i(this._ah,this._al,0),i(this._bh,this._bl,8),i(this._ch,this._cl,16),i(this._dh,this._dl,24),i(this._eh,this._el,32),i(this._fh,this._fl,40),t},z.exports=e},function(z,l,c){var s=c(13).Buffer,m=c(287).Transform,y=c(20).StringDecoder;function n(o){m.call(this),this.hashMode="string"==typeof o,this.hashMode?this[o]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}c(3)(n,m),n.prototype.update=function(o,e,t){"string"==typeof o&&(o=s.from(o,e));var i=this._update(o);return this.hashMode?this:(t&&(i=this._toString(i,t)),i)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(o,e,t){var i;try{this.hashMode?this._update(o):this.push(this._update(o))}catch(u){i=u}finally{t(i)}},n.prototype._flush=function(o){var e;try{this.push(this.__final())}catch(t){e=t}o(e)},n.prototype._finalOrDigest=function(o){var e=this.__final()||s.alloc(0);return o&&(e=this._toString(e,o,!0)),e},n.prototype._toString=function(o,e,t){if(this._decoder||(this._decoder=new y(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(o);return t&&(i+=this._decoder.end()),i},z.exports=n},function(z,l,c){z.exports=m;var s=c(12).EventEmitter;function m(){s.call(this)}c(3)(m,s),m.Readable=c(34),m.Writable=c(288),m.Duplex=c(289),m.Transform=c(290),m.PassThrough=c(291),m.Stream=m,m.prototype.pipe=function(y,n){var o=this;function e(_){y.writable&&!1===y.write(_)&&o.pause&&o.pause()}function t(){o.readable&&o.resume&&o.resume()}o.on("data",e),y.on("drain",t),y._isStdio||n&&!1===n.end||(o.on("end",u),o.on("close",h));var i=!1;function u(){i||(i=!0,y.end())}function h(){i||(i=!0,"function"==typeof y.destroy&&y.destroy())}function f(_){if(d(),0===s.listenerCount(this,"error"))throw _}function d(){o.removeListener("data",e),y.removeListener("drain",t),o.removeListener("end",u),o.removeListener("close",h),o.removeListener("error",f),y.removeListener("error",f),o.removeListener("end",d),o.removeListener("close",d),y.removeListener("close",d)}return o.on("error",f),y.on("error",f),o.on("end",d),o.on("close",d),y.on("close",d),y.emit("pipe",o),y}},function(z,l,c){z.exports=c(53)},function(z,l,c){z.exports=c(19)},function(z,l,c){z.exports=c(34).Transform},function(z,l,c){z.exports=c(34).PassThrough},function(z,l,c){var s=c(2),m=s.Buffer;function y(o,e){for(var t in o)e[t]=o[t]}function n(o,e,t){return m(o,e,t)}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?z.exports=s:(y(s,l),l.Buffer=n),y(m,n),n.from=function(o,e,t){if("number"==typeof o)throw new TypeError("Argument must not be a number");return m(o,e,t)},n.alloc=function(o,e,t){if("number"!=typeof o)throw new TypeError("Argument must be a number");var i=m(o);return void 0!==e?"string"==typeof t?i.fill(e,t):i.fill(e):i.fill(0),i},n.allocUnsafe=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return m(o)},n.allocUnsafeSlow=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return s.SlowBuffer(o)}},function(z,l,c){var s=c(136);z.exports=function(m){return"string"!=typeof m?m:s(m)?m.slice(2):m}},function(z,l,c){const s=c(137),m=c(295);function y(n,o){return new Promise(e=>{const t=setTimeout(e,n);t.unref&&o&&t.unref()})}z.exports=class extends m{constructor(n={}){if(!n.provider)throw new Error("PollingBlockTracker - no provider specified.");const o=n.pollingInterval||2e4,e=n.retryTimeout||o/10,t=void 0===n.keepEventLoopActive||n.keepEventLoopActive,i=n.setSkipCacheFlag||!1;super(Object.assign({blockResetDuration:o},n)),this._provider=n.provider,this._pollingInterval=o,this._retryTimeout=e,this._keepEventLoopActive=t,this._setSkipCacheFlag=i}checkForLatestBlock(){var n=this;return ge(function*(){return yield n._updateLatestBlock(),yield n.getLatestBlock()})()}_start(){this._performSync().catch(n=>this.emit("error",n))}_performSync(){var n=this;return ge(function*(){for(;n._isRunning;)try{yield n._updateLatestBlock(),yield y(n._pollingInterval,!n._keepEventLoopActive)}catch(o){const e=new Error("PollingBlockTracker - encountered an error while attempting to update latest block:\n"+o.stack);try{n.emit("error",e)}catch{console.error(e)}yield y(n._retryTimeout,!n._keepEventLoopActive)}})()}_updateLatestBlock(){var n=this;return ge(function*(){const o=yield n._fetchLatestBlock();n._newPotentialLatest(o)})()}_fetchLatestBlock(){var n=this;return ge(function*(){const o={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]};n._setSkipCacheFlag&&(o.skipCache=!0);const e=yield s(t=>n._provider.sendAsync(o,t))();if(e.error)throw new Error("PollingBlockTracker - encountered error fetching block:\n"+e.error);return e.result})()}}},function(z,l,c){c(138),c(137);const s=c(297),m=(o,e)=>o+e,y=["sync","latest"];function n(o){return Number.parseInt(o,16)}z.exports=class extends s{constructor(o={}){super(),this._blockResetDuration=o.blockResetDuration||2e4,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}getLatestBlock(){var o=this;return ge(function*(){return o._currentBlock?o._currentBlock:yield new Promise(e=>o.once("latest",e))})()}removeAllListeners(o){o?super.removeAllListeners(o):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener()}_start(){}_end(){}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(o,e){y.includes(o)&&this._maybeStart()}_onRemoveListener(o,e){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return y.map(o=>this.listenerCount(o)).reduce(m)}_newPotentialLatest(o){const e=this._currentBlock;e&&n(o)<=n(e)||this._setCurrentBlock(o)}_setCurrentBlock(o){const e=this._currentBlock;this._currentBlock=o,this.emit("latest",o),this.emit("sync",{oldBlock:e,newBlock:o})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}},function(z,l){z.exports=function(c){var s=(c=c||{}).max||Number.MAX_SAFE_INTEGER,m=void 0!==c.start?c.start:Math.floor(Math.random()*s);return function(){return m%=s,m++}}},function(z,l,c){const s=c(21),m=c(12);var y="object"==typeof Reflect?Reflect:null,n=y&&"function"==typeof y.apply?y.apply:function(i,u,h){return Function.prototype.apply.call(i,u,h)};function o(){m.call(this)}function e(i,u,h){try{n(i,u,h)}catch(f){setTimeout(()=>{throw f})}}function t(i,u){for(var h=new Array(u),f=0;f0&&(_=u[0]),_ instanceof Error)throw _;var v=new Error("Unhandled error."+(_?" ("+_.message+")":""));throw v.context=_,v}var T=d[i];if(void 0===T)return!1;if("function"==typeof T)e(T,this,u);else{var O=T.length,b=t(T,O);for(h=0;h-1&&s%1==0&&s="0"&&s<="9";)f+=s,e();if("."===s)for(f+=".";e()&&s>="0"&&s<="9";)f+=s;if("e"===s||"E"===s)for(f+=s,e(),"-"!==s&&"+"!==s||(f+=s,e());s>="0"&&s<="9";)f+=s,e();if(h=+f,isFinite(h))return h;o("Bad number")},i=function(){var h,f,d,_="";if('"'===s)for(;e();){if('"'===s)return e(),_;if("\\"===s)if(e(),"u"===s){for(d=0,f=0;f<4&&(h=parseInt(e(),16),isFinite(h));f+=1)d=16*d+h;_+=String.fromCharCode(d)}else{if("string"!=typeof n[s])break;_+=n[s]}else _+=s}o("Bad string")},u=function(){for(;s&&s<=" ";)e()};y=function(){switch(u(),s){case"{":return function(){var h,f={};if("{"===s){if(e("{"),u(),"}"===s)return e("}"),f;for(;s;){if(h=i(),u(),e(":"),Object.hasOwnProperty.call(f,h)&&o('Duplicate key "'+h+'"'),f[h]=y(),u(),"}"===s)return e("}"),f;e(","),u()}}o("Bad object")}();case"[":return function(){var h=[];if("["===s){if(e("["),u(),"]"===s)return e("]"),h;for(;s;){if(h.push(y()),u(),"]"===s)return e("]"),h;e(","),u()}}o("Bad array")}();case'"':return i();case"-":return t();default:return s>="0"&&s<="9"?t():function(){switch(s){case"t":return e("t"),e("r"),e("u"),e("e"),!0;case"f":return e("f"),e("a"),e("l"),e("s"),e("e"),!1;case"n":return e("n"),e("u"),e("l"),e("l"),null}o("Unexpected '"+s+"'")}()}},z.exports=function(h,f){var d;return m=h,c=0,s=" ",d=y(),u(),s&&o("Syntax error"),"function"==typeof f?function _(v,T){var O,b,S=v[T];if(S&&"object"==typeof S)for(O in S)Object.prototype.hasOwnProperty.call(S,O)&&(void 0!==(b=_(S,O))?S[O]=b:delete S[O]);return f.call(v,T,S)}({"":d},""):d}},function(z,l){var c,s,m,y=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function o(e){return y.lastIndex=0,y.test(e)?'"'+e.replace(y,function(t){var i=n[t];return"string"==typeof i?i:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}z.exports=function(e,t,i){var u;if(c="",s="","number"==typeof i)for(u=0;um(Object.assign({blockTracker:n},y)))}}},function(z,l,c){const s=c(336),m=c(337),y=[void 0,null,""];z.exports=function(o={}){const{blockTracker:e}=o;if(!e)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");const t=new n,i={perma:t,block:t,fork:t};return m(function(){var u=ge(function*(h,f,d){if(h.skipCache)return d();const _=s.cacheTypeForPayload(h),v=i[_];if(!v||!v.canCacheRequest(h))return d();let T,O=s.blockTagForPayload(h);if(O||(O="latest"),"earliest"===O)T="0x00";else if("latest"===O){const S=yield e.getLatestBlock();t.clearBefore(S),T=S}else T=O;const b=yield v.get(h,T);void 0===b?(yield d(),yield v.set(h,T,f.result)):f.result=b});return function(h,f,d){return u.apply(this,arguments)}}())};class n{constructor(){this.cache={}}getBlockCacheForPayload(e,t){const i=Number.parseInt(t,16);let u=this.cache[i];if(!u){const h={};this.cache[i]=h,u=h}return u}get(e,t){var i=this;return ge(function*(){const u=i.getBlockCacheForPayload(e,t);if(u)return u[s.cacheIdentifierForPayload(e,!0)]})()}set(e,t,i){var u=this;return ge(function*(){!u.canCacheResult(e,i)||(u.getBlockCacheForPayload(e,t)[s.cacheIdentifierForPayload(e,!0)]=i)})()}canCacheRequest(e){return!!s.canCache(e)&&"pending"!==s.blockTagForPayload(e)}canCacheResult(e,t){if(!y.includes(t))return!!(!["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(e.method)||t&&t.blockHash&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==t.blockHash)}clearBefore(e){const t=this,i=Number.parseInt(e,16);Object.keys(t.cache).map(Number).filter(u=>udelete t.cache[u])}}},function(z,l,c){const s=c(150);function m(e){return"never"!==o(e)}function y(e){const t=n(e);return t>=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function n(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function o(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}z.exports={cacheIdentifierForPayload:function(e,t){const i=t?y(e):e.params;return m(e)?e.method+":"+s(i):null},canCache:m,blockTagForPayload:function(e){let t=n(e);return t>=e.params.length?null:e.params[t]},paramsWithoutBlockTag:y,blockTagParamIndex:n,cacheTypeForPayload:o}},function(z,l){z.exports=function(c){return(s,m,y,n)=>{let o;const e=new Promise(u=>{o=u});let t,i;c(s,m,ge(function*(){i=!0,y(u=>{t=u,o()}),yield e})).then(ge(function*(){i?(yield e,t(null)):n(null)})).catch(u=>{t?t(u):n(u)})}}},function(z,l,c){const s=c(21).inherits,m=c(49);function y(n){this.staticResponses=n=n||{}}z.exports=y,s(y,m),y.prototype.handleRequest=function(n,o,e){var t=this.staticResponses[n.method];"function"==typeof t?t(n,o,e):void 0!==t?setTimeout(()=>e(null,t)):o()}},function(z,l,c){const s=c(68),m=c(151);z.exports=class extends s{constructor(){super(({blockTracker:y,provider:n})=>m({blockTracker:y,provider:n}))}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.createIdRemapMiddleware=void 0;const s=c(153);l.createIdRemapMiddleware=function(){return(m,y,n,o)=>{const e=m.id,t=s.getUniqueId();m.id=t,y.id=t,n(i=>{m.id=e,y.id=e,i()})}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.createAsyncMiddleware=void 0,l.createAsyncMiddleware=function(s){return function(){var m=ge(function*(y,n,o,e){let t;const i=new Promise(d=>{t=d});let u=null,h=!1;const f=function(){var d=ge(function*(){h=!0,o(_=>{u=_,t()}),yield i});return function(){return d.apply(this,arguments)}}();try{yield s(y,n,f),h?(yield i,u(null)):e(null)}catch(d){u?u(d):e(d)}});return function(y,n,o,e){return m.apply(this,arguments)}}()}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.createScaffoldMiddleware=void 0,l.createScaffoldMiddleware=function(s){return(m,y,n,o)=>{const e=s[m.method];return void 0===e?n():"function"==typeof e?e(m,y,n,o):(y.result=e,o())}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.getMessageFromCode=l.serializeError=l.EthereumProviderError=l.EthereumRpcError=l.ethErrors=l.errorCodes=void 0;const s=c(70);Object.defineProperty(l,"EthereumRpcError",{enumerable:!0,get:function(){return s.EthereumRpcError}}),Object.defineProperty(l,"EthereumProviderError",{enumerable:!0,get:function(){return s.EthereumProviderError}});const m=c(155);Object.defineProperty(l,"serializeError",{enumerable:!0,get:function(){return m.serializeError}}),Object.defineProperty(l,"getMessageFromCode",{enumerable:!0,get:function(){return m.getMessageFromCode}});const y=c(345);Object.defineProperty(l,"ethErrors",{enumerable:!0,get:function(){return y.ethErrors}});const n=c(71);Object.defineProperty(l,"errorCodes",{enumerable:!0,get:function(){return n.errorCodes}})},function(z,l){z.exports=y,y.default=y,y.stable=e,y.stableStringify=e;var c=[],s=[];function m(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function y(i,u,h,f){var d;void 0===f&&(f=m()),function v(T,O,b,S,w,A,L){var H;if(A+=1,"object"==typeof T&&null!==T){for(H=0;HL.depthLimit||void 0!==L.edgesLimit&&b+1>L.edgesLimit)return void n("[...]",T,O,w);if(S.push(T),Array.isArray(T))for(H=0;Hu?1:0}function e(i,u,h,f){void 0===f&&(f=m());var d,_=function T(O,b,S,w,A,L,H){var D;if(L+=1,"object"==typeof O&&null!==O){for(D=0;DH.depthLimit||void 0!==H.edgesLimit&&S+1>H.edgesLimit)return void n("[...]",O,b,A);if(w.push(O),Array.isArray(O))for(D=0;D0)for(var f=0;fn(y.errorCodes.rpc.parse,t),invalidRequest:t=>n(y.errorCodes.rpc.invalidRequest,t),invalidParams:t=>n(y.errorCodes.rpc.invalidParams,t),methodNotFound:t=>n(y.errorCodes.rpc.methodNotFound,t),internal:t=>n(y.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:i}=t;if(!Number.isInteger(i)||i>-32005||i<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(i,t)},invalidInput:t=>n(y.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>n(y.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>n(y.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>n(y.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>n(y.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>n(y.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>o(y.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>o(y.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>o(y.errorCodes.provider.unsupportedMethod,t),disconnected:t=>o(y.errorCodes.provider.disconnected,t),chainDisconnected:t=>o(y.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:i,message:u,data:h}=t;if(!u||"string"!=typeof u)throw new Error('"message" must be a nonempty string');return new s.EthereumProviderError(i,u,h)}}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.mergeMiddleware=void 0;const s=c(154);l.mergeMiddleware=function(m){const y=new s.JsonRpcEngine;return m.forEach(n=>y.push(n)),y.asMiddleware()}},function(z,l){z.exports=function(c){return(s,m,y,n)=>{const o=c[s.method];return void 0===o?y():"function"==typeof o?o(s,m,y,n):(m.result=o,n())}}},function(z,l,c){const s=c(138),m=c(349),y=c(350),{hexToInt:o,incrementHexInt:e,minBlockRef:t,blockRefIsNumber:i}=c(39);z.exports=class extends y{constructor({provider:u,params:h}){super(),this.type="log",this.ethQuery=new s(u),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},h),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(f=>f.toLowerCase()))}initialize({currentBlock:u}){var h=this;return ge(function*(){let f=h.params.fromBlock;["latest","pending"].includes(f)&&(f=u),"earliest"===f&&(f="0x0"),h.params.fromBlock=f;const d=t(h.params.toBlock,u),_=Object.assign({},h.params,{toBlock:d}),v=yield h._fetchLogs(_);h.addInitialResults(v)})()}update({oldBlock:u,newBlock:h}){var f=this;return ge(function*(){const d=h;let _;_=u?e(u):h;const v=Object.assign({},f.params,{fromBlock:_,toBlock:d}),T=(yield f._fetchLogs(v)).filter(O=>f.matchLog(O));f.addResults(T)})()}_fetchLogs(u){var h=this;return ge(function*(){return yield m(f=>h.ethQuery.getLogs(u,f))()})()}matchLog(u){if(o(this.params.fromBlock)>=o(u.blockNumber)||i(this.params.toBlock)&&o(this.params.toBlock)<=o(u.blockNumber))return!1;const h=u.address&&u.address.toLowerCase();return!(this.params.address&&h&&!this.params.address.includes(h))&&this.params.topics.every((f,d)=>{let _=u.topics[d];if(!_)return!1;_=_.toLowerCase();let v=Array.isArray(f)?f:[f];return!!v.includes(null)||(v=v.map(T=>T.toLowerCase()),v.includes(_))})}}},function(z,l,c){"use strict";const s=(y,n,o,e)=>function(...t){return new n.promiseModule((i,u)=>{t.push(n.multiArgs?(...f)=>{n.errorFirst?f[0]?u(f):(f.shift(),i(f)):i(f)}:n.errorFirst?(f,d)=>{f?u(f):i(d)}:i),Reflect.apply(y,this===o?e:this,t)})},m=new WeakMap;z.exports=(y,n)=>{n={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...n};const o=typeof y;if(null===y||"object"!==o&&"function"!==o)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===y?"null":o}\``);const e=new WeakMap,t=new Proxy(y,{apply(i,u,h){const f=e.get(i);if(f)return Reflect.apply(f,u,h);const d=n.excludeMain?i:s(i,n,t,i);return e.set(i,d),Reflect.apply(d,u,h)},get(i,u){const h=i[u];if(!((d,_)=>{let v=m.get(d);if(v||(v={},m.set(d,v)),_ in v)return v[_];const T=w=>"string"==typeof w||"symbol"==typeof _?_===w:w.test(_),O=Reflect.getOwnPropertyDescriptor(d,_),b=void 0===O||O.writable||O.configurable,S=(n.include?n.include.some(T):!n.exclude.some(T))&&b;return v[_]=S,S})(i,u)||h===Function.prototype[u])return h;const f=e.get(h);if(f)return f;if("function"==typeof h){const d=s(h,n,t,i);return e.set(h,d),d}return h}});return t}},function(z,l,c){const s=c(72);z.exports=class extends s{constructor(){super(),this.allResults=[]}update(){return ge(function*(){throw new Error("BaseFilterWithHistory - no update method specified")})()}addResults(m){this.allResults=this.allResults.concat(m),super.addResults(m)}addInitialResults(m){this.allResults=this.allResults.concat(m),super.addInitialResults(m)}getAllResults(){return this.allResults}}},function(z,l,c){const s=c(72),m=c(73),{incrementHexInt:y}=c(39);z.exports=class extends s{constructor({provider:n}){super(),this.type="block",this.provider=n}update({oldBlock:n,newBlock:o}){var e=this;return ge(function*(){const t=o,i=y(n),u=(yield m({provider:e.provider,fromBlock:i,toBlock:t})).map(h=>h.hash);e.addResults(u)})()}}},function(z,l,c){const s=c(72),m=c(73),{incrementHexInt:y}=c(39);z.exports=class extends s{constructor({provider:n}){super(),this.type="tx",this.provider=n}update({oldBlock:n}){var o=this;return ge(function*(){const e=n,t=y(n),i=yield m({provider:o.provider,fromBlock:t,toBlock:e}),u=[];for(const h of i)u.push(...h.transactions);o.addResults(u)})()}}},function(z,l,c){const s=c(354),m=c(355),y=c(21).inherits,n=c(36),o=c(357),e=c(44),t=c(367),i=c(49),u=c(368),h=/^[0-9A-Fa-f]+$/g;function f(b){this.nonceLock=t(1),b.getAccounts&&(this.getAccounts=b.getAccounts),b.processTransaction&&(this.processTransaction=b.processTransaction),b.processMessage&&(this.processMessage=b.processMessage),b.processPersonalMessage&&(this.processPersonalMessage=b.processPersonalMessage),b.processTypedMessage&&(this.processTypedMessage=b.processTypedMessage),this.approveTransaction=b.approveTransaction||this.autoApprove,this.approveMessage=b.approveMessage||this.autoApprove,this.approvePersonalMessage=b.approvePersonalMessage||this.autoApprove,this.approveDecryptMessage=b.approveDecryptMessage||this.autoApprove,this.approveEncryptionPublicKey=b.approveEncryptionPublicKey||this.autoApprove,this.approveTypedMessage=b.approveTypedMessage||this.autoApprove,b.signTransaction&&(this.signTransaction=b.signTransaction||O("signTransaction")),b.signMessage&&(this.signMessage=b.signMessage||O("signMessage")),b.signPersonalMessage&&(this.signPersonalMessage=b.signPersonalMessage||O("signPersonalMessage")),b.decryptMessage&&(this.decryptMessage=b.decryptMessage||O("decryptMessage")),b.encryptionPublicKey&&(this.encryptionPublicKey=b.encryptionPublicKey||O("encryptionPublicKey")),b.signTypedMessage&&(this.signTypedMessage=b.signTypedMessage||O("signTypedMessage")),b.recoverPersonalSignature&&(this.recoverPersonalSignature=b.recoverPersonalSignature),b.publishTransaction&&(this.publishTransaction=b.publishTransaction),this.estimateGas=b.estimateGas||this.estimateGas,this.getGasPrice=b.getGasPrice||this.getGasPrice}function d(b){return b.toLowerCase()}function _(b){const S=n.addHexPrefix(b);return n.isValidAddress(S)}function v(b){const S=n.addHexPrefix(b);return!n.isValidAddress(S)&&T(b)}function T(b){return"string"==typeof b&&"0x"===b.slice(0,2)&&b.slice(2).match(h)}function O(b){return function(S,w){w(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+b+'" fn in constructor options'))}}z.exports=f,y(f,i),f.prototype.handleRequest=function(b,S,w){const A=this;let L,H,D,q,k;switch(A._parityRequests={},A._parityRequestCount=0,b.method){case"eth_coinbase":case"parity_defaultAccount":return void A.getAccounts(function(p,x){if(p)return w(p);w(null,x[0]||null)});case"eth_accounts":return void A.getAccounts(function(p,x){if(p)return w(p);w(null,x)});case"eth_sendTransaction":return L=b.params[0],void s([p=>A.validateTransaction(L,p),p=>A.processTransaction(L,p)],w);case"eth_signTransaction":return L=b.params[0],void s([p=>A.validateTransaction(L,p),p=>A.processSignTransaction(L,p)],w);case"eth_sign":return k=b.params[0],q=b.params[1],D=b.params[2]||{},H=e(D,{from:k,data:q}),void s([p=>A.validateMessage(H,p),p=>A.processMessage(H,p)],w);case"personal_sign":return function(){const p=b.params[0];if(v(b.params[1])&&_(p)){let x="The eth_personalSign method requires params ordered ";x+="[message, address]. This was previously handled incorrectly, ",x+="and has been corrected automatically. ",x+="Please switch this param order for smooth behavior in the future.",console.warn(x),k=b.params[0],q=b.params[1]}else q=b.params[0],k=b.params[1];D=b.params[2]||{},H=e(D,{from:k,data:q}),s([x=>A.validatePersonalMessage(H,x),x=>A.processPersonalMessage(H,x)],w)}();case"eth_decryptMessage":return function(){const p=b.params[0];if(v(b.params[1])&&_(p)){let x="The eth_decryptMessage method requires params ordered ";x+="[message, address]. This was previously handled incorrectly, ",x+="and has been corrected automatically. ",x+="Please switch this param order for smooth behavior in the future.",console.warn(x),k=b.params[0],q=b.params[1]}else q=b.params[0],k=b.params[1];D=b.params[2]||{},H=e(D,{from:k,data:q}),s([x=>A.validateDecryptMessage(H,x),x=>A.processDecryptMessage(H,x)],w)}();case"encryption_public_key":return function(){const p=b.params[0];s([x=>A.validateEncryptionPublicKey(p,x),x=>A.processEncryptionPublicKey(p,x)],w)}();case"personal_ecRecover":return q=b.params[0],D=b.params[2]||{},H=e(D,{sig:b.params[1],data:q}),void A.recoverPersonalSignature(H,w);case"eth_signTypedData":case"eth_signTypedData_v3":case"eth_signTypedData_v4":return function(){const p=b.params[0],x=b.params[1];_(p)?(k=p,q=x):(q=p,k=x),D=b.params[2]||{},H=e(D,{from:k,data:q}),s([R=>A.validateTypedMessage(H,R),R=>A.processTypedMessage(H,R)],w)}();case"parity_postTransaction":return L=b.params[0],void A.parityPostTransaction(L,w);case"parity_postSign":return k=b.params[0],q=b.params[1],void A.parityPostSign(k,q,w);case"parity_checkRequest":return void A.parityCheckRequest(b.params[0],w);default:return void S()}},f.prototype.getAccounts=function(b){b(null,[])},f.prototype.processTransaction=function(b,S){const w=this;s([A=>w.approveTransaction(b,A),(A,L)=>w.checkApproval("transaction",A,L),A=>w.finalizeAndSubmitTx(b,A)],S)},f.prototype.processSignTransaction=function(b,S){const w=this;s([A=>w.approveTransaction(b,A),(A,L)=>w.checkApproval("transaction",A,L),A=>w.finalizeTx(b,A)],S)},f.prototype.processMessage=function(b,S){const w=this;s([A=>w.approveMessage(b,A),(A,L)=>w.checkApproval("message",A,L),A=>w.signMessage(b,A)],S)},f.prototype.processPersonalMessage=function(b,S){const w=this;s([A=>w.approvePersonalMessage(b,A),(A,L)=>w.checkApproval("message",A,L),A=>w.signPersonalMessage(b,A)],S)},f.prototype.processDecryptMessage=function(b,S){const w=this;s([A=>w.approveDecryptMessage(b,A),(A,L)=>w.checkApproval("decryptMessage",A,L),A=>w.decryptMessage(b,A)],S)},f.prototype.processEncryptionPublicKey=function(b,S){const w=this;s([A=>w.approveEncryptionPublicKey(b,A),(A,L)=>w.checkApproval("encryptionPublicKey",A,L),A=>w.encryptionPublicKey(b,A)],S)},f.prototype.processTypedMessage=function(b,S){const w=this;s([A=>w.approveTypedMessage(b,A),(A,L)=>w.checkApproval("message",A,L),A=>w.signTypedMessage(b,A)],S)},f.prototype.autoApprove=function(b,S){S(null,!0)},f.prototype.checkApproval=function(b,S,w){w(S?null:new Error("User denied "+b+" signature."))},f.prototype.parityPostTransaction=function(b,S){const w=this,A="0x"+w._parityRequestCount.toString(16);w._parityRequestCount++,w.emitPayload({method:"eth_sendTransaction",params:[b]},function(L,H){w._parityRequests[A]=L?{error:L}:H.result}),S(null,A)},f.prototype.parityPostSign=function(b,S,w){const A=this,L="0x"+A._parityRequestCount.toString(16);A._parityRequestCount++,A.emitPayload({method:"eth_sign",params:[b,S]},function(H,D){A._parityRequests[L]=H?{error:H}:D.result}),w(null,L)},f.prototype.parityCheckRequest=function(b,S){const w=this._parityRequests[b]||null;return w?w.error?S(w.error):void S(null,w):S(null,null)},f.prototype.recoverPersonalSignature=function(b,S){let w;try{w=o.recoverPersonalSignature(b)}catch(A){return S(A)}S(null,w)},f.prototype.validateTransaction=function(b,S){if(void 0===b.from)return S(new Error("Undefined address - from address required to sign transaction."));this.validateSender(b.from,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to sign transaction for this address: "${b.from}"`))})},f.prototype.validateMessage=function(b,S){if(void 0===b.from)return S(new Error("Undefined address - from address required to sign message."));this.validateSender(b.from,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to sign message for this address: "${b.from}"`))})},f.prototype.validatePersonalMessage=function(b,S){return void 0===b.from?S(new Error("Undefined address - from address required to sign personal message.")):void 0===b.data?S(new Error("Undefined message - message required to sign personal message.")):T(b.data)?void this.validateSender(b.from,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to sign message for this address: "${b.from}"`))}):S(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},f.prototype.validateDecryptMessage=function(b,S){return void 0===b.from?S(new Error("Undefined address - from address required to decrypt message.")):void 0===b.data?S(new Error("Undefined message - message required to decrypt message.")):T(b.data)?void this.validateSender(b.from,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to decrypt message for this address: "${b.from}"`))}):S(new Error("HookedWalletSubprovider - validateDecryptMessage - message was not encoded as hex."))},f.prototype.validateEncryptionPublicKey=function(b,S){this.validateSender(b,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to obtain encryption public key for this address: "${b}"`))})},f.prototype.validateTypedMessage=function(b,S){return void 0===b.from?S(new Error("Undefined address - from address required to sign typed data.")):void 0===b.data?S(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(b.from,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to sign message for this address: "${b.from}"`))})},f.prototype.validateSender=function(b,S){if(!b)return S(null,!1);this.getAccounts(function(w,A){if(w)return S(w);const L=-1!==A.map(d).indexOf(b.toLowerCase());S(null,L)})},f.prototype.finalizeAndSubmitTx=function(b,S){const w=this;w.nonceLock.take(function(){s([w.fillInTxExtras.bind(w,b),w.signTransaction.bind(w),w.publishTransaction.bind(w)],function(A,L){if(w.nonceLock.leave(),A)return S(A);S(null,L)})})},f.prototype.finalizeTx=function(b,S){const w=this;w.nonceLock.take(function(){s([w.fillInTxExtras.bind(w,b),w.signTransaction.bind(w)],function(A,L){if(w.nonceLock.leave(),A)return S(A);S(null,{raw:L,tx:b})})})},f.prototype.publishTransaction=function(b,S){this.emitPayload({method:"eth_sendRawTransaction",params:[b]},function(w,A){if(w)return S(w);S(null,A.result)})},f.prototype.estimateGas=function(b,S){u(this.engine,b,S)},f.prototype.getGasPrice=function(b){this.emitPayload({method:"eth_gasPrice",params:[]},function(S,w){if(S)return b(S);b(null,w.result)})},f.prototype.fillInTxExtras=function(b,S){const w=this,A=b.from,L={};var H;void 0===b.gasPrice&&(L.gasPrice=w.getGasPrice.bind(w)),void 0===b.nonce&&(L.nonce=w.emitPayload.bind(w,{method:"eth_getTransactionCount",params:[A,"pending"]})),void 0===b.gas&&(L.gas=w.estimateGas.bind(w,{from:(H=b).from,to:H.to,value:H.value,data:H.data,gas:H.gas,gasPrice:H.gasPrice,nonce:H.nonce})),m(L,function(H,D){if(H)return S(H);const q={};D.gasPrice&&(q.gasPrice=D.gasPrice),D.nonce&&(q.nonce=D.nonce.result),D.gas&&(q.gas=D.gas),S(null,e(b,q))})}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(i,u){if(u=(0,y.default)(u||m.default),!(0,s.default)(i))return u(new Error("First argument to waterfall must be an array of functions"));if(!i.length)return u();var h=0;function f(_){var v=(0,e.default)(i[h++]);_.push((0,o.default)(d)),v.apply(null,_)}function d(_){if(_||h===i.length)return u.apply(null,arguments);f((0,n.default)(arguments,1))}f([])};var s=t(c(147)),m=t(c(38)),y=t(c(64)),n=t(c(48)),o=t(c(66)),e=t(c(23));function t(i){return i&&i.__esModule?i:{default:i}}z.exports=l.default},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(n,o){(0,m.default)(s.default,n,o)};var s=y(c(139)),m=y(c(356));function y(n){return n&&n.__esModule?n:{default:n}}z.exports=l.default},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(e,t,i){i=i||s.default;var u=(0,m.default)(t)?[]:{};e(t,function(h,f,d){(0,n.default)(h)(function(_,v){arguments.length>2&&(v=(0,y.default)(arguments,1)),u[f]=v,d(_)})},function(h){i(h,u)})};var s=o(c(38)),m=o(c(47)),y=o(c(48)),n=o(c(23));function o(e){return e&&e.__esModule?e:{default:e}}z.exports=l.default},function(z,l,c){const s=c(36),m=c(358);function y(t){const i=new Error("Expect argument to be non-empty array");if("object"!=typeof t||!t.length)throw i;const u=t.map(function(d){return"bytes"===d.type?s.toBuffer(d.value):d.value}),h=t.map(function(d){return d.type}),f=t.map(function(d){if(!d.name)throw i;return d.type+" "+d.name});return m.soliditySHA3(["bytes32","bytes32"],[m.soliditySHA3(new Array(t.length).fill("string"),f),m.soliditySHA3(h,u)])}function n(t,i){const u=s.toBuffer(i),h=s.fromRpcSig(u);return s.ecrecover(t,h.v,h.r,h.s)}function o(t){const i=s.toBuffer(t.data);return n(s.hashPersonalMessage(i),t.sig)}function e(t,i){for(var u=""+t;u.lengthw)throw new Error("Elements exceed array size: "+w);for(H in L=[],b=b.slice(0,b.lastIndexOf("[")),"string"==typeof S&&(S=JSON.parse(S)),S)L.push(f(b,S[H]));if("dynamic"===w){var D=f("uint256",S.length);L.unshift(D)}return s.concat(L)}if("bytes"===b)return S=s.from(S),L=s.concat([f("uint256",S.length),S]),S.length%32!=0&&(L=s.concat([L,m.zeros(32-S.length%32)])),L;if(b.startsWith("bytes")){if((w=e(b))<1||w>32)throw new Error("Invalid bytes width: "+w);return m.setLengthRight(S,32)}if(b.startsWith("uint")){if((w=e(b))%8||w<8||w>256)throw new Error("Invalid uint width: "+w);if((A=u(S)).bitLength()>w)throw new Error("Supplied uint exceeds width: "+w+" vs "+A.bitLength());if(A<0)throw new Error("Supplied uint is negative");return A.toArrayLike(s,"be",32)}if(b.startsWith("int")){if((w=e(b))%8||w<8||w>256)throw new Error("Invalid int width: "+w);if((A=u(S)).bitLength()>w)throw new Error("Supplied int exceeds width: "+w+" vs "+A.bitLength());return A.toTwos(256).toArrayLike(s,"be",32)}if(b.startsWith("ufixed")){if(w=t(b),(A=u(S))<0)throw new Error("Supplied ufixed is negative");return f("uint256",A.mul(new y(2).pow(new y(w[1]))))}if(b.startsWith("fixed"))return w=t(b),f("int256",u(S).mul(new y(2).pow(new y(w[1]))));throw new Error("Unsupported or invalid type: "+b)}function d(b,S,w){var A,L,H,D;if("string"==typeof b&&(b=_(b)),"address"===b.name)return d(b.rawType,S,w).toArrayLike(s,"be",20).toString("hex");if("bool"===b.name)return d(b.rawType,S,w).toString()===new y(1).toString();if("string"===b.name){var q=d(b.rawType,S,w);return s.from(q,"utf8").toString()}if(b.isArray){for(H=[],A=b.size,"dynamic"===b.size&&(w=d("uint256",S,w).toNumber(),A=d("uint256",S,w).toNumber(),w+=32),D=0;Db.size)throw new Error("Decoded int exceeds width: "+b.size+" vs "+L.bitLength());return L}if(b.name.startsWith("int")){if((L=new y(S.slice(w,w+32),16,"be").fromTwos(256)).bitLength()>b.size)throw new Error("Decoded uint exceeds width: "+b.size+" vs "+L.bitLength());return L}if(b.name.startsWith("ufixed")){if(A=new y(2).pow(new y(b.size[1])),!(L=d("uint256",S,w)).mod(A).isZero())throw new Error("Decimals not supported yet");return L.div(A)}if(b.name.startsWith("fixed")){if(A=new y(2).pow(new y(b.size[1])),!(L=d("int256",S,w)).mod(A).isZero())throw new Error("Decimals not supported yet");return L.div(A)}throw new Error("Unsupported or invalid type: "+b.name)}function _(b){var S,w,A;if(T(b)){S=i(b);var L=b.slice(0,b.lastIndexOf("["));return L=_(L),{isArray:!0,name:b,size:S,memoryUsage:"dynamic"===S?32:L.memoryUsage*S,subArray:L}}switch(b){case"address":A="uint160";break;case"bool":A="uint8";break;case"string":A="bytes"}if(w={rawType:A,name:b,memoryUsage:32},b.startsWith("bytes")&&"bytes"!==b||b.startsWith("uint")||b.startsWith("int")?w.size=e(b):(b.startsWith("ufixed")||b.startsWith("fixed"))&&(w.size=t(b)),b.startsWith("bytes")&&"bytes"!==b&&(w.size<1||w.size>32))throw new Error("Invalid bytes width: "+w.size);if((b.startsWith("uint")||b.startsWith("int"))&&(w.size%8||w.size<8||w.size>256))throw new Error("Invalid int/uint width: "+w.size);return w}function v(b){return"string"===b||"bytes"===b||"dynamic"===i(b)}function T(b){return b.lastIndexOf("]")===b.length-1}function O(b,S){return b.startsWith("address")||b.startsWith("bytes")?"0x"+S.toString("hex"):S.toString()}n.eventID=function(b,S){var w=b+"("+S.map(o).join(",")+")";return m.keccak256(s.from(w))},n.methodID=function(b,S){return n.eventID(b,S).slice(0,4)},n.rawEncode=function(b,S){var w=[],A=[],L=0;b.forEach(function(k){if(T(k)){var p=i(k);L+="dynamic"!==p?32*p:32}else L+=32});for(var H=0;HD)throw new Error("Elements exceed array size: "+D)}var q=S.map(function(x){return n.solidityHexValue(H,x,256)});return s.concat(q)}if("bytes"===b)return S;if("string"===b)return s.from(S,"utf8");if("bool"===b){w=w||8;var k=Array(w/4).join("0");return s.from(S?k+"1":k+"0","hex")}if("address"===b){var p=20;return w&&(p=w/8),m.setLengthLeft(S,p)}if(b.startsWith("bytes")){if((A=e(b))<1||A>32)throw new Error("Invalid bytes width: "+A);return m.setLengthRight(S,A)}if(b.startsWith("uint")){if((A=e(b))%8||A<8||A>256)throw new Error("Invalid uint width: "+A);if((L=u(S)).bitLength()>A)throw new Error("Supplied uint exceeds width: "+A+" vs "+L.bitLength());return L.toArrayLike(s,"be",(w=w||A)/8)}if(b.startsWith("int")){if((A=e(b))%8||A<8||A>256)throw new Error("Invalid int width: "+A);if((L=u(S)).bitLength()>A)throw new Error("Supplied int exceeds width: "+A+" vs "+L.bitLength());return w=w||A,L.toTwos(A).toArrayLike(s,"be",w/8)}throw new Error("Unsupported or invalid type: "+b)},n.solidityPack=function(b,S){if(b.length!==S.length)throw new Error("Number of types are not matching the values");for(var w=[],A=0;A="0"&&S<="9";)H+=b[D]-"0",D++;A=D-1,w.push(H)}else if("i"===L)w.push("int256");else{if("a"!==L)throw new Error("Unsupported or invalid type: "+L);w.push("int256[]")}}return w},n.toSerpent=function(b){for(var S=[],w=0;w=0)throw new Error("couldn't export to DER format");var u=y.g.mul(i);return o(u.getX(),u.getY(),t)},l.privateKeyModInverse=function(e){var t=new m(e);if(t.ucmp(n.n)>=0||t.isZero())throw new Error("private key range is invalid");return t.invm(n.n).toArrayLike(s,"be",32)},l.signatureImport=function(e){var t=new m(e.r);t.ucmp(n.n)>=0&&(t=new m(0));var i=new m(e.s);return i.ucmp(n.n)>=0&&(i=new m(0)),s.concat([t.toArrayLike(s,"be",32),i.toArrayLike(s,"be",32)])},l.ecdhUnsafe=function(e,t,i){void 0===i&&(i=!0);var u=y.keyFromPublic(e),h=new m(t);if(h.ucmp(n.n)>=0||h.isZero())throw new Error("scalar was invalid (zero or overflow)");var f=u.pub.mul(h);return o(f.getX(),f.getY(),i)};var o=function(e,t,i){var u;return i?((u=s.alloc(33))[0]=t.isOdd()?3:2,e.toArrayLike(s,"be",32).copy(u,1)):((u=s.alloc(65))[0]=4,e.toArrayLike(s,"be",32).copy(u,1),t.toArrayLike(s,"be",32).copy(u,33)),u}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0});var m=s.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),y=s.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);l.privateKeyExport=function(n,o,e){void 0===e&&(e=!0);var t=s.from(e?m:y);return n.copy(t,e?8:9),o.copy(t,e?181:214),t},l.privateKeyImport=function(n){var o=n.length,e=0;if(o2||o<(e+=1)+t)return null;var i=n[e+t-1]|(t>1?n[e+t-2]<<8:0);return o<(e+=t)+i||o32||ot||2!==n[i++])return null;var h=n[i++];if(128&h){if(i+(u=h-128)>t)return null;for(;u>0&&0===n[i];i+=1,u-=1);for(h=0;u>0;i+=1,u-=1)h=(h<<8)+n[i]}if(h>t-i)return null;var f=i;if(i+=h,2!==n[i++])return null;var d=n[i++];if(128&d){if(i+(u=d-128)>t)return null;for(;u>0&&0===n[i];i+=1,u-=1);for(d=0;u>0;i+=1,u-=1)d=(d<<8)+n[i]}if(d>t-i)return null;var _=i;for(i+=d;h>0&&0===n[f];h-=1,f+=1);if(h>32)return null;var v=n.slice(f,f+h);for(v.copy(o,32-v.length);d>0&&0===n[_];d-=1,_+=1);if(d>32)return null;var T=n.slice(_,_+d);return T.copy(e,32-T.length),{r:o,s:e}}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.KECCAK256_RLP=l.KECCAK256_RLP_S=l.KECCAK256_RLP_ARRAY=l.KECCAK256_RLP_ARRAY_S=l.KECCAK256_NULL=l.KECCAK256_NULL_S=l.TWO_POW256=l.MAX_INTEGER=void 0;var m=c(9);l.MAX_INTEGER=new m("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),l.TWO_POW256=new m("10000000000000000000000000000000000000000000000000000000000000000",16),l.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",l.KECCAK256_NULL=s.from(l.KECCAK256_NULL_S,"hex"),l.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",l.KECCAK256_RLP_ARRAY=s.from(l.KECCAK256_RLP_ARRAY_S,"hex"),l.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",l.KECCAK256_RLP=s.from(l.KECCAK256_RLP_S,"hex")}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.importPublic=l.privateToPublic=l.privateToAddress=l.publicToAddress=l.pubToAddress=l.isValidPublic=l.isValidPrivate=l.isPrecompiled=l.generateAddress2=l.generateAddress=l.isValidChecksumAddress=l.toChecksumAddress=l.isZeroAddress=l.isValidAddress=l.zeroAddress=void 0;var m=c(61),y=c(32),n=c(74),o=c(9),e=c(40),t=c(75);l.zeroAddress=function(){var i=e.zeros(20);return e.bufferToHex(i)},l.isValidAddress=function(i){return/^0x[0-9a-fA-F]{40}$/.test(i)},l.isZeroAddress=function(i){return l.zeroAddress()===e.addHexPrefix(i)},l.toChecksumAddress=function(i,u){i=y.stripHexPrefix(i).toLowerCase();for(var h=void 0!==u?u.toString()+"0x":"",f=t.keccak(h+i).toString("hex"),d="0x",_=0;_=8?d+=i[_].toUpperCase():d+=i[_];return d},l.isValidChecksumAddress=function(i,u){return l.isValidAddress(i)&&l.toChecksumAddress(i,u)===i},l.generateAddress=function(i,u){i=e.toBuffer(i);var h=new o(u);return h.isZero()?t.rlphash([i,null]).slice(-20):t.rlphash([i,s.from(h.toArray())]).slice(-20)},l.generateAddress2=function(i,u,h){var f=e.toBuffer(i),d=e.toBuffer(u),_=e.toBuffer(h);return m(20===f.length),m(32===d.length),t.keccak256(s.concat([s.from("ff","hex"),f,d,t.keccak256(_)])).slice(-20)},l.isPrecompiled=function(i){var u=e.unpad(i);return 1===u.length&&u[0]>=1&&u[0]<=8},l.isValidPrivate=function(i){return n.privateKeyVerify(i)},l.isValidPublic=function(i,u){return void 0===u&&(u=!1),64===i.length?n.publicKeyVerify(s.concat([s.from([4]),i])):!!u&&n.publicKeyVerify(i)},l.pubToAddress=function(i,u){return void 0===u&&(u=!1),i=e.toBuffer(i),u&&64!==i.length&&(i=n.publicKeyConvert(i,!1).slice(1)),m(64===i.length),t.keccak(i).slice(-20)},l.publicToAddress=l.pubToAddress,l.privateToAddress=function(i){return l.publicToAddress(l.privateToPublic(i))},l.privateToPublic=function(i){return i=e.toBuffer(i),n.publicKeyCreate(i,!1).slice(1)},l.importPublic=function(i){return 64!==(i=e.toBuffer(i)).length&&(i=n.publicKeyConvert(i,!1).slice(1)),i}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.hashPersonalMessage=l.isValidSignature=l.fromRpcSig=l.toRpcSig=l.ecrecover=l.ecsign=void 0;var m=c(74),y=c(9),n=c(40),o=c(75);function e(i,u){return u?i-(2*u+35):i-27}function t(i){return 0===i||1===i}l.ecsign=function(i,u,h){var f=m.sign(i,u),d=f.recovery;return{r:f.signature.slice(0,32),s:f.signature.slice(32,64),v:h?d+(2*h+35):d+27}},l.ecrecover=function(i,u,h,f,d){var _=s.concat([n.setLength(h,32),n.setLength(f,32)],64),v=e(u,d);if(!t(v))throw new Error("Invalid signature v value");var T=m.recover(i,_,v);return m.publicKeyConvert(T,!1).slice(1)},l.toRpcSig=function(i,u,h,f){if(!t(e(i,f)))throw new Error("Invalid signature v value");return n.bufferToHex(s.concat([n.setLengthLeft(u,32),n.setLengthLeft(h,32),n.toBuffer(i)]))},l.fromRpcSig=function(i){var u=n.toBuffer(i);if(65!==u.length)throw new Error("Invalid signature length");var h=u[64];return h<27&&(h+=27),{v:h,r:u.slice(0,32),s:u.slice(32,64)}},l.isValidSignature=function(i,u,h,f,d){void 0===f&&(f=!0);var _=new y("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),v=new y("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==u.length||32!==h.length||!t(e(i,d)))return!1;var T=new y(u),O=new y(h);return!(T.isZero()||T.gt(v)||O.isZero()||O.gt(v)||f&&1===O.cmp(_))},l.hashPersonalMessage=function(i){var u=s.from("\x19Ethereum Signed Message:\n"+i.length.toString(),"utf-8");return o.keccak(s.concat([u,i]))}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.defineProperties=void 0;var m=c(61),y=c(32),n=c(46),o=c(40);l.defineProperties=function(e,t,i){if(e.raw=[],e._fields=[],e.toJSON=function(h){if(void 0===h&&(h=!1),h){var f={};return e._fields.forEach(function(d){f[d]="0x"+e[d].toString("hex")}),f}return o.baToJSON(e.raw)},e.serialize=function(){return n.encode(e.raw)},t.forEach(function(h,f){function d(){return e.raw[f]}function _(v){"00"!==(v=o.toBuffer(v)).toString("hex")||h.allowZero||(v=s.allocUnsafe(0)),h.allowLess&&h.length?(v=o.stripZeros(v),m(h.length>=v.length,"The field "+h.name+" must not have more "+h.length+" bytes")):h.allowZero&&0===v.length||!h.length||m(h.length===v.length,"The field "+h.name+" must have byte length of "+h.length),e.raw[f]=v}e._fields.push(h.name),Object.defineProperty(e,h.name,{enumerable:!0,configurable:!0,get:d,set:_}),h.default&&(e[h.name]=h.default),h.alias&&Object.defineProperty(e,h.alias,{enumerable:!1,configurable:!0,set:_,get:d})}),i)if("string"==typeof i&&(i=s.from(y.stripHexPrefix(i),"hex")),s.isBuffer(i)&&(i=n.decode(i)),Array.isArray(i)){if(i.length>e._fields.length)throw new Error("wrong number of fields in data");i.forEach(function(h,f){e[e._fields[f]]=o.toBuffer(h)})}else{if("object"!=typeof i)throw new Error("invalid data");var u=Object.keys(i);t.forEach(function(h){-1!==u.indexOf(h.name)&&(e[h.name]=i[h.name]),-1!==u.indexOf(h.alias)&&(e[h.alias]=i[h.alias])})}}}).call(this,c(2).Buffer)},function(z,l,c){(function(s){!function(m){"use strict";var y=function(n){setTimeout(n,0)};void 0!==s&&s&&"function"==typeof s.nextTick&&(y=s.nextTick),z.exports=function(n){var o={capacity:n||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===o.firstHere){o.current++,o.firstHere=!0;var e=1}else e=0;var t={n:1};"function"==typeof arguments[0]?t.task=arguments[0]:t.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?t.task=arguments[1]:t.n=arguments[1]);var i=t.task;if(t.task=function(){i(o.leave)},o.current+t.n-e>o.capacity)return 1===e&&(o.current--,o.firstHere=!1),o.queue.push(t);o.current+=t.n-e,t.task(o.leave),1===e&&(o.firstHere=!1)},leave:function(e){if(o.current-=e=e||1,o.queue.length){var t=o.queue[0];t.n+o.current>o.capacity||(o.queue.shift(),o.current+=t.n,y(t.task))}else if(o.current<0)throw new Error("leave called too many times.")},available:function(e){return o.current+(e=e||1)<=o.capacity}};return o}}()}).call(this,c(5))},function(z,l,c){const s=c(67);z.exports=function(m,y,n){m.sendAsync(s({method:"eth_estimateGas",params:[y]}),function(o,e){if(o)return"no contract code at given address"===o.message?n(null,"0xcf08"):n(o);n(null,e.result)})}},function(z,l,c){(function(s){const m=c(21).inherits,y=c(370),n=c(36),o=c(49),e=c(149).blockTagForPayload;function t(i){this.nonceCache={}}z.exports=t,m(t,o),t.prototype.handleRequest=function(i,u,h){const f=this;switch(i.method){case"eth_getTransactionCount":var d=e(i),_=i.params[0].toLowerCase(),v=f.nonceCache[_];return void("pending"===d?v?h(null,v):u(function(T,O,b){if(T)return b();void 0===f.nonceCache[_]&&(f.nonceCache[_]=O),b()}):u());case"eth_sendRawTransaction":return void u(function(T,O,b){if(T)return b();var S=i.params[0],w=(n.stripHexPrefix(S),s.from(n.stripHexPrefix(S),"hex"),new y(s.from(n.stripHexPrefix(S),"hex"))),A="0x"+w.getSenderAddress().toString("hex").toLowerCase(),L=n.bufferToInt(w.nonce),H=(++L).toString(16);H.length%2&&(H="0"+H),f.nonceCache[A]=H="0x"+H,b()});case"evm_revert":return f.nonceCache={},void u();default:return void u()}}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){var m=c(36),y=c(371),n=m.BN,o=new n("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),e=function(){function t(i){(function(d,_){if(!(d instanceof _))throw new TypeError("Cannot call a class as a function")})(this,t),i=i||{};var u=[{name:"nonce",length:32,allowLess:!0,default:new s([])},{name:"gasPrice",length:32,allowLess:!0,default:new s([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new s([])},{name:"to",allowZero:!0,length:20,default:new s([])},{name:"value",length:32,allowLess:!0,default:new s([])},{name:"data",alias:"input",allowZero:!0,default:new s([])},{name:"v",allowZero:!0,default:new s([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new s([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new s([])}];m.defineProperties(this,u,i),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var h=m.bufferToInt(this.v),f=Math.floor((h-35)/2);f<0&&(f=0),this._chainId=f||i.chainId||0,this._homestead=!0}return t.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},t.prototype.hash=function(i){void 0===i&&(i=!0);var u=void 0;if(i)u=this.raw;else if(this._chainId>0){var h=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,u=this.raw,this.raw=h}else u=this.raw.slice(0,6);return m.rlphash(u)},t.prototype.getChainId=function(){return this._chainId},t.prototype.getSenderAddress=function(){if(this._from)return this._from;var i=this.getSenderPublicKey();return this._from=m.publicToAddress(i),this._from},t.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},t.prototype.verifySignature=function(){var i=this.hash(!1);if(this._homestead&&1===new n(this.s).cmp(o))return!1;try{var u=m.bufferToInt(this.v);this._chainId>0&&(u-=2*this._chainId+8),this._senderPubKey=m.ecrecover(i,u,this.r,this.s)}catch{return!1}return!!this._senderPubKey},t.prototype.sign=function(i){var u=this.hash(!1),h=m.ecsign(u,i);this._chainId>0&&(h.v+=2*this._chainId+8),Object.assign(this,h)},t.prototype.getDataFee=function(){for(var i=this.raw[5],u=new n(0),h=0;h0&&u.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===i||!1===i?0===u.length:u.join(" ")},t}();z.exports=e}).call(this,c(2).Buffer)},function(z){z.exports=JSON.parse('{"genesisGasLimit":{"v":5000,"d":"Gas limit of the Genesis block."},"genesisDifficulty":{"v":17179869184,"d":"Difficulty of the Genesis block."},"genesisNonce":{"v":"0x0000000000000042","d":"the geneis nonce"},"genesisExtraData":{"v":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","d":"extra data "},"genesisHash":{"v":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","d":"genesis hash"},"genesisStateRoot":{"v":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544","d":"the genesis state root"},"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be."},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations."},"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be."},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations."},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},"maximumExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis."},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs."},"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed."},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack."},"tierStepGas":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them."},"expGas":{"v":10,"d":"Once per EXP instuction."},"expByteGas":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction."},"sha3Gas":{"v":30,"d":"Once per SHA3 operation."},"sha3WordGas":{"v":6,"d":"Once per word of the SHA3 operation\'s data."},"sloadGas":{"v":50,"d":"Once per SLOAD operation."},"sstoreSetGas":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero."},"sstoreResetGas":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero."},"sstoreRefundGas":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero."},"jumpdestGas":{"v":1,"d":"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},"logGas":{"v":375,"d":"Per LOG* operation."},"logDataGas":{"v":8,"d":"Per byte in a LOG* operation\'s data."},"logTopicGas":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},"createGas":{"v":32000,"d":"Once per CREATE operation & contract-creation transaction."},"callGas":{"v":40,"d":"Once per CALL operation & message call transaction."},"callStipend":{"v":2300,"d":"Free gas given at beginning of call."},"callValueTransferGas":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero."},"callNewAccountGas":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior."},"suicideRefundGas":{"v":24000,"d":"Refunded following a suicide operation."},"memoryGas":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation."},"createDataGas":{"v":200,"d":""},"txGas":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions."},"txCreation":{"v":32000,"d":"the cost of creating a contract via tx"},"txDataZeroGas":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},"txDataNonZeroGas":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},"copyGas":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},"ecrecoverGas":{"v":3000,"d":""},"sha256Gas":{"v":60,"d":""},"sha256WordGas":{"v":12,"d":""},"ripemd160Gas":{"v":600,"d":""},"ripemd160WordGas":{"v":120,"d":""},"identityGas":{"v":15,"d":""},"identityWordGas":{"v":3,"d":""},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"ommerReward":{"v":"625000000000000000","d":"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},"niblingReward":{"v":"156250000000000000","d":"the amount a miner gets for inculding a uncle"},"homeSteadForkNumber":{"v":1150000,"d":"the block that the Homestead fork started at"},"homesteadRepriceForkNumber":{"v":2463000,"d":"the block that the Homestead Reprice (EIP150) fork started at"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"freeBlockPeriod":{"v":2}}')},function(z,l,c){const s=c(68),m=c(373);z.exports=class extends s{constructor(){super(({blockTracker:y,provider:n,engine:o})=>{const{events:e,middleware:t}=m({blockTracker:y,provider:n});return e.on("notification",i=>o.emit("data",null,i)),t})}}},function(z,l,c){const s=c(69).default,m=c(156),{createAsyncMiddleware:y}=c(152),n=c(151),{unsafeRandomBytes:o,incrementHexInt:e}=c(39),t=c(73);function i(u){return{hash:u.hash,parentHash:u.parentHash,sha3Uncles:u.sha3Uncles,miner:u.miner,stateRoot:u.stateRoot,transactionsRoot:u.transactionsRoot,receiptsRoot:u.receiptsRoot,logsBloom:u.logsBloom,difficulty:u.difficulty,number:u.number,gasLimit:u.gasLimit,gasUsed:u.gasUsed,nonce:u.nonce,mixHash:u.mixHash,timestamp:u.timestamp,extraData:u.extraData}}z.exports=function({blockTracker:u,provider:h}){const f={},d=n({blockTracker:u,provider:h});let _=!1;const v=new s,T=m({eth_subscribe:y(function(){var b=ge(function*(S,w){if(_)throw new Error("SubscriptionManager - attempting to use after destroying");const A=S.params[0],L=o(16);let H;switch(A){case"newHeads":H=function({subId:k}){const p={type:A,destroy:(x=ge(function*(){u.removeListener("sync",p.update)}),function(){return x.apply(this,arguments)}),update:function(){var x=ge(function*({oldBlock:R,newBlock:r}){const a=r,g=e(R);(yield t({provider:h,fromBlock:g,toBlock:a})).map(i).forEach(M=>{O(k,M)})});return function(r){return x.apply(this,arguments)}}()};var x;return u.on("sync",p.update),p}({subId:L});break;case"logs":const D=S.params[1];H=function({subId:k,filter:p}){return p.on("update",x=>O(k,x)),{type:A,destroy:(x=ge(function*(){return yield d.uninstallFilter(p.idHex)}),function(){return x.apply(this,arguments)})};var x}({subId:L,filter:yield d.newLogFilter(D)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${A}"`)}return f[L]=H,void(w.result=L)});return function(S,w){return b.apply(this,arguments)}}()),eth_unsubscribe:y(function(){var b=ge(function*(S,w){if(_)throw new Error("SubscriptionManager - attempting to use after destroying");const A=S.params[0],L=f[A];L?(delete f[A],yield L.destroy(),w.result=!0):w.result=!1});return function(S,w){return b.apply(this,arguments)}}())});return T.destroy=function(){v.removeAllListeners();for(const b in f)f[b].destroy(),delete f[b];_=!0},{events:v,middleware:T};function O(b,S){v.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:b,result:S}})}}},function(z,l,c){"use strict";c.r(l);var s={};c.r(s),c.d(s,"generateKey",function(){return f}),c.d(s,"verifyHmac",function(){return _}),c.d(s,"encrypt",function(){return T}),c.d(s,"decrypt",function(){return b});var m=c(1),y=c(162);const e="abcdefghijklmnopqrstuvwxyz0123456789".split("").map(w=>`https://${w}.bridge.walletconnect.org`);var u=c(33),h=c(0);function f(w){return d.apply(this,arguments)}function d(){return(d=ge(function*(w){const L=u.randomBytes((w||256)/8);return Object(m.convertBufferToArrayBuffer)(h.b(L))})).apply(this,arguments)}function _(w,A){return v.apply(this,arguments)}function v(){return(v=ge(function*(w,A){const L=h.n(w.data),H=h.n(w.iv),D=h.n(w.hmac),q=h.c(D,!1),k=h.j(L,H),p=yield u.hmacSha256Sign(A,k),x=h.c(p,!1);return h.x(q)===h.x(x)})).apply(this,arguments)}function T(w,A,L){return O.apply(this,arguments)}function O(){return(O=ge(function*(w,A,L){const H=h.f(Object(m.convertArrayBufferToBuffer)(A)),D=L||(yield f(128)),q=h.f(Object(m.convertArrayBufferToBuffer)(D)),k=h.c(q,!1),p=JSON.stringify(w),x=h.z(p),R=yield u.aesCbcEncrypt(q,H,x),r=h.c(R,!1),a=h.j(R,q),g=yield u.hmacSha256Sign(H,a);return{data:r,hmac:h.c(g,!1),iv:k}})).apply(this,arguments)}function b(w,A){return S.apply(this,arguments)}function S(){return(S=ge(function*(w,A){const L=h.f(Object(m.convertArrayBufferToBuffer)(A));if(!L)throw new Error("Missing key: required for decryption");if(!(yield _(w,L)))return null;const H=h.n(w.data),D=h.n(w.iv),q=yield u.aesCbcDecrypt(D,L,H),k=h.e(q);let p;try{p=JSON.parse(k)}catch{return null}return p})).apply(this,arguments)}l.default=class extends class{constructor(w){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 class{constructor(){this._eventEmitters=[]}subscribe(w){this._eventEmitters.push(w)}unsubscribe(w){this._eventEmitters=this._eventEmitters.filter(A=>A.event!==w)}trigger(w){let A,L=[];A=Object(m.isJsonRpcRequest)(w)?w.method:Object(m.isJsonRpcResponseSuccess)(w)||Object(m.isJsonRpcResponseError)(w)?"response:"+w.id:Object(m.isInternalEvent)(w)?w.event:"",A&&(L=this._eventEmitters.filter(H=>H.event===A)),L&&L.length||Object(m.isReservedEvent)(A)||Object(m.isInternalEvent)(A)||(L=this._eventEmitters.filter(H=>"call_request"===H.event)),L.forEach(H=>{if(Object(m.isJsonRpcResponseError)(w)){const D=new Error(w.error.message);H.callback(D,null)}else H.callback(null,w)})}},this._clientMeta=Object(m.getClientMeta)()||w.connectorOpts.clientMeta||null,this._cryptoLib=w.cryptoLib,this._sessionStorage=w.sessionStorage||new class{constructor(w="walletconnect"){this.storageId=w}getSession(){let w=null;const A=Object(m.getLocal)(this.storageId);return A&&Object(m.isWalletConnectSession)(A)&&(w=A),w}setSession(w){return Object(m.setLocal)(this.storageId,w),w}removeSession(){Object(m.removeLocal)(this.storageId)}}(w.connectorOpts.storageId),this._qrcodeModal=w.connectorOpts.qrcodeModal,this._qrcodeModalOptions=w.connectorOpts.qrcodeModalOptions,this._signingMethods=[...m.signingMethods,...w.connectorOpts.signingMethods||[]],!w.connectorOpts.bridge&&!w.connectorOpts.uri&&!w.connectorOpts.session)throw new Error("Missing one of the required parameters: bridge / uri / session");var A;w.connectorOpts.bridge&&(this.bridge="walletconnect.org"===function(q){let k=q.indexOf("//")>-1?q.split("/")[2]:q.split("/")[0];return k=k.split(":")[0],k=k.split("?")[0],k}(A=w.connectorOpts.bridge).split(".").slice(-2).join(".")?function t(){return e[Math.floor(Math.random()*e.length)]}():A),w.connectorOpts.uri&&(this.uri=w.connectorOpts.uri);const L=w.connectorOpts.session||this._getStorageSession();L&&(this.session=L),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=w.transport||new y.a({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),w.connectorOpts.uri&&this._subscribeToSessionRequest(),w.pushServerOpts&&this._registerPushServer(w.pushServerOpts)}set bridge(w){w&&(this._bridge=w)}get bridge(){return this._bridge}set key(w){if(!w)return;const A=Object(m.convertHexToArrayBuffer)(w);this._key=A}get key(){return this._key?Object(m.convertArrayBufferToHex)(this._key,!0):""}set clientId(w){w&&(this._clientId=w)}get clientId(){let w=this._clientId;return w||(w=this._clientId=Object(m.uuid)()),this._clientId}set peerId(w){w&&(this._peerId=w)}get peerId(){return this._peerId}set clientMeta(w){}get clientMeta(){let w=this._clientMeta;return w||(w=this._clientMeta=Object(m.getClientMeta)()),w}set peerMeta(w){this._peerMeta=w}get peerMeta(){return this._peerMeta}set handshakeTopic(w){w&&(this._handshakeTopic=w)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(w){w&&(this._handshakeId=w)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(w){if(!w)return;const{handshakeTopic:A,bridge:L,key:H}=this._parseUri(w);this.handshakeTopic=A,this.bridge=L,this.key=H}set chainId(w){this._chainId=w}get chainId(){return this._chainId}set networkId(w){this._networkId=w}get networkId(){return this._networkId}set accounts(w){this._accounts=w}get accounts(){return this._accounts}set rpcUrl(w){this._rpcUrl=w}get rpcUrl(){return this._rpcUrl}set connected(w){}get connected(){return this._connected}set pending(w){}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(w){w&&(this._connected=w.connected,this.accounts=w.accounts,this.chainId=w.chainId,this.bridge=w.bridge,this.key=w.key,this.clientId=w.clientId,this.clientMeta=w.clientMeta,this.peerId=w.peerId,this.peerMeta=w.peerMeta,this.handshakeId=w.handshakeId,this.handshakeTopic=w.handshakeTopic)}on(w,A){this._eventManager.subscribe({event:w,callback:A})}off(w){this._eventManager.unsubscribe(w)}createInstantRequest(w){var A=this;return ge(function*(){A._key=yield A._generateKey();const L=A._formatRequest({method:"wc_instantRequest",params:[{peerId:A.clientId,peerMeta:A.clientMeta,request:A._formatRequest(w)}]});A.handshakeId=L.id,A.handshakeTopic=Object(m.uuid)(),A._eventManager.trigger({event:"display_uri",params:[A.uri]}),A.on("modal_closed",()=>{throw new Error("User close QRCode Modal")});const H=()=>{A.killSession()};try{const D=yield A._sendCallRequest(L);return D&&H(),D}catch(D){throw H(),D}})()}connect(w){var A=this;return ge(function*(){if(!A._qrcodeModal)throw new Error("QRCode Modal not provided");return A.connected?{chainId:A.chainId,accounts:A.accounts}:(yield A.createSession(w),new Promise(function(){var L=ge(function*(H,D){A.on("modal_closed",()=>D(new Error("User close QRCode Modal"))),A.on("connect",(q,k)=>{if(q)return D(q);H(k.params[0])})});return function(H,D){return L.apply(this,arguments)}}()))})()}createSession(w){var A=this;return ge(function*(){if(A._connected)throw new Error("Session currently connected");if(A.pending)return;A._key=yield A._generateKey();const L=A._formatRequest({method:"wc_sessionRequest",params:[{peerId:A.clientId,peerMeta:A.clientMeta,chainId:w&&w.chainId?w.chainId:null}]});A.handshakeId=L.id,A.handshakeTopic=Object(m.uuid)(),A._sendSessionRequest(L,"Session update rejected",{topic:A.handshakeTopic}),A._eventManager.trigger({event:"display_uri",params:[A.uri]})})()}approveSession(w){if(this._connected)throw new Error("Session currently connected");this.chainId=w.chainId,this.accounts=w.accounts,this.networkId=w.networkId||0,this.rpcUrl=w.rpcUrl||"",this._sendResponse({id:this.handshakeId,jsonrpc:"2.0",result:{approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta}}),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(w){if(this._connected)throw new Error("Session currently connected");const A=w&&w.message?w.message:"Session Rejected",L=this._formatResponse({id:this.handshakeId,error:{message:A}});this._sendResponse(L),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:A}]}),this._removeStorageSession()}updateSession(w){if(!this._connected)throw new Error("Session currently disconnected");this.chainId=w.chainId,this.accounts=w.accounts,this.networkId=w.networkId||0,this.rpcUrl=w.rpcUrl||"";const L=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl}]});this._sendSessionRequest(L,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}killSession(w){var A=this;return ge(function*(){const L=w?w.message:"Session Disconnected",H=A._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]});yield A._sendRequest(H),A._handleSessionDisconnect(L)})()}sendTransaction(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");const L=Object(m.parseTransactionData)(w),H=A._formatRequest({method:"eth_sendTransaction",params:[L]});return yield A._sendCallRequest(H)})()}signTransaction(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");const L=Object(m.parseTransactionData)(w),H=A._formatRequest({method:"eth_signTransaction",params:[L]});return yield A._sendCallRequest(H)})()}signMessage(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");const L=A._formatRequest({method:"eth_sign",params:w});return yield A._sendCallRequest(L)})()}signPersonalMessage(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");w=Object(m.parsePersonalSign)(w);const L=A._formatRequest({method:"personal_sign",params:w});return yield A._sendCallRequest(L)})()}signTypedData(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");const L=A._formatRequest({method:"eth_signTypedData",params:w});return yield A._sendCallRequest(L)})()}updateChain(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");const L=A._formatRequest({method:"wallet_updateChain",params:[w]});return yield A._sendCallRequest(L)})()}unsafeSend(w,A){return this._sendRequest(w,A),this._eventManager.trigger({event:"call_request_sent",params:[{request:w,options:A}]}),new Promise((L,H)=>{this._subscribeToResponse(w.id,(D,q)=>{if(D)H(D);else{if(!q)throw new Error("Missing JSON RPC response");L(q)}})})}sendCustomRequest(w,A){var L=this;return ge(function*(){if(!L._connected)throw new Error("Session currently disconnected");switch(w.method){case"eth_accounts":return L.accounts;case"eth_chainId":return Object(m.convertNumberToHex)(L.chainId);case"eth_sendTransaction":case"eth_signTransaction":w.params&&(w.params[0]=Object(m.parseTransactionData)(w.params[0]));break;case"personal_sign":w.params&&(w.params=Object(m.parsePersonalSign)(w.params))}const H=L._formatRequest(w);return yield L._sendCallRequest(H,A)})()}approveRequest(w){if(!Object(m.isJsonRpcResponseSuccess)(w))throw new Error('JSON-RPC success response must include "result" field');{const A=this._formatResponse(w);this._sendResponse(A)}}rejectRequest(w){if(!Object(m.isJsonRpcResponseError)(w))throw new Error('JSON-RPC error response must include "error" field');{const A=this._formatResponse(w);this._sendResponse(A)}}transportClose(){this._transport.close()}_sendRequest(w,A){var L=this;return ge(function*(){const H=L._formatRequest(w),D=yield L._encrypt(H),q=void 0!==(null==A?void 0:A.topic)?A.topic:L.peerId,k=JSON.stringify(D),p=void 0!==(null==A?void 0:A.forcePushNotification)?!A.forcePushNotification:Object(m.isSilentPayload)(H);L._transport.send(k,q,p)})()}_sendResponse(w){var A=this;return ge(function*(){const L=yield A._encrypt(w),H=A.peerId,D=JSON.stringify(L);A._transport.send(D,H,!0)})()}_sendSessionRequest(w,A,L){var H=this;return ge(function*(){H._sendRequest(w,L),H._subscribeToSessionResponse(w.id,A)})()}_sendCallRequest(w,A){return this._sendRequest(w,A),this._eventManager.trigger({event:"call_request_sent",params:[{request:w,options:A}]}),this._subscribeToCallResponse(w.id)}_formatRequest(w){if(void 0===w.method)throw new Error('JSON RPC request must have valid "method" value');return{id:void 0===w.id?Object(m.payloadId)():w.id,jsonrpc:"2.0",method:w.method,params:void 0===w.params?[]:w.params}}_formatResponse(w){if(void 0===w.id)throw new Error('JSON RPC request must have valid "id" value');const A={id:w.id,jsonrpc:"2.0"};if(Object(m.isJsonRpcResponseError)(w)){const L=Object(m.formatRpcError)(w.error);return Object.assign(Object.assign(Object.assign({},A),w),{error:L})}if(Object(m.isJsonRpcResponseSuccess)(w))return Object.assign(Object.assign({},A),w);throw new Error("JSON RPC response format is invalid")}_handleSessionDisconnect(w){const A=w||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),Object(m.removeLocal)(m.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:A}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(w,A){A&&A.approved?(this._connected?(A.chainId&&(this.chainId=A.chainId),A.accounts&&(this.accounts=A.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,A.chainId&&(this.chainId=A.chainId),A.accounts&&(this.accounts=A.accounts),A.peerId&&!this.peerId&&(this.peerId=A.peerId),A.peerMeta&&!this.peerMeta&&(this.peerMeta=A.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(w)}_handleIncomingMessages(w){var A=this;return ge(function*(){if(![A.clientId,A.handshakeTopic].includes(w.topic))return;let L;try{L=JSON.parse(w.payload)}catch{return}const H=yield A._decrypt(L);H&&A._eventManager.trigger(H)})()}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(w,A){this.on("response:"+w,A)}_subscribeToSessionResponse(w,A){this._subscribeToResponse(w,(L,H)=>{L?this._handleSessionResponse(L.message):Object(m.isJsonRpcResponseSuccess)(H)?this._handleSessionResponse(A,H.result):this._handleSessionResponse(H.error&&H.error.message?H.error.message:A)})}_subscribeToCallResponse(w){return new Promise((A,L)=>{this._subscribeToResponse(w,(H,D)=>{H?L(H):Object(m.isJsonRpcResponseSuccess)(D)?A(D.result):L(D.error&&D.error.message?D.error: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",(w,A)=>{const{request:L}=A.params[0];if(Object(m.isMobile)()&&this._signingMethods.includes(L.method)){const H=Object(m.getLocal)(m.mobileLinkChoiceKey);H&&(window.location.href=H.href)}}),this.on("wc_sessionRequest",(w,A)=>{w&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:w.toString()}]}),this.handshakeId=A.id,this.peerId=A.params[0].peerId,this.peerMeta=A.params[0].peerMeta;const L=Object.assign(Object.assign({},A),{method:"session_request"});this._eventManager.trigger(L)}),this.on("wc_sessionUpdate",(w,A)=>{w&&this._handleSessionResponse(w.message),this._handleSessionResponse("Session disconnected",A.params[0])})}_initTransport(){this._transport.on("message",w=>this._handleIncomingMessages(w)),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(w){const A=Object(m.parseWalletConnectUri)(w);if(A.protocol===this.protocol){if(!A.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const L=A.handshakeTopic;if(!A.bridge)throw Error("Invalid or missing bridge url parameter value");const H=decodeURIComponent(A.bridge);if(!A.key)throw Error("Invalid or missing key parameter value");return{handshakeTopic:L,bridge:H,key:A.key}}throw new Error("URI format is invalid")}_generateKey(){var w=this;return ge(function*(){return w._cryptoLib?yield w._cryptoLib.generateKey():null})()}_encrypt(w){var A=this;return ge(function*(){const L=A._key;return A._cryptoLib&&L?yield A._cryptoLib.encrypt(w,L):null})()}_decrypt(w){var A=this;return ge(function*(){const L=A._key;return A._cryptoLib&&L?yield A._cryptoLib.decrypt(w,L):null})()}_getStorageSession(){let w=null;return this._sessionStorage&&(w=this._sessionStorage.getSession()),w}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(w){if(!w.url||"string"!=typeof w.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!w.type||"string"!=typeof w.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!w.token||"string"!=typeof w.token)throw Error("Invalid or missing pushServerOpts.token parameter value");const A={bridge:this.bridge,topic:this.clientId,type:w.type,token:w.token,peerName:"",language:w.language||""};this.on("connect",function(){var L=ge(function*(H,D){if(H)throw H;w.peerMeta&&(A.peerName=D.params[0].peerMeta.name);try{if(!(yield(yield fetch(w.url+"/new",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(A)})).json()).success)throw Error("Failed to register in Push Server")}catch{throw Error("Failed to register in Push Server")}});return function(H,D){return L.apply(this,arguments)}}())}}{constructor(w,A){super({cryptoLib:s,connectorOpts:w,pushServerOpts:A})}}},function(z,l,c){"use strict";function s(e,t,i,u){return new(i||(i=Promise))(function(h,f){function d(T){try{v(u.next(T))}catch(O){f(O)}}function _(T){try{v(u.throw(T))}catch(O){f(O)}}function v(T){var O;T.done?h(T.value):(O=T.value,O instanceof i?O:new i(function(b){b(O)})).then(d,_)}v((u=u.apply(e,t||[])).next())})}function m(e,t){var i,u,h,f,d={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return f={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function _(v){return function(T){return function(O){if(i)throw new TypeError("Generator is already executing.");for(;d;)try{if(i=1,u&&(h=2&O[0]?u.return:O[0]?u.throw||((h=u.return)&&h.call(u),0):u.next)&&!(h=h.call(u,O[1])).done)return h;switch(u=0,h&&(O=[2&O[0],h.value]),O[0]){case 0:case 1:h=O;break;case 4:return d.label++,{value:O[1],done:!1};case 5:d.label++,u=O[1],O=[0];continue;case 7:O=d.ops.pop(),d.trys.pop();continue;default:if(!((h=(h=d.trys).length>0&&h[h.length-1])||6!==O[0]&&2!==O[0])){d=0;continue}if(3===O[0]&&(!h||O[1]>h[0]&&O[1]1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,i=this._queue.shift();if(i){var u=!1;this._currentReleaser=function(){u||(u=!0,t._value++,t._dispatch())},i([this._value--,this._currentReleaser])}},e}(),n=function(){function e(){this._semaphore=new y(1)}return e.prototype.acquire=function(){return s(this,void 0,void 0,function(){return m(this,function(i){switch(i.label){case 0:return[4,this._semaphore.acquire()];case 1:return[2,i.sent()[1]]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();function o(e,t,i){var u=this;return void 0===i&&(i=new Error("timeout")),{acquire:function(){return new Promise(function(h,f){return s(u,void 0,void 0,function(){var d,_;return m(this,function(v){switch(v.label){case 0:return d=!1,setTimeout(function(){d=!0,f(i)},t),[4,e.acquire()];case 1:return _=v.sent(),d?(Array.isArray(_)?_[1]:_)():h(_),[2]}})})})},runExclusive:function(h){return s(this,void 0,void 0,function(){var f,d;return m(this,function(_){switch(_.label){case 0:f=function(){},_.label=1;case 1:return _.trys.push([1,,7,8]),[4,this.acquire()];case 2:return d=_.sent(),Array.isArray(d)?(f=d[1],[4,h(d[0])]):[3,4];case 3:return[2,_.sent()];case 4:return f=d,[4,h()];case 5:return[2,_.sent()];case 6:return[3,8];case 7:return f(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}c.d(l,"Mutex",function(){return n}),c.d(l,"Semaphore",function(){return y}),c.d(l,"withTimeout",function(){return o})},function(z,l,c){"use strict";c.r(l);var s,m,y,n,o,e,t,i={},u=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function f(Y,G){for(var $ in G)Y[$]=G[$];return Y}function d(Y){var G=Y.parentNode;G&&G.removeChild(Y)}function _(Y,G,$){var ne,ce=arguments,ue={};for(ne in G)"key"!==ne&&"ref"!==ne&&(ue[ne]=G[ne]);if(arguments.length>3)for($=[$],ne=3;ne2&&(G.children=u.slice.call(arguments,2)),$={},G)"key"!==ne&&"ref"!==ne&&($[ne]=G[ne]);return v(Y.type,$,G.key||Y.key,G.ref||Y.ref,null)}function V(Y){var G={},$={__c:"__cC"+t++,__:Y,Consumer:function(ne,ce){return ne.children(ce)},Provider:function(ne){var ce,ue=this;return this.getChildContext||(ce=[],this.getChildContext=function(){return G[$.__c]=ue,G},this.shouldComponentUpdate=function(Ce){ue.props.value!==Ce.value&&ce.some(function(Ie){Ie.context=Ce.value,A(Ie)})},this.sub=function(Ce){ce.push(Ce);var Ie=Ce.componentWillUnmount;Ce.componentWillUnmount=function(){ce.splice(ce.indexOf(Ce),1),Ie&&Ie.call(Ce)}}),ne.children}};return $.Consumer.contextType=$,$.Provider.__=$,$}s={__e:function(Y,G){for(var $,ne;G=G.__;)if(($=G.__c)&&!$.__)try{if($.constructor&&null!=$.constructor.getDerivedStateFromError&&(ne=!0,$.setState($.constructor.getDerivedStateFromError(Y))),null!=$.componentDidCatch&&(ne=!0,$.componentDidCatch(Y)),ne)return A($.__E=$)}catch(ce){Y=ce}throw Y}},b.prototype.setState=function(Y,G){var $;$=this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof Y&&(Y=Y($,this.props)),Y&&f($,Y),null!=Y&&this.__v&&(G&&this.__h.push(G),A(this))},b.prototype.forceUpdate=function(Y){this.__v&&(this.__e=!0,Y&&this.__h.push(Y),A(this))},b.prototype.render=O,m=[],y=0,n="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=i,t=0;var I,W,F,B=0,N=[],P=s.__r,j=s.diffed,K=s.__c,Z=s.unmount;function J(Y,G){s.__h&&s.__h(W,Y,B||G),B=0;var $=W.__H||(W.__H={__:[],__h:[]});return Y>=$.__.length&&$.__.push({}),$.__[Y]}function X(Y){return B=1,ee(Pe,Y)}function ee(Y,G,$){var ne=J(I++,2);return ne.__c||(ne.__c=W,ne.__=[$?$(G):Pe(void 0,G),function(ce){var ue=Y(ne.__[0],ce);ne.__[0]!==ue&&(ne.__[0]=ue,ne.__c.setState({}))}]),ne.__}function te(Y,G){var $=J(I++,3);!s.__s&&be($.__H,G)&&($.__=Y,$.__H=G,W.__H.__h.push($))}function oe(Y,G){var $=J(I++,4);!s.__s&&be($.__H,G)&&($.__=Y,$.__H=G,W.__h.push($))}function ve(Y){return B=5,de(function(){return{current:Y}},[])}function ie(Y,G,$){B=6,oe(function(){"function"==typeof Y?Y(G()):Y&&(Y.current=G())},null==$?$:$.concat(Y))}function de(Y,G){var $=J(I++,7);return be($.__H,G)?($.__H=G,$.__h=Y,$.__=Y()):$.__}function fe(Y,G){return B=8,de(function(){return Y},G)}function re(Y){var G=W.context[Y.__c],$=J(I++,9);return $.__c=Y,G?(null==$.__&&($.__=!0,G.sub(W)),G.props.value):Y.__}function _e(Y,G){s.useDebugValue&&s.useDebugValue(G?G(Y):Y)}function Ke(Y){var G=J(I++,10),$=X();return G.__=Y,W.componentDidCatch||(W.componentDidCatch=function(ne){G.__&&G.__(ne),$[1](ne)}),[$[0],function(){$[1](void 0)}]}function pe(){N.some(function(Y){if(Y.__P)try{Y.__H.__h.forEach(Te),Y.__H.__h.forEach(Ve),Y.__H.__h=[]}catch(G){return Y.__H.__h=[],s.__e(G,Y.__v),!0}}),N=[]}function Te(Y){Y.t&&Y.t()}function Ve(Y){var G=Y.__();"function"==typeof G&&(Y.t=G)}function be(Y,G){return!Y||G.some(function($,ne){return $!==Y[ne]})}function Pe(Y,G){return"function"==typeof G?G(Y):G}function Ye(Y,G){for(var $ in G)Y[$]=G[$];return Y}function we(Y,G){for(var $ in Y)if("__source"!==$&&!($ in G))return!0;for(var ne in G)if("__source"!==ne&&Y[ne]!==G[ne])return!0;return!1}s.__r=function(Y){P&&P(Y),I=0,(W=Y.__c).__H&&(W.__H.__h.forEach(Te),W.__H.__h.forEach(Ve),W.__H.__h=[])},s.diffed=function(Y){j&&j(Y);var G=Y.__c;if(G){var $=G.__H;$&&$.__h.length&&(1!==N.push(G)&&F===s.requestAnimationFrame||((F=s.requestAnimationFrame)||function(ne){var ce,ue=function(){clearTimeout(Ce),cancelAnimationFrame(ce),setTimeout(ne)},Ce=setTimeout(ue,100);typeof window<"u"&&(ce=requestAnimationFrame(ue))})(pe))}},s.__c=function(Y,G){G.some(function($){try{$.__h.forEach(Te),$.__h=$.__h.filter(function(ne){return!ne.__||Ve(ne)})}catch(ne){G.some(function(ce){ce.__h&&(ce.__h=[])}),G=[],s.__e(ne,$.__v)}}),K&&K(Y,G)},s.unmount=function(Y){Z&&Z(Y);var G=Y.__c;if(G){var $=G.__H;if($)try{$.__.forEach(function(ne){return ne.t&&ne.t()})}catch(ne){s.__e(ne,G.__v)}}},c.d(l,"version",function(){return We}),c.d(l,"Children",function(){return se}),c.d(l,"render",function(){return Ne}),c.d(l,"hydrate",function(){return it}),c.d(l,"unmountComponentAtNode",function(){return nt}),c.d(l,"createPortal",function(){return He}),c.d(l,"createFactory",function(){return tt}),c.d(l,"cloneElement",function(){return Fe}),c.d(l,"isValidElement",function(){return Se}),c.d(l,"findDOMNode",function(){return Ae}),c.d(l,"PureComponent",function(){return Be}),c.d(l,"memo",function(){return $e}),c.d(l,"forwardRef",function(){return je}),c.d(l,"unstable_batchedUpdates",function(){return Ue}),c.d(l,"Suspense",function(){return he}),c.d(l,"SuspenseList",function(){return me}),c.d(l,"lazy",function(){return Ge}),c.d(l,"useState",function(){return X}),c.d(l,"useReducer",function(){return ee}),c.d(l,"useEffect",function(){return te}),c.d(l,"useLayoutEffect",function(){return oe}),c.d(l,"useRef",function(){return ve}),c.d(l,"useImperativeHandle",function(){return ie}),c.d(l,"useMemo",function(){return de}),c.d(l,"useCallback",function(){return fe}),c.d(l,"useContext",function(){return re}),c.d(l,"useDebugValue",function(){return _e}),c.d(l,"useErrorBoundary",function(){return Ke}),c.d(l,"createElement",function(){return _}),c.d(l,"createContext",function(){return V}),c.d(l,"createRef",function(){return T}),c.d(l,"Fragment",function(){return O}),c.d(l,"Component",function(){return b});var Be=function(Y){var G,$;function ne(ce){var ue;return(ue=Y.call(this,ce)||this).isPureReactComponent=!0,ue}return $=Y,(G=ne).prototype=Object.create($.prototype),G.prototype.constructor=G,G.__proto__=$,ne.prototype.shouldComponentUpdate=function(ce,ue){return we(this.props,ce)||we(this.state,ue)},ne}(b);function $e(Y,G){function $(ce){var ue=this.props.ref,Ce=ue==ce.ref;return!Ce&&ue&&(ue.call?ue(null):ue.current=null),G?!G(this.props,ce)||!Ce:we(this.props,ce)}function ne(ce){return this.shouldComponentUpdate=$,_(Y,Ye({},ce))}return ne.prototype.isReactComponent=!0,ne.displayName="Memo("+(Y.displayName||Y.name)+")",ne.t=!0,ne}var Me=s.__b;function je(Y){function G($){var ne=Ye({},$);return delete ne.ref,Y(ne,$.ref)}return G.prototype.isReactComponent=G.t=!0,G.displayName="ForwardRef("+(Y.displayName||Y.name)+")",G}s.__b=function(Y){Y.type&&Y.type.t&&Y.ref&&(Y.props.ref=Y.ref,Y.ref=null),Me&&Me(Y)};var Q=function(Y,G){return Y?D(Y).reduce(function($,ne,ce){return $.concat(G(ne,ce))},[]):null},se={map:Q,forEach:Q,count:function(Y){return Y?D(Y).length:0},only:function(Y){if(1!==(Y=D(Y)).length)throw new Error("Children.only() expects only one child.");return Y[0]},toArray:D},le=s.__e;function Le(Y){return Y&&((Y=Ye({},Y)).__c=null,Y.__k=Y.__k&&Y.__k.map(Le)),Y}function he(){this.__u=0,this.o=null,this.__b=null}function Oe(Y){var G=Y.__.__c;return G&&G.u&&G.u(Y)}function Ge(Y){var G,$,ne;function ce(ue){if(G||(G=Y()).then(function(Ce){$=Ce.default||Ce},function(Ce){ne=Ce}),ne)throw ne;if(!$)throw G;return _($,ue)}return ce.displayName="Lazy",ce.t=!0,ce}function me(){this.i=null,this.l=null}s.__e=function(Y,G,$){if(Y.then)for(var ne,ce=G;ce=ce.__;)if((ne=ce.__c)&&ne.__c)return ne.__c(Y,G.__c);le(Y,G,$)},(he.prototype=new b).__c=function(Y,G){var $=this;null==$.o&&($.o=[]),$.o.push(G);var ne=Oe($.__v),ce=!1,ue=function(){ce||(ce=!0,ne?ne(Ce):Ce())};G.__c=G.componentWillUnmount,G.componentWillUnmount=function(){ue(),G.__c&&G.__c()};var Ce=function(){var Ie;if(!--$.__u)for($.__v.__k[0]=$.state.u,$.setState({u:$.__b=null});Ie=$.o.pop();)Ie.forceUpdate()};$.__u++||$.setState({u:$.__b=$.__v.__k[0]}),Y.then(ue,ue)},he.prototype.render=function(Y,G){return this.__b&&(this.__v.__k[0]=Le(this.__b),this.__b=null),[_(b,null,G.u?null:Y.children),G.u&&Y.fallback]};var ze=function(Y,G,$){if(++$[1]===$[0]&&Y.l.delete(G),Y.props.revealOrder&&("t"!==Y.props.revealOrder[0]||!Y.l.size))for($=Y.i;$;){for(;$.length>3;)$.pop()();if($[1]<$[0])break;Y.i=$=$[2]}};(me.prototype=new b).u=function(Y){var G=this,$=Oe(G.__v),ne=G.l.get(Y);return ne[0]++,function(ce){var ue=function(){G.props.revealOrder?(ne.push(ce),ze(G,Y,ne)):ce()};$?$(ue):ue()}},me.prototype.render=function(Y){this.i=null,this.l=new Map;var G=D(Y.children);Y.revealOrder&&"b"===Y.revealOrder[0]&&G.reverse();for(var $=G.length;$--;)this.l.set(G[$],this.i=[1,0,this.i]);return Y.children},me.prototype.componentDidUpdate=me.prototype.componentDidMount=function(){var Y=this;Y.l.forEach(function(G,$){ze(Y,$,G)})};var rt=function(){function Y(){}var G=Y.prototype;return G.getChildContext=function(){return this.props.context},G.render=function($){return $.children},Y}();function Re(Y){var G=this,$=Y.container,ne=_(rt,{context:G.context},Y.vnode);return G.s&&G.s!==$&&(G.v.parentNode&&G.s.removeChild(G.v),g(G.h),G.p=!1),Y.vnode?G.p?($.__k=G.__k,E(ne,$),G.__k=$.__k):(G.v=document.createTextNode(""),C("",$),$.appendChild(G.v),G.p=!0,G.s=$,E(ne,$,G.v),G.__k=G.v.__k):G.p&&(G.v.parentNode&&G.s.removeChild(G.v),g(G.h)),G.h=ne,G.componentWillUnmount=function(){G.v.parentNode&&G.s.removeChild(G.v),g(G.h)},null}function He(Y,G){return _(Re,{vnode:Y,container:G})}var Qe=/^(?: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]/;b.prototype.isReactComponent={};var Ee=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103;function Ne(Y,G,$){if(null==G.__k)for(;G.firstChild;)G.removeChild(G.firstChild);return E(Y,G),"function"==typeof $&&$(),Y?Y.__c:null}function it(Y,G,$){return C(Y,G),"function"==typeof $&&$(),Y?Y.__c:null}var xe=s.event;function qe(Y,G){Y["UNSAFE_"+G]&&!Y[G]&&Object.defineProperty(Y,G,{configurable:!1,get:function(){return this["UNSAFE_"+G]},set:function($){this["UNSAFE_"+G]=$}})}s.event=function(Y){xe&&(Y=xe(Y)),Y.persist=function(){};var G=!1,$=!1,ne=Y.stopPropagation;Y.stopPropagation=function(){ne.call(Y),G=!0};var ce=Y.preventDefault;return Y.preventDefault=function(){ce.call(Y),$=!0},Y.isPropagationStopped=function(){return G},Y.isDefaultPrevented=function(){return $},Y.nativeEvent=Y};var et={configurable:!0,get:function(){return this.class}},ke=s.vnode;s.vnode=function(Y){Y.$$typeof=Ee;var G=Y.type,$=Y.props;if(G){if($.class!=$.className&&(et.enumerable="className"in $,null!=$.className&&($.class=$.className),Object.defineProperty($,"className",et)),"function"!=typeof G){var ne,ce,ue;for(ue in $.defaultValue&&void 0!==$.value&&($.value||0===$.value||($.value=$.defaultValue),delete $.defaultValue),Array.isArray($.value)&&$.multiple&&"select"===G&&(D($.children).forEach(function(Ce){-1!=$.value.indexOf(Ce.props.value)&&(Ce.props.selected=!0)}),delete $.value),$)if(ne=Qe.test(ue))break;if(ne)for(ue in ce=Y.props={},$)ce[Qe.test(ue)?ue.replace(/[A-Z0-9]/,"-$&").toLowerCase():ue]=$[ue]}(function(Ce){var Ie=Y.type,De=Y.props;if(De&&"string"==typeof Ie){var ye={};for(var ae in De)/^on(Ani|Tra|Tou)/.test(ae)&&(De[ae.toLowerCase()]=De[ae],delete De[ae]),ye[ae.toLowerCase()]=ae;if(ye.ondoubleclick&&(De.ondblclick=De[ye.ondoubleclick],delete De[ye.ondoubleclick]),ye.onbeforeinput&&(De.onbeforeinput=De[ye.onbeforeinput],delete De[ye.onbeforeinput]),ye.onchange&&("textarea"===Ie||"input"===Ie.toLowerCase()&&!/^fil|che|ra/i.test(De.type))){var Je=ye.oninput||"oninput";De[Je]||(De[Je]=De[ye.onchange],delete De[ye.onchange])}}})(),"function"==typeof G&&!G.m&&G.prototype&&(qe(G.prototype,"componentWillMount"),qe(G.prototype,"componentWillReceiveProps"),qe(G.prototype,"componentWillUpdate"),G.m=!0)}ke&&ke(Y)};var We="16.8.0";function tt(Y){return _.bind(null,Y)}function Se(Y){return!!Y&&Y.$$typeof===Ee}function Fe(Y){return Se(Y)?U.apply(null,arguments):Y}function nt(Y){return!!Y.__k&&(E(null,Y),!0)}function Ae(Y){return Y&&(Y.base||1===Y.nodeType&&Y)||null}var Ue=function(Y,G){return Y(G)};l.default={useState:X,useReducer:ee,useEffect:te,useLayoutEffect:oe,useRef:ve,useImperativeHandle:ie,useMemo:de,useCallback:fe,useContext:re,useDebugValue:_e,version:"16.8.0",Children:se,render:Ne,hydrate:Ne,unmountComponentAtNode:nt,createPortal:He,createElement:_,createContext:V,createFactory:tt,cloneElement:Fe,createRef:T,Fragment:O,isValidElement:Se,findDOMNode:Ae,Component:b,PureComponent:Be,memo:$e,forwardRef:je,unstable_batchedUpdates:Ue,Suspense:he,SuspenseList:me,lazy:Ge}}])}}]); \ No newline at end of file +(self.webpackChunkAngular_bare_bones_demo=self.webpackChunkAngular_bare_bones_demo||[]).push([[109],{98109:(mt,dt,lt)=>{"use strict";lt.r(dt),lt.d(dt,{getWalletConnectProviderInstance:()=>m});var ge=lt(84330),z=lt.n(ge),l=lt(88178),m=function(y){return function(y,n,o,e){return new(o||(o=Promise))(function(i,u){function h(_){try{d(e.next(_))}catch(v){u(v)}}function f(_){try{d(e.throw(_))}catch(v){u(v)}}function d(_){_.done?i(_.value):function t(i){return i instanceof o?i:new o(function(u){u(i)})}(_.value).then(h,f)}d((e=e.apply(y,n||[])).next())})}(void 0,void 0,void 0,function(){return function(y,n){var e,t,i,u,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:h(0),throw:h(1),return:h(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function h(d){return function(_){return function f(d){if(e)throw new TypeError("Generator is already executing.");for(;u&&(u=0,d[0]&&(o=0)),o;)try{if(e=1,t&&(i=2&d[0]?t.return:d[0]?t.throw||((i=t.return)&&i.call(t),0):t.next)&&!(i=i.call(t,d[1])).done)return i;switch(t=0,i&&(d=[2&d[0],i.value]),d[0]){case 0:case 1:i=d;break;case 4:return o.label++,{value:d[1],done:!1};case 5:o.label++,t=d[1],d=[0];continue;case 7:d=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===d[0]||2===d[0])){o=0;continue}if(3===d[0]&&(!i||d[1]>i[0]&&d[1]>>0).toString(2))}function D(F){return new Uint8Array(function M(F,B=8){const N=E(F).match(new RegExp(`.{${B}}`,"gi"));return Array.from(N||[])}(F).map(B=>parseInt(B,2)))}function q(F,B){return!("string"!=typeof F||!F.match(/^0x[0-9A-Fa-f]*$/)||B&&F.length!==2+2*B)}function k(F){return s.isBuffer(F)}function p(F){return y.a.strict(F)&&!k(F)}function x(F){return!p(F)&&!k(F)&&void 0!==F.byteLength}function R(F){return k(F)?"buffer":p(F)?"typed-array":x(F)?"array-buffer":Array.isArray(F)?"array":typeof F}function r(F){return"string"==typeof(B=F)&&new RegExp(/^[01]+$/).test(B)&&B.length%8==0?"binary":q(F)?"hex":"utf8";var B}function a(...F){return s.concat(F)}function g(...F){let B=[];return F.forEach(N=>B=B.concat(Array.from(N))),new Uint8Array([...B])}function E(F,B=8,N="0"){return function(P,j,K="0"){return function W(F,B,N,P="0"){const j=B-F.length;let K=F;if(j>0){const Z=P.repeat(j);K=N?Z+F:F+Z}return K}(P,j,!0,K)}(F,function(P,j=8){const K=P%j;return K?(P-K)/j*j+j:P}(F.length,B),N)}function C(F){return F.replace(/^0x/,"")}function U(F){return F.startsWith("0x")?F:"0x"+F}function V(F){return(F=E(F=C(F),2))&&(F=U(F)),F}function I(F){const B=F.startsWith("0x");return F=(F=C(F)).startsWith("0")?F.substring(1):F,B?U(F):F}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";c.r(l);var s=c(76);const m=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],y=["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"],n=["eth_accounts","eth_chainId","net_version"],o={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var e=c(9),t=c.n(e),i=c(0);function u(Q){return i.b(new Uint8Array(Q))}function h(Q){return i.e(new Uint8Array(Q))}function f(Q,se){return i.c(new Uint8Array(Q),!se)}function d(Q){return i.d(new Uint8Array(Q))}function _(...Q){return i.n(Q.map(se=>i.c(new Uint8Array(se))).join("")).buffer}function v(Q){return i.f(Q).buffer}function T(Q){return i.i(Q)}function O(Q,se){return i.g(Q,!se)}function b(Q){return i.h(Q)}function S(...Q){return i.k(...Q)}function w(Q){return i.z(Q).buffer}function A(Q){return i.A(Q)}function L(Q,se){return i.B(Q,!se)}function H(Q){return new t.a(Q,10).toNumber()}function D(Q){return i.o(Q)}function q(Q){return i.n(Q).buffer}function k(Q){return i.p(Q)}function p(Q){return new t.a(i.x(Q),"hex").toNumber()}function x(Q){return i.v(Q)}function R(Q){return i.u(Q).buffer}function r(Q){return new t.a(Q).toString()}function a(Q,se){const le=i.x(i.y(new t.a(Q).toString(16)));return se?le:i.a(le)}var g=c(160);function M(Q){return i.y(Q)}function E(Q){return i.a(Q)}function C(Q){return i.x(Q)}function U(Q){return i.w(i.a(Q))}const V=c(161).payloadId;function I(){return((Q,se)=>{for(se=Q="";Q++<36;se+=51*Q&52?(15^Q?8^Math.random()*(20^Q?16:4):4).toString(16):"-");return se})()}function W(){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 F(Q,se){let le;const Le=o[Q];return Le&&(le=`https://${Le}.infura.io/v3/${se}`),le}function B(Q,se){let le;const Le=F(Q,se.infuraId);return se.custom&&se.custom[Q]?le=se.custom[Q]:Le&&(le=Le),le}function N(Q){return""===Q||"string"==typeof Q&&""===Q.trim()}function P(Q){return!(Q&&Q.length)}function j(Q){return i.r(Q)}function K(Q){return i.t(Q)}function Z(Q){return i.q(Q)}function J(Q){return i.m(Q)}function X(Q){return i.l(Q)}function ee(Q,se){return i.s(Q,se)}function te(Q){return"object"==typeof Q.params}function oe(Q){return void 0!==Q.method}function ve(Q){return void 0!==Q.result}function ie(Q){return void 0!==Q.error}function de(Q){return void 0!==Q.event}function fe(Q){return m.includes(Q)||Q.startsWith("wc_")}function re(Q){return!!Q.method.startsWith("wc_")||!y.includes(Q.method)}function _e(Q){Q=Object(i.x)(Q.toLowerCase());const se=Object(i.x)(Object(g.keccak_256)(A(Q)));let le="";for(let Le=0;Le7?le+=Q[Le].toUpperCase():le+=Q[Le];return Object(i.a)(le)}const Ke=Q=>!(!Q||"0x"!==Q.toLowerCase().substring(0,2)||!/^(0x)?[0-9a-f]{40}$/i.test(Q)||!/^(0x)?[0-9a-f]{40}$/.test(Q)&&!/^(0x)?[0-9A-F]{40}$/.test(Q)&&Q!==_e(Q));function pe(Q){return P(Q)||ee(Q[0])||(Q[0]=L(Q[0])),Q}function Te(Q){if(void 0!==Q.type&&"0"!==Q.type)return Q;if(void 0===Q.from||!Ke(Q.from))throw new Error("Transaction object must include a valid 'from' value.");function se(he){let Oe=he;return("number"==typeof he||"string"==typeof he&&!N(he))&&(ee(he)?"string"==typeof he&&(Oe=M(he)):Oe=a(he)),"string"==typeof Oe&&(Oe=U(Oe)),Oe}const le={from:M(Q.from),to:void 0===Q.to?void 0:M(Q.to),gasPrice:void 0===Q.gasPrice?"":se(Q.gasPrice),gas:void 0===Q.gas?void 0===Q.gasLimit?"":se(Q.gasLimit):se(Q.gas),value:void 0===Q.value?"":se(Q.value),nonce:void 0===Q.nonce?"":se(Q.nonce),data:void 0===Q.data?"":M(Q.data)||"0x"},Le=["gasPrice","gas","value","nonce"];return Object.keys(le).forEach(he=>{(void 0===le[he]||"string"==typeof le[he]&&!le[he].trim().length)&&Le.includes(he)&&delete le[he]}),le}function Ve(Q,se){return ge(function*(...le){return new Promise((Le,he)=>{Q.apply(se,[...le,(Oe,Ge)=>{null==Oe&&he(Oe),Le(Ge)}])})})}function be(Q){const se=Q.message||"Failed or Rejected Request";let le=-32e3;if(Q&&!Q.code)switch(se){case"Parse error":le=-32700;break;case"Invalid request":le=-32600;break;case"Method not found":le=-32601;break;case"Invalid params":le=-32602;break;case"Internal error":le=-32603;break;default:le=-32e3}const Le={code:le,message:se};return Q.data&&(Le.data=Q.data),Le}var Pe=c(78);function Ye(Q){const se=-1!==Q.indexOf("?")?Q.indexOf("?"):void 0;return void 0!==se?Q.substr(se):""}function we(Q,se){let le=Be(Q);return le=Object.assign(Object.assign({},le),se),$e(le)}function Be(Q){return Pe.parse(Q)}function $e(Q){return Pe.stringify(Q)}function Me(Q){return void 0!==Q.bridge}function je(Q){const se=Q.indexOf(":"),le=-1!==Q.indexOf("?")?Q.indexOf("?"):void 0,Le=Q.substring(0,se),he=function(Ge){const me=Ge.split("@");return{handshakeTopic:me[0],version:parseInt(me[1],10)}}(Q.substring(se+1,le)),Oe=function(Ge){const me=Be(Ge);return{key:me.key||"",bridge:me.bridge||""}}(void 0!==le?Q.substr(le):"");return Object.assign(Object.assign({protocol:Le},he),Oe)}c.d(l,"detectEnv",function(){return s.detectEnv}),c.d(l,"detectOS",function(){return s.detectOS}),c.d(l,"isAndroid",function(){return s.isAndroid}),c.d(l,"isIOS",function(){return s.isIOS}),c.d(l,"isMobile",function(){return s.isMobile}),c.d(l,"isNode",function(){return s.isNode}),c.d(l,"isBrowser",function(){return s.isBrowser}),c.d(l,"getFromWindow",function(){return s.getFromWindow}),c.d(l,"getFromWindowOrThrow",function(){return s.getFromWindowOrThrow}),c.d(l,"getDocumentOrThrow",function(){return s.getDocumentOrThrow}),c.d(l,"getDocument",function(){return s.getDocument}),c.d(l,"getNavigatorOrThrow",function(){return s.getNavigatorOrThrow}),c.d(l,"getNavigator",function(){return s.getNavigator}),c.d(l,"getLocationOrThrow",function(){return s.getLocationOrThrow}),c.d(l,"getLocation",function(){return s.getLocation}),c.d(l,"getCryptoOrThrow",function(){return s.getCryptoOrThrow}),c.d(l,"getCrypto",function(){return s.getCrypto}),c.d(l,"getLocalStorageOrThrow",function(){return s.getLocalStorageOrThrow}),c.d(l,"getLocalStorage",function(){return s.getLocalStorage}),c.d(l,"getClientMeta",function(){return s.getClientMeta}),c.d(l,"safeJsonParse",function(){return s.safeJsonParse}),c.d(l,"safeJsonStringify",function(){return s.safeJsonStringify}),c.d(l,"setLocal",function(){return s.setLocal}),c.d(l,"getLocal",function(){return s.getLocal}),c.d(l,"removeLocal",function(){return s.removeLocal}),c.d(l,"mobileLinkChoiceKey",function(){return s.mobileLinkChoiceKey}),c.d(l,"formatIOSMobile",function(){return s.formatIOSMobile}),c.d(l,"saveMobileLinkInfo",function(){return s.saveMobileLinkInfo}),c.d(l,"getMobileRegistryEntry",function(){return s.getMobileRegistryEntry}),c.d(l,"getMobileLinkRegistry",function(){return s.getMobileLinkRegistry}),c.d(l,"getWalletRegistryUrl",function(){return s.getWalletRegistryUrl}),c.d(l,"getDappRegistryUrl",function(){return s.getDappRegistryUrl}),c.d(l,"formatMobileRegistryEntry",function(){return s.formatMobileRegistryEntry}),c.d(l,"formatMobileRegistry",function(){return s.formatMobileRegistry}),c.d(l,"reservedEvents",function(){return m}),c.d(l,"signingMethods",function(){return y}),c.d(l,"stateMethods",function(){return n}),c.d(l,"infuraNetworks",function(){return o}),c.d(l,"convertArrayBufferToBuffer",function(){return u}),c.d(l,"convertArrayBufferToUtf8",function(){return h}),c.d(l,"convertArrayBufferToHex",function(){return f}),c.d(l,"convertArrayBufferToNumber",function(){return d}),c.d(l,"concatArrayBuffers",function(){return _}),c.d(l,"convertBufferToArrayBuffer",function(){return v}),c.d(l,"convertBufferToUtf8",function(){return T}),c.d(l,"convertBufferToHex",function(){return O}),c.d(l,"convertBufferToNumber",function(){return b}),c.d(l,"concatBuffers",function(){return S}),c.d(l,"convertUtf8ToArrayBuffer",function(){return w}),c.d(l,"convertUtf8ToBuffer",function(){return A}),c.d(l,"convertUtf8ToHex",function(){return L}),c.d(l,"convertUtf8ToNumber",function(){return H}),c.d(l,"convertHexToBuffer",function(){return D}),c.d(l,"convertHexToArrayBuffer",function(){return q}),c.d(l,"convertHexToUtf8",function(){return k}),c.d(l,"convertHexToNumber",function(){return p}),c.d(l,"convertNumberToBuffer",function(){return x}),c.d(l,"convertNumberToArrayBuffer",function(){return R}),c.d(l,"convertNumberToUtf8",function(){return r}),c.d(l,"convertNumberToHex",function(){return a}),c.d(l,"toChecksumAddress",function(){return _e}),c.d(l,"isValidAddress",function(){return Ke}),c.d(l,"parsePersonalSign",function(){return pe}),c.d(l,"parseTransactionData",function(){return Te}),c.d(l,"sanitizeHex",function(){return M}),c.d(l,"addHexPrefix",function(){return E}),c.d(l,"removeHexPrefix",function(){return C}),c.d(l,"removeHexLeadingZeros",function(){return U}),c.d(l,"payloadId",function(){return V}),c.d(l,"uuid",function(){return I}),c.d(l,"logDeprecationWarning",function(){return W}),c.d(l,"getInfuraRpcUrl",function(){return F}),c.d(l,"getRpcUrl",function(){return B}),c.d(l,"promisify",function(){return Ve}),c.d(l,"formatRpcError",function(){return be}),c.d(l,"isWalletConnectSession",function(){return Me}),c.d(l,"parseWalletConnectUri",function(){return je}),c.d(l,"getQueryString",function(){return Ye}),c.d(l,"appendToQueryString",function(){return we}),c.d(l,"parseQueryString",function(){return Be}),c.d(l,"formatQueryString",function(){return $e}),c.d(l,"isEmptyString",function(){return N}),c.d(l,"isEmptyArray",function(){return P}),c.d(l,"isBuffer",function(){return j}),c.d(l,"isTypedArray",function(){return K}),c.d(l,"isArrayBuffer",function(){return Z}),c.d(l,"getType",function(){return J}),c.d(l,"getEncoding",function(){return X}),c.d(l,"isHexString",function(){return ee}),c.d(l,"isJsonRpcSubscription",function(){return te}),c.d(l,"isJsonRpcRequest",function(){return oe}),c.d(l,"isJsonRpcResponseSuccess",function(){return ve}),c.d(l,"isJsonRpcResponseError",function(){return ie}),c.d(l,"isInternalEvent",function(){return de}),c.d(l,"isReservedEvent",function(){return fe}),c.d(l,"isSilentPayload",function(){return re})},function(z,l,c){"use strict";(function(s){var m=c(169),y=c(170),n=c(79);function o(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function e(P,j){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|P}function _(P,j){if(t.isBuffer(P))return P.length;if(typeof ArrayBuffer<"u"&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(P)||P instanceof ArrayBuffer))return P.byteLength;"string"!=typeof P&&(P=""+P);var K=P.length;if(0===K)return 0;for(var Z=!1;;)switch(j){case"ascii":case"latin1":case"binary":return K;case"utf8":case"utf-8":case void 0:return F(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*K;case"hex":return K>>>1;case"base64":return B(P).length;default:if(Z)return F(P).length;j=(""+j).toLowerCase(),Z=!0}}function v(P,j,K){var Z=!1;if((void 0===j||j<0)&&(j=0),j>this.length||((void 0===K||K>this.length)&&(K=this.length),K<=0)||(K>>>=0)<=(j>>>=0))return"";for(P||(P="utf8");;)switch(P){case"hex":return R(this,j,K);case"utf8":case"utf-8":return k(this,j,K);case"ascii":return p(this,j,K);case"latin1":case"binary":return x(this,j,K);case"base64":return q(this,j,K);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r(this,j,K);default:if(Z)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),Z=!0}}function T(P,j,K){var Z=P[j];P[j]=P[K],P[K]=Z}function O(P,j,K,Z,J){if(0===P.length)return-1;if("string"==typeof K?(Z=K,K=0):K>2147483647?K=2147483647:K<-2147483648&&(K=-2147483648),K=+K,isNaN(K)&&(K=J?0:P.length-1),K<0&&(K=P.length+K),K>=P.length){if(J)return-1;K=P.length-1}else if(K<0){if(!J)return-1;K=0}if("string"==typeof j&&(j=t.from(j,Z)),t.isBuffer(j))return 0===j.length?-1:b(P,j,K,Z,J);if("number"==typeof j)return j&=255,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?J?Uint8Array.prototype.indexOf.call(P,j,K):Uint8Array.prototype.lastIndexOf.call(P,j,K):b(P,[j],K,Z,J);throw new TypeError("val must be string, number or Buffer")}function b(P,j,K,Z,J){var X,ee=1,te=P.length,oe=j.length;if(void 0!==Z&&("ucs2"===(Z=String(Z).toLowerCase())||"ucs-2"===Z||"utf16le"===Z||"utf-16le"===Z)){if(P.length<2||j.length<2)return-1;ee=2,te/=2,oe/=2,K/=2}function ve(re,_e){return 1===ee?re[_e]:re.readUInt16BE(_e*ee)}if(J){var ie=-1;for(X=K;Xte&&(K=te-oe),X=K;X>=0;X--){for(var de=!0,fe=0;feJ&&(Z=J):Z=J;var X=j.length;if(X%2!=0)throw new TypeError("Invalid hex string");Z>X/2&&(Z=X/2);for(var ee=0;ee>8,ve.push(ee%256),ve.push(te);return ve}(j,P.length-K),P,K,Z)}function q(P,j,K){return m.fromByteArray(0===j&&K===P.length?P:P.slice(j,K))}function k(P,j,K){K=Math.min(P.length,K);for(var Z=[],J=j;J239?4:ve>223?3:ve>191?2:1;if(J+de<=K)switch(de){case 1:ve<128&&(ie=ve);break;case 2:128==(192&(X=P[J+1]))&&(oe=(31&ve)<<6|63&X)>127&&(ie=oe);break;case 3:ee=P[J+2],128==(192&(X=P[J+1]))&&128==(192&ee)&&(oe=(15&ve)<<12|(63&X)<<6|63&ee)>2047&&(oe<55296||oe>57343)&&(ie=oe);break;case 4:ee=P[J+2],te=P[J+3],128==(192&(X=P[J+1]))&&128==(192&ee)&&128==(192&te)&&(oe=(15&ve)<<18|(63&X)<<12|(63&ee)<<6|63&te)>65535&&oe<1114112&&(ie=oe)}null===ie?(ie=65533,de=1):ie>65535&&(Z.push((ie-=65536)>>>10&1023|55296),ie=56320|1023&ie),Z.push(ie),J+=de}return function(fe){var re=fe.length;if(re<=4096)return String.fromCharCode.apply(String,fe);for(var _e="",Ke=0;KeZ)&&(K=Z);for(var J="",X=j;XK)throw new RangeError("Trying to access beyond buffer length")}function g(P,j,K,Z,J,X){if(!t.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(j>J||jP.length)throw new RangeError("Index out of range")}function M(P,j,K,Z){j<0&&(j=65535+j+1);for(var J=0,X=Math.min(P.length-K,2);J>>8*(Z?J:1-J)}function E(P,j,K,Z){j<0&&(j=4294967295+j+1);for(var J=0,X=Math.min(P.length-K,4);J>>8*(Z?J:3-J)&255}function C(P,j,K,Z,J,X){if(K+Z>P.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("Index out of range")}function U(P,j,K,Z,J){return J||C(P,0,K,4),y.write(P,j,K,Z,23,4),K+4}function V(P,j,K,Z,J){return J||C(P,0,K,8),y.write(P,j,K,Z,52,8),K+8}l.Buffer=t,l.SlowBuffer=function(P){return+P!=P&&(P=0),t.alloc(+P)},l.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==s.TYPED_ARRAY_SUPPORT?s.TYPED_ARRAY_SUPPORT:function(){try{var P=new Uint8Array(1);return P.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===P.foo()&&"function"==typeof P.subarray&&0===P.subarray(1,1).byteLength}catch{return!1}}(),l.kMaxLength=o(),t.poolSize=8192,t._augment=function(P){return P.__proto__=t.prototype,P},t.from=function(P,j,K){return i(null,P,j,K)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(P,j,K){return Z=null,X=j,ee=K,u(J=P),J<=0?e(Z,J):void 0!==X?"string"==typeof ee?e(Z,J).fill(X,ee):e(Z,J).fill(X):e(Z,J);var Z,J,X,ee},t.allocUnsafe=function(P){return h(null,P)},t.allocUnsafeSlow=function(P){return h(null,P)},t.isBuffer=function(P){return!(null==P||!P._isBuffer)},t.compare=function(P,j){if(!t.isBuffer(P)||!t.isBuffer(j))throw new TypeError("Arguments must be Buffers");if(P===j)return 0;for(var K=P.length,Z=j.length,J=0,X=Math.min(K,Z);J0&&(P=this.toString("hex",0,j).match(/.{2}/g).join(" "),this.length>j&&(P+=" ... ")),""},t.prototype.compare=function(P,j,K,Z,J){if(!t.isBuffer(P))throw new TypeError("Argument must be a Buffer");if(void 0===j&&(j=0),void 0===K&&(K=P?P.length:0),void 0===Z&&(Z=0),void 0===J&&(J=this.length),j<0||K>P.length||Z<0||J>this.length)throw new RangeError("out of range index");if(Z>=J&&j>=K)return 0;if(Z>=J)return-1;if(j>=K)return 1;if(this===P)return 0;for(var X=(J>>>=0)-(Z>>>=0),ee=(K>>>=0)-(j>>>=0),te=Math.min(X,ee),oe=this.slice(Z,J),ve=P.slice(j,K),ie=0;ieJ)&&(K=J),P.length>0&&(K<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");for(var X=!1;;)switch(Z){case"hex":return S(this,P,j,K);case"utf8":case"utf-8":return w(this,P,j,K);case"ascii":return A(this,P,j,K);case"latin1":case"binary":return L(this,P,j,K);case"base64":return H(this,P,j,K);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,P,j,K);default:if(X)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),X=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(P,j){var K,Z=this.length;if((P=~~P)<0?(P+=Z)<0&&(P=0):P>Z&&(P=Z),(j=void 0===j?Z:~~j)<0?(j+=Z)<0&&(j=0):j>Z&&(j=Z),j0&&(J*=256);)Z+=this[P+--j]*J;return Z},t.prototype.readUInt8=function(P,j){return j||a(P,1,this.length),this[P]},t.prototype.readUInt16LE=function(P,j){return j||a(P,2,this.length),this[P]|this[P+1]<<8},t.prototype.readUInt16BE=function(P,j){return j||a(P,2,this.length),this[P]<<8|this[P+1]},t.prototype.readUInt32LE=function(P,j){return j||a(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+16777216*this[P+3]},t.prototype.readUInt32BE=function(P,j){return j||a(P,4,this.length),16777216*this[P]+(this[P+1]<<16|this[P+2]<<8|this[P+3])},t.prototype.readIntLE=function(P,j,K){P|=0,j|=0,K||a(P,j,this.length);for(var Z=this[P],J=1,X=0;++X=(J*=128)&&(Z-=Math.pow(2,8*j)),Z},t.prototype.readIntBE=function(P,j,K){P|=0,j|=0,K||a(P,j,this.length);for(var Z=j,J=1,X=this[P+--Z];Z>0&&(J*=256);)X+=this[P+--Z]*J;return X>=(J*=128)&&(X-=Math.pow(2,8*j)),X},t.prototype.readInt8=function(P,j){return j||a(P,1,this.length),128&this[P]?-1*(255-this[P]+1):this[P]},t.prototype.readInt16LE=function(P,j){j||a(P,2,this.length);var K=this[P]|this[P+1]<<8;return 32768&K?4294901760|K:K},t.prototype.readInt16BE=function(P,j){j||a(P,2,this.length);var K=this[P+1]|this[P]<<8;return 32768&K?4294901760|K:K},t.prototype.readInt32LE=function(P,j){return j||a(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},t.prototype.readInt32BE=function(P,j){return j||a(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},t.prototype.readFloatLE=function(P,j){return j||a(P,4,this.length),y.read(this,P,!0,23,4)},t.prototype.readFloatBE=function(P,j){return j||a(P,4,this.length),y.read(this,P,!1,23,4)},t.prototype.readDoubleLE=function(P,j){return j||a(P,8,this.length),y.read(this,P,!0,52,8)},t.prototype.readDoubleBE=function(P,j){return j||a(P,8,this.length),y.read(this,P,!1,52,8)},t.prototype.writeUIntLE=function(P,j,K,Z){P=+P,j|=0,K|=0,Z||g(this,P,j,K,Math.pow(2,8*K)-1,0);var J=1,X=0;for(this[j]=255&P;++X=0&&(X*=256);)this[j+J]=P/X&255;return j+K},t.prototype.writeUInt8=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,1,255,0),t.TYPED_ARRAY_SUPPORT||(P=Math.floor(P)),this[j]=255&P,j+1},t.prototype.writeUInt16LE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8):M(this,P,j,!0),j+2},t.prototype.writeUInt16BE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[j]=P>>>8,this[j+1]=255&P):M(this,P,j,!1),j+2},t.prototype.writeUInt32LE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[j+3]=P>>>24,this[j+2]=P>>>16,this[j+1]=P>>>8,this[j]=255&P):E(this,P,j,!0),j+4},t.prototype.writeUInt32BE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[j]=P>>>24,this[j+1]=P>>>16,this[j+2]=P>>>8,this[j+3]=255&P):E(this,P,j,!1),j+4},t.prototype.writeIntLE=function(P,j,K,Z){if(P=+P,j|=0,!Z){var J=Math.pow(2,8*K-1);g(this,P,j,K,J-1,-J)}var X=0,ee=1,te=0;for(this[j]=255&P;++X>0)-te&255;return j+K},t.prototype.writeIntBE=function(P,j,K,Z){if(P=+P,j|=0,!Z){var J=Math.pow(2,8*K-1);g(this,P,j,K,J-1,-J)}var X=K-1,ee=1,te=0;for(this[j+X]=255&P;--X>=0&&(ee*=256);)P<0&&0===te&&0!==this[j+X+1]&&(te=1),this[j+X]=(P/ee>>0)-te&255;return j+K},t.prototype.writeInt8=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,1,127,-128),t.TYPED_ARRAY_SUPPORT||(P=Math.floor(P)),P<0&&(P=255+P+1),this[j]=255&P,j+1},t.prototype.writeInt16LE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8):M(this,P,j,!0),j+2},t.prototype.writeInt16BE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[j]=P>>>8,this[j+1]=255&P):M(this,P,j,!1),j+2},t.prototype.writeInt32LE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8,this[j+2]=P>>>16,this[j+3]=P>>>24):E(this,P,j,!0),j+4},t.prototype.writeInt32BE=function(P,j,K){return P=+P,j|=0,K||g(this,P,j,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),t.TYPED_ARRAY_SUPPORT?(this[j]=P>>>24,this[j+1]=P>>>16,this[j+2]=P>>>8,this[j+3]=255&P):E(this,P,j,!1),j+4},t.prototype.writeFloatLE=function(P,j,K){return U(this,P,j,!0,K)},t.prototype.writeFloatBE=function(P,j,K){return U(this,P,j,!1,K)},t.prototype.writeDoubleLE=function(P,j,K){return V(this,P,j,!0,K)},t.prototype.writeDoubleBE=function(P,j,K){return V(this,P,j,!1,K)},t.prototype.copy=function(P,j,K,Z){if(K||(K=0),Z||0===Z||(Z=this.length),j>=P.length&&(j=P.length),j||(j=0),Z>0&&Z=this.length)throw new RangeError("sourceStart out of bounds");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),P.length-j=0;--J)P[J+j]=this[J+K];else if(X<1e3||!t.TYPED_ARRAY_SUPPORT)for(J=0;J>>=0,K=void 0===K?this.length:K>>>0,P||(P=0),"number"==typeof P)for(X=j;X55295&&K<57344){if(!J){if(K>56319){(j-=3)>-1&&X.push(239,191,189);continue}if(ee+1===Z){(j-=3)>-1&&X.push(239,191,189);continue}J=K;continue}if(K<56320){(j-=3)>-1&&X.push(239,191,189),J=K;continue}K=65536+(J-55296<<10|K-56320)}else J&&(j-=3)>-1&&X.push(239,191,189);if(J=null,K<128){if((j-=1)<0)break;X.push(K)}else if(K<2048){if((j-=2)<0)break;X.push(K>>6|192,63&K|128)}else if(K<65536){if((j-=3)<0)break;X.push(K>>12|224,K>>6&63|128,63&K|128)}else{if(!(K<1114112))throw new Error("Invalid code point");if((j-=4)<0)break;X.push(K>>18|240,K>>12&63|128,K>>6&63|128,63&K|128)}}return X}function B(P){return m.toByteArray(function(j){if((j=(K=j,K.trim?K.trim():K.replace(/^\s+|\s+$/g,"")).replace(I,"")).length<2)return"";for(var K;j.length%4!=0;)j+="=";return j}(P))}function N(P,j,K,Z){for(var J=0;J=j.length||J>=P.length);++J)j[J+K]=P[J];return J}}).call(this,c(6))},function(z,l){z.exports="function"==typeof Object.create?function(c,s){s&&(c.super_=s,c.prototype=Object.create(s.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:function(c,s){if(s){c.super_=s;var m=function(){};m.prototype=s.prototype,c.prototype=new m,c.prototype.constructor=c}}},function(z,l,c){"use strict";c.d(l,"b",function(){return 256}),c.d(l,"g",function(){return 256}),c.d(l,"a",function(){return"AES-CBC"}),c.d(l,"f",function(){return"SHA-256"}),c.d(l,"e",function(){return"HMAC"}),c.d(l,"i",function(){return"SHA-256"}),c.d(l,"j",function(){return"SHA-512"}),c.d(l,"h",function(){return 512}),c.d(l,"d",function(){return"encrypt"}),c.d(l,"c",function(){return"decrypt"}),c.d(l,"k",function(){return"sign"}),c.d(l,"l",function(){return"verify"})},function(z,l){var c,s,m=z.exports={};function y(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(v){if(c===setTimeout)return setTimeout(v,0);if((c===y||!c)&&setTimeout)return c=setTimeout,setTimeout(v,0);try{return c(v,0)}catch{try{return c.call(null,v,0)}catch{return c.call(this,v,0)}}}!function(){try{c="function"==typeof setTimeout?setTimeout:y}catch{c=y}try{s="function"==typeof clearTimeout?clearTimeout:n}catch{s=n}}();var e,t=[],i=!1,u=-1;function h(){i&&e&&(i=!1,e.length?t=e.concat(t):u=-1,t.length&&f())}function f(){if(!i){var v=o(h);i=!0;for(var T=t.length;T;){for(e=t,t=[];++u1)for(var O=1;O=49&&g<=54?g-49+10:g>=17&&g<=22?g-17+10:15&g}return R}function u(k,p,x,R){for(var r=0,a=Math.min(k.length,x),g=p;g=49?M-49+10:M>=17?M-17+10:M}return r}e.isBN=function(k){return k instanceof e||null!==k&&"object"==typeof k&&k.constructor.wordSize===e.wordSize&&Array.isArray(k.words)},e.max=function(k,p){return k.cmp(p)>0?k:p},e.min=function(k,p){return k.cmp(p)<0?k:p},e.prototype._init=function(k,p,x){if("number"==typeof k)return this._initNumber(k,p,x);if("object"==typeof k)return this._initArray(k,p,x);"hex"===p&&(p=16),n(p===(0|p)&&p>=2&&p<=36);var R=0;"-"===(k=k.toString().replace(/\s+/g,""))[0]&&R++,16===p?this._parseHex(k,R):this._parseBase(k,p,R),"-"===k[0]&&(this.negative=1),this.strip(),"le"===x&&this._initArray(this.toArray(),p,x)},e.prototype._initNumber=function(k,p,x){k<0&&(this.negative=1,k=-k),k<67108864?(this.words=[67108863&k],this.length=1):k<4503599627370496?(this.words=[67108863&k,k/67108864&67108863],this.length=2):(n(k<9007199254740992),this.words=[67108863&k,k/67108864&67108863,1],this.length=3),"le"===x&&this._initArray(this.toArray(),p,x)},e.prototype._initArray=function(k,p,x){if(n("number"==typeof k.length),k.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(k.length/3),this.words=new Array(this.length);for(var R=0;R=0;R-=3)this.words[r]|=(a=k[R]|k[R-1]<<8|k[R-2]<<16)<>>26-g&67108863,(g+=24)>=26&&(g-=26,r++);else if("le"===x)for(R=0,r=0;R>>26-g&67108863,(g+=24)>=26&&(g-=26,r++);return this.strip()},e.prototype._parseHex=function(k,p){this.length=Math.ceil((k.length-p)/6),this.words=new Array(this.length);for(var x=0;x=p;x-=6)r=i(k,x,x+6),this.words[R]|=r<>>26-a&4194303,(a+=24)>=26&&(a-=26,R++);x+6!==p&&(r=i(k,p,x+6),this.words[R]|=r<>>26-a&4194303),this.strip()},e.prototype._parseBase=function(k,p,x){this.words=[0],this.length=1;for(var R=0,r=1;r<=67108863;r*=p)R++;R--,r=r/p|0;for(var a=k.length-x,g=a%R,M=Math.min(a,a-g)+x,E=0,C=x;C1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},e.prototype.inspect=function(){return(this.red?""};var h=["","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"],f=[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],d=[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 _(k,p,x){x.negative=p.negative^k.negative;var R=k.length+p.length|0;x.length=R,R=R-1|0;var r=0|k.words[0],a=0|p.words[0],g=r*a,E=g/67108864|0;x.words[0]=67108863&g;for(var C=1;C>>26,V=67108863&E,I=Math.min(C,p.length-1),W=Math.max(0,C-k.length+1);W<=I;W++)U+=(g=(r=0|k.words[C-W|0])*(a=0|p.words[W])+V)/67108864|0,V=67108863&g;x.words[C]=0|V,E=0|U}return 0!==E?x.words[C]=0|E:x.length--,x.strip()}e.prototype.toString=function(k,p){var x;if(p=0|p||1,16===(k=k||10)||"hex"===k){x="";for(var R=0,r=0,a=0;a>>24-R&16777215)||a!==this.length-1?h[6-M.length]+M+x:M+x,(R+=2)>=26&&(R-=26,a--)}for(0!==r&&(x=r.toString(16)+x);x.length%p!=0;)x="0"+x;return 0!==this.negative&&(x="-"+x),x}if(k===(0|k)&&k>=2&&k<=36){var E=f[k],C=d[k];x="";var U=this.clone();for(U.negative=0;!U.isZero();){var V=U.modn(C).toString(k);x=(U=U.idivn(C)).isZero()?V+x:h[E-V.length]+V+x}for(this.isZero()&&(x="0"+x);x.length%p!=0;)x="0"+x;return 0!==this.negative&&(x="-"+x),x}n(!1,"Base should be between 2 and 36")},e.prototype.toNumber=function(){var k=this.words[0];return 2===this.length?k+=67108864*this.words[1]:3===this.length&&1===this.words[2]?k+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-k:k},e.prototype.toJSON=function(){return this.toString(16)},e.prototype.toBuffer=function(k,p){return n(void 0!==t),this.toArrayLike(t,k,p)},e.prototype.toArray=function(k,p){return this.toArrayLike(Array,k,p)},e.prototype.toArrayLike=function(k,p,x){var R=this.byteLength(),r=x||Math.max(1,R);n(R<=r,"byte array longer than desired length"),n(r>0,"Requested array length <= 0"),this.strip();var a,g,M="le"===p,E=new k(r),C=this.clone();if(M){for(g=0;!C.isZero();g++)a=C.andln(255),C.iushrn(8),E[g]=a;for(;g=4096&&(x+=13,p>>>=13),p>=64&&(x+=7,p>>>=7),p>=8&&(x+=4,p>>>=4),p>=2&&(x+=2,p>>>=2),x+p},e.prototype._zeroBits=function(k){if(0===k)return 26;var p=k,x=0;return 0==(8191&p)&&(x+=13,p>>>=13),0==(127&p)&&(x+=7,p>>>=7),0==(15&p)&&(x+=4,p>>>=4),0==(3&p)&&(x+=2,p>>>=2),0==(1&p)&&x++,x},e.prototype.bitLength=function(){var p=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+p},e.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,p=0;pk.length?this.clone().ior(k):k.clone().ior(this)},e.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},e.prototype.iuand=function(k){var p;p=this.length>k.length?k:this;for(var x=0;xk.length?this.clone().iand(k):k.clone().iand(this)},e.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},e.prototype.iuxor=function(k){var p,x;this.length>k.length?(p=this,x=k):(p=k,x=this);for(var R=0;Rk.length?this.clone().ixor(k):k.clone().ixor(this)},e.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},e.prototype.inotn=function(k){n("number"==typeof k&&k>=0);var p=0|Math.ceil(k/26),x=k%26;this._expand(p),x>0&&p--;for(var R=0;R0&&(this.words[R]=~this.words[R]&67108863>>26-x),this.strip()},e.prototype.notn=function(k){return this.clone().inotn(k)},e.prototype.setn=function(k,p){n("number"==typeof k&&k>=0);var x=k/26|0,R=k%26;return this._expand(x+1),this.words[x]=p?this.words[x]|1<k.length?(x=this,R=k):(x=k,R=this);for(var r=0,a=0;a>>26;for(;0!==r&&a>>26;if(this.length=x.length,0!==r)this.words[this.length]=r,this.length++;else if(x!==this)for(;ak.length?this.clone().iadd(k):k.clone().iadd(this)},e.prototype.isub=function(k){if(0!==k.negative){k.negative=0;var p=this.iadd(k);return k.negative=1,p._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var x,R,r=this.cmp(k);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(x=this,R=k):(x=k,R=this);for(var a=0,g=0;g>26,this.words[g]=67108863&p;for(;0!==a&&g>26,this.words[g]=67108863&p;if(0===a&&g>>13,W=0|g[1],F=8191&W,B=W>>>13,N=0|g[2],P=8191&N,j=N>>>13,K=0|g[3],Z=8191&K,J=K>>>13,X=0|g[4],ee=8191&X,te=X>>>13,oe=0|g[5],ve=8191&oe,ie=oe>>>13,de=0|g[6],fe=8191&de,re=de>>>13,_e=0|g[7],Ke=8191&_e,pe=_e>>>13,Te=0|g[8],Ve=8191&Te,be=Te>>>13,Pe=0|g[9],Ye=8191&Pe,we=Pe>>>13,Be=0|M[0],$e=8191&Be,Me=Be>>>13,je=0|M[1],Q=8191&je,se=je>>>13,le=0|M[2],Le=8191&le,he=le>>>13,Oe=0|M[3],Ge=8191&Oe,me=Oe>>>13,ze=0|M[4],rt=8191&ze,Re=ze>>>13,He=0|M[5],Qe=8191&He,Ee=He>>>13,Ne=0|M[6],it=8191&Ne,xe=Ne>>>13,qe=0|M[7],et=8191&qe,ke=qe>>>13,We=0|M[8],tt=8191&We,Se=We>>>13,Fe=0|M[9],nt=8191&Fe,Ae=Fe>>>13;x.negative=k.negative^p.negative,x.length=19;var Ue=(C+(R=Math.imul(V,$e))|0)+((8191&(r=(r=Math.imul(V,Me))+Math.imul(I,$e)|0))<<13)|0;C=((a=Math.imul(I,Me))+(r>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,R=Math.imul(F,$e),r=(r=Math.imul(F,Me))+Math.imul(B,$e)|0,a=Math.imul(B,Me);var Y=(C+(R=R+Math.imul(V,Q)|0)|0)+((8191&(r=(r=r+Math.imul(V,se)|0)+Math.imul(I,Q)|0))<<13)|0;C=((a=a+Math.imul(I,se)|0)+(r>>>13)|0)+(Y>>>26)|0,Y&=67108863,R=Math.imul(P,$e),r=(r=Math.imul(P,Me))+Math.imul(j,$e)|0,a=Math.imul(j,Me),R=R+Math.imul(F,Q)|0,r=(r=r+Math.imul(F,se)|0)+Math.imul(B,Q)|0,a=a+Math.imul(B,se)|0;var G=(C+(R=R+Math.imul(V,Le)|0)|0)+((8191&(r=(r=r+Math.imul(V,he)|0)+Math.imul(I,Le)|0))<<13)|0;C=((a=a+Math.imul(I,he)|0)+(r>>>13)|0)+(G>>>26)|0,G&=67108863,R=Math.imul(Z,$e),r=(r=Math.imul(Z,Me))+Math.imul(J,$e)|0,a=Math.imul(J,Me),R=R+Math.imul(P,Q)|0,r=(r=r+Math.imul(P,se)|0)+Math.imul(j,Q)|0,a=a+Math.imul(j,se)|0,R=R+Math.imul(F,Le)|0,r=(r=r+Math.imul(F,he)|0)+Math.imul(B,Le)|0,a=a+Math.imul(B,he)|0;var $=(C+(R=R+Math.imul(V,Ge)|0)|0)+((8191&(r=(r=r+Math.imul(V,me)|0)+Math.imul(I,Ge)|0))<<13)|0;C=((a=a+Math.imul(I,me)|0)+(r>>>13)|0)+($>>>26)|0,$&=67108863,R=Math.imul(ee,$e),r=(r=Math.imul(ee,Me))+Math.imul(te,$e)|0,a=Math.imul(te,Me),R=R+Math.imul(Z,Q)|0,r=(r=r+Math.imul(Z,se)|0)+Math.imul(J,Q)|0,a=a+Math.imul(J,se)|0,R=R+Math.imul(P,Le)|0,r=(r=r+Math.imul(P,he)|0)+Math.imul(j,Le)|0,a=a+Math.imul(j,he)|0,R=R+Math.imul(F,Ge)|0,r=(r=r+Math.imul(F,me)|0)+Math.imul(B,Ge)|0,a=a+Math.imul(B,me)|0;var ne=(C+(R=R+Math.imul(V,rt)|0)|0)+((8191&(r=(r=r+Math.imul(V,Re)|0)+Math.imul(I,rt)|0))<<13)|0;C=((a=a+Math.imul(I,Re)|0)+(r>>>13)|0)+(ne>>>26)|0,ne&=67108863,R=Math.imul(ve,$e),r=(r=Math.imul(ve,Me))+Math.imul(ie,$e)|0,a=Math.imul(ie,Me),R=R+Math.imul(ee,Q)|0,r=(r=r+Math.imul(ee,se)|0)+Math.imul(te,Q)|0,a=a+Math.imul(te,se)|0,R=R+Math.imul(Z,Le)|0,r=(r=r+Math.imul(Z,he)|0)+Math.imul(J,Le)|0,a=a+Math.imul(J,he)|0,R=R+Math.imul(P,Ge)|0,r=(r=r+Math.imul(P,me)|0)+Math.imul(j,Ge)|0,a=a+Math.imul(j,me)|0,R=R+Math.imul(F,rt)|0,r=(r=r+Math.imul(F,Re)|0)+Math.imul(B,rt)|0,a=a+Math.imul(B,Re)|0;var ce=(C+(R=R+Math.imul(V,Qe)|0)|0)+((8191&(r=(r=r+Math.imul(V,Ee)|0)+Math.imul(I,Qe)|0))<<13)|0;C=((a=a+Math.imul(I,Ee)|0)+(r>>>13)|0)+(ce>>>26)|0,ce&=67108863,R=Math.imul(fe,$e),r=(r=Math.imul(fe,Me))+Math.imul(re,$e)|0,a=Math.imul(re,Me),R=R+Math.imul(ve,Q)|0,r=(r=r+Math.imul(ve,se)|0)+Math.imul(ie,Q)|0,a=a+Math.imul(ie,se)|0,R=R+Math.imul(ee,Le)|0,r=(r=r+Math.imul(ee,he)|0)+Math.imul(te,Le)|0,a=a+Math.imul(te,he)|0,R=R+Math.imul(Z,Ge)|0,r=(r=r+Math.imul(Z,me)|0)+Math.imul(J,Ge)|0,a=a+Math.imul(J,me)|0,R=R+Math.imul(P,rt)|0,r=(r=r+Math.imul(P,Re)|0)+Math.imul(j,rt)|0,a=a+Math.imul(j,Re)|0,R=R+Math.imul(F,Qe)|0,r=(r=r+Math.imul(F,Ee)|0)+Math.imul(B,Qe)|0,a=a+Math.imul(B,Ee)|0;var ue=(C+(R=R+Math.imul(V,it)|0)|0)+((8191&(r=(r=r+Math.imul(V,xe)|0)+Math.imul(I,it)|0))<<13)|0;C=((a=a+Math.imul(I,xe)|0)+(r>>>13)|0)+(ue>>>26)|0,ue&=67108863,R=Math.imul(Ke,$e),r=(r=Math.imul(Ke,Me))+Math.imul(pe,$e)|0,a=Math.imul(pe,Me),R=R+Math.imul(fe,Q)|0,r=(r=r+Math.imul(fe,se)|0)+Math.imul(re,Q)|0,a=a+Math.imul(re,se)|0,R=R+Math.imul(ve,Le)|0,r=(r=r+Math.imul(ve,he)|0)+Math.imul(ie,Le)|0,a=a+Math.imul(ie,he)|0,R=R+Math.imul(ee,Ge)|0,r=(r=r+Math.imul(ee,me)|0)+Math.imul(te,Ge)|0,a=a+Math.imul(te,me)|0,R=R+Math.imul(Z,rt)|0,r=(r=r+Math.imul(Z,Re)|0)+Math.imul(J,rt)|0,a=a+Math.imul(J,Re)|0,R=R+Math.imul(P,Qe)|0,r=(r=r+Math.imul(P,Ee)|0)+Math.imul(j,Qe)|0,a=a+Math.imul(j,Ee)|0,R=R+Math.imul(F,it)|0,r=(r=r+Math.imul(F,xe)|0)+Math.imul(B,it)|0,a=a+Math.imul(B,xe)|0;var Ce=(C+(R=R+Math.imul(V,et)|0)|0)+((8191&(r=(r=r+Math.imul(V,ke)|0)+Math.imul(I,et)|0))<<13)|0;C=((a=a+Math.imul(I,ke)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,R=Math.imul(Ve,$e),r=(r=Math.imul(Ve,Me))+Math.imul(be,$e)|0,a=Math.imul(be,Me),R=R+Math.imul(Ke,Q)|0,r=(r=r+Math.imul(Ke,se)|0)+Math.imul(pe,Q)|0,a=a+Math.imul(pe,se)|0,R=R+Math.imul(fe,Le)|0,r=(r=r+Math.imul(fe,he)|0)+Math.imul(re,Le)|0,a=a+Math.imul(re,he)|0,R=R+Math.imul(ve,Ge)|0,r=(r=r+Math.imul(ve,me)|0)+Math.imul(ie,Ge)|0,a=a+Math.imul(ie,me)|0,R=R+Math.imul(ee,rt)|0,r=(r=r+Math.imul(ee,Re)|0)+Math.imul(te,rt)|0,a=a+Math.imul(te,Re)|0,R=R+Math.imul(Z,Qe)|0,r=(r=r+Math.imul(Z,Ee)|0)+Math.imul(J,Qe)|0,a=a+Math.imul(J,Ee)|0,R=R+Math.imul(P,it)|0,r=(r=r+Math.imul(P,xe)|0)+Math.imul(j,it)|0,a=a+Math.imul(j,xe)|0,R=R+Math.imul(F,et)|0,r=(r=r+Math.imul(F,ke)|0)+Math.imul(B,et)|0,a=a+Math.imul(B,ke)|0;var Ie=(C+(R=R+Math.imul(V,tt)|0)|0)+((8191&(r=(r=r+Math.imul(V,Se)|0)+Math.imul(I,tt)|0))<<13)|0;C=((a=a+Math.imul(I,Se)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,R=Math.imul(Ye,$e),r=(r=Math.imul(Ye,Me))+Math.imul(we,$e)|0,a=Math.imul(we,Me),R=R+Math.imul(Ve,Q)|0,r=(r=r+Math.imul(Ve,se)|0)+Math.imul(be,Q)|0,a=a+Math.imul(be,se)|0,R=R+Math.imul(Ke,Le)|0,r=(r=r+Math.imul(Ke,he)|0)+Math.imul(pe,Le)|0,a=a+Math.imul(pe,he)|0,R=R+Math.imul(fe,Ge)|0,r=(r=r+Math.imul(fe,me)|0)+Math.imul(re,Ge)|0,a=a+Math.imul(re,me)|0,R=R+Math.imul(ve,rt)|0,r=(r=r+Math.imul(ve,Re)|0)+Math.imul(ie,rt)|0,a=a+Math.imul(ie,Re)|0,R=R+Math.imul(ee,Qe)|0,r=(r=r+Math.imul(ee,Ee)|0)+Math.imul(te,Qe)|0,a=a+Math.imul(te,Ee)|0,R=R+Math.imul(Z,it)|0,r=(r=r+Math.imul(Z,xe)|0)+Math.imul(J,it)|0,a=a+Math.imul(J,xe)|0,R=R+Math.imul(P,et)|0,r=(r=r+Math.imul(P,ke)|0)+Math.imul(j,et)|0,a=a+Math.imul(j,ke)|0,R=R+Math.imul(F,tt)|0,r=(r=r+Math.imul(F,Se)|0)+Math.imul(B,tt)|0,a=a+Math.imul(B,Se)|0;var De=(C+(R=R+Math.imul(V,nt)|0)|0)+((8191&(r=(r=r+Math.imul(V,Ae)|0)+Math.imul(I,nt)|0))<<13)|0;C=((a=a+Math.imul(I,Ae)|0)+(r>>>13)|0)+(De>>>26)|0,De&=67108863,R=Math.imul(Ye,Q),r=(r=Math.imul(Ye,se))+Math.imul(we,Q)|0,a=Math.imul(we,se),R=R+Math.imul(Ve,Le)|0,r=(r=r+Math.imul(Ve,he)|0)+Math.imul(be,Le)|0,a=a+Math.imul(be,he)|0,R=R+Math.imul(Ke,Ge)|0,r=(r=r+Math.imul(Ke,me)|0)+Math.imul(pe,Ge)|0,a=a+Math.imul(pe,me)|0,R=R+Math.imul(fe,rt)|0,r=(r=r+Math.imul(fe,Re)|0)+Math.imul(re,rt)|0,a=a+Math.imul(re,Re)|0,R=R+Math.imul(ve,Qe)|0,r=(r=r+Math.imul(ve,Ee)|0)+Math.imul(ie,Qe)|0,a=a+Math.imul(ie,Ee)|0,R=R+Math.imul(ee,it)|0,r=(r=r+Math.imul(ee,xe)|0)+Math.imul(te,it)|0,a=a+Math.imul(te,xe)|0,R=R+Math.imul(Z,et)|0,r=(r=r+Math.imul(Z,ke)|0)+Math.imul(J,et)|0,a=a+Math.imul(J,ke)|0,R=R+Math.imul(P,tt)|0,r=(r=r+Math.imul(P,Se)|0)+Math.imul(j,tt)|0,a=a+Math.imul(j,Se)|0;var ye=(C+(R=R+Math.imul(F,nt)|0)|0)+((8191&(r=(r=r+Math.imul(F,Ae)|0)+Math.imul(B,nt)|0))<<13)|0;C=((a=a+Math.imul(B,Ae)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,R=Math.imul(Ye,Le),r=(r=Math.imul(Ye,he))+Math.imul(we,Le)|0,a=Math.imul(we,he),R=R+Math.imul(Ve,Ge)|0,r=(r=r+Math.imul(Ve,me)|0)+Math.imul(be,Ge)|0,a=a+Math.imul(be,me)|0,R=R+Math.imul(Ke,rt)|0,r=(r=r+Math.imul(Ke,Re)|0)+Math.imul(pe,rt)|0,a=a+Math.imul(pe,Re)|0,R=R+Math.imul(fe,Qe)|0,r=(r=r+Math.imul(fe,Ee)|0)+Math.imul(re,Qe)|0,a=a+Math.imul(re,Ee)|0,R=R+Math.imul(ve,it)|0,r=(r=r+Math.imul(ve,xe)|0)+Math.imul(ie,it)|0,a=a+Math.imul(ie,xe)|0,R=R+Math.imul(ee,et)|0,r=(r=r+Math.imul(ee,ke)|0)+Math.imul(te,et)|0,a=a+Math.imul(te,ke)|0,R=R+Math.imul(Z,tt)|0,r=(r=r+Math.imul(Z,Se)|0)+Math.imul(J,tt)|0,a=a+Math.imul(J,Se)|0;var ae=(C+(R=R+Math.imul(P,nt)|0)|0)+((8191&(r=(r=r+Math.imul(P,Ae)|0)+Math.imul(j,nt)|0))<<13)|0;C=((a=a+Math.imul(j,Ae)|0)+(r>>>13)|0)+(ae>>>26)|0,ae&=67108863,R=Math.imul(Ye,Ge),r=(r=Math.imul(Ye,me))+Math.imul(we,Ge)|0,a=Math.imul(we,me),R=R+Math.imul(Ve,rt)|0,r=(r=r+Math.imul(Ve,Re)|0)+Math.imul(be,rt)|0,a=a+Math.imul(be,Re)|0,R=R+Math.imul(Ke,Qe)|0,r=(r=r+Math.imul(Ke,Ee)|0)+Math.imul(pe,Qe)|0,a=a+Math.imul(pe,Ee)|0,R=R+Math.imul(fe,it)|0,r=(r=r+Math.imul(fe,xe)|0)+Math.imul(re,it)|0,a=a+Math.imul(re,xe)|0,R=R+Math.imul(ve,et)|0,r=(r=r+Math.imul(ve,ke)|0)+Math.imul(ie,et)|0,a=a+Math.imul(ie,ke)|0,R=R+Math.imul(ee,tt)|0,r=(r=r+Math.imul(ee,Se)|0)+Math.imul(te,tt)|0,a=a+Math.imul(te,Se)|0;var Je=(C+(R=R+Math.imul(Z,nt)|0)|0)+((8191&(r=(r=r+Math.imul(Z,Ae)|0)+Math.imul(J,nt)|0))<<13)|0;C=((a=a+Math.imul(J,Ae)|0)+(r>>>13)|0)+(Je>>>26)|0,Je&=67108863,R=Math.imul(Ye,rt),r=(r=Math.imul(Ye,Re))+Math.imul(we,rt)|0,a=Math.imul(we,Re),R=R+Math.imul(Ve,Qe)|0,r=(r=r+Math.imul(Ve,Ee)|0)+Math.imul(be,Qe)|0,a=a+Math.imul(be,Ee)|0,R=R+Math.imul(Ke,it)|0,r=(r=r+Math.imul(Ke,xe)|0)+Math.imul(pe,it)|0,a=a+Math.imul(pe,xe)|0,R=R+Math.imul(fe,et)|0,r=(r=r+Math.imul(fe,ke)|0)+Math.imul(re,et)|0,a=a+Math.imul(re,ke)|0,R=R+Math.imul(ve,tt)|0,r=(r=r+Math.imul(ve,Se)|0)+Math.imul(ie,tt)|0,a=a+Math.imul(ie,Se)|0;var ot=(C+(R=R+Math.imul(ee,nt)|0)|0)+((8191&(r=(r=r+Math.imul(ee,Ae)|0)+Math.imul(te,nt)|0))<<13)|0;C=((a=a+Math.imul(te,Ae)|0)+(r>>>13)|0)+(ot>>>26)|0,ot&=67108863,R=Math.imul(Ye,Qe),r=(r=Math.imul(Ye,Ee))+Math.imul(we,Qe)|0,a=Math.imul(we,Ee),R=R+Math.imul(Ve,it)|0,r=(r=r+Math.imul(Ve,xe)|0)+Math.imul(be,it)|0,a=a+Math.imul(be,xe)|0,R=R+Math.imul(Ke,et)|0,r=(r=r+Math.imul(Ke,ke)|0)+Math.imul(pe,et)|0,a=a+Math.imul(pe,ke)|0,R=R+Math.imul(fe,tt)|0,r=(r=r+Math.imul(fe,Se)|0)+Math.imul(re,tt)|0,a=a+Math.imul(re,Se)|0;var at=(C+(R=R+Math.imul(ve,nt)|0)|0)+((8191&(r=(r=r+Math.imul(ve,Ae)|0)+Math.imul(ie,nt)|0))<<13)|0;C=((a=a+Math.imul(ie,Ae)|0)+(r>>>13)|0)+(at>>>26)|0,at&=67108863,R=Math.imul(Ye,it),r=(r=Math.imul(Ye,xe))+Math.imul(we,it)|0,a=Math.imul(we,xe),R=R+Math.imul(Ve,et)|0,r=(r=r+Math.imul(Ve,ke)|0)+Math.imul(be,et)|0,a=a+Math.imul(be,ke)|0,R=R+Math.imul(Ke,tt)|0,r=(r=r+Math.imul(Ke,Se)|0)+Math.imul(pe,tt)|0,a=a+Math.imul(pe,Se)|0;var st=(C+(R=R+Math.imul(fe,nt)|0)|0)+((8191&(r=(r=r+Math.imul(fe,Ae)|0)+Math.imul(re,nt)|0))<<13)|0;C=((a=a+Math.imul(re,Ae)|0)+(r>>>13)|0)+(st>>>26)|0,st&=67108863,R=Math.imul(Ye,et),r=(r=Math.imul(Ye,ke))+Math.imul(we,et)|0,a=Math.imul(we,ke),R=R+Math.imul(Ve,tt)|0,r=(r=r+Math.imul(Ve,Se)|0)+Math.imul(be,tt)|0,a=a+Math.imul(be,Se)|0;var ut=(C+(R=R+Math.imul(Ke,nt)|0)|0)+((8191&(r=(r=r+Math.imul(Ke,Ae)|0)+Math.imul(pe,nt)|0))<<13)|0;C=((a=a+Math.imul(pe,Ae)|0)+(r>>>13)|0)+(ut>>>26)|0,ut&=67108863,R=Math.imul(Ye,tt),r=(r=Math.imul(Ye,Se))+Math.imul(we,tt)|0,a=Math.imul(we,Se);var Ze=(C+(R=R+Math.imul(Ve,nt)|0)|0)+((8191&(r=(r=r+Math.imul(Ve,Ae)|0)+Math.imul(be,nt)|0))<<13)|0;C=((a=a+Math.imul(be,Ae)|0)+(r>>>13)|0)+(Ze>>>26)|0,Ze&=67108863;var ct=(C+(R=Math.imul(Ye,nt))|0)+((8191&(r=(r=Math.imul(Ye,Ae))+Math.imul(we,nt)|0))<<13)|0;return C=((a=Math.imul(we,Ae))+(r>>>13)|0)+(ct>>>26)|0,ct&=67108863,E[0]=Ue,E[1]=Y,E[2]=G,E[3]=$,E[4]=ne,E[5]=ce,E[6]=ue,E[7]=Ce,E[8]=Ie,E[9]=De,E[10]=ye,E[11]=ae,E[12]=Je,E[13]=ot,E[14]=at,E[15]=st,E[16]=ut,E[17]=Ze,E[18]=ct,0!==C&&(E[19]=C,x.length++),x};function T(k,p,x){return(new O).mulp(k,p,x)}function O(k,p){this.x=k,this.y=p}Math.imul||(v=_),e.prototype.mulTo=function(k,p){var x=this.length+k.length;return 10===this.length&&10===k.length?v(this,k,p):x<63?_(this,k,p):x<1024?function(R,r,a){a.negative=r.negative^R.negative,a.length=R.length+r.length;for(var g=0,M=0,E=0;E>>26)|0)>>>26,C&=67108863}a.words[E]=U,g=C,C=M}return 0!==g?a.words[E]=g:a.length--,a.strip()}(this,k,p):T(this,k,p)},O.prototype.makeRBT=function(k){for(var p=new Array(k),x=e.prototype._countBits(k)-1,R=0;R>=1;return R},O.prototype.permute=function(k,p,x,R,r,a){for(var g=0;g>>=1)r++;return 1<>>=13),r>>>=13;for(a=2*p;a>=26,p+=R/67108864|0,p+=r>>>26,this.words[x]=67108863&r}return 0!==p&&(this.words[x]=p,this.length++),this},e.prototype.muln=function(k){return this.clone().imuln(k)},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.imul(this.clone())},e.prototype.pow=function(k){var p=function(a){for(var g=new Array(a.bitLength()),M=0;M>>C}return g}(k);if(0===p.length)return new e(1);for(var x=this,R=0;R=0);var p,x=k%26,R=(k-x)/26,r=67108863>>>26-x<<26-x;if(0!==x){var a=0;for(p=0;p>>26-x}a&&(this.words[p]=a,this.length++)}if(0!==R){for(p=this.length-1;p>=0;p--)this.words[p+R]=this.words[p];for(p=0;p=0),R=p?(p-p%26)/26:0;var r=k%26,a=Math.min((k-r)/26,this.length),g=67108863^67108863>>>r<a)for(this.length-=a,E=0;E=0&&(0!==C||E>=R);E--){var U=0|this.words[E];this.words[E]=C<<26-r|U>>>r,C=U&g}return M&&0!==C&&(M.words[M.length++]=C),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},e.prototype.ishrn=function(k,p,x){return n(0===this.negative),this.iushrn(k,p,x)},e.prototype.shln=function(k){return this.clone().ishln(k)},e.prototype.ushln=function(k){return this.clone().iushln(k)},e.prototype.shrn=function(k){return this.clone().ishrn(k)},e.prototype.ushrn=function(k){return this.clone().iushrn(k)},e.prototype.testn=function(k){n("number"==typeof k&&k>=0);var p=k%26,x=(k-p)/26;return!(this.length<=x||!(this.words[x]&1<=0);var p=k%26,x=(k-p)/26;return n(0===this.negative,"imaskn works only with positive numbers"),this.length<=x?this:(0!==p&&x++,this.length=Math.min(x,this.length),0!==p&&(this.words[this.length-1]&=67108863^67108863>>>p<=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},e.prototype.isubn=function(k){if(n("number"==typeof k),n(k<67108864),k<0)return this.iaddn(-k);if(0!==this.negative)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(M/67108864|0),this.words[R+x]=67108863&r}for(;R>26,this.words[R+x]=67108863&r;if(0===g)return this.strip();for(n(-1===g),g=0,R=0;R>26,this.words[R]=67108863&r;return this.negative=1,this.strip()},e.prototype._wordDiv=function(k,p){var x,R=this.clone(),r=k,a=0|r.words[r.length-1];0!=(x=26-this._countBits(a))&&(r=r.ushln(x),R.iushln(x),a=0|r.words[r.length-1]);var g,M=R.length-r.length;if("mod"!==p){(g=new e(null)).length=M+1,g.words=new Array(g.length);for(var E=0;E=0;U--){var V=67108864*(0|R.words[r.length+U])+(0|R.words[r.length+U-1]);for(V=Math.min(V/a|0,67108863),R._ishlnsubmul(r,V,U);0!==R.negative;)V--,R.negative=0,R._ishlnsubmul(r,1,U),R.isZero()||(R.negative^=1);g&&(g.words[U]=V)}return g&&g.strip(),R.strip(),"div"!==p&&0!==x&&R.iushrn(x),{div:g||null,mod:R}},e.prototype.divmod=function(k,p,x){return n(!k.isZero()),this.isZero()?{div:new e(0),mod:new e(0)}:0!==this.negative&&0===k.negative?(a=this.neg().divmod(k,p),"mod"!==p&&(R=a.div.neg()),"div"!==p&&(r=a.mod.neg(),x&&0!==r.negative&&r.iadd(k)),{div:R,mod:r}):0===this.negative&&0!==k.negative?(a=this.divmod(k.neg(),p),"mod"!==p&&(R=a.div.neg()),{div:R,mod:a.mod}):0!=(this.negative&k.negative)?(a=this.neg().divmod(k.neg(),p),"div"!==p&&(r=a.mod.neg(),x&&0!==r.negative&&r.isub(k)),{div:a.div,mod:r}):k.length>this.length||this.cmp(k)<0?{div:new e(0),mod:this}:1===k.length?"div"===p?{div:this.divn(k.words[0]),mod:null}:"mod"===p?{div:null,mod:new e(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new e(this.modn(k.words[0]))}:this._wordDiv(k,p);var R,r,a},e.prototype.div=function(k){return this.divmod(k,"div",!1).div},e.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},e.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},e.prototype.divRound=function(k){var p=this.divmod(k);if(p.mod.isZero())return p.div;var x=0!==p.div.negative?p.mod.isub(k):p.mod,R=k.ushrn(1),r=k.andln(1),a=x.cmp(R);return a<0||1===r&&0===a?p.div:0!==p.div.negative?p.div.isubn(1):p.div.iaddn(1)},e.prototype.modn=function(k){n(k<=67108863);for(var p=(1<<26)%k,x=0,R=this.length-1;R>=0;R--)x=(p*x+(0|this.words[R]))%k;return x},e.prototype.idivn=function(k){n(k<=67108863);for(var p=0,x=this.length-1;x>=0;x--){var R=(0|this.words[x])+67108864*p;this.words[x]=R/k|0,p=R%k}return this.strip()},e.prototype.divn=function(k){return this.clone().idivn(k)},e.prototype.egcd=function(k){n(0===k.negative),n(!k.isZero());var p=this,x=k.clone();p=0!==p.negative?p.umod(k):p.clone();for(var R=new e(1),r=new e(0),a=new e(0),g=new e(1),M=0;p.isEven()&&x.isEven();)p.iushrn(1),x.iushrn(1),++M;for(var E=x.clone(),C=p.clone();!p.isZero();){for(var U=0,V=1;0==(p.words[0]&V)&&U<26;++U,V<<=1);if(U>0)for(p.iushrn(U);U-- >0;)(R.isOdd()||r.isOdd())&&(R.iadd(E),r.isub(C)),R.iushrn(1),r.iushrn(1);for(var I=0,W=1;0==(x.words[0]&W)&&I<26;++I,W<<=1);if(I>0)for(x.iushrn(I);I-- >0;)(a.isOdd()||g.isOdd())&&(a.iadd(E),g.isub(C)),a.iushrn(1),g.iushrn(1);p.cmp(x)>=0?(p.isub(x),R.isub(a),r.isub(g)):(x.isub(p),a.isub(R),g.isub(r))}return{a,b:g,gcd:x.iushln(M)}},e.prototype._invmp=function(k){n(0===k.negative),n(!k.isZero());var p=this,x=k.clone();p=0!==p.negative?p.umod(k):p.clone();for(var R,r=new e(1),a=new e(0),g=x.clone();p.cmpn(1)>0&&x.cmpn(1)>0;){for(var M=0,E=1;0==(p.words[0]&E)&&M<26;++M,E<<=1);if(M>0)for(p.iushrn(M);M-- >0;)r.isOdd()&&r.iadd(g),r.iushrn(1);for(var C=0,U=1;0==(x.words[0]&U)&&C<26;++C,U<<=1);if(C>0)for(x.iushrn(C);C-- >0;)a.isOdd()&&a.iadd(g),a.iushrn(1);p.cmp(x)>=0?(p.isub(x),r.isub(a)):(x.isub(p),a.isub(r))}return(R=0===p.cmpn(1)?r:a).cmpn(0)<0&&R.iadd(k),R},e.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var p=this.clone(),x=k.clone();p.negative=0,x.negative=0;for(var R=0;p.isEven()&&x.isEven();R++)p.iushrn(1),x.iushrn(1);for(;;){for(;p.isEven();)p.iushrn(1);for(;x.isEven();)x.iushrn(1);var r=p.cmp(x);if(r<0){var a=p;p=x,x=a}else if(0===r||0===x.cmpn(1))break;p.isub(x)}return x.iushln(R)},e.prototype.invm=function(k){return this.egcd(k).a.umod(k)},e.prototype.isEven=function(){return 0==(1&this.words[0])},e.prototype.isOdd=function(){return 1==(1&this.words[0])},e.prototype.andln=function(k){return this.words[0]&k},e.prototype.bincn=function(k){n("number"==typeof k);var p=k%26,x=(k-p)/26,R=1<>>26,this.words[a]=g&=67108863}return 0!==r&&(this.words[a]=r,this.length++),this},e.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},e.prototype.cmpn=function(k){var p,x=k<0;if(0!==this.negative&&!x)return-1;if(0===this.negative&&x)return 1;if(this.strip(),this.length>1)p=1;else{x&&(k=-k),n(k<=67108863,"Number is too big");var R=0|this.words[0];p=R===k?0:Rk.length)return 1;if(this.length=0;x--){var R=0|this.words[x],r=0|k.words[x];if(R!==r){Rr&&(p=1);break}}return p},e.prototype.gtn=function(k){return 1===this.cmpn(k)},e.prototype.gt=function(k){return 1===this.cmp(k)},e.prototype.gten=function(k){return this.cmpn(k)>=0},e.prototype.gte=function(k){return this.cmp(k)>=0},e.prototype.ltn=function(k){return-1===this.cmpn(k)},e.prototype.lt=function(k){return-1===this.cmp(k)},e.prototype.lten=function(k){return this.cmpn(k)<=0},e.prototype.lte=function(k){return this.cmp(k)<=0},e.prototype.eqn=function(k){return 0===this.cmpn(k)},e.prototype.eq=function(k){return 0===this.cmp(k)},e.red=function(k){return new D(k)},e.prototype.toRed=function(k){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),k.convertTo(this)._forceRed(k)},e.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(k){return this.red=k,this},e.prototype.forceRed=function(k){return n(!this.red,"Already a number in reduction context"),this._forceRed(k)},e.prototype.redAdd=function(k){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},e.prototype.redIAdd=function(k){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},e.prototype.redSub=function(k){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},e.prototype.redISub=function(k){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},e.prototype.redShl=function(k){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},e.prototype.redMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},e.prototype.redIMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},e.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(k){return n(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var b={k256:null,p224:null,p192:null,p25519:null};function S(k,p){this.name=k,this.p=new e(p,16),this.n=this.p.bitLength(),this.k=new e(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function L(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function H(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function D(k){if("string"==typeof k){var p=e._prime(k);this.m=p.p,this.prime=p}else n(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}function q(k){D.call(this,k),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new e(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)}S.prototype._tmp=function(){var k=new e(null);return k.words=new Array(Math.ceil(this.n/13)),k},S.prototype.ireduce=function(k){var p,x=k;do{this.split(x,this.tmp),p=(x=(x=this.imulK(x)).iadd(this.tmp)).bitLength()}while(p>this.n);var R=p0?x.isub(this.p):x.strip(),x},S.prototype.split=function(k,p){k.iushrn(this.n,0,p)},S.prototype.imulK=function(k){return k.imul(this.k)},o(w,S),w.prototype.split=function(k,p){for(var x=Math.min(k.length,9),R=0;R>>22,r=a}k.words[R-10]=r>>>=22,k.length-=0===r&&k.length>10?10:9},w.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var p=0,x=0;x>>=26,k.words[x]=r,p=R}return 0!==p&&(k.words[k.length++]=p),k},e._prime=function(k){if(b[k])return b[k];var p;if("k256"===k)p=new w;else if("p224"===k)p=new A;else if("p192"===k)p=new L;else{if("p25519"!==k)throw new Error("Unknown prime "+k);p=new H}return b[k]=p,p},D.prototype._verify1=function(k){n(0===k.negative,"red works only with positives"),n(k.red,"red works only with red numbers")},D.prototype._verify2=function(k,p){n(0==(k.negative|p.negative),"red works only with positives"),n(k.red&&k.red===p.red,"red works only with red numbers")},D.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},D.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},D.prototype.add=function(k,p){this._verify2(k,p);var x=k.add(p);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},D.prototype.iadd=function(k,p){this._verify2(k,p);var x=k.iadd(p);return x.cmp(this.m)>=0&&x.isub(this.m),x},D.prototype.sub=function(k,p){this._verify2(k,p);var x=k.sub(p);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},D.prototype.isub=function(k,p){this._verify2(k,p);var x=k.isub(p);return x.cmpn(0)<0&&x.iadd(this.m),x},D.prototype.shl=function(k,p){return this._verify1(k),this.imod(k.ushln(p))},D.prototype.imul=function(k,p){return this._verify2(k,p),this.imod(k.imul(p))},D.prototype.mul=function(k,p){return this._verify2(k,p),this.imod(k.mul(p))},D.prototype.isqr=function(k){return this.imul(k,k.clone())},D.prototype.sqr=function(k){return this.mul(k,k)},D.prototype.sqrt=function(k){if(k.isZero())return k.clone();var p=this.m.andln(3);if(n(p%2==1),3===p){var x=this.m.add(new e(1)).iushrn(2);return this.pow(k,x)}for(var R=this.m.subn(1),r=0;!R.isZero()&&0===R.andln(1);)r++,R.iushrn(1);n(!R.isZero());var a=new e(1).toRed(this),g=a.redNeg(),M=this.m.subn(1).iushrn(1),E=this.m.bitLength();for(E=new e(2*E*E).toRed(this);0!==this.pow(E,M).cmp(g);)E.redIAdd(g);for(var C=this.pow(E,R),U=this.pow(k,R.addn(1).iushrn(1)),V=this.pow(k,R),I=r;0!==V.cmp(a);){for(var W=V,F=0;0!==W.cmp(a);F++)W=W.redSqr();n(F=0;R--){for(var E=p.words[R],C=M-1;C>=0;C--){var U=E>>C&1;r!==x[0]&&(r=this.sqr(r)),0!==U||0!==a?(a<<=1,a|=U,(4==++g||0===R&&0===C)&&(r=this.mul(r,x[a]),g=0,a=0)):g=0}M=26}return r},D.prototype.convertTo=function(k){var p=k.umod(this.m);return p===k?p.clone():p},D.prototype.convertFrom=function(k){var p=k.clone();return p.red=null,p},e.mont=function(k){return new q(k)},o(q,D),q.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},q.prototype.convertFrom=function(k){var p=this.imod(k.mul(this.rinv));return p.red=null,p},q.prototype.imul=function(k,p){if(k.isZero()||p.isZero())return k.words[0]=0,k.length=1,k;var x=k.imul(p),R=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=x.isub(R).iushrn(this.shift),a=r;return r.cmp(this.m)>=0?a=r.isub(this.m):r.cmpn(0)<0&&(a=r.iadd(this.m)),a._forceRed(this)},q.prototype.mul=function(k,p){if(k.isZero()||p.isZero())return new e(0)._forceRed(this);var x=k.mul(p),R=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=x.isub(R).iushrn(this.shift),a=r;return r.cmp(this.m)>=0?a=r.isub(this.m):r.cmpn(0)<0&&(a=r.iadd(this.m)),a._forceRed(this)},q.prototype.invm=function(k){return this.imod(k._invmp(this.m).mul(this.r2))._forceRed(this)}}(s,this)}).call(this,c(25)(z))},function(z,l,c){"use strict";function s(y){let n;return typeof window<"u"&&void 0!==window[y]&&(n=window[y]),n}function m(y){const n=s(y);if(!n)throw new Error(y+" is not defined in Window");return n}Object.defineProperty(l,"__esModule",{value:!0}),l.getLocalStorage=l.getLocalStorageOrThrow=l.getCrypto=l.getCryptoOrThrow=l.getLocation=l.getLocationOrThrow=l.getNavigator=l.getNavigatorOrThrow=l.getDocument=l.getDocumentOrThrow=l.getFromWindowOrThrow=l.getFromWindow=void 0,l.getFromWindow=s,l.getFromWindowOrThrow=m,l.getDocumentOrThrow=function(){return m("document")},l.getDocument=function(){return s("document")},l.getNavigatorOrThrow=function(){return m("navigator")},l.getNavigator=function(){return s("navigator")},l.getLocationOrThrow=function(){return m("location")},l.getLocation=function(){return s("location")},l.getCryptoOrThrow=function(){return m("crypto")},l.getCrypto=function(){return s("crypto")},l.getLocalStorageOrThrow=function(){return m("localStorage")},l.getLocalStorage=function(){return s("localStorage")}},function(z,l,c){"use strict";var s=l,m=c(16),y=c(22),n=c(120);s.assert=y,s.toArray=n.toArray,s.zero2=n.zero2,s.toHex=n.toHex,s.encode=n.encode,s.getNAF=function(o,e,t){var i=new Array(Math.max(o.bitLength(),t)+1);i.fill(0);for(var u=1<(u>>1)-1?(u>>1)-_:_):d=0,i[f]=d,h.iushrn(1)}return i},s.getJSF=function(o,e){var t=[[],[]];o=o.clone(),e=e.clone();for(var i,u=0,h=0;o.cmpn(-u)>0||e.cmpn(-h)>0;){var f,d,_=o.andln(3)+u&3,v=e.andln(3)+h&3;3===_&&(_=-1),3===v&&(v=-1),f=0==(1&_)?0:3!=(i=o.andln(7)+u&7)&&5!==i||2!==v?_:-_,t[0].push(f),d=0==(1&v)?0:3!=(i=e.andln(7)+h&7)&&5!==i||2!==_?v:-v,t[1].push(d),2*u===f+1&&(u=1-u),2*h===d+1&&(h=1-h),o.iushrn(1),e.iushrn(1)}return t},s.cachedProperty=function(o,e,t){var i="_"+e;o.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=t.call(this)}},s.parseBytes=function(o){return"string"==typeof o?s.toArray(o,"hex"):o},s.intFromLE=function(o){return new m(o,"hex","le")}},function(z,l,c){"use strict";var s,m="object"==typeof Reflect?Reflect:null,y=m&&"function"==typeof m.apply?m.apply:function(O,b,S){return Function.prototype.apply.call(O,b,S)};s=m&&"function"==typeof m.ownKeys?m.ownKeys:Object.getOwnPropertySymbols?function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:function(O){return Object.getOwnPropertyNames(O)};var n=Number.isNaN||function(O){return O!=O};function o(){o.init.call(this)}z.exports=o,z.exports.once=function(O,b){return new Promise(function(S,w){function A(H){O.removeListener(b,L),w(H)}function L(){"function"==typeof O.removeListener&&O.removeListener("error",A),S([].slice.call(arguments))}var H;T(O,b,L,{once:!0}),"error"!==b&&("function"==typeof(H=O).on&&T(H,"error",A,{once:!0}))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var e=10;function t(O){if("function"!=typeof O)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof O)}function i(O){return void 0===O._maxListeners?o.defaultMaxListeners:O._maxListeners}function u(O,b,S,w){var A,L,H;if(t(S),void 0===(L=O._events)?(L=O._events=Object.create(null),O._eventsCount=0):(void 0!==L.newListener&&(O.emit("newListener",b,S.listener?S.listener:S),L=O._events),H=L[b]),void 0===H)H=L[b]=S,++O._eventsCount;else if("function"==typeof H?H=L[b]=w?[S,H]:[H,S]:w?H.unshift(S):H.push(S),(A=i(O))>0&&H.length>A&&!H.warned){H.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+H.length+" "+String(b)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=O,q.type=b,q.count=H.length,console&&console.warn&&console.warn(q)}return O}function h(){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 f(O,b,S){var w={fired:!1,wrapFn:void 0,target:O,type:b,listener:S},A=h.bind(w);return A.listener=S,w.wrapFn=A,A}function d(O,b,S){var w=O._events;if(void 0===w)return[];var A=w[b];return void 0===A?[]:"function"==typeof A?S?[A.listener||A]:[A]:S?function(L){for(var H=new Array(L.length),D=0;D0&&(L=b[0]),L instanceof Error)throw L;var H=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw H.context=L,H}var D=A[O];if(void 0===D)return!1;if("function"==typeof D)y(D,this,b);else{var q=D.length,k=v(D,q);for(S=0;S=0;L--)if(S[L]===b||S[L].listener===b){H=S[L].listener,A=L;break}if(A<0)return this;0===A?S.shift():function(D,q){for(;q+1=0;w--)this.removeListener(O,b[w]);return this},o.prototype.listeners=function(O){return d(this,O,!0)},o.prototype.rawListeners=function(O){return d(this,O,!1)},o.listenerCount=function(O,b){return"function"==typeof O.listenerCount?O.listenerCount(b):_.call(O,b)},o.prototype.listenerCount=_,o.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]}},function(z,l,c){var s=c(2),m=s.Buffer;function y(o,e){for(var t in o)e[t]=o[t]}function n(o,e,t){return m(o,e,t)}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?z.exports=s:(y(s,l),l.Buffer=n),n.prototype=Object.create(m.prototype),y(m,n),n.from=function(o,e,t){if("number"==typeof o)throw new TypeError("Argument must not be a number");return m(o,e,t)},n.alloc=function(o,e,t){if("number"!=typeof o)throw new TypeError("Argument must be a number");var i=m(o);return void 0!==e?"string"==typeof t?i.fill(e,t):i.fill(e):i.fill(0),i},n.allocUnsafe=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return m(o)},n.allocUnsafeSlow=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return s.SlowBuffer(o)}},function(z,l,c){"use strict";c.d(l,"b",function(){return o}),c.d(l,"a",function(){return t}),c.d(l,"c",function(){return u}),c.d(l,"d",function(){return f}),c.d(l,"e",function(){return _}),c.d(l,"f",function(){return T});var s=c(8),m=c(4);function y(b){return n.apply(this,arguments)}function n(){return(n=ge(function*(b,S=m.a){return s.getSubtleCrypto().importKey("raw",b,S===m.a?{length:m.b,name:m.a}:{hash:{name:m.f},name:m.e},!0,S===m.a?[m.d,m.c]:[m.k,m.l])})).apply(this,arguments)}function o(b,S,w){return e.apply(this,arguments)}function e(){return(e=ge(function*(b,S,w){const A=s.getSubtleCrypto(),L=yield y(S,m.a),H=yield A.encrypt({iv:b,name:m.a},L,w);return new Uint8Array(H)})).apply(this,arguments)}function t(b,S,w){return i.apply(this,arguments)}function i(){return(i=ge(function*(b,S,w){const A=s.getSubtleCrypto(),L=yield y(S,m.a),H=yield A.decrypt({iv:b,name:m.a},L,w);return new Uint8Array(H)})).apply(this,arguments)}function u(b,S){return h.apply(this,arguments)}function h(){return(h=ge(function*(b,S){const w=s.getSubtleCrypto(),A=yield y(b,m.e),L=yield w.sign({length:m.g,name:m.e},A,S);return new Uint8Array(L)})).apply(this,arguments)}function f(b,S){return d.apply(this,arguments)}function d(){return(d=ge(function*(b,S){const w=s.getSubtleCrypto(),A=yield y(b,m.e),L=yield w.sign({length:m.h,name:m.e},A,S);return new Uint8Array(L)})).apply(this,arguments)}function _(b){return v.apply(this,arguments)}function v(){return(v=ge(function*(b){const S=s.getSubtleCrypto(),w=yield S.digest({name:m.i},b);return new Uint8Array(w)})).apply(this,arguments)}function T(b){return O.apply(this,arguments)}function O(){return(O=ge(function*(b){const S=s.getSubtleCrypto(),w=yield S.digest({name:m.j},b);return new Uint8Array(w)})).apply(this,arguments)}},function(z,l,c){"use strict";var s=c(22),m=c(3);function y(t,i){return 55296==(64512&t.charCodeAt(i))&&!(i<0||i+1>=t.length)&&56320==(64512&t.charCodeAt(i+1))}function n(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function o(t){return 1===t.length?"0"+t:t}function e(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}l.inherits=m,l.toArray=function(t,i){if(Array.isArray(t))return t.slice();if(!t)return[];var u=[];if("string"==typeof t)if(i){if("hex"===i)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),f=0;f>6|192,u[h++]=63&d|128):y(t,f)?(d=65536+((1023&d)<<10)+(1023&t.charCodeAt(++f)),u[h++]=d>>18|240,u[h++]=d>>12&63|128,u[h++]=d>>6&63|128,u[h++]=63&d|128):(u[h++]=d>>12|224,u[h++]=d>>6&63|128,u[h++]=63&d|128)}else for(f=0;f>>0;return d},l.split32=function(t,i){for(var u=new Array(4*t.length),h=0,f=0;h>>24,u[f+1]=d>>>16&255,u[f+2]=d>>>8&255,u[f+3]=255&d):(u[f+3]=d>>>24,u[f+2]=d>>>16&255,u[f+1]=d>>>8&255,u[f]=255&d)}return u},l.rotr32=function(t,i){return t>>>i|t<<32-i},l.rotl32=function(t,i){return t<>>32-i},l.sum32=function(t,i){return t+i>>>0},l.sum32_3=function(t,i,u){return t+i+u>>>0},l.sum32_4=function(t,i,u,h){return t+i+u+h>>>0},l.sum32_5=function(t,i,u,h,f){return t+i+u+h+f>>>0},l.sum64=function(t,i,u,h){var d=h+t[i+1]>>>0;t[i]=(d>>0,t[i+1]=d},l.sum64_hi=function(t,i,u,h){return(i+h>>>0>>0},l.sum64_lo=function(t,i,u,h){return i+h>>>0},l.sum64_4_hi=function(t,i,u,h,f,d,_,v){var T=0,O=i;return T+=(O=O+h>>>0)>>0)>>0)>>0},l.sum64_4_lo=function(t,i,u,h,f,d,_,v){return i+h+d+v>>>0},l.sum64_5_hi=function(t,i,u,h,f,d,_,v,T,O){var b=0,S=i;return b+=(S=S+h>>>0)>>0)>>0)>>0)>>0},l.sum64_5_lo=function(t,i,u,h,f,d,_,v,T,O){return i+h+d+v+O>>>0},l.rotr64_hi=function(t,i,u){return(i<<32-u|t>>>u)>>>0},l.rotr64_lo=function(t,i,u){return(t<<32-u|i>>>u)>>>0},l.shr64_hi=function(t,i,u){return t>>>u},l.shr64_lo=function(t,i,u){return(t<<32-u|i>>>u)>>>0}},function(z,l,c){(function(s){!function(m,y){"use strict";function n(p,x){if(!p)throw new Error(x||"Assertion failed")}function o(p,x){p.super_=x;var R=function(){};R.prototype=x.prototype,p.prototype=new R,p.prototype.constructor=p}function e(p,x,R){if(e.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,null!==p&&("le"!==x&&"be"!==x||(R=x,x=10),this._init(p||0,x||10,R||"be"))}var t;"object"==typeof m?m.exports=e:y.BN=e,e.BN=e,e.wordSize=26;try{t=typeof window<"u"&&void 0!==window.Buffer?window.Buffer:c(245).Buffer}catch{}function i(p,x){var R=p.charCodeAt(x);return R>=65&&R<=70?R-55:R>=97&&R<=102?R-87:R-48&15}function u(p,x,R){var r=i(p,R);return R-1>=x&&(r|=i(p,R-1)<<4),r}function h(p,x,R,r){for(var a=0,g=Math.min(p.length,R),M=x;M=49?E-49+10:E>=17?E-17+10:E}return a}e.isBN=function(p){return p instanceof e||null!==p&&"object"==typeof p&&p.constructor.wordSize===e.wordSize&&Array.isArray(p.words)},e.max=function(p,x){return p.cmp(x)>0?p:x},e.min=function(p,x){return p.cmp(x)<0?p:x},e.prototype._init=function(p,x,R){if("number"==typeof p)return this._initNumber(p,x,R);if("object"==typeof p)return this._initArray(p,x,R);"hex"===x&&(x=16),n(x===(0|x)&&x>=2&&x<=36);var r=0;"-"===(p=p.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)this.words[a]|=(g=p[r]|p[r-1]<<8|p[r-2]<<16)<>>26-M&67108863,(M+=24)>=26&&(M-=26,a++);else if("le"===R)for(r=0,a=0;r>>26-M&67108863,(M+=24)>=26&&(M-=26,a++);return this.strip()},e.prototype._parseHex=function(p,x,R){this.length=Math.ceil((p.length-x)/6),this.words=new Array(this.length);for(var r=0;r=x;r-=2)a=u(p,x,r)<=18?(g-=18,this.words[M+=1]|=a>>>26):g+=8;else for(r=(p.length-x)%2==0?x+1:x;r=18?(g-=18,this.words[M+=1]|=a>>>26):g+=8;this.strip()},e.prototype._parseBase=function(p,x,R){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=x)r++;r--,a=a/x|0;for(var g=p.length-R,M=g%r,E=Math.min(g,g-M)+R,C=0,U=R;U1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},e.prototype.inspect=function(){return(this.red?""};var f=["","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"],d=[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],_=[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 v(p,x,R){R.negative=x.negative^p.negative;var r=p.length+x.length|0;R.length=r,r=r-1|0;var a=0|p.words[0],g=0|x.words[0],M=a*g,C=M/67108864|0;R.words[0]=67108863&M;for(var U=1;U>>26,I=67108863&C,W=Math.min(U,x.length-1),F=Math.max(0,U-p.length+1);F<=W;F++)V+=(M=(a=0|p.words[U-F|0])*(g=0|x.words[F])+I)/67108864|0,I=67108863&M;R.words[U]=0|I,C=0|V}return 0!==C?R.words[U]=0|C:R.length--,R.strip()}e.prototype.toString=function(p,x){var R;if(x=0|x||1,16===(p=p||10)||"hex"===p){R="";for(var r=0,a=0,g=0;g>>24-r&16777215)||g!==this.length-1?f[6-E.length]+E+R:E+R,(r+=2)>=26&&(r-=26,g--)}for(0!==a&&(R=a.toString(16)+R);R.length%x!=0;)R="0"+R;return 0!==this.negative&&(R="-"+R),R}if(p===(0|p)&&p>=2&&p<=36){var C=d[p],U=_[p];R="";var V=this.clone();for(V.negative=0;!V.isZero();){var I=V.modn(U).toString(p);R=(V=V.idivn(U)).isZero()?I+R:f[C-I.length]+I+R}for(this.isZero()&&(R="0"+R);R.length%x!=0;)R="0"+R;return 0!==this.negative&&(R="-"+R),R}n(!1,"Base should be between 2 and 36")},e.prototype.toNumber=function(){var p=this.words[0];return 2===this.length?p+=67108864*this.words[1]:3===this.length&&1===this.words[2]?p+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-p:p},e.prototype.toJSON=function(){return this.toString(16)},e.prototype.toBuffer=function(p,x){return n(void 0!==t),this.toArrayLike(t,p,x)},e.prototype.toArray=function(p,x){return this.toArrayLike(Array,p,x)},e.prototype.toArrayLike=function(p,x,R){var r=this.byteLength(),a=R||Math.max(1,r);n(r<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var g,M,E="le"===x,C=new p(a),U=this.clone();if(E){for(M=0;!U.isZero();M++)g=U.andln(255),U.iushrn(8),C[M]=g;for(;M=4096&&(R+=13,x>>>=13),x>=64&&(R+=7,x>>>=7),x>=8&&(R+=4,x>>>=4),x>=2&&(R+=2,x>>>=2),R+x},e.prototype._zeroBits=function(p){if(0===p)return 26;var x=p,R=0;return 0==(8191&x)&&(R+=13,x>>>=13),0==(127&x)&&(R+=7,x>>>=7),0==(15&x)&&(R+=4,x>>>=4),0==(3&x)&&(R+=2,x>>>=2),0==(1&x)&&R++,R},e.prototype.bitLength=function(){var x=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+x},e.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,x=0;xp.length?this.clone().ior(p):p.clone().ior(this)},e.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},e.prototype.iuand=function(p){var x;x=this.length>p.length?p:this;for(var R=0;Rp.length?this.clone().iand(p):p.clone().iand(this)},e.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},e.prototype.iuxor=function(p){var x,R;this.length>p.length?(x=this,R=p):(x=p,R=this);for(var r=0;rp.length?this.clone().ixor(p):p.clone().ixor(this)},e.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},e.prototype.inotn=function(p){n("number"==typeof p&&p>=0);var x=0|Math.ceil(p/26),R=p%26;this._expand(x),R>0&&x--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-R),this.strip()},e.prototype.notn=function(p){return this.clone().inotn(p)},e.prototype.setn=function(p,x){n("number"==typeof p&&p>=0);var R=p/26|0,r=p%26;return this._expand(R+1),this.words[R]=x?this.words[R]|1<p.length?(R=this,r=p):(R=p,r=this);for(var a=0,g=0;g>>26;for(;0!==a&&g>>26;if(this.length=R.length,0!==a)this.words[this.length]=a,this.length++;else if(R!==this)for(;gp.length?this.clone().iadd(p):p.clone().iadd(this)},e.prototype.isub=function(p){if(0!==p.negative){p.negative=0;var x=this.iadd(p);return p.negative=1,x._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var R,r,a=this.cmp(p);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(R=this,r=p):(R=p,r=this);for(var g=0,M=0;M>26,this.words[M]=67108863&x;for(;0!==g&&M>26,this.words[M]=67108863&x;if(0===g&&M>>13,F=0|M[1],B=8191&F,N=F>>>13,P=0|M[2],j=8191&P,K=P>>>13,Z=0|M[3],J=8191&Z,X=Z>>>13,ee=0|M[4],te=8191&ee,oe=ee>>>13,ve=0|M[5],ie=8191&ve,de=ve>>>13,fe=0|M[6],re=8191&fe,_e=fe>>>13,Ke=0|M[7],pe=8191&Ke,Te=Ke>>>13,Ve=0|M[8],be=8191&Ve,Pe=Ve>>>13,Ye=0|M[9],we=8191&Ye,Be=Ye>>>13,$e=0|E[0],Me=8191&$e,je=$e>>>13,Q=0|E[1],se=8191&Q,le=Q>>>13,Le=0|E[2],he=8191&Le,Oe=Le>>>13,Ge=0|E[3],me=8191&Ge,ze=Ge>>>13,rt=0|E[4],Re=8191&rt,He=rt>>>13,Qe=0|E[5],Ee=8191&Qe,Ne=Qe>>>13,it=0|E[6],xe=8191&it,qe=it>>>13,et=0|E[7],ke=8191&et,We=et>>>13,tt=0|E[8],Se=8191&tt,Fe=tt>>>13,nt=0|E[9],Ae=8191&nt,Ue=nt>>>13;R.negative=p.negative^x.negative,R.length=19;var Y=(U+(r=Math.imul(I,Me))|0)+((8191&(a=(a=Math.imul(I,je))+Math.imul(W,Me)|0))<<13)|0;U=((g=Math.imul(W,je))+(a>>>13)|0)+(Y>>>26)|0,Y&=67108863,r=Math.imul(B,Me),a=(a=Math.imul(B,je))+Math.imul(N,Me)|0,g=Math.imul(N,je);var G=(U+(r=r+Math.imul(I,se)|0)|0)+((8191&(a=(a=a+Math.imul(I,le)|0)+Math.imul(W,se)|0))<<13)|0;U=((g=g+Math.imul(W,le)|0)+(a>>>13)|0)+(G>>>26)|0,G&=67108863,r=Math.imul(j,Me),a=(a=Math.imul(j,je))+Math.imul(K,Me)|0,g=Math.imul(K,je),r=r+Math.imul(B,se)|0,a=(a=a+Math.imul(B,le)|0)+Math.imul(N,se)|0,g=g+Math.imul(N,le)|0;var $=(U+(r=r+Math.imul(I,he)|0)|0)+((8191&(a=(a=a+Math.imul(I,Oe)|0)+Math.imul(W,he)|0))<<13)|0;U=((g=g+Math.imul(W,Oe)|0)+(a>>>13)|0)+($>>>26)|0,$&=67108863,r=Math.imul(J,Me),a=(a=Math.imul(J,je))+Math.imul(X,Me)|0,g=Math.imul(X,je),r=r+Math.imul(j,se)|0,a=(a=a+Math.imul(j,le)|0)+Math.imul(K,se)|0,g=g+Math.imul(K,le)|0,r=r+Math.imul(B,he)|0,a=(a=a+Math.imul(B,Oe)|0)+Math.imul(N,he)|0,g=g+Math.imul(N,Oe)|0;var ne=(U+(r=r+Math.imul(I,me)|0)|0)+((8191&(a=(a=a+Math.imul(I,ze)|0)+Math.imul(W,me)|0))<<13)|0;U=((g=g+Math.imul(W,ze)|0)+(a>>>13)|0)+(ne>>>26)|0,ne&=67108863,r=Math.imul(te,Me),a=(a=Math.imul(te,je))+Math.imul(oe,Me)|0,g=Math.imul(oe,je),r=r+Math.imul(J,se)|0,a=(a=a+Math.imul(J,le)|0)+Math.imul(X,se)|0,g=g+Math.imul(X,le)|0,r=r+Math.imul(j,he)|0,a=(a=a+Math.imul(j,Oe)|0)+Math.imul(K,he)|0,g=g+Math.imul(K,Oe)|0,r=r+Math.imul(B,me)|0,a=(a=a+Math.imul(B,ze)|0)+Math.imul(N,me)|0,g=g+Math.imul(N,ze)|0;var ce=(U+(r=r+Math.imul(I,Re)|0)|0)+((8191&(a=(a=a+Math.imul(I,He)|0)+Math.imul(W,Re)|0))<<13)|0;U=((g=g+Math.imul(W,He)|0)+(a>>>13)|0)+(ce>>>26)|0,ce&=67108863,r=Math.imul(ie,Me),a=(a=Math.imul(ie,je))+Math.imul(de,Me)|0,g=Math.imul(de,je),r=r+Math.imul(te,se)|0,a=(a=a+Math.imul(te,le)|0)+Math.imul(oe,se)|0,g=g+Math.imul(oe,le)|0,r=r+Math.imul(J,he)|0,a=(a=a+Math.imul(J,Oe)|0)+Math.imul(X,he)|0,g=g+Math.imul(X,Oe)|0,r=r+Math.imul(j,me)|0,a=(a=a+Math.imul(j,ze)|0)+Math.imul(K,me)|0,g=g+Math.imul(K,ze)|0,r=r+Math.imul(B,Re)|0,a=(a=a+Math.imul(B,He)|0)+Math.imul(N,Re)|0,g=g+Math.imul(N,He)|0;var ue=(U+(r=r+Math.imul(I,Ee)|0)|0)+((8191&(a=(a=a+Math.imul(I,Ne)|0)+Math.imul(W,Ee)|0))<<13)|0;U=((g=g+Math.imul(W,Ne)|0)+(a>>>13)|0)+(ue>>>26)|0,ue&=67108863,r=Math.imul(re,Me),a=(a=Math.imul(re,je))+Math.imul(_e,Me)|0,g=Math.imul(_e,je),r=r+Math.imul(ie,se)|0,a=(a=a+Math.imul(ie,le)|0)+Math.imul(de,se)|0,g=g+Math.imul(de,le)|0,r=r+Math.imul(te,he)|0,a=(a=a+Math.imul(te,Oe)|0)+Math.imul(oe,he)|0,g=g+Math.imul(oe,Oe)|0,r=r+Math.imul(J,me)|0,a=(a=a+Math.imul(J,ze)|0)+Math.imul(X,me)|0,g=g+Math.imul(X,ze)|0,r=r+Math.imul(j,Re)|0,a=(a=a+Math.imul(j,He)|0)+Math.imul(K,Re)|0,g=g+Math.imul(K,He)|0,r=r+Math.imul(B,Ee)|0,a=(a=a+Math.imul(B,Ne)|0)+Math.imul(N,Ee)|0,g=g+Math.imul(N,Ne)|0;var Ce=(U+(r=r+Math.imul(I,xe)|0)|0)+((8191&(a=(a=a+Math.imul(I,qe)|0)+Math.imul(W,xe)|0))<<13)|0;U=((g=g+Math.imul(W,qe)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(pe,Me),a=(a=Math.imul(pe,je))+Math.imul(Te,Me)|0,g=Math.imul(Te,je),r=r+Math.imul(re,se)|0,a=(a=a+Math.imul(re,le)|0)+Math.imul(_e,se)|0,g=g+Math.imul(_e,le)|0,r=r+Math.imul(ie,he)|0,a=(a=a+Math.imul(ie,Oe)|0)+Math.imul(de,he)|0,g=g+Math.imul(de,Oe)|0,r=r+Math.imul(te,me)|0,a=(a=a+Math.imul(te,ze)|0)+Math.imul(oe,me)|0,g=g+Math.imul(oe,ze)|0,r=r+Math.imul(J,Re)|0,a=(a=a+Math.imul(J,He)|0)+Math.imul(X,Re)|0,g=g+Math.imul(X,He)|0,r=r+Math.imul(j,Ee)|0,a=(a=a+Math.imul(j,Ne)|0)+Math.imul(K,Ee)|0,g=g+Math.imul(K,Ne)|0,r=r+Math.imul(B,xe)|0,a=(a=a+Math.imul(B,qe)|0)+Math.imul(N,xe)|0,g=g+Math.imul(N,qe)|0;var Ie=(U+(r=r+Math.imul(I,ke)|0)|0)+((8191&(a=(a=a+Math.imul(I,We)|0)+Math.imul(W,ke)|0))<<13)|0;U=((g=g+Math.imul(W,We)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(be,Me),a=(a=Math.imul(be,je))+Math.imul(Pe,Me)|0,g=Math.imul(Pe,je),r=r+Math.imul(pe,se)|0,a=(a=a+Math.imul(pe,le)|0)+Math.imul(Te,se)|0,g=g+Math.imul(Te,le)|0,r=r+Math.imul(re,he)|0,a=(a=a+Math.imul(re,Oe)|0)+Math.imul(_e,he)|0,g=g+Math.imul(_e,Oe)|0,r=r+Math.imul(ie,me)|0,a=(a=a+Math.imul(ie,ze)|0)+Math.imul(de,me)|0,g=g+Math.imul(de,ze)|0,r=r+Math.imul(te,Re)|0,a=(a=a+Math.imul(te,He)|0)+Math.imul(oe,Re)|0,g=g+Math.imul(oe,He)|0,r=r+Math.imul(J,Ee)|0,a=(a=a+Math.imul(J,Ne)|0)+Math.imul(X,Ee)|0,g=g+Math.imul(X,Ne)|0,r=r+Math.imul(j,xe)|0,a=(a=a+Math.imul(j,qe)|0)+Math.imul(K,xe)|0,g=g+Math.imul(K,qe)|0,r=r+Math.imul(B,ke)|0,a=(a=a+Math.imul(B,We)|0)+Math.imul(N,ke)|0,g=g+Math.imul(N,We)|0;var De=(U+(r=r+Math.imul(I,Se)|0)|0)+((8191&(a=(a=a+Math.imul(I,Fe)|0)+Math.imul(W,Se)|0))<<13)|0;U=((g=g+Math.imul(W,Fe)|0)+(a>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(we,Me),a=(a=Math.imul(we,je))+Math.imul(Be,Me)|0,g=Math.imul(Be,je),r=r+Math.imul(be,se)|0,a=(a=a+Math.imul(be,le)|0)+Math.imul(Pe,se)|0,g=g+Math.imul(Pe,le)|0,r=r+Math.imul(pe,he)|0,a=(a=a+Math.imul(pe,Oe)|0)+Math.imul(Te,he)|0,g=g+Math.imul(Te,Oe)|0,r=r+Math.imul(re,me)|0,a=(a=a+Math.imul(re,ze)|0)+Math.imul(_e,me)|0,g=g+Math.imul(_e,ze)|0,r=r+Math.imul(ie,Re)|0,a=(a=a+Math.imul(ie,He)|0)+Math.imul(de,Re)|0,g=g+Math.imul(de,He)|0,r=r+Math.imul(te,Ee)|0,a=(a=a+Math.imul(te,Ne)|0)+Math.imul(oe,Ee)|0,g=g+Math.imul(oe,Ne)|0,r=r+Math.imul(J,xe)|0,a=(a=a+Math.imul(J,qe)|0)+Math.imul(X,xe)|0,g=g+Math.imul(X,qe)|0,r=r+Math.imul(j,ke)|0,a=(a=a+Math.imul(j,We)|0)+Math.imul(K,ke)|0,g=g+Math.imul(K,We)|0,r=r+Math.imul(B,Se)|0,a=(a=a+Math.imul(B,Fe)|0)+Math.imul(N,Se)|0,g=g+Math.imul(N,Fe)|0;var ye=(U+(r=r+Math.imul(I,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(I,Ue)|0)+Math.imul(W,Ae)|0))<<13)|0;U=((g=g+Math.imul(W,Ue)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(we,se),a=(a=Math.imul(we,le))+Math.imul(Be,se)|0,g=Math.imul(Be,le),r=r+Math.imul(be,he)|0,a=(a=a+Math.imul(be,Oe)|0)+Math.imul(Pe,he)|0,g=g+Math.imul(Pe,Oe)|0,r=r+Math.imul(pe,me)|0,a=(a=a+Math.imul(pe,ze)|0)+Math.imul(Te,me)|0,g=g+Math.imul(Te,ze)|0,r=r+Math.imul(re,Re)|0,a=(a=a+Math.imul(re,He)|0)+Math.imul(_e,Re)|0,g=g+Math.imul(_e,He)|0,r=r+Math.imul(ie,Ee)|0,a=(a=a+Math.imul(ie,Ne)|0)+Math.imul(de,Ee)|0,g=g+Math.imul(de,Ne)|0,r=r+Math.imul(te,xe)|0,a=(a=a+Math.imul(te,qe)|0)+Math.imul(oe,xe)|0,g=g+Math.imul(oe,qe)|0,r=r+Math.imul(J,ke)|0,a=(a=a+Math.imul(J,We)|0)+Math.imul(X,ke)|0,g=g+Math.imul(X,We)|0,r=r+Math.imul(j,Se)|0,a=(a=a+Math.imul(j,Fe)|0)+Math.imul(K,Se)|0,g=g+Math.imul(K,Fe)|0;var ae=(U+(r=r+Math.imul(B,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(B,Ue)|0)+Math.imul(N,Ae)|0))<<13)|0;U=((g=g+Math.imul(N,Ue)|0)+(a>>>13)|0)+(ae>>>26)|0,ae&=67108863,r=Math.imul(we,he),a=(a=Math.imul(we,Oe))+Math.imul(Be,he)|0,g=Math.imul(Be,Oe),r=r+Math.imul(be,me)|0,a=(a=a+Math.imul(be,ze)|0)+Math.imul(Pe,me)|0,g=g+Math.imul(Pe,ze)|0,r=r+Math.imul(pe,Re)|0,a=(a=a+Math.imul(pe,He)|0)+Math.imul(Te,Re)|0,g=g+Math.imul(Te,He)|0,r=r+Math.imul(re,Ee)|0,a=(a=a+Math.imul(re,Ne)|0)+Math.imul(_e,Ee)|0,g=g+Math.imul(_e,Ne)|0,r=r+Math.imul(ie,xe)|0,a=(a=a+Math.imul(ie,qe)|0)+Math.imul(de,xe)|0,g=g+Math.imul(de,qe)|0,r=r+Math.imul(te,ke)|0,a=(a=a+Math.imul(te,We)|0)+Math.imul(oe,ke)|0,g=g+Math.imul(oe,We)|0,r=r+Math.imul(J,Se)|0,a=(a=a+Math.imul(J,Fe)|0)+Math.imul(X,Se)|0,g=g+Math.imul(X,Fe)|0;var Je=(U+(r=r+Math.imul(j,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(j,Ue)|0)+Math.imul(K,Ae)|0))<<13)|0;U=((g=g+Math.imul(K,Ue)|0)+(a>>>13)|0)+(Je>>>26)|0,Je&=67108863,r=Math.imul(we,me),a=(a=Math.imul(we,ze))+Math.imul(Be,me)|0,g=Math.imul(Be,ze),r=r+Math.imul(be,Re)|0,a=(a=a+Math.imul(be,He)|0)+Math.imul(Pe,Re)|0,g=g+Math.imul(Pe,He)|0,r=r+Math.imul(pe,Ee)|0,a=(a=a+Math.imul(pe,Ne)|0)+Math.imul(Te,Ee)|0,g=g+Math.imul(Te,Ne)|0,r=r+Math.imul(re,xe)|0,a=(a=a+Math.imul(re,qe)|0)+Math.imul(_e,xe)|0,g=g+Math.imul(_e,qe)|0,r=r+Math.imul(ie,ke)|0,a=(a=a+Math.imul(ie,We)|0)+Math.imul(de,ke)|0,g=g+Math.imul(de,We)|0,r=r+Math.imul(te,Se)|0,a=(a=a+Math.imul(te,Fe)|0)+Math.imul(oe,Se)|0,g=g+Math.imul(oe,Fe)|0;var ot=(U+(r=r+Math.imul(J,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(J,Ue)|0)+Math.imul(X,Ae)|0))<<13)|0;U=((g=g+Math.imul(X,Ue)|0)+(a>>>13)|0)+(ot>>>26)|0,ot&=67108863,r=Math.imul(we,Re),a=(a=Math.imul(we,He))+Math.imul(Be,Re)|0,g=Math.imul(Be,He),r=r+Math.imul(be,Ee)|0,a=(a=a+Math.imul(be,Ne)|0)+Math.imul(Pe,Ee)|0,g=g+Math.imul(Pe,Ne)|0,r=r+Math.imul(pe,xe)|0,a=(a=a+Math.imul(pe,qe)|0)+Math.imul(Te,xe)|0,g=g+Math.imul(Te,qe)|0,r=r+Math.imul(re,ke)|0,a=(a=a+Math.imul(re,We)|0)+Math.imul(_e,ke)|0,g=g+Math.imul(_e,We)|0,r=r+Math.imul(ie,Se)|0,a=(a=a+Math.imul(ie,Fe)|0)+Math.imul(de,Se)|0,g=g+Math.imul(de,Fe)|0;var at=(U+(r=r+Math.imul(te,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(te,Ue)|0)+Math.imul(oe,Ae)|0))<<13)|0;U=((g=g+Math.imul(oe,Ue)|0)+(a>>>13)|0)+(at>>>26)|0,at&=67108863,r=Math.imul(we,Ee),a=(a=Math.imul(we,Ne))+Math.imul(Be,Ee)|0,g=Math.imul(Be,Ne),r=r+Math.imul(be,xe)|0,a=(a=a+Math.imul(be,qe)|0)+Math.imul(Pe,xe)|0,g=g+Math.imul(Pe,qe)|0,r=r+Math.imul(pe,ke)|0,a=(a=a+Math.imul(pe,We)|0)+Math.imul(Te,ke)|0,g=g+Math.imul(Te,We)|0,r=r+Math.imul(re,Se)|0,a=(a=a+Math.imul(re,Fe)|0)+Math.imul(_e,Se)|0,g=g+Math.imul(_e,Fe)|0;var st=(U+(r=r+Math.imul(ie,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(ie,Ue)|0)+Math.imul(de,Ae)|0))<<13)|0;U=((g=g+Math.imul(de,Ue)|0)+(a>>>13)|0)+(st>>>26)|0,st&=67108863,r=Math.imul(we,xe),a=(a=Math.imul(we,qe))+Math.imul(Be,xe)|0,g=Math.imul(Be,qe),r=r+Math.imul(be,ke)|0,a=(a=a+Math.imul(be,We)|0)+Math.imul(Pe,ke)|0,g=g+Math.imul(Pe,We)|0,r=r+Math.imul(pe,Se)|0,a=(a=a+Math.imul(pe,Fe)|0)+Math.imul(Te,Se)|0,g=g+Math.imul(Te,Fe)|0;var ut=(U+(r=r+Math.imul(re,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(re,Ue)|0)+Math.imul(_e,Ae)|0))<<13)|0;U=((g=g+Math.imul(_e,Ue)|0)+(a>>>13)|0)+(ut>>>26)|0,ut&=67108863,r=Math.imul(we,ke),a=(a=Math.imul(we,We))+Math.imul(Be,ke)|0,g=Math.imul(Be,We),r=r+Math.imul(be,Se)|0,a=(a=a+Math.imul(be,Fe)|0)+Math.imul(Pe,Se)|0,g=g+Math.imul(Pe,Fe)|0;var Ze=(U+(r=r+Math.imul(pe,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(pe,Ue)|0)+Math.imul(Te,Ae)|0))<<13)|0;U=((g=g+Math.imul(Te,Ue)|0)+(a>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,r=Math.imul(we,Se),a=(a=Math.imul(we,Fe))+Math.imul(Be,Se)|0,g=Math.imul(Be,Fe);var ct=(U+(r=r+Math.imul(be,Ae)|0)|0)+((8191&(a=(a=a+Math.imul(be,Ue)|0)+Math.imul(Pe,Ae)|0))<<13)|0;U=((g=g+Math.imul(Pe,Ue)|0)+(a>>>13)|0)+(ct>>>26)|0,ct&=67108863;var Xe=(U+(r=Math.imul(we,Ae))|0)+((8191&(a=(a=Math.imul(we,Ue))+Math.imul(Be,Ae)|0))<<13)|0;return U=((g=Math.imul(Be,Ue))+(a>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,C[0]=Y,C[1]=G,C[2]=$,C[3]=ne,C[4]=ce,C[5]=ue,C[6]=Ce,C[7]=Ie,C[8]=De,C[9]=ye,C[10]=ae,C[11]=Je,C[12]=ot,C[13]=at,C[14]=st,C[15]=ut,C[16]=Ze,C[17]=ct,C[18]=Xe,0!==U&&(C[19]=U,R.length++),R};function O(p,x,R){return(new b).mulp(p,x,R)}function b(p,x){this.x=p,this.y=x}Math.imul||(T=v),e.prototype.mulTo=function(p,x){var R=this.length+p.length;return 10===this.length&&10===p.length?T(this,p,x):R<63?v(this,p,x):R<1024?function(r,a,g){g.negative=a.negative^r.negative,g.length=r.length+a.length;for(var M=0,E=0,C=0;C>>26)|0)>>>26,U&=67108863}g.words[C]=V,M=U,U=E}return 0!==M?g.words[C]=M:g.length--,g.strip()}(this,p,x):O(this,p,x)},b.prototype.makeRBT=function(p){for(var x=new Array(p),R=e.prototype._countBits(p)-1,r=0;r>=1;return r},b.prototype.permute=function(p,x,R,r,a,g){for(var M=0;M>>=1)a++;return 1<>>=13),a>>>=13;for(g=2*x;g>=26,x+=r/67108864|0,x+=a>>>26,this.words[R]=67108863&a}return 0!==x&&(this.words[R]=x,this.length++),this},e.prototype.muln=function(p){return this.clone().imuln(p)},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.imul(this.clone())},e.prototype.pow=function(p){var x=function(g){for(var M=new Array(g.bitLength()),E=0;E>>U}return M}(p);if(0===x.length)return new e(1);for(var R=this,r=0;r=0);var x,R=p%26,r=(p-R)/26,a=67108863>>>26-R<<26-R;if(0!==R){var g=0;for(x=0;x>>26-R}g&&(this.words[x]=g,this.length++)}if(0!==r){for(x=this.length-1;x>=0;x--)this.words[x+r]=this.words[x];for(x=0;x=0),r=x?(x-x%26)/26:0;var a=p%26,g=Math.min((p-a)/26,this.length),M=67108863^67108863>>>a<g)for(this.length-=g,C=0;C=0&&(0!==U||C>=r);C--){var V=0|this.words[C];this.words[C]=U<<26-a|V>>>a,U=V&M}return E&&0!==U&&(E.words[E.length++]=U),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},e.prototype.ishrn=function(p,x,R){return n(0===this.negative),this.iushrn(p,x,R)},e.prototype.shln=function(p){return this.clone().ishln(p)},e.prototype.ushln=function(p){return this.clone().iushln(p)},e.prototype.shrn=function(p){return this.clone().ishrn(p)},e.prototype.ushrn=function(p){return this.clone().iushrn(p)},e.prototype.testn=function(p){n("number"==typeof p&&p>=0);var x=p%26,R=(p-x)/26;return!(this.length<=R||!(this.words[R]&1<=0);var x=p%26,R=(p-x)/26;return n(0===this.negative,"imaskn works only with positive numbers"),this.length<=R?this:(0!==x&&R++,this.length=Math.min(R,this.length),0!==x&&(this.words[this.length-1]&=67108863^67108863>>>x<=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},e.prototype.isubn=function(p){if(n("number"==typeof p),n(p<67108864),p<0)return this.iaddn(-p);if(0!==this.negative)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x>26)-(E/67108864|0),this.words[r+R]=67108863&a}for(;r>26,this.words[r+R]=67108863&a;if(0===M)return this.strip();for(n(-1===M),M=0,r=0;r>26,this.words[r]=67108863&a;return this.negative=1,this.strip()},e.prototype._wordDiv=function(p,x){var R,r=this.clone(),a=p,g=0|a.words[a.length-1];0!=(R=26-this._countBits(g))&&(a=a.ushln(R),r.iushln(R),g=0|a.words[a.length-1]);var M,E=r.length-a.length;if("mod"!==x){(M=new e(null)).length=E+1,M.words=new Array(M.length);for(var C=0;C=0;V--){var I=67108864*(0|r.words[a.length+V])+(0|r.words[a.length+V-1]);for(I=Math.min(I/g|0,67108863),r._ishlnsubmul(a,I,V);0!==r.negative;)I--,r.negative=0,r._ishlnsubmul(a,1,V),r.isZero()||(r.negative^=1);M&&(M.words[V]=I)}return M&&M.strip(),r.strip(),"div"!==x&&0!==R&&r.iushrn(R),{div:M||null,mod:r}},e.prototype.divmod=function(p,x,R){return n(!p.isZero()),this.isZero()?{div:new e(0),mod:new e(0)}:0!==this.negative&&0===p.negative?(g=this.neg().divmod(p,x),"mod"!==x&&(r=g.div.neg()),"div"!==x&&(a=g.mod.neg(),R&&0!==a.negative&&a.iadd(p)),{div:r,mod:a}):0===this.negative&&0!==p.negative?(g=this.divmod(p.neg(),x),"mod"!==x&&(r=g.div.neg()),{div:r,mod:g.mod}):0!=(this.negative&p.negative)?(g=this.neg().divmod(p.neg(),x),"div"!==x&&(a=g.mod.neg(),R&&0!==a.negative&&a.isub(p)),{div:g.div,mod:a}):p.length>this.length||this.cmp(p)<0?{div:new e(0),mod:this}:1===p.length?"div"===x?{div:this.divn(p.words[0]),mod:null}:"mod"===x?{div:null,mod:new e(this.modn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new e(this.modn(p.words[0]))}:this._wordDiv(p,x);var r,a,g},e.prototype.div=function(p){return this.divmod(p,"div",!1).div},e.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},e.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},e.prototype.divRound=function(p){var x=this.divmod(p);if(x.mod.isZero())return x.div;var R=0!==x.div.negative?x.mod.isub(p):x.mod,r=p.ushrn(1),a=p.andln(1),g=R.cmp(r);return g<0||1===a&&0===g?x.div:0!==x.div.negative?x.div.isubn(1):x.div.iaddn(1)},e.prototype.modn=function(p){n(p<=67108863);for(var x=(1<<26)%p,R=0,r=this.length-1;r>=0;r--)R=(x*R+(0|this.words[r]))%p;return R},e.prototype.idivn=function(p){n(p<=67108863);for(var x=0,R=this.length-1;R>=0;R--){var r=(0|this.words[R])+67108864*x;this.words[R]=r/p|0,x=r%p}return this.strip()},e.prototype.divn=function(p){return this.clone().idivn(p)},e.prototype.egcd=function(p){n(0===p.negative),n(!p.isZero());var x=this,R=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var r=new e(1),a=new e(0),g=new e(0),M=new e(1),E=0;x.isEven()&&R.isEven();)x.iushrn(1),R.iushrn(1),++E;for(var C=R.clone(),U=x.clone();!x.isZero();){for(var V=0,I=1;0==(x.words[0]&I)&&V<26;++V,I<<=1);if(V>0)for(x.iushrn(V);V-- >0;)(r.isOdd()||a.isOdd())&&(r.iadd(C),a.isub(U)),r.iushrn(1),a.iushrn(1);for(var W=0,F=1;0==(R.words[0]&F)&&W<26;++W,F<<=1);if(W>0)for(R.iushrn(W);W-- >0;)(g.isOdd()||M.isOdd())&&(g.iadd(C),M.isub(U)),g.iushrn(1),M.iushrn(1);x.cmp(R)>=0?(x.isub(R),r.isub(g),a.isub(M)):(R.isub(x),g.isub(r),M.isub(a))}return{a:g,b:M,gcd:R.iushln(E)}},e.prototype._invmp=function(p){n(0===p.negative),n(!p.isZero());var x=this,R=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var r,a=new e(1),g=new e(0),M=R.clone();x.cmpn(1)>0&&R.cmpn(1)>0;){for(var E=0,C=1;0==(x.words[0]&C)&&E<26;++E,C<<=1);if(E>0)for(x.iushrn(E);E-- >0;)a.isOdd()&&a.iadd(M),a.iushrn(1);for(var U=0,V=1;0==(R.words[0]&V)&&U<26;++U,V<<=1);if(U>0)for(R.iushrn(U);U-- >0;)g.isOdd()&&g.iadd(M),g.iushrn(1);x.cmp(R)>=0?(x.isub(R),a.isub(g)):(R.isub(x),g.isub(a))}return(r=0===x.cmpn(1)?a:g).cmpn(0)<0&&r.iadd(p),r},e.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var x=this.clone(),R=p.clone();x.negative=0,R.negative=0;for(var r=0;x.isEven()&&R.isEven();r++)x.iushrn(1),R.iushrn(1);for(;;){for(;x.isEven();)x.iushrn(1);for(;R.isEven();)R.iushrn(1);var a=x.cmp(R);if(a<0){var g=x;x=R,R=g}else if(0===a||0===R.cmpn(1))break;x.isub(R)}return R.iushln(r)},e.prototype.invm=function(p){return this.egcd(p).a.umod(p)},e.prototype.isEven=function(){return 0==(1&this.words[0])},e.prototype.isOdd=function(){return 1==(1&this.words[0])},e.prototype.andln=function(p){return this.words[0]&p},e.prototype.bincn=function(p){n("number"==typeof p);var x=p%26,R=(p-x)/26,r=1<>>26,this.words[g]=M&=67108863}return 0!==a&&(this.words[g]=a,this.length++),this},e.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},e.prototype.cmpn=function(p){var x,R=p<0;if(0!==this.negative&&!R)return-1;if(0===this.negative&&R)return 1;if(this.strip(),this.length>1)x=1;else{R&&(p=-p),n(p<=67108863,"Number is too big");var r=0|this.words[0];x=r===p?0:rp.length)return 1;if(this.length=0;R--){var r=0|this.words[R],a=0|p.words[R];if(r!==a){ra&&(x=1);break}}return x},e.prototype.gtn=function(p){return 1===this.cmpn(p)},e.prototype.gt=function(p){return 1===this.cmp(p)},e.prototype.gten=function(p){return this.cmpn(p)>=0},e.prototype.gte=function(p){return this.cmp(p)>=0},e.prototype.ltn=function(p){return-1===this.cmpn(p)},e.prototype.lt=function(p){return-1===this.cmp(p)},e.prototype.lten=function(p){return this.cmpn(p)<=0},e.prototype.lte=function(p){return this.cmp(p)<=0},e.prototype.eqn=function(p){return 0===this.cmpn(p)},e.prototype.eq=function(p){return 0===this.cmp(p)},e.red=function(p){return new q(p)},e.prototype.toRed=function(p){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),p.convertTo(this)._forceRed(p)},e.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(p){return this.red=p,this},e.prototype.forceRed=function(p){return n(!this.red,"Already a number in reduction context"),this._forceRed(p)},e.prototype.redAdd=function(p){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},e.prototype.redIAdd=function(p){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},e.prototype.redSub=function(p){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},e.prototype.redISub=function(p){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},e.prototype.redShl=function(p){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},e.prototype.redMul=function(p){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},e.prototype.redIMul=function(p){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},e.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(p){return n(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var S={k256:null,p224:null,p192:null,p25519:null};function w(p,x){this.name=p,this.p=new e(x,16),this.n=this.p.bitLength(),this.k=new e(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function L(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function H(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function D(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function q(p){if("string"==typeof p){var x=e._prime(p);this.m=x.p,this.prime=x}else n(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}function k(p){q.call(this,p),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new e(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)}w.prototype._tmp=function(){var p=new e(null);return p.words=new Array(Math.ceil(this.n/13)),p},w.prototype.ireduce=function(p){var x,R=p;do{this.split(R,this.tmp),x=(R=(R=this.imulK(R)).iadd(this.tmp)).bitLength()}while(x>this.n);var r=x0?R.isub(this.p):void 0!==R.strip?R.strip():R._strip(),R},w.prototype.split=function(p,x){p.iushrn(this.n,0,x)},w.prototype.imulK=function(p){return p.imul(this.k)},o(A,w),A.prototype.split=function(p,x){for(var R=Math.min(p.length,9),r=0;r>>22,a=g}p.words[r-10]=a>>>=22,p.length-=0===a&&p.length>10?10:9},A.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var x=0,R=0;R>>=26,p.words[R]=a,x=r}return 0!==x&&(p.words[p.length++]=x),p},e._prime=function(p){if(S[p])return S[p];var x;if("k256"===p)x=new A;else if("p224"===p)x=new L;else if("p192"===p)x=new H;else{if("p25519"!==p)throw new Error("Unknown prime "+p);x=new D}return S[p]=x,x},q.prototype._verify1=function(p){n(0===p.negative,"red works only with positives"),n(p.red,"red works only with red numbers")},q.prototype._verify2=function(p,x){n(0==(p.negative|x.negative),"red works only with positives"),n(p.red&&p.red===x.red,"red works only with red numbers")},q.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):p.umod(this.m)._forceRed(this)},q.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},q.prototype.add=function(p,x){this._verify2(p,x);var R=p.add(x);return R.cmp(this.m)>=0&&R.isub(this.m),R._forceRed(this)},q.prototype.iadd=function(p,x){this._verify2(p,x);var R=p.iadd(x);return R.cmp(this.m)>=0&&R.isub(this.m),R},q.prototype.sub=function(p,x){this._verify2(p,x);var R=p.sub(x);return R.cmpn(0)<0&&R.iadd(this.m),R._forceRed(this)},q.prototype.isub=function(p,x){this._verify2(p,x);var R=p.isub(x);return R.cmpn(0)<0&&R.iadd(this.m),R},q.prototype.shl=function(p,x){return this._verify1(p),this.imod(p.ushln(x))},q.prototype.imul=function(p,x){return this._verify2(p,x),this.imod(p.imul(x))},q.prototype.mul=function(p,x){return this._verify2(p,x),this.imod(p.mul(x))},q.prototype.isqr=function(p){return this.imul(p,p.clone())},q.prototype.sqr=function(p){return this.mul(p,p)},q.prototype.sqrt=function(p){if(p.isZero())return p.clone();var x=this.m.andln(3);if(n(x%2==1),3===x){var R=this.m.add(new e(1)).iushrn(2);return this.pow(p,R)}for(var r=this.m.subn(1),a=0;!r.isZero()&&0===r.andln(1);)a++,r.iushrn(1);n(!r.isZero());var g=new e(1).toRed(this),M=g.redNeg(),E=this.m.subn(1).iushrn(1),C=this.m.bitLength();for(C=new e(2*C*C).toRed(this);0!==this.pow(C,E).cmp(M);)C.redIAdd(M);for(var U=this.pow(C,r),V=this.pow(p,r.addn(1).iushrn(1)),I=this.pow(p,r),W=a;0!==I.cmp(g);){for(var F=I,B=0;0!==F.cmp(g);B++)F=F.redSqr();n(B=0;r--){for(var C=x.words[r],U=E-1;U>=0;U--){var V=C>>U&1;a!==R[0]&&(a=this.sqr(a)),0!==V||0!==g?(g<<=1,g|=V,(4==++M||0===r&&0===U)&&(a=this.mul(a,R[g]),M=0,g=0)):M=0}E=26}return a},q.prototype.convertTo=function(p){var x=p.umod(this.m);return x===p?x.clone():x},q.prototype.convertFrom=function(p){var x=p.clone();return x.red=null,x},e.mont=function(p){return new k(p)},o(k,q),k.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},k.prototype.convertFrom=function(p){var x=this.imod(p.mul(this.rinv));return x.red=null,x},k.prototype.imul=function(p,x){if(p.isZero()||x.isZero())return p.words[0]=0,p.length=1,p;var R=p.imul(x),r=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=R.isub(r).iushrn(this.shift),g=a;return a.cmp(this.m)>=0?g=a.isub(this.m):a.cmpn(0)<0&&(g=a.iadd(this.m)),g._forceRed(this)},k.prototype.mul=function(p,x){if(p.isZero()||x.isZero())return new e(0)._forceRed(this);var R=p.mul(x),r=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=R.isub(r).iushrn(this.shift),g=a;return a.cmp(this.m)>=0?g=a.isub(this.m):a.cmpn(0)<0&&(g=a.iadd(this.m)),g._forceRed(this)},k.prototype.invm=function(p){return this.imod(p._invmp(this.m).mul(this.r2))._forceRed(this)}}(s,this)}).call(this,c(25)(z))},function(z,l){var c,s=[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];l.getSymbolSize=function(m){if(!m)throw new Error('"version" cannot be null or undefined');if(m<1||m>40)throw new Error('"version" should be in range from 1 to 40');return 4*m+17},l.getSymbolTotalCodewords=function(m){return s[m]},l.getBCHDigit=function(m){for(var y=0;0!==m;)y++,m>>>=1;return y},l.setToSJISFunction=function(m){if("function"!=typeof m)throw new Error('"toSJISFunc" is not a valid function.');c=m},l.isKanjiModeEnabled=function(){return void 0!==c},l.toSJIS=function(m){return c(m)}},function(z,l,c){var s=c(99),m=c(100);l.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},l.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},l.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},l.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},l.MIXED={bit:-1},l.getCharCountIndicator=function(y,n){if(!y.ccBits)throw new Error("Invalid mode: "+y);if(!s.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?y.ccBits[0]:n<27?y.ccBits[1]:y.ccBits[2]},l.getBestModeForData=function(y){return m.testNumeric(y)?l.NUMERIC:m.testAlphanumeric(y)?l.ALPHANUMERIC:m.testKanji(y)?l.KANJI:l.BYTE},l.toString=function(y){if(y&&y.id)return y.id;throw new Error("Invalid mode")},l.isValid=function(y){return y&&y.bit&&y.ccBits},l.from=function(y,n){if(l.isValid(y))return y;try{return function(o){if("string"!=typeof o)throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return l.NUMERIC;case"alphanumeric":return l.ALPHANUMERIC;case"kanji":return l.KANJI;case"byte":return l.BYTE;default:throw new Error("Unknown mode: "+o)}}(y)}catch{return n}}},function(z,l,c){"use strict";var s=c(43),m=Object.keys||function(d){var _=[];for(var v in d)_.push(v);return _};z.exports=u;var y=Object.create(c(35));y.inherits=c(3);var n=c(105),o=c(53);y.inherits(u,n);for(var e=m(o.prototype),t=0;t>5==6?2:d>>4==14?3:d>>3==30?4:d>>6==2?-1:-2}function o(d){var _=this.lastTotal-this.lastNeed,v=function(T,O,b){if(128!=(192&O[0]))return T.lastNeed=0,"\ufffd";if(T.lastNeed>1&&O.length>1){if(128!=(192&O[1]))return T.lastNeed=1,"\ufffd";if(T.lastNeed>2&&O.length>2&&128!=(192&O[2]))return T.lastNeed=2,"\ufffd"}}(this,d);return void 0!==v?v:this.lastNeed<=d.length?(d.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(d.copy(this.lastChar,_,0,d.length),void(this.lastNeed-=d.length))}function e(d,_){if((d.length-_)%2==0){var v=d.toString("utf16le",_);if(v){var T=v.charCodeAt(v.length-1);if(T>=55296&&T<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=d[d.length-2],this.lastChar[1]=d[d.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=d[d.length-1],d.toString("utf16le",_,d.length-1)}function t(d){var _=d&&d.length?this.write(d):"";return this.lastNeed?_+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):_}function i(d,_){var v=(d.length-_)%3;return 0===v?d.toString("base64",_):(this.lastNeed=3-v,this.lastTotal=3,1===v?this.lastChar[0]=d[d.length-1]:(this.lastChar[0]=d[d.length-2],this.lastChar[1]=d[d.length-1]),d.toString("base64",_,d.length-v))}function u(d){var _=d&&d.length?this.write(d):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function h(d){return d.toString(this.encoding)}function f(d){return d&&d.length?this.write(d):""}l.StringDecoder=y,y.prototype.write=function(d){if(0===d.length)return"";var _,v;if(this.lastNeed){if(void 0===(_=this.fillLast(d)))return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v=0?(A>0&&(O.lastNeed=A-1),A):--w=0?(A>0&&(O.lastNeed=A-2),A):--w=0?(A>0&&(2===A?A=0:O.lastNeed=A-3),A):0}(this,d,_);if(!this.lastNeed)return d.toString("utf8",_);this.lastTotal=v;var T=d.length-(v-this.lastNeed);return d.copy(this.lastChar,0,T),d.toString("utf8",_,T)},y.prototype.fillLast=function(d){if(this.lastNeed<=d.length)return d.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);d.copy(this.lastChar,this.lastTotal-this.lastNeed,0,d.length),this.lastNeed-=d.length}},function(z,l,c){(function(s){var m=Object.getOwnPropertyDescriptors||function(a){for(var g=Object.keys(a),M={},E=0;E=C)return I;switch(I){case"%s":return String(E[M++]);case"%d":return Number(E[M++]);case"%j":try{return JSON.stringify(E[M++])}catch{return"[Circular]"}default:return I}}),V=E[M];M=3&&(M.depth=arguments[2]),arguments.length>=4&&(M.colors=arguments[3]),_(g)?M.showHidden=g:g&&l._extend(M,g),b(M.showHidden)&&(M.showHidden=!1),b(M.depth)&&(M.depth=2),b(M.colors)&&(M.colors=!1),b(M.customInspect)&&(M.customInspect=!0),M.colors&&(M.stylize=t),u(M,a,M.depth)}function t(a,g){var M=e.styles[g];return M?"\x1b["+e.colors[M][0]+"m"+a+"\x1b["+e.colors[M][1]+"m":a}function i(a,g){return a}function u(a,g,M){if(a.customInspect&&g&&H(g.inspect)&&g.inspect!==l.inspect&&(!g.constructor||g.constructor.prototype!==g)){var E=g.inspect(M,a);return O(E)||(E=u(a,E,M)),E}var C=function(P,j){if(b(j))return P.stylize("undefined","undefined");if(O(j)){var K="'"+JSON.stringify(j).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return P.stylize(K,"string")}return T(j)?P.stylize(""+j,"number"):_(j)?P.stylize(""+j,"boolean"):v(j)?P.stylize("null","null"):void 0}(a,g);if(C)return C;var j,U=Object.keys(g),V=(j={},U.forEach(function(K,Z){j[K]=!0}),j);if(a.showHidden&&(U=Object.getOwnPropertyNames(g)),L(g)&&(U.indexOf("message")>=0||U.indexOf("description")>=0))return h(g);if(0===U.length){if(H(g))return a.stylize("[Function"+(g.name?": "+g.name:"")+"]","special");if(S(g))return a.stylize(RegExp.prototype.toString.call(g),"regexp");if(A(g))return a.stylize(Date.prototype.toString.call(g),"date");if(L(g))return h(g)}var W,F="",B=!1,N=["{","}"];return d(g)&&(B=!0,N=["[","]"]),H(g)&&(F=" [Function"+(g.name?": "+g.name:"")+"]"),S(g)&&(F=" "+RegExp.prototype.toString.call(g)),A(g)&&(F=" "+Date.prototype.toUTCString.call(g)),L(g)&&(F=" "+h(g)),0!==U.length||B&&0!=g.length?M<0?S(g)?a.stylize(RegExp.prototype.toString.call(g),"regexp"):a.stylize("[Object]","special"):(a.seen.push(g),W=B?function(P,j,K,Z,J){for(var X=[],ee=0,te=j.length;ee60?K[0]+(""===j?"":j+"\n ")+" "+P.join(",\n ")+" "+K[1]:K[0]+j+" "+P.join(", ")+" "+K[1]}(W,F,N)):N[0]+F+N[1]}function h(a){return"["+Error.prototype.toString.call(a)+"]"}function f(a,g,M,E,C,U){var V,I,W;if((W=Object.getOwnPropertyDescriptor(g,C)||{value:g[C]}).get?I=a.stylize(W.set?"[Getter/Setter]":"[Getter]","special"):W.set&&(I=a.stylize("[Setter]","special")),x(E,C)||(V="["+C+"]"),I||(a.seen.indexOf(W.value)<0?(I=v(M)?u(a,W.value,null):u(a,W.value,M-1)).indexOf("\n")>-1&&(I=U?I.split("\n").map(function(F){return" "+F}).join("\n").substr(2):"\n"+I.split("\n").map(function(F){return" "+F}).join("\n")):I=a.stylize("[Circular]","special")),b(V)){if(U&&C.match(/^\d+$/))return I;(V=JSON.stringify(""+C)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(V=V.substr(1,V.length-2),V=a.stylize(V,"name")):(V=V.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),V=a.stylize(V,"string"))}return V+": "+I}function d(a){return Array.isArray(a)}function _(a){return"boolean"==typeof a}function v(a){return null===a}function T(a){return"number"==typeof a}function O(a){return"string"==typeof a}function b(a){return void 0===a}function S(a){return w(a)&&"[object RegExp]"===D(a)}function w(a){return"object"==typeof a&&null!==a}function A(a){return w(a)&&"[object Date]"===D(a)}function L(a){return w(a)&&("[object Error]"===D(a)||a instanceof Error)}function H(a){return"function"==typeof a}function D(a){return Object.prototype.toString.call(a)}function q(a){return a<10?"0"+a.toString(10):a.toString(10)}l.debuglog=function(a){if(b(n)&&(n=s.env.NODE_DEBUG||""),a=a.toUpperCase(),!o[a])if(new RegExp("\\b"+a+"\\b","i").test(n)){var g=s.pid;o[a]=function(){var M=l.format.apply(l,arguments);console.error("%s %d: %s",a,g,M)}}else o[a]=function(){};return o[a]},l.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},l.isArray=d,l.isBoolean=_,l.isNull=v,l.isNullOrUndefined=function(a){return null==a},l.isNumber=T,l.isString=O,l.isSymbol=function(a){return"symbol"==typeof a},l.isUndefined=b,l.isRegExp=S,l.isObject=w,l.isDate=A,l.isError=L,l.isFunction=H,l.isPrimitive=function(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||void 0===a},l.isBuffer=c(225);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function p(){var a=new Date,g=[q(a.getHours()),q(a.getMinutes()),q(a.getSeconds())].join(":");return[a.getDate(),k[a.getMonth()],g].join(" ")}function x(a,g){return Object.prototype.hasOwnProperty.call(a,g)}l.log=function(){console.log("%s - %s",p(),l.format.apply(l,arguments))},l.inherits=c(226),l._extend=function(a,g){if(!g||!w(g))return a;for(var M=Object.keys(g),E=M.length;E--;)a[M[E]]=g[M[E]];return a};var R=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function r(a,g){if(!a){var M=new Error("Promise was rejected with a falsy value");M.reason=a,a=M}return g(a)}l.promisify=function(a){if("function"!=typeof a)throw new TypeError('The "original" argument must be of type Function');if(R&&a[R]){var g;if("function"!=typeof(g=a[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(g,R,{value:g,enumerable:!1,writable:!1,configurable:!0}),g}function g(){for(var M,E,C=new Promise(function(I,W){M=I,E=W}),U=[],V=0;Vt.code===o)||s.f[s.a]}},function(z,l){z.exports=function(c){return c.webpackPolyfill||(c.deprecate=function(){},c.paths=[],c.children||(c.children=[]),Object.defineProperty(c,"loaded",{enumerable:!0,get:function(){return c.l}}),Object.defineProperty(c,"id",{enumerable:!0,get:function(){return c.i}}),c.webpackPolyfill=1),c}},function(z,l,c){"use strict";var s=c(50),m=(y.TYPED_ARRAY_SUPPORT=function(){try{var h=new Uint8Array(1);return h.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===h.foo()}catch{return!1}}())?2147483647:1073741823;function y(h,f,d){return y.TYPED_ARRAY_SUPPORT||this instanceof y?"number"==typeof h?e(this,h):function(_,v,T,O){if("number"==typeof v)throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&v instanceof ArrayBuffer?function(b,S,w,A){if(w<0||S.byteLength=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return 0|h}function o(h,f){var d;return y.TYPED_ARRAY_SUPPORT?(d=new Uint8Array(f)).__proto__=y.prototype:(null===(d=h)&&(d=new y(f)),d.length=f),d}function e(h,f){var d=o(h,f<0?0:0|n(f));if(!y.TYPED_ARRAY_SUPPORT)for(var _=0;_55295&&d<57344){if(!v){if(d>56319){(f-=3)>-1&&T.push(239,191,189);continue}if(O+1===_){(f-=3)>-1&&T.push(239,191,189);continue}v=d;continue}if(d<56320){(f-=3)>-1&&T.push(239,191,189),v=d;continue}d=65536+(v-55296<<10|d-56320)}else v&&(f-=3)>-1&&T.push(239,191,189);if(v=null,d<128){if((f-=1)<0)break;T.push(d)}else if(d<2048){if((f-=2)<0)break;T.push(d>>6|192,63&d|128)}else if(d<65536){if((f-=3)<0)break;T.push(d>>12|224,d>>6&63|128,63&d|128)}else{if(!(d<1114112))throw new Error("Invalid code point");if((f-=4)<0)break;T.push(d>>18|240,d>>12&63|128,d>>6&63|128,63&d|128)}}return T}function u(h){return y.isBuffer(h)?h.length:typeof ArrayBuffer<"u"&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(h)||h instanceof ArrayBuffer)?h.byteLength:("string"!=typeof h&&(h=""+h),0===h.length?0:i(h).length)}y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&y[Symbol.species]===y&&Object.defineProperty(y,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),y.prototype.write=function(h,f,d){void 0===f||void 0===d&&"string"==typeof f?(d=this.length,f=0):isFinite(f)&&(f|=0,isFinite(d)?d|=0:d=void 0);var O,b,_=this.length-f;if((void 0===d||d>_)&&(d=_),h.length>0&&(d<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");return b=d,function(S,w,A,L){for(var H=0;H=w.length||H>=S.length);++H)w[H+A]=S[H];return H}(i(h,this.length-(O=f)),this,O,b)},y.prototype.slice=function(h,f){var d,_=this.length;if((h=~~h)<0?(h+=_)<0&&(h=0):h>_&&(h=_),(f=void 0===f?_:~~f)<0?(f+=_)<0&&(f=0):f>_&&(f=_),f=h.length&&(f=h.length),f||(f=0),_>0&&_=this.length)throw new RangeError("sourceStart out of bounds");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),h.length-f<_-d&&(_=h.length-f+d);var v,T=_-d;if(this===h&&d=0;--v)h[v+f]=this[v+d];else if(T<1e3||!y.TYPED_ARRAY_SUPPORT)for(v=0;v>>=0,d=void 0===d?this.length:d>>>0,h||(h=0),"number"==typeof h)for(v=f;v2?"one of ".concat(o," ").concat(n.slice(0,e-1).join(", "),", or ")+n[e-1]:2===e?"one of ".concat(o," ").concat(n[0]," or ").concat(n[1]):"of ".concat(o," ").concat(n[0])}return"of ".concat(o," ").concat(String(n))}m("ERR_INVALID_OPT_VALUE",function(n,o){return'The value "'+o+'" is invalid for option "'+n+'"'},TypeError),m("ERR_INVALID_ARG_TYPE",function(n,o,e){var t,h,d,v;if("string"==typeof o&&"not "===o.substr(0,"not ".length)?(t="must not be",o=o.replace(/^not /,"")):t="must be",d=n,(void 0===v||v>d.length)&&(v=d.length)," argument"===d.substring(v-" argument".length,v))h="The ".concat(n," ").concat(t," ").concat(y(o,"type"));else{var f=function(d,_,v){return"number"!=typeof v&&(v=0),!(v+".".length>d.length)&&-1!==d.indexOf(".",v)}(n)?"property":"argument";h='The "'.concat(n,'" ').concat(f," ").concat(t," ").concat(y(o,"type"))}return h+". Received type ".concat(typeof e)},TypeError),m("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),m("ERR_METHOD_NOT_IMPLEMENTED",function(n){return"The "+n+" method is not implemented"}),m("ERR_STREAM_PREMATURE_CLOSE","Premature close"),m("ERR_STREAM_DESTROYED",function(n){return"Cannot call "+n+" after a stream was destroyed"}),m("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),m("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),m("ERR_STREAM_WRITE_AFTER_END","write after end"),m("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),m("ERR_UNKNOWN_ENCODING",function(n){return"Unknown encoding: "+n},TypeError),m("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),z.exports.codes=s},function(z,l,c){"use strict";(function(s){var m=Object.keys||function(f){var d=[];for(var _ in f)d.push(_);return d};z.exports=i;var y=c(112),n=c(116);c(3)(i,y);for(var o=m(n.prototype),e=0;e2?"one of ".concat(o," ").concat(n.slice(0,e-1).join(", "),", or ")+n[e-1]:2===e?"one of ".concat(o," ").concat(n[0]," or ").concat(n[1]):"of ".concat(o," ").concat(n[0])}return"of ".concat(o," ").concat(String(n))}m("ERR_INVALID_OPT_VALUE",function(n,o){return'The value "'+o+'" is invalid for option "'+n+'"'},TypeError),m("ERR_INVALID_ARG_TYPE",function(n,o,e){var t,h,d,v;if("string"==typeof o&&"not "===o.substr(0,"not ".length)?(t="must not be",o=o.replace(/^not /,"")):t="must be",d=n,(void 0===v||v>d.length)&&(v=d.length)," argument"===d.substring(v-" argument".length,v))h="The ".concat(n," ").concat(t," ").concat(y(o,"type"));else{var f=function(d,_,v){return"number"!=typeof v&&(v=0),!(v+".".length>d.length)&&-1!==d.indexOf(".",v)}(n)?"property":"argument";h='The "'.concat(n,'" ').concat(f," ").concat(t," ").concat(y(o,"type"))}return h+". Received type ".concat(typeof e)},TypeError),m("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),m("ERR_METHOD_NOT_IMPLEMENTED",function(n){return"The "+n+" method is not implemented"}),m("ERR_STREAM_PREMATURE_CLOSE","Premature close"),m("ERR_STREAM_DESTROYED",function(n){return"Cannot call "+n+" after a stream was destroyed"}),m("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),m("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),m("ERR_STREAM_WRITE_AFTER_END","write after end"),m("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),m("ERR_UNKNOWN_ENCODING",function(n){return"Unknown encoding: "+n},TypeError),m("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),z.exports.codes=s},function(z,l,c){"use strict";(function(s){var m=Object.keys||function(f){var d=[];for(var _ in f)d.push(_);return d};z.exports=i;var y=c(128),n=c(132);c(3)(i,y);for(var o=m(n.prototype),e=0;e=this._finalSize&&(this._update(this._block),this._block.fill(0));var o=8*this._len;if(o<=4294967295)this._block.writeUInt32BE(o,this._blockSize-4);else{var e=(4294967295&o)>>>0;this._block.writeUInt32BE((o-e)/4294967296,this._blockSize-8),this._block.writeUInt32BE(e,this._blockSize-4)}this._update(this._block);var i=this._hash();return y?i.toString(y):i},m.prototype._update=function(){throw new Error("_update must be implemented by subclass")},z.exports=m},function(z,l,c){"use strict";(function(s){var m=c(136),y=c(293);function n(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function o(e){return"0x"+e.toString(16)}z.exports={arrayContainsArray:function(e,t,i){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(i)?"some":"every"](function(u){return e.indexOf(u)>=0})},intToBuffer:function(e){var t=o(e);return new s(n(t.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return s.byteLength(e,"utf8")},isHexPrefixed:m,stripHexPrefix:y,padToEven:n,intToHex:o,fromAscii:function(e){for(var t="",i=0;i0&&"0"===T.toString();)T=(v=v.slice(1))[0];return v},l.toBuffer=function(v){if(!d.isBuffer(v))if(Array.isArray(v))v=d.from(v);else if("string"==typeof v)v=l.isHexString(v)?d.from(l.padToEven(l.stripHexPrefix(v)),"hex"):d.from(v);else if("number"==typeof v)v=l.intToBuffer(v);else if(null==v)v=d.allocUnsafe(0);else if(h.isBN(v))v=v.toArrayLike(d);else{if(!v.toArray)throw new Error("invalid type");v=d.from(v.toArray())}return v},l.bufferToInt=function(v){return new h(l.toBuffer(v)).toNumber()},l.bufferToHex=function(v){return"0x"+(v=l.toBuffer(v)).toString("hex")},l.fromSigned=function(v){return new h(v).fromTwos(256)},l.toUnsigned=function(v){return d.from(v.toTwos(256).toArray())},l.keccak=function(v,T){switch(v=l.toBuffer(v),T||(T=256),T){case 224:return y(v);case 256:return o(v);case 384:return n(v);case 512:return e(v);default:throw new Error("Invald algorithm: keccak"+T)}},l.keccak256=function(v){return l.keccak(v)},l.sha3=l.keccak,l.sha256=function(v){return v=l.toBuffer(v),f("sha256").update(v).digest()},l.ripemd160=function(v,T){v=l.toBuffer(v);var O=f("rmd160").update(v).digest();return!0===T?l.setLength(O,32):O},l.rlphash=function(v){return l.keccak(u.encode(v))},l.isValidPrivate=function(v){return t.privateKeyVerify(v)},l.isValidPublic=function(v,T){return 64===v.length?t.publicKeyVerify(d.concat([d.from([4]),v])):!!T&&t.publicKeyVerify(v)},l.pubToAddress=l.publicToAddress=function(v,T){return v=l.toBuffer(v),T&&64!==v.length&&(v=t.publicKeyConvert(v,!1).slice(1)),i(64===v.length),l.keccak(v).slice(-20)};var _=l.privateToPublic=function(v){return v=l.toBuffer(v),t.publicKeyCreate(v,!1).slice(1)};l.importPublic=function(v){return 64!==(v=l.toBuffer(v)).length&&(v=t.publicKeyConvert(v,!1).slice(1)),v},l.ecsign=function(v,T){var O=t.sign(v,T),b={};return b.r=O.signature.slice(0,32),b.s=O.signature.slice(32,64),b.v=O.recovery+27,b},l.hashPersonalMessage=function(v){var T=l.toBuffer("\x19Ethereum Signed Message:\n"+v.length.toString());return l.keccak(d.concat([T,v]))},l.ecrecover=function(v,T,O,b){var S=d.concat([l.setLength(O,32),l.setLength(b,32)],64),w=T-27;if(0!==w&&1!==w)throw new Error("Invalid signature v value");var A=t.recover(v,S,w);return t.publicKeyConvert(A,!1).slice(1)},l.toRpcSig=function(v,T,O){if(27!==v&&28!==v)throw new Error("Invalid recovery id");return l.bufferToHex(d.concat([l.setLengthLeft(T,32),l.setLengthLeft(O,32),l.toBuffer(v-27)]))},l.fromRpcSig=function(v){if(65!==(v=l.toBuffer(v)).length)throw new Error("Invalid signature length");var T=v[64];return T<27&&(T+=27),{v:T,r:v.slice(0,32),s:v.slice(32,64)}},l.privateToAddress=function(v){return l.publicToAddress(_(v))},l.isValidAddress=function(v){return/^0x[0-9a-fA-F]{40}$/.test(v)},l.isZeroAddress=function(v){return l.zeroAddress()===l.addHexPrefix(v)},l.toChecksumAddress=function(v){v=l.stripHexPrefix(v).toLowerCase();for(var T=l.keccak(v).toString("hex"),O="0x",b=0;b=8?O+=v[b].toUpperCase():O+=v[b];return O},l.isValidChecksumAddress=function(v){return l.isValidAddress(v)&&l.toChecksumAddress(v)===v},l.generateAddress=function(v,T){return v=l.toBuffer(v),T=(T=new h(T)).isZero()?null:d.from(T.toArray()),l.rlphash([v,T]).slice(-20)},l.isPrecompiled=function(v){var T=l.unpad(v);return 1===T.length&&T[0]>=1&&T[0]<=8},l.addHexPrefix=function(v){return"string"!=typeof v||l.isHexPrefixed(v)?v:"0x"+v},l.isValidSignature=function(v,T,O,b){var S=new h("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),w=new h("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return!(32!==T.length||32!==O.length||27!==v&&28!==v||(T=new h(T),O=new h(O),T.isZero()||T.gt(w)||O.isZero()||O.gt(w)||!1===b&&1===new h(O).cmp(S)))},l.baToJSON=function(v){if(d.isBuffer(v))return"0x"+v.toString("hex");if(v instanceof Array){for(var T=[],O=0;O=H.length,"The field "+S.name+" must not have more "+S.length+" bytes")):S.allowZero&&0===H.length||!S.length||i(S.length===H.length,"The field "+S.name+" must have byte length of "+S.length),v.raw[w]=H}v._fields.push(S.name),Object.defineProperty(v,S.name,{enumerable:!0,configurable:!0,get:A,set:L}),S.default&&(v[S.name]=S.default),S.alias&&Object.defineProperty(v,S.alias,{enumerable:!1,configurable:!0,set:L,get:A})}),O)if("string"==typeof O&&(O=d.from(l.stripHexPrefix(O),"hex")),d.isBuffer(O)&&(O=u.decode(O)),Array.isArray(O)){if(O.length>v._fields.length)throw new Error("wrong number of fields in data");O.forEach(function(S,w){v[v._fields[w]]=l.toBuffer(S)})}else{if("object"!==(void 0===O?"undefined":s(O)))throw new Error("invalid data");var b=Object.keys(O);T.forEach(function(S){-1!==b.indexOf(S.name)&&(v[S.name]=O[S.name]),-1!==b.indexOf(S.alias)&&(v[S.alias]=O[S.alias])})}}},function(z,l,c){"use strict";var s=c(15),m=c(22);function y(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}l.BlockHash=y,y.prototype.update=function(n,o){if(n=s.toArray(n,o),this.pending=this.pending?this.pending.concat(n):n,this.pendingTotal+=n.length,this.pending.length>=this._delta8){var e=(n=this.pending).length%this._delta8;this.pending=n.slice(n.length-e,n.length),0===this.pending.length&&(this.pending=null),n=s.join32(n,0,n.length-e,this.endian);for(var t=0;t>>24&255,t[i++]=n>>>16&255,t[i++]=n>>>8&255,t[i++]=255&n}else for(t[i++]=255&n,t[i++]=n>>>8&255,t[i++]=n>>>16&255,t[i++]=n>>>24&255,t[i++]=0,t[i++]=0,t[i++]=0,t[i++]=0,u=8;u"latest"===o||"earliest"===e?1:"latest"===e||"earliest"===o?-1:s(o)-s(e))}function s(n){return null==n?n:Number.parseInt(n,16)}function m(n){if(null==n)return n;let o=n.toString(16);return o.length%2&&(o="0"+o),"0x"+o}function y(){return Math.floor(16*Math.random()).toString(16)}z.exports={minBlockRef:function(...n){return c(n)[0]},maxBlockRef:function(...n){const o=c(n);return o[o.length-1]},sortBlockRefs:c,bnToHex:function(n){return"0x"+n.toString(16)},blockRefIsNumber:function(n){return n&&!["earliest","latest","pending"].includes(n)},hexToInt:s,incrementHexInt:function(n){return null==n?n:m(s(n)+1)},intToHex:m,unsafeRandomBytes:function(n){let o="0x";for(let e=0;e0&&"0"===o.toString();)o=(n=n.slice(1))[0];return n},l.stripZeros=l.unpad,l.toBuffer=function(n){if(!s.isBuffer(n))if(Array.isArray(n))n=s.from(n);else if("string"==typeof n){if(!m.isHexString(n))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+n);n=s.from(m.padToEven(m.stripHexPrefix(n)),"hex")}else if("number"==typeof n)n=m.intToBuffer(n);else if(null==n)n=s.allocUnsafe(0);else if(y.isBN(n))n=n.toArrayLike(s);else{if(!n.toArray)throw new Error("invalid type");n=s.from(n.toArray())}return n},l.bufferToInt=function(n){return new y(l.toBuffer(n)).toNumber()},l.bufferToHex=function(n){return"0x"+(n=l.toBuffer(n)).toString("hex")},l.fromSigned=function(n){return new y(n).fromTwos(256)},l.toUnsigned=function(n){return s.from(n.toTwos(256).toArray())},l.addHexPrefix=function(n){return"string"!=typeof n||m.isHexPrefixed(n)?n:"0x"+n},l.baToJSON=function(n){if(s.isBuffer(n))return"0x"+n.toString("hex");if(n instanceof Array){for(var o=[],e=0;e0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function t(i,u){this.curve=i,this.type=u,this.precomputed=null}z.exports=e,e.prototype.point=function(){throw new Error("Not implemented")},e.prototype.validate=function(){throw new Error("Not implemented")},e.prototype._fixedNafMul=function(i,u){o(i.precomputed);var h=i._getDoubles(),f=y(u,1,this._bitLength),d=(1<=_;O--)v=(v<<1)+f[O];T.push(v)}for(var b=this.jpoint(null,null,null),S=this.jpoint(null,null,null),w=d;w>0;w--){for(_=0;_=0;T--){for(var O=0;T>=0&&0===_[T];T--)O++;if(T>=0&&O++,v=v.dblp(O),T<0)break;var b=_[T];o(0!==b),v="affine"===i.type?v.mixedAdd(b>0?d[b-1>>1]:d[-b-1>>1].neg()):v.add(b>0?d[b-1>>1]:d[-b-1>>1].neg())}return"affine"===i.type?v.toP():v},e.prototype._wnafMulAdd=function(i,u,h,f,d){var _,v,T,O=this._wnafT1,b=this._wnafT2,S=this._wnafT3,w=0;for(_=0;_=1;_-=2){var L=_-1,H=_;if(1===O[L]&&1===O[H]){var D=[u[L],null,null,u[H]];0===u[L].y.cmp(u[H].y)?(D[1]=u[L].add(u[H]),D[2]=u[L].toJ().mixedAdd(u[H].neg())):0===u[L].y.cmp(u[H].y.redNeg())?(D[1]=u[L].toJ().mixedAdd(u[H]),D[2]=u[L].add(u[H].neg())):(D[1]=u[L].toJ().mixedAdd(u[H]),D[2]=u[L].toJ().mixedAdd(u[H].neg()));var q=[-3,-1,-5,-7,0,7,5,1,3],k=n(h[L],h[H]);for(w=Math.max(k[0].length,w),S[L]=new Array(w),S[H]=new Array(w),v=0;v=0;_--){for(var a=0;_>=0;){var g=!0;for(v=0;v=0&&a++,R=R.dblp(a),_<0)break;for(v=0;v0?T=b[v][M-1>>1]:M<0&&(T=b[v][-M-1>>1].neg()),R="affine"===T.type?R.mixedAdd(T):R.add(T))}}for(_=0;_=Math.ceil((i.bitLength()+1)/u.step)},t.prototype._getDoubles=function(i,u){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var h=[this],f=this,d=0;d_.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(b=_.slice(T,L)).length)throw new Error("invalid rlp, List has a invalid length");for(;b.length;)S=d(b),w.push(S.data),b=S.remainder;return{data:w,remainder:_.slice(L)}}(i(u));if(h)return f;if(0!==f.remainder.length)throw new Error("invalid remainder");return f.data},l.getLength=function(u){if(!u||0===u.length)return s.from([]);var h=i(u),f=h[0];if(f<=127)return h.length;if(f<=183)return f-127;if(f<=191)return f-182;if(f<=247)return f-191;var d=f-246;return d+n(h.slice(1,d).toString("hex"),16)}}).call(this,c(2).Buffer)},function(z,l,c){var s=c(300),m=c(144);z.exports=function(y){return null!=y&&m(y.length)&&!s(y)}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(s,m){m|=0;for(var y=Math.max(s.length-m,0),n=Array(y),o=0;o=0&&c.bit<4},l.from=function(c,s){if(l.isValid(c))return c;try{return function(m){if("string"!=typeof m)throw new Error("Param is not a string");switch(m.toLowerCase()){case"l":case"low":return l.L;case"m":case"medium":return l.M;case"q":case"quartile":return l.Q;case"h":case"high":return l.H;default:throw new Error("Unknown EC Level: "+m)}}(c)}catch{return s}}},function(z,l,c){var s=c(2),m=s.Buffer;function y(o,e){for(var t in o)e[t]=o[t]}function n(o,e,t){return m(o,e,t)}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?z.exports=s:(y(s,l),l.Buffer=n),y(m,n),n.from=function(o,e,t){if("number"==typeof o)throw new TypeError("Argument must not be a number");return m(o,e,t)},n.alloc=function(o,e,t){if("number"!=typeof o)throw new TypeError("Argument must be a number");var i=m(o);return void 0!==e?"string"==typeof t?i.fill(e,t):i.fill(e):i.fill(0),i},n.allocUnsafe=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return m(o)},n.allocUnsafeSlow=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return s.SlowBuffer(o)}},function(z,l,c){"use strict";(function(s,m,y){var n=c(43);function o(q){var k=this;this.next=null,this.entry=null,this.finish=function(){!function(p,x,R){var r=p.entry;for(p.entry=null;r;){var a=r.callback;x.pendingcb--,a(undefined),r=r.next}x.corkedRequestsFree?x.corkedRequestsFree.next=p:x.corkedRequestsFree=p}(k,q)}}z.exports=b;var e,t=!s.browser&&["v0.10","v0.9."].indexOf(s.version.slice(0,5))>-1?m:n.nextTick;b.WritableState=O;var i=Object.create(c(35));i.inherits=c(3);var _,u={deprecate:c(54)},h=c(106),f=c(52).Buffer,d=y.Uint8Array||function(){},v=c(107);function T(){}function O(q,k){e=e||c(19);var p=k instanceof e;this.objectMode=!!(q=q||{}).objectMode,p&&(this.objectMode=this.objectMode||!!q.writableObjectMode);var x=q.highWaterMark,R=q.writableHighWaterMark;this.highWaterMark=x||0===x?x:p&&(R||0===R)?R:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===q.decodeStrings),this.defaultEncoding=q.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(g){!function(M,E){var W,C=M._writableState,U=C.sync,V=C.writecb;if((W=C).writing=!1,W.writecb=null,W.length-=W.writelen,W.writelen=0,E)!function(W,F,B,N,P){--F.pendingcb,B?(n.nextTick(P,N),n.nextTick(D,W,F),W._writableState.errorEmitted=!0,W.emit("error",N)):(P(N),W._writableState.errorEmitted=!0,W.emit("error",N),D(W,F))}(M,C,U,E,V);else{var I=L(C);I||C.corked||C.bufferProcessing||!C.bufferedRequest||A(M,C),U?t(w,M,C,I,V):w(M,C,I,V)}}(k,g)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(q){if(e=e||c(19),!(_.call(b,this)||this instanceof e))return new b(q);this._writableState=new O(q,this),this.writable=!0,q&&("function"==typeof q.write&&(this._write=q.write),"function"==typeof q.writev&&(this._writev=q.writev),"function"==typeof q.destroy&&(this._destroy=q.destroy),"function"==typeof q.final&&(this._final=q.final)),h.call(this)}function S(q,k,p,x,R,r,a){k.writelen=x,k.writecb=a,k.writing=!0,k.sync=!0,p?q._writev(R,k.onwrite):q._write(R,r,k.onwrite),k.sync=!1}function w(q,k,p,x){var R,r;p||(R=q,0===(r=k).length&&r.needDrain&&(r.needDrain=!1,R.emit("drain"))),k.pendingcb--,x(),D(q,k)}function A(q,k){k.bufferProcessing=!0;var p=k.bufferedRequest;if(q._writev&&p&&p.next){var R=new Array(k.bufferedRequestCount),r=k.corkedRequestsFree;r.entry=p;for(var a=0,g=!0;p;)R[a]=p,p.isBuf||(g=!1),p=p.next,a+=1;R.allBuffers=g,S(q,k,!0,k.length,R,"",r.finish),k.pendingcb++,k.lastBufferedRequest=null,r.next?(k.corkedRequestsFree=r.next,r.next=null):k.corkedRequestsFree=new o(k),k.bufferedRequestCount=0}else{for(;p;){var M=p.chunk;if(S(q,k,!1,k.objectMode?1:M.length,M,p.encoding,p.callback),p=p.next,k.bufferedRequestCount--,k.writing)break}null===p&&(k.lastBufferedRequest=null)}k.bufferedRequest=p,k.bufferProcessing=!1}function L(q){return q.ending&&0===q.length&&null===q.bufferedRequest&&!q.finished&&!q.writing}function H(q,k){q._final(function(p){k.pendingcb--,p&&q.emit("error",p),k.prefinished=!0,q.emit("prefinish"),D(q,k)})}function D(q,k){var x,R,p=L(k);return p&&(x=q,(R=k).prefinished||R.finalCalled||("function"==typeof x._final?(R.pendingcb++,R.finalCalled=!0,n.nextTick(H,x,R)):(R.prefinished=!0,x.emit("prefinish"))),0===k.pendingcb&&(k.finished=!0,q.emit("finish"))),p}i.inherits(b,h),O.prototype.getBuffer=function(){for(var q=this.bufferedRequest,k=[];q;)k.push(q),q=q.next;return k},function(){try{Object.defineProperty(O.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(_=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(q){return!!_.call(this,q)||this===b&&q&&q._writableState instanceof O}})):_=function(q){return q instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(q,k,p){var x,g,M,E,R=this._writableState,r=!1,a=!R.objectMode&&(f.isBuffer(x=q)||x instanceof d);return a&&!f.isBuffer(q)&&(q=f.from(q)),"function"==typeof k&&(p=k,k=null),a?k="buffer":k||(k=R.defaultEncoding),"function"!=typeof p&&(p=T),R.ended?(g=this,M=p,E=new Error("write after end"),g.emit("error",E),n.nextTick(M,E)):(a||function(g,M,E,C){var U=!0,V=!1;return null===E?V=new TypeError("May not write null values to stream"):"string"==typeof E||void 0===E||M.objectMode||(V=new TypeError("Invalid non-string/buffer chunk")),V&&(g.emit("error",V),n.nextTick(C,V),U=!1),U}(this,R,q,p))&&(R.pendingcb++,r=function(g,M,E,C,U,V){if(!E){var I=(P=C,(N=M).objectMode||!1===N.decodeStrings||"string"!=typeof P||(P=f.from(P,U)),P);C!==I&&(E=!0,U="buffer",C=I)}var N,P,W=M.objectMode?1:C.length;M.length+=W;var F=M.length-1))throw new TypeError("Unknown encoding: "+q);return this._writableState.defaultEncoding=q,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(q,k,p){p(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(q,k,p){var R,r,a,x=this._writableState;"function"==typeof q?(p=q,q=null,k=null):"function"==typeof k&&(p=k,k=null),null!=q&&this.write(q,k),x.corked&&(x.corked=1,this.uncork()),x.ending||x.finished||(R=this,a=p,(r=x).ending=!0,D(R,r),a&&(r.finished?n.nextTick(a):R.once("finish",a)),r.ended=!0,R.writable=!1)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(q){this._writableState&&(this._writableState.destroyed=q)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(q,k){this.end(),k(q)}}).call(this,c(5),c(108).setImmediate,c(6))},function(z,l,c){(function(s){function m(y){try{if(!s.localStorage)return!1}catch{return!1}var n=s.localStorage[y];return null!=n&&"true"===String(n).toLowerCase()}z.exports=function(y,n){if(m("noDeprecation"))return y;var o=!1;return function(){if(!o){if(m("throwDeprecation"))throw new Error(n);m("traceDeprecation")?console.trace(n):console.warn(n),o=!0}return y.apply(this,arguments)}}}).call(this,c(6))},function(z,l,c){"use strict";var s=c(213),m=c(214);function y(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}l.parse=b,l.resolve=function(S,w){return b(S,!1,!0).resolve(w)},l.resolveObject=function(S,w){return S?b(S,!1,!0).resolveObject(w):w},l.format=function(S){return m.isString(S)&&(S=b(S)),S instanceof y?S.format():y.prototype.format.call(S)},l.Url=y;var n=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,e=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,t=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),i=["'"].concat(t),u=["%","/","?",";","#"].concat(i),h=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},T={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=c(215);function b(S,w,A){if(S&&m.isObject(S)&&S instanceof y)return S;var L=new y;return L.parse(S,w,A),L}y.prototype.parse=function(S,w,A){if(!m.isString(S))throw new TypeError("Parameter 'url' must be a string, not "+typeof S);var L=S.indexOf("?"),H=-1!==L&&L127?W+="x":W+=I[F];if(!W.match(f)){var N=U.slice(0,M),P=U.slice(M+1),j=I.match(d);j&&(N.push(j[1]),P.unshift(j[2])),P.length&&(q="/"+P.join(".")+q),this.hostname=N.join(".");break}}}this.hostname=this.hostname.length>255?"":this.hostname.toLowerCase(),C||(this.hostname=s.toASCII(this.hostname));var K=this.port?":"+this.port:"";this.host=(this.hostname||"")+K,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==q[0]&&(q="/"+q))}if(!_[x])for(M=0,V=i.length;M0)&&A.host.split("@"))&&(A.auth=j.shift(),A.host=A.hostname=j.shift())),A.search=S.search,A.query=S.query,m.isNull(A.pathname)&&m.isNull(A.search)||(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.href=A.format(),A;if(!I.length)return A.pathname=null,A.path=A.search?"/"+A.search:null,A.href=A.format(),A;for(var F=I.slice(-1)[0],B=(A.host||S.host||I.length>1)&&("."===F||".."===F)||""===F,N=0,P=I.length;P>=0;P--)"."===(F=I[P])?I.splice(P,1):".."===F?(I.splice(P,1),N++):N&&(I.splice(P,1),N--);if(!U&&!V)for(;N--;N)I.unshift("..");!U||""===I[0]||I[0]&&"/"===I[0].charAt(0)||I.unshift(""),B&&"/"!==I.join("/").substr(-1)&&I.push("");var j,K=""===I[0]||I[0]&&"/"===I[0].charAt(0);return W&&(A.hostname=A.host=K?"":I.length?I.shift():"",(j=!!(A.host&&A.host.indexOf("@")>0)&&A.host.split("@"))&&(A.auth=j.shift(),A.host=A.hostname=j.shift())),(U=U||A.host&&I.length)&&!K&&I.unshift(""),I.length?A.pathname=I.join("/"):(A.pathname=null,A.path=null),m.isNull(A.pathname)&&m.isNull(A.search)||(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.auth=S.auth||A.auth,A.slashes=A.slashes||S.slashes,A.href=A.format(),A},y.prototype.parseHost=function(){var S=this.host,w=o.exec(S);w&&(":"!==(w=w[0])&&(this.port=w.substr(1)),S=S.substr(0,S.length-w.length)),S&&(this.hostname=S)}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var s=function(){function m(){this.listeners={}}return m.prototype.addEventListener=function(y,n){y=y.toLowerCase(),this.listeners[y]=this.listeners[y]||[],this.listeners[y].push(n.handleEvent||n)},m.prototype.removeEventListener=function(y,n){if(y=y.toLowerCase(),this.listeners[y]){var o=this.listeners[y].indexOf(n.handleEvent||n);o<0||this.listeners[y].splice(o,1)}},m.prototype.dispatchEvent=function(y){var n=y.type.toLowerCase();if(y.target=this,this.listeners[n])for(var o=0,e=this.listeners[n];o=0;U--)if(V[U]!==I[U])return!1;for(U=V.length-1;U>=0;U--)if(!S(R[C=V[U]],r[C],a,g))return!1;return!0}(D,q,k,p))}return k?D===q:D==q}function w(D){return"[object Arguments]"==Object.prototype.toString.call(D)}function A(D,q){if(!D||!q)return!1;if("[object RegExp]"==Object.prototype.toString.call(q))return q.test(D);try{if(D instanceof q)return!0}catch{}return!Error.isPrototypeOf(q)&&!0===q.call({},D)}function L(D,q,k,p){var x;if("function"!=typeof q)throw new TypeError('"block" argument must be a function');"string"==typeof k&&(p=k,k=null),x=function(a){var g;try{a()}catch(M){g=M}return g}(q),p=(k&&k.name?" ("+k.name+").":".")+(p?" "+p:"."),D&&!x&&O(x,k,"Missing expected exception"+p);var R="string"==typeof p,r=!D&&x&&!k;if((!D&&o.isError(x)&&R&&A(x,k)||r)&&O(x,k,"Got unwanted exception"+p),D&&x&&k&&!A(x,k)||!D&&x)throw x}f.AssertionError=function(D){this.name="AssertionError",this.actual=D.actual,this.expected=D.expected,this.operator=D.operator,D.message?(this.message=D.message,this.generatedMessage=!1):(this.message=v(T(this.actual),128)+" "+this.operator+" "+v(T(this.expected),128),this.generatedMessage=!0);var q=D.stackStartFunction||O;if(Error.captureStackTrace)Error.captureStackTrace(this,q);else{var k=new Error;if(k.stack){var p=k.stack,x=_(q),R=p.indexOf("\n"+x);if(R>=0){var r=p.indexOf("\n",R+1);p=p.substring(r+1)}this.stack=p}}},o.inherits(f.AssertionError,Error),f.fail=O,f.ok=b,f.equal=function(D,q,k){D!=q&&O(D,q,k,"==",f.equal)},f.notEqual=function(D,q,k){D==q&&O(D,q,k,"!=",f.notEqual)},f.deepEqual=function(D,q,k){S(D,q,!1)||O(D,q,k,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(D,q,k){S(D,q,!0)||O(D,q,k,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(D,q,k){S(D,q,!1)&&O(D,q,k,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function D(q,k,p){S(q,k,!0)&&O(q,k,p,"notDeepStrictEqual",D)},f.strictEqual=function(D,q,k){D!==q&&O(D,q,k,"===",f.strictEqual)},f.notStrictEqual=function(D,q,k){D===q&&O(D,q,k,"!==",f.notStrictEqual)},f.throws=function(D,q,k){L(!0,D,q,k)},f.doesNotThrow=function(D,q,k){L(!1,D,q,k)},f.ifError=function(D){if(D)throw D},f.strict=m(function D(q,k){q||O(q,!0,k,"==",D)},f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var H=Object.keys||function(D){var q=[];for(var k in D)e.call(D,k)&&q.push(k);return q}}).call(this,c(6))},function(z,l,c){"use strict";var s=c(29).codes.ERR_STREAM_PREMATURE_CLOSE;function m(){}z.exports=function y(n,o,e){if("function"==typeof o)return y(n,null,o);var b,S;o||(o={}),b=e||m,S=!1,e=function(){if(!S){S=!0;for(var w=arguments.length,A=new Array(w),L=0;L{t?(delete o.result,o.error={message:t.message||t}):o.result=i,e?e(u):u()})},function(e){if(e)return n(e);n(null,o.result)})}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0});const s=c(12);function m(n,o,e){try{Reflect.apply(n,o,e)}catch(t){setTimeout(()=>{throw t})}}l.default=class y extends s.EventEmitter{emit(o,...e){let t="error"===o;const i=this._events;if(void 0!==i)t=t&&void 0===i.error;else if(!t)return!1;if(t){let h;if(e.length>0&&([h]=e),h instanceof Error)throw h;const f=new Error("Unhandled error."+(h?` (${h.message})`:""));throw f.context=h,f}const u=i[o];if(void 0===u)return!1;if("function"==typeof u)m(u,this,e);else{const h=u.length,f=function(d){const _=d.length,v=new Array(_);for(let T=0;T<_;T+=1)v[T]=d[T];return v}(u);for(let d=0;d=1e3&&t<=4999))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');var t;super(n,o,e)}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.errorValues=l.errorCodes=void 0,l.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},l.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},function(z,l,c){const s=c(69).default;z.exports=class extends s{constructor(){super(),this.updates=[]}initialize(){return ge(function*(){})()}update(){return ge(function*(){throw new Error("BaseFilter - no update method specified")})()}addResults(m){this.updates=this.updates.concat(m),m.forEach(y=>this.emit("update",y))}addInitialResults(m){}getChangesAndClear(){const m=this.updates;return this.updates=[],m}}},function(z,l){function c(m){return null==m?m:Number.parseInt(m,16)}function s(m){return null==m?m:"0x"+m.toString(16)}z.exports=function(){var m=ge(function*({provider:y,fromBlock:n,toBlock:o}){n||(n=o);const e=c(n),t=c(o),i=Array(t-e+1).fill().map((u,h)=>e+h).map(s);return yield Promise.all(i.map(u=>{return h=y,"eth_getBlockByNumber",d=[u,!1],new Promise((_,v)=>{h.sendAsync({id:1,jsonrpc:"2.0",method:"eth_getBlockByNumber",params:d},(T,O)=>{if(T)return v(T);_(O.result)})});var h,d}))});return function(y){return m.apply(this,arguments)}}()},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.ecdhUnsafe=l.ecdh=l.recover=l.verify=l.sign=l.signatureImportLax=l.signatureImport=l.signatureExport=l.signatureNormalize=l.publicKeyCombine=l.publicKeyTweakMul=l.publicKeyTweakAdd=l.publicKeyVerify=l.publicKeyConvert=l.publicKeyCreate=l.privateKeyTweakMul=l.privateKeyTweakAdd=l.privateKeyModInverse=l.privateKeyNegate=l.privateKeyImport=l.privateKeyExport=l.privateKeyVerify=void 0;var m=c(118),y=c(361),n=c(362);l.privateKeyVerify=function(o){return 32===o.length&&m.privateKeyVerify(Uint8Array.from(o))},l.privateKeyExport=function(o,e){if(32!==o.length)throw new RangeError("private key length is invalid");var t=y.privateKeyExport(o,e);return n.privateKeyExport(o,t,e)},l.privateKeyImport=function(o){if(null!==(o=n.privateKeyImport(o))&&32===o.length&&l.privateKeyVerify(o))return o;throw new Error("couldn't import from DER format")},l.privateKeyNegate=function(o){return s.from(m.privateKeyNegate(Uint8Array.from(o)))},l.privateKeyModInverse=function(o){if(32!==o.length)throw new Error("private key length is invalid");return s.from(y.privateKeyModInverse(Uint8Array.from(o)))},l.privateKeyTweakAdd=function(o,e){return s.from(m.privateKeyTweakAdd(Uint8Array.from(o),e))},l.privateKeyTweakMul=function(o,e){return s.from(m.privateKeyTweakMul(Uint8Array.from(o),Uint8Array.from(e)))},l.publicKeyCreate=function(o,e){return s.from(m.publicKeyCreate(Uint8Array.from(o),e))},l.publicKeyConvert=function(o,e){return s.from(m.publicKeyConvert(Uint8Array.from(o),e))},l.publicKeyVerify=function(o){return(33===o.length||65===o.length)&&m.publicKeyVerify(Uint8Array.from(o))},l.publicKeyTweakAdd=function(o,e,t){return s.from(m.publicKeyTweakAdd(Uint8Array.from(o),Uint8Array.from(e),t))},l.publicKeyTweakMul=function(o,e,t){return s.from(m.publicKeyTweakMul(Uint8Array.from(o),Uint8Array.from(e),t))},l.publicKeyCombine=function(o,e){var t=[];return o.forEach(function(i){t.push(Uint8Array.from(i))}),s.from(m.publicKeyCombine(t,e))},l.signatureNormalize=function(o){return s.from(m.signatureNormalize(Uint8Array.from(o)))},l.signatureExport=function(o){return s.from(m.signatureExport(Uint8Array.from(o)))},l.signatureImport=function(o){return s.from(m.signatureImport(Uint8Array.from(o)))},l.signatureImportLax=function(o){if(0===o.length)throw new RangeError("signature length is invalid");var e=n.signatureImportLax(o);if(null===e)throw new Error("couldn't parse DER signature");return y.signatureImport(e)},l.sign=function(o,e,t){if(null===t)throw new TypeError("options should be an Object");var i=void 0;if(t){if(i={},null===t.data)throw new TypeError("options.data should be a Buffer");if(t.data){if(32!=t.data.length)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(t.data)}if(null===t.noncefn)throw new TypeError("options.noncefn should be a Function");t.noncefn&&(i.noncefn=function(h,f,d,_,v){var T=null!=d?s.from(d):null,O=null!=_?s.from(_):null,b=s.from("");return t.noncefn&&(b=t.noncefn(s.from(h),s.from(f),T,O,v)),new Uint8Array(b)})}var u=m.ecdsaSign(Uint8Array.from(o),Uint8Array.from(e),i);return{signature:s.from(u.signature),recovery:u.recid}},l.verify=function(o,e,t){return m.ecdsaVerify(Uint8Array.from(e),Uint8Array.from(o),t)},l.recover=function(o,e,t,i){return s.from(m.ecdsaRecover(Uint8Array.from(e),t,Uint8Array.from(o),i))},l.ecdh=function(o,e){return s.from(m.ecdh(Uint8Array.from(o),Uint8Array.from(e),{}))},l.ecdhUnsafe=function(o,e,t){if(33!==o.length&&65!==o.length)throw new RangeError("public key length is invalid");if(32!==e.length)throw new RangeError("private key length is invalid");return s.from(y.ecdhUnsafe(Uint8Array.from(o),Uint8Array.from(e),t))}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.rlphash=l.ripemd160=l.sha256=l.keccak256=l.keccak=void 0;var m=c(110),y=m.keccak224,n=m.keccak384,o=m.keccak256,e=m.keccak512,t=c(126),i=c(32),u=c(46),h=c(40);l.keccak=function(f,d){switch(void 0===d&&(d=256),f="string"!=typeof f||i.isHexString(f)?h.toBuffer(f):s.from(f,"utf8"),d||(d=256),d){case 224:return y(f);case 256:return o(f);case 384:return n(f);case 512:return e(f);default:throw new Error("Invald algorithm: keccak"+d)}},l.keccak256=function(f){return l.keccak(f)},l.sha256=function(f){return f=h.toBuffer(f),t("sha256").update(f).digest()},l.ripemd160=function(f,d){f=h.toBuffer(f);var _=t("rmd160").update(f).digest();return!0===d?h.setLength(_,32):_},l.rlphash=function(f){return l.keccak(u.encode(f))}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";c.r(l);var s=c(157),m=c(10),y=c(158);function n(W){return Object(y.a)(W)}function o(){const W=n();return W&&W.os?W.os:void 0}function e(){const W=o();return!!W&&W.toLowerCase().includes("android")}function t(){const W=o();return!!W&&(W.toLowerCase().includes("ios")||W.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}function i(){return!!o()&&(e()||t())}function u(){const W=n();return!(!W||!W.name)&&"node"===W.name.toLowerCase()}function h(){return!u()&&!!O()}const f=m.getFromWindow,d=m.getFromWindowOrThrow,_=m.getDocumentOrThrow,v=m.getDocument,T=m.getNavigatorOrThrow,O=m.getNavigator,b=m.getLocationOrThrow,S=m.getLocation,w=m.getCryptoOrThrow,A=m.getCrypto,L=m.getLocalStorageOrThrow,H=m.getLocalStorage;function D(){return s.getWindowMetadata()}const q=function(W){if("string"!=typeof W)throw new Error("Cannot safe json parse value of type "+typeof W);try{return JSON.parse(W)}catch{return W}},k=function(W){return"string"==typeof W?W:JSON.stringify(W)};function p(W,F){const B=k(F),N=H();N&&N.setItem(W,B)}function x(W){let F=null,B=null;const N=H();return N&&(B=N.getItem(W)),F=B&&q(B),F}function R(W){const F=H();F&&F.removeItem(W)}function r(W,F){const B=encodeURIComponent(W);return F.universalLink?`${F.universalLink}/wc?uri=${B}`:F.deepLink?`${F.deepLink}${F.deepLink.endsWith(":")?"//":"/"}wc?uri=${B}`:""}function a(W){const F=W.href.split("?")[0];p("WALLETCONNECT_DEEPLINK_CHOICE",Object.assign(Object.assign({},W),{href:F}))}function g(W,F){return W.filter(B=>B.name.toLowerCase().includes(F.toLowerCase()))[0]}function M(W,F){let B=W;return F&&(B=F.map(N=>g(W,N)).filter(Boolean)),B}const E="https://registry.walletconnect.com";function C(){return E+"/api/v2/wallets"}function U(){return E+"/api/v2/dapps"}function V(W,F="mobile"){var B;return{name:W.name||"",shortName:W.metadata.shortName||"",color:W.metadata.colors.primary||"",logo:null!==(B=W.image_url.sm)&&void 0!==B?B:"",universalLink:W[F].universal||"",deepLink:W[F].native||""}}function I(W,F="mobile"){return Object.values(W).filter(B=>!!B[F].universal||!!B[F].native).map(B=>V(B,F))}c.d(l,"detectEnv",function(){return n}),c.d(l,"detectOS",function(){return o}),c.d(l,"isAndroid",function(){return e}),c.d(l,"isIOS",function(){return t}),c.d(l,"isMobile",function(){return i}),c.d(l,"isNode",function(){return u}),c.d(l,"isBrowser",function(){return h}),c.d(l,"getFromWindow",function(){return f}),c.d(l,"getFromWindowOrThrow",function(){return d}),c.d(l,"getDocumentOrThrow",function(){return _}),c.d(l,"getDocument",function(){return v}),c.d(l,"getNavigatorOrThrow",function(){return T}),c.d(l,"getNavigator",function(){return O}),c.d(l,"getLocationOrThrow",function(){return b}),c.d(l,"getLocation",function(){return S}),c.d(l,"getCryptoOrThrow",function(){return w}),c.d(l,"getCrypto",function(){return A}),c.d(l,"getLocalStorageOrThrow",function(){return L}),c.d(l,"getLocalStorage",function(){return H}),c.d(l,"getClientMeta",function(){return D}),c.d(l,"safeJsonParse",function(){return q}),c.d(l,"safeJsonStringify",function(){return k}),c.d(l,"setLocal",function(){return p}),c.d(l,"getLocal",function(){return x}),c.d(l,"removeLocal",function(){return R}),c.d(l,"mobileLinkChoiceKey",function(){return"WALLETCONNECT_DEEPLINK_CHOICE"}),c.d(l,"formatIOSMobile",function(){return r}),c.d(l,"saveMobileLinkInfo",function(){return a}),c.d(l,"getMobileRegistryEntry",function(){return g}),c.d(l,"getMobileLinkRegistry",function(){return M}),c.d(l,"getWalletRegistryUrl",function(){return C}),c.d(l,"getDappRegistryUrl",function(){return U}),c.d(l,"formatMobileRegistryEntry",function(){return V}),c.d(l,"formatMobileRegistry",function(){return I})},function(z,l){z.exports=m,m.strict=y,m.loose=n;var c=Object.prototype.toString,s={"[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 m(o){return y(o)||n(o)}function y(o){return o instanceof Int8Array||o instanceof Int16Array||o instanceof Int32Array||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Uint16Array||o instanceof Uint32Array||o instanceof Float32Array||o instanceof Float64Array}function n(o){return s[c.call(o)]}},function(z,l,c){"use strict";const s=c(174),m=c(175),y=c(176);function n(f){if("string"!=typeof f||1!==f.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(f,d){return d.encode?d.strict?s(f):encodeURIComponent(f):f}function e(f,d){return d.decode?m(f):f}function t(f){const d=f.indexOf("#");return-1!==d&&(f=f.slice(0,d)),f}function i(f){const d=(f=t(f)).indexOf("?");return-1===d?"":f.slice(d+1)}function u(f,d){return d.parseNumbers&&!Number.isNaN(Number(f))&&"string"==typeof f&&""!==f.trim()?f=Number(f):!d.parseBooleans||null===f||"true"!==f.toLowerCase()&&"false"!==f.toLowerCase()||(f="true"===f.toLowerCase()),f}function h(f,d){n((d=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},d)).arrayFormatSeparator);const _=function(T){let O;switch(T.arrayFormat){case"index":return(b,S,w)=>{O=/\[(\d*)\]$/.exec(b),b=b.replace(/\[\d*\]$/,""),O?(void 0===w[b]&&(w[b]={}),w[b][O[1]]=S):w[b]=S};case"bracket":return(b,S,w)=>{O=/(\[\])$/.exec(b),w[b=b.replace(/\[\]$/,"")]=O?void 0!==w[b]?[].concat(w[b],S):[S]:S};case"comma":case"separator":return(b,S,w)=>{const A="string"==typeof S&&S.split("").indexOf(T.arrayFormatSeparator)>-1?S.split(T.arrayFormatSeparator).map(L=>e(L,T)):null===S?S:e(S,T);w[b]=A};default:return(b,S,w)=>{w[b]=void 0!==w[b]?[].concat(w[b],S):S}}}(d),v=Object.create(null);if("string"!=typeof f||!(f=f.trim().replace(/^[?#&]/,"")))return v;for(const T of f.split("&")){let[O,b]=y(d.decode?T.replace(/\+/g," "):T,"=");b=void 0===b?null:["comma","separator"].includes(d.arrayFormat)?b:e(b,d),_(e(O,d),b,v)}for(const T of Object.keys(v)){const O=v[T];if("object"==typeof O&&null!==O)for(const b of Object.keys(O))O[b]=u(O[b],d);else v[T]=u(O,d)}return!1===d.sort?v:(!0===d.sort?Object.keys(v).sort():Object.keys(v).sort(d.sort)).reduce((T,O)=>{const b=v[O];return T[O]=Boolean(b)&&"object"==typeof b&&!Array.isArray(b)?function S(w){return Array.isArray(w)?w.sort():"object"==typeof w?S(Object.keys(w)).sort((A,L)=>Number(A)-Number(L)).map(A=>w[A]):w}(b):b,T},Object.create(null))}l.extract=i,l.parse=h,l.stringify=(f,d)=>{if(!f)return"";n((d=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},d)).arrayFormatSeparator);const _=b=>d.skipNull&&null==f[b]||d.skipEmptyString&&""===f[b],v=function(b){switch(b.arrayFormat){case"index":return S=>(w,A)=>{const L=w.length;return void 0===A||b.skipNull&&null===A||b.skipEmptyString&&""===A?w:null===A?[...w,[o(S,b),"[",L,"]"].join("")]:[...w,[o(S,b),"[",o(L,b),"]=",o(A,b)].join("")]};case"bracket":return S=>(w,A)=>void 0===A||b.skipNull&&null===A||b.skipEmptyString&&""===A?w:null===A?[...w,[o(S,b),"[]"].join("")]:[...w,[o(S,b),"[]=",o(A,b)].join("")];case"comma":case"separator":return S=>(w,A)=>null==A||0===A.length?w:0===w.length?[[o(S,b),"=",o(A,b)].join("")]:[[w,o(A,b)].join(b.arrayFormatSeparator)];default:return S=>(w,A)=>void 0===A||b.skipNull&&null===A||b.skipEmptyString&&""===A?w:null===A?[...w,o(S,b)]:[...w,[o(S,b),"=",o(A,b)].join("")]}}(d),T={};for(const b of Object.keys(f))_(b)||(T[b]=f[b]);const O=Object.keys(T);return!1!==d.sort&&O.sort(d.sort),O.map(b=>{const S=f[b];return void 0===S?"":null===S?o(b,d):Array.isArray(S)?S.reduce(v(b),[]).join("&"):o(b,d)+"="+o(S,d)}).filter(b=>b.length>0).join("&")},l.parseUrl=(f,d)=>{d=Object.assign({decode:!0},d);const[_,v]=y(f,"#");return Object.assign({url:_.split("?")[0]||"",query:h(i(f),d)},d&&d.parseFragmentIdentifier&&v?{fragmentIdentifier:e(v,d)}:{})},l.stringifyUrl=(f,d)=>{d=Object.assign({encode:!0,strict:!0},d);const _=t(f.url).split("?")[0]||"",v=l.extract(f.url),T=l.parse(v,{sort:!1}),O=Object.assign(T,f.query);let b=l.stringify(O,d);b&&(b="?"+b);let S=function(w){let A="";const L=w.indexOf("#");return-1!==L&&(A=w.slice(L)),A}(f.url);return f.fragmentIdentifier&&(S="#"+o(f.fragmentIdentifier,d)),`${_}${b}${S}`}},function(z,l){var c={}.toString;z.exports=Array.isArray||function(s){return"[object Array]"==c.call(s)}},function(z,l,c){"use strict";var s=c(8);c.o(s,"payloadId")&&c.d(l,"payloadId",function(){return s.payloadId})},function(z,l,c){"use strict";function s(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}c.d(l,"a",function(){return s}),c(24),c(7)},function(z,l,c){},function(z,l,c){"use strict";c(84)},function(z,l,c){"use strict";c(85),c(41),c(86),c(87)},function(z,l){},function(z,l,c){"use strict";c(41)},function(z,l){},function(z,l,c){},function(z,l,c){},function(z,l,c){"use strict";c.d(l,"a",function(){return m});var s=c(8);function m(y){return s.getBrowerCrypto().getRandomValues(new Uint8Array(y))}},function(z,l,c){"use strict";c.d(l,"b",function(){return m}),c.d(l,"a",function(){return y});var s=c(14);function m(n,o,e){return Object(s.b)(n,o,e)}function y(n,o,e){return Object(s.a)(n,o,e)}},function(z,l,c){"use strict";c.d(l,"a",function(){return m});var s=c(14);function m(n,o){return y.apply(this,arguments)}function y(){return(y=ge(function*(n,o){return yield Object(s.c)(n,o)})).apply(this,arguments)}c(42)},function(z,l,c){"use strict";var s=c(8);c.o(s,"isConstantTime")&&c.d(l,"isConstantTime",function(){return s.isConstantTime})},function(z,l,c){},function(z,l){},function(z,l,c){"use strict";function s(m,y){if(m.length!==y.length)return!1;let n=0;for(let o=0;o=1&&c<=40}},function(z,l){var c="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",s="(?:(?![A-Z0-9 $%*+\\-./:]|"+(c=c.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";l.KANJI=new RegExp(c,"g"),l.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),l.BYTE=new RegExp(s,"g"),l.NUMERIC=new RegExp("[0-9]+","g"),l.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var m=new RegExp("^"+c+"$"),y=new RegExp("^[0-9]+$"),n=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");l.testKanji=function(o){return m.test(o)},l.testNumeric=function(o){return y.test(o)},l.testAlphanumeric=function(o){return n.test(o)}},function(z,l){function c(s){if("number"==typeof s&&(s=s.toString()),"string"!=typeof s)throw new Error("Color should be defined as hex string");var m=s.slice().replace("#","").split("");if(m.length<3||5===m.length||m.length>8)throw new Error("Invalid hex color: "+s);3!==m.length&&4!==m.length||(m=Array.prototype.concat.apply([],m.map(function(n){return[n,n]}))),6===m.length&&m.push("F","F");var y=parseInt(m.join(""),16);return{r:y>>24&255,g:y>>16&255,b:y>>8&255,a:255&y,hex:"#"+m.slice(0,6).join("")}}l.getOptions=function(s){s||(s={}),s.color||(s.color={});var y=s.width&&s.width>=21?s.width:void 0;return{width:y,scale:y?4:s.scale||4,margin:null==s.margin||s.margin<0?4:s.margin,color:{dark:c(s.color.dark||"#000000ff"),light:c(s.color.light||"#ffffffff")},type:s.type,rendererOpts:s.rendererOpts||{}}},l.getScale=function(s,m){return m.width&&m.width>=s+2*m.margin?m.width/(s+2*m.margin):m.scale},l.getImageWidth=function(s,m){var y=l.getScale(s,m);return Math.floor((s+2*m.margin)*y)},l.qrToImageData=function(s,m,y){for(var n=m.modules.size,o=m.modules.data,e=l.getScale(n,y),t=Math.floor((n+2*y.margin)*e),i=y.margin*e,u=[y.color.light,y.color.dark],h=0;h=i&&f>=i&&hu._pos){var d=f.substr(u._pos);if("x-user-defined"===u._charset){for(var _=new m(d.length),v=0;vu._pos&&(u.push(new m(new Uint8Array(T.result.slice(u._pos)))),u._pos=T.result.byteLength)},T.onload=function(){u.push(null)},T.readAsArrayBuffer(f)}u._xhr.readyState===t.DONE&&"ms-stream"!==u._mode&&u.push(null)}}).call(this,c(5),c(2).Buffer,c(6))},function(z,l,c){"use strict";(function(s,m){var y=c(43);z.exports=S;var n,o=c(79);S.ReadableState=b,c(12);var e=function(E,C){return E.listeners(C).length},t=c(106),i=c(52).Buffer,u=s.Uint8Array||function(){},h=Object.create(c(35));h.inherits=c(3);var f=c(205),d=void 0;d=f&&f.debuglog?f.debuglog("stream"):function(){};var _,v=c(206),T=c(107);h.inherits(S,t);var O=["error","close","destroy","pause","resume"];function b(E,C){E=E||{};var U=C instanceof(n=n||c(19));this.objectMode=!!E.objectMode,U&&(this.objectMode=this.objectMode||!!E.readableObjectMode);var V=E.highWaterMark,I=E.readableHighWaterMark;this.highWaterMark=V||0===V?V:U&&(I||0===I)?I:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new v,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=E.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,E.encoding&&(_||(_=c(20).StringDecoder),this.decoder=new _(E.encoding),this.encoding=E.encoding)}function S(E){if(n=n||c(19),!(this instanceof S))return new S(E);this._readableState=new b(E,this),this.readable=!0,E&&("function"==typeof E.read&&(this._read=E.read),"function"==typeof E.destroy&&(this._destroy=E.destroy)),t.call(this)}function w(E,C,U,V,I){var W,B,N,P,j,F=E._readableState;return null===C?(F.reading=!1,function(B,N){if(!N.ended){if(N.decoder){var P=N.decoder.end();P&&P.length&&(N.buffer.push(P),N.length+=N.objectMode?1:P.length)}N.ended=!0,H(B)}}(E,F)):(I||(B=F,i.isBuffer(j=N=C)||j instanceof u||"string"==typeof N||void 0===N||B.objectMode||(P=new TypeError("Invalid non-string/buffer chunk")),W=P),W?E.emit("error",W):F.objectMode||C&&C.length>0?("string"==typeof C||F.objectMode||Object.getPrototypeOf(C)===i.prototype||(C=function(B){return i.from(B)}(C)),V?F.endEmitted?E.emit("error",new Error("stream.unshift() after end event")):A(E,F,C,!0):F.ended?E.emit("error",new Error("stream.push() after EOF")):(F.reading=!1,F.decoder&&!U?(C=F.decoder.write(C),F.objectMode||0!==C.length?A(E,F,C,!1):q(E,F)):A(E,F,C,!1))):V||(F.reading=!1)),function(B){return!B.ended&&(B.needReadable||B.lengthC.highWaterMark&&(C.highWaterMark=((U=E)>=8388608?U=8388608:(U--,U|=U>>>1,U|=U>>>2,U|=U>>>4,U|=U>>>8,U|=U>>>16,U++),U)),E<=C.length?E:C.ended?C.length:(C.needReadable=!0,0));var U}function H(E){var C=E._readableState;C.needReadable=!1,C.emittedReadable||(d("emitReadable",C.flowing),C.emittedReadable=!0,C.sync?y.nextTick(D,E):D(E))}function D(E){d("emit readable"),E.emit("readable"),R(E)}function q(E,C){C.readingMore||(C.readingMore=!0,y.nextTick(k,E,C))}function k(E,C){for(var U=C.length;!C.reading&&!C.flowing&&!C.ended&&C.length=C.length?(U=C.decoder?C.buffer.join(""):1===C.buffer.length?C.buffer.head.data:C.buffer.concat(C.length),C.buffer.clear()):(W=C.decoder,(V=E)<(I=C.buffer).head.data.length?(F=I.head.data.slice(0,V),I.head.data=I.head.data.slice(V)):F=V===I.head.data.length?I.shift():W?function(B,N){var P=N.head,j=1,K=P.data;for(B-=K.length;P=P.next;){var Z=P.data,J=B>Z.length?Z.length:B;if(K+=J===Z.length?Z:Z.slice(0,B),0==(B-=J)){J===Z.length?(++j,N.head=P.next?P.next:N.tail=null):(N.head=P,P.data=Z.slice(J));break}++j}return N.length-=j,K}(V,I):function(B,N){var P=i.allocUnsafe(B),j=N.head,K=1;for(j.data.copy(P),B-=j.data.length;j=j.next;){var Z=j.data,J=B>Z.length?Z.length:B;if(Z.copy(P,P.length-B,0,J),0==(B-=J)){J===Z.length?(++K,N.head=j.next?j.next:N.tail=null):(N.head=j,j.data=Z.slice(J));break}++K}return N.length-=K,P}(V,I),U=F),U);var V,I,W,F,U}function a(E){var C=E._readableState;if(C.length>0)throw new Error('"endReadable()" called on non-empty stream');C.endEmitted||(C.ended=!0,y.nextTick(g,C,E))}function g(E,C){E.endEmitted||0!==E.length||(E.endEmitted=!0,C.readable=!1,C.emit("end"))}function M(E,C){for(var U=0,V=E.length;U=C.highWaterMark||C.ended))return d("read: emitReadable",C.length,C.ended),0===C.length&&C.ended?a(this):H(this),null;if(0===(E=L(E,C))&&C.ended)return 0===C.length&&a(this),null;var V,I=C.needReadable;return d("need readable",I),(0===C.length||C.length-E0?r(E,C):null)?(C.needReadable=!0,E=0):C.length-=E,0===C.length&&(C.ended||(C.needReadable=!0),U!==E&&C.ended&&a(this)),null!==V&&this.emit("data",V),V},S.prototype._read=function(E){this.emit("error",new Error("_read() is not implemented"))},S.prototype.pipe=function(E,C){var U=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=E;break;case 1:V.pipes=[V.pipes,E];break;default:V.pipes.push(E)}V.pipesCount+=1,d("pipe count=%d opts=%j",V.pipesCount,C);var I=C&&!1===C.end||E===m.stdout||E===m.stderr?X:F;function F(){d("onend"),E.end()}V.endEmitted?y.nextTick(I):U.once("end",I),E.on("unpipe",function W(ee,te){d("onunpipe"),ee===U&&te&&!1===te.hasUnpiped&&(te.hasUnpiped=!0,d("cleanup"),E.removeListener("close",Z),E.removeListener("finish",J),E.removeListener("drain",B),E.removeListener("error",K),E.removeListener("unpipe",W),U.removeListener("end",F),U.removeListener("end",X),U.removeListener("data",j),N=!0,!V.awaitDrain||E._writableState&&!E._writableState.needDrain||B())});var ee,B=(ee=U,function(){var te=ee._readableState;d("pipeOnDrain",te.awaitDrain),te.awaitDrain&&te.awaitDrain--,0===te.awaitDrain&&e(ee,"data")&&(te.flowing=!0,R(ee))});E.on("drain",B);var N=!1,P=!1;function j(ee){d("ondata"),P=!1,!1!==E.write(ee)||P||((1===V.pipesCount&&V.pipes===E||V.pipesCount>1&&-1!==M(V.pipes,E))&&!N&&(d("false write response, pause",U._readableState.awaitDrain),U._readableState.awaitDrain++,P=!0),U.pause())}function K(ee){d("onerror",ee),X(),E.removeListener("error",K),0===e(E,"error")&&E.emit("error",ee)}function Z(){E.removeListener("finish",J),X()}function J(){d("onfinish"),E.removeListener("close",Z),X()}function X(){d("unpipe"),U.unpipe(E)}return U.on("data",j),function(ee,te,oe){if("function"==typeof ee.prependListener)return ee.prependListener(te,oe);ee._events&&ee._events[te]?o(ee._events[te])?ee._events[te].unshift(oe):ee._events[te]=[oe,ee._events[te]]:ee.on(te,oe)}(E,"error",K),E.once("close",Z),E.once("finish",J),E.emit("pipe",U),V.flowing||(d("pipe resume"),U.resume()),E},S.prototype.unpipe=function(E){var C=this._readableState,U={hasUnpiped:!1};if(0===C.pipesCount)return this;if(1===C.pipesCount)return E&&E!==C.pipes||(E||(E=C.pipes),C.pipes=null,C.pipesCount=0,C.flowing=!1,E&&E.emit("unpipe",this,U)),this;if(!E){var V=C.pipes,I=C.pipesCount;C.pipes=null,C.pipesCount=0,C.flowing=!1;for(var W=0;W=0&&(o._idleTimeoutId=setTimeout(function(){o._onTimeout&&o._onTimeout()},e))},c(208),l.setImmediate=typeof self<"u"&&self.setImmediate||void 0!==s&&s.setImmediate||this&&this.setImmediate,l.clearImmediate=typeof self<"u"&&self.clearImmediate||void 0!==s&&s.clearImmediate||this&&this.clearImmediate}).call(this,c(6))},function(z,l,c){"use strict";z.exports=n;var s=c(19),m=Object.create(c(35));function y(t,i){var u=this._transformState;u.transforming=!1;var h=u.writecb;if(!h)return this.emit("error",new Error("write callback called multiple times"));u.writechunk=null,u.writecb=null,null!=i&&this.push(i),h(t);var f=this._readableState;f.reading=!1,(f.needReadable||f.length0)if("string"==typeof N||J.objectMode||Object.getPrototypeOf(N)===e.prototype||(N=function(X){return e.from(X)}(N)),j)J.endEmitted?L(B,new A):p(B,J,N,!0);else if(J.ended)L(B,new S);else{if(J.destroyed)return!1;J.reading=!1,J.decoder&&!P?(N=J.decoder.write(N),J.objectMode||0!==N.length?p(B,J,N,!1):a(B,J)):p(B,J,N,!1)}else j||(J.reading=!1,a(B,J));return!J.ended&&(J.lengthN.highWaterMark&&(N.highWaterMark=((P=B)>=1073741824?P=1073741824:(P--,P|=P>>>1,P|=P>>>2,P|=P>>>4,P|=P>>>8,P|=P>>>16,P++),P)),B<=N.length?B:N.ended?N.length:(N.needReadable=!0,0));var P}function R(B){var N=B._readableState;i("emitReadable",N.needReadable,N.emittedReadable),N.needReadable=!1,N.emittedReadable||(i("emitReadable",N.flowing),N.emittedReadable=!0,m.nextTick(r,B))}function r(B){var N=B._readableState;i("emitReadable_",N.destroyed,N.length,N.ended),N.destroyed||!N.length&&!N.ended||(B.emit("readable"),N.emittedReadable=!1),N.needReadable=!N.flowing&&!N.ended&&N.length<=N.highWaterMark,U(B)}function a(B,N){N.readingMore||(N.readingMore=!0,m.nextTick(g,B,N))}function g(B,N){for(;!N.reading&&!N.ended&&(N.length0,N.resumeScheduled&&!N.paused?N.flowing=!0:B.listenerCount("data")>0&&B.resume()}function E(B){i("readable nexttick read 0"),B.read(0)}function C(B,N){i("resume",N.reading),N.reading||B.read(0),N.resumeScheduled=!1,B.emit("resume"),U(B),N.flowing&&!N.reading&&B.read(0)}function U(B){var N=B._readableState;for(i("flow",N.flowing);N.flowing&&null!==B.read(););}function V(B,N){return 0===N.length?null:(N.objectMode?P=N.buffer.shift():!B||B>=N.length?(P=N.decoder?N.buffer.join(""):1===N.buffer.length?N.buffer.first():N.buffer.concat(N.length),N.buffer.clear()):P=N.buffer.consume(B,N.decoder),P);var P}function I(B){var N=B._readableState;i("endReadable",N.endEmitted),N.endEmitted||(N.ended=!0,m.nextTick(W,N,B))}function W(B,N){if(i("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&0===B.length&&(B.endEmitted=!0,N.readable=!1,N.emit("end"),B.autoDestroy)){var P=N._writableState;(!P||P.autoDestroy&&P.finished)&&N.destroy()}}function F(B,N){for(var P=0,j=B.length;P=N.highWaterMark:N.length>0)||N.ended))return i("read: emitReadable",N.length,N.ended),0===N.length&&N.ended?I(this):R(this),null;if(0===(B=x(B,N))&&N.ended)return 0===N.length&&I(this),null;var j,K=N.needReadable;return i("need readable",K),(0===N.length||N.length-B0?V(B,N):null)?(N.needReadable=N.length<=N.highWaterMark,B=0):(N.length-=B,N.awaitDrain=0),0===N.length&&(N.ended||(N.needReadable=!0),P!==B&&N.ended&&I(this)),null!==j&&this.emit("data",j),j},q.prototype._read=function(B){L(this,new w("_read()"))},q.prototype.pipe=function(B,N){var P=this,j=this._readableState;switch(j.pipesCount){case 0:j.pipes=B;break;case 1:j.pipes=[j.pipes,B];break;default:j.pipes.push(B)}j.pipesCount+=1,i("pipe count=%d opts=%j",j.pipesCount,N);var K=N&&!1===N.end||B===m.stdout||B===m.stderr?de:J;function J(){i("onend"),B.end()}j.endEmitted?m.nextTick(K):P.once("end",K),B.on("unpipe",function Z(fe,re){i("onunpipe"),fe===P&&re&&!1===re.hasUnpiped&&(re.hasUnpiped=!0,i("cleanup"),B.removeListener("close",ve),B.removeListener("finish",ie),B.removeListener("drain",X),B.removeListener("error",oe),B.removeListener("unpipe",Z),P.removeListener("end",J),P.removeListener("end",de),P.removeListener("data",te),ee=!0,!j.awaitDrain||B._writableState&&!B._writableState.needDrain||X())});var fe,X=(fe=P,function(){var re=fe._readableState;i("pipeOnDrain",re.awaitDrain),re.awaitDrain&&re.awaitDrain--,0===re.awaitDrain&&n(fe,"data")&&(re.flowing=!0,U(fe))});B.on("drain",X);var ee=!1;function te(fe){i("ondata");var re=B.write(fe);i("dest.write",re),!1===re&&((1===j.pipesCount&&j.pipes===B||j.pipesCount>1&&-1!==F(j.pipes,B))&&!ee&&(i("false write response, pause",j.awaitDrain),j.awaitDrain++),P.pause())}function oe(fe){i("onerror",fe),de(),B.removeListener("error",oe),0===n(B,"error")&&L(B,fe)}function ve(){B.removeListener("finish",ie),de()}function ie(){i("onfinish"),B.removeListener("close",ve),de()}function de(){i("unpipe"),P.unpipe(B)}return P.on("data",te),function(fe,re,_e){if("function"==typeof fe.prependListener)return fe.prependListener(re,_e);fe._events&&fe._events[re]?Array.isArray(fe._events[re])?fe._events[re].unshift(_e):fe._events[re]=[_e,fe._events[re]]:fe.on(re,_e)}(B,"error",oe),B.once("close",ve),B.once("finish",ie),B.emit("pipe",P),j.flowing||(i("pipe resume"),P.resume()),B},q.prototype.unpipe=function(B){var N=this._readableState,P={hasUnpiped:!1};if(0===N.pipesCount)return this;if(1===N.pipesCount)return B&&B!==N.pipes||(B||(B=N.pipes),N.pipes=null,N.pipesCount=0,N.flowing=!1,B&&B.emit("unpipe",this,P)),this;if(!B){var j=N.pipes,K=N.pipesCount;N.pipes=null,N.pipesCount=0,N.flowing=!1;for(var Z=0;Z0,!1!==j.flowing&&this.resume()):"readable"===B&&(j.endEmitted||j.readableListening||(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,i("on readable",j.length,j.reading),j.length?R(this):j.reading||m.nextTick(E,this))),P},q.prototype.removeListener=function(B,N){var P=o.prototype.removeListener.call(this,B,N);return"readable"===B&&m.nextTick(M,this),P},q.prototype.removeAllListeners=function(B){var N=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==B&&void 0!==B||m.nextTick(M,this),N},q.prototype.resume=function(){var P,B=this._readableState;return B.flowing||(i("resume"),B.flowing=!B.readableListening,this,(P=B).resumeScheduled||(P.resumeScheduled=!0,m.nextTick(C,this,P))),B.paused=!1,this},q.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},q.prototype.wrap=function(B){var N=this,P=this._readableState,j=!1;for(var K in B.on("end",function(){if(i("wrapped end"),P.decoder&&!P.ended){var J=P.decoder.end();J&&J.length&&N.push(J)}N.push(null)}),B.on("data",function(J){i("wrapped data"),P.decoder&&(J=P.decoder.write(J)),P.objectMode&&null==J||(P.objectMode||J&&J.length)&&(N.push(J)||(j=!0,B.pause()))}),B)void 0===this[K]&&"function"==typeof B[K]&&(this[K]=function(J){return function(){return B[J].apply(B,arguments)}}(K));for(var Z=0;Z-1))throw new A(g);return this._writableState.defaultEncoding=g,this},Object.defineProperty(q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),q.prototype._write=function(g,M,E){E(new v("_write()"))},q.prototype._writev=null,q.prototype.end=function(g,M,E){var U,V,I,C=this._writableState;return"function"==typeof g?(E=g,g=null,M=null):"function"==typeof M&&(E=M,M=null),null!=g&&this.write(g,M),C.corked&&(C.corked=1,this.uncork()),C.ending||(U=this,I=E,(V=C).ending=!0,a(U,V),I&&(V.finished?m.nextTick(I):U.once("finish",I)),V.ended=!0,U.writable=!1),this},Object.defineProperty(q.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(q.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(g){this._writableState&&(this._writableState.destroyed=g)}}),q.prototype.destroy=h.destroy,q.prototype._undestroy=h.undestroy,q.prototype._destroy=function(g,M){M(g)}}).call(this,c(6),c(5))},function(z,l,c){"use strict";z.exports=i;var s=c(27).codes,m=s.ERR_METHOD_NOT_IMPLEMENTED,y=s.ERR_MULTIPLE_CALLBACK,n=s.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=s.ERR_TRANSFORM_WITH_LENGTH_0,e=c(28);function t(f,d){var _=this._transformState;_.transforming=!1;var v=_.writecb;if(null===v)return this.emit("error",new y);_.writechunk=null,_.writecb=null,null!=d&&this.push(d),v(f);var T=this._readableState;T.reading=!1,(T.needReadable||T.length0&&u[u.length-1])||6!==T[0]&&2!==T[0])){f=0;continue}if(3===T[0]&&(!u||T[1]>u[0]&&T[1]>8,h=255&i;u?e.push(u,h):e.push(h)}return e},s.zero2=m,s.toHex=y,s.encode=function(n,o){return"hex"===o?y(n):n}},function(z,l,c){var s;function m(n){this.rand=n}if(z.exports=function(n){return s||(s=new m(null)),s.generate(n)},z.exports.Rand=m,m.prototype.generate=function(n){return this._rand(n)},m.prototype._rand=function(n){if(this.rand.getBytes)return this.rand.getBytes(n);for(var o=new Uint8Array(n),e=0;e>>3},l.g1_256=function(o){return s(o,17)^s(o,19)^o>>>10}},function(z,l,c){"use strict";var s=c(15),m=c(37),y=c(123),n=c(22),o=s.sum32,e=s.sum32_4,t=s.sum32_5,i=y.ch32,u=y.maj32,h=y.s0_256,f=y.s1_256,d=y.g0_256,_=y.g1_256,v=m.BlockHash,T=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function O(){if(!(this instanceof O))return new O;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=T,this.W=new Array(64)}s.inherits(O,v),z.exports=O,O.blockSize=512,O.outSize=256,O.hmacStrength=192,O.padLength=64,O.prototype._update=function(b,S){for(var w=this.W,A=0;A<16;A++)w[A]=b[S+A];for(;A=this._blockSize;){for(var i=this._blockOffset;i0;++u)this._length[u]+=h,(h=this._length[u]/4294967296|0)>0&&(this._length[u]-=4294967296*h);return this},y.prototype._update=function(){throw new Error("_update is not implemented")},y.prototype.digest=function(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var o=this._digest();void 0!==n&&(o=o.toString(n)),this._block.fill(0),this._blockOffset=0;for(var e=0;e<4;++e)this._length[e]=0;return o},y.prototype._digest=function(){throw new Error("_digest is not implemented")},z.exports=y},function(z,l,c){"use strict";(function(s,m){var y;z.exports=q,q.ReadableState=D,c(12);var i,n=function(B,N){return B.listeners(N).length},o=c(129),e=c(2).Buffer,t=s.Uint8Array||function(){},u=c(273);i=u&&u.debuglog?u.debuglog("stream"):function(){};var h,f,d,_=c(274),v=c(130),T=c(131).getHighWaterMark,O=c(29).codes,b=O.ERR_INVALID_ARG_TYPE,S=O.ERR_STREAM_PUSH_AFTER_EOF,w=O.ERR_METHOD_NOT_IMPLEMENTED,A=O.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;c(3)(q,o);var L=v.errorOrDestroy,H=["error","close","destroy","pause","resume"];function D(B,N,P){y=y||c(30),"boolean"!=typeof P&&(P=N instanceof y),this.objectMode=!!(B=B||{}).objectMode,P&&(this.objectMode=this.objectMode||!!B.readableObjectMode),this.highWaterMark=T(this,B,"readableHighWaterMark",P),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==B.emitClose,this.autoDestroy=!!B.autoDestroy,this.destroyed=!1,this.defaultEncoding=B.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,B.encoding&&(h||(h=c(20).StringDecoder),this.decoder=new h(B.encoding),this.encoding=B.encoding)}function q(B){if(y=y||c(30),!(this instanceof q))return new q(B);this._readableState=new D(B,this,this instanceof y),this.readable=!0,B&&("function"==typeof B.read&&(this._read=B.read),"function"==typeof B.destroy&&(this._destroy=B.destroy)),o.call(this)}function k(B,N,P,j,K){i("readableAddChunk",N);var Z,X,ee,te,oe,J=B._readableState;if(null===N)J.reading=!1,function(X,ee){if(i("onEofChunk"),!ee.ended){if(ee.decoder){var te=ee.decoder.end();te&&te.length&&(ee.buffer.push(te),ee.length+=ee.objectMode?1:te.length)}ee.ended=!0,ee.sync?R(X):(ee.needReadable=!1,ee.emittedReadable||(ee.emittedReadable=!0,r(X)))}}(B,J);else if(K||(X=J,e.isBuffer(oe=ee=N)||oe instanceof t||"string"==typeof ee||void 0===ee||X.objectMode||(te=new b("chunk",["string","Buffer","Uint8Array"],ee)),Z=te),Z)L(B,Z);else if(J.objectMode||N&&N.length>0)if("string"==typeof N||J.objectMode||Object.getPrototypeOf(N)===e.prototype||(N=function(X){return e.from(X)}(N)),j)J.endEmitted?L(B,new A):p(B,J,N,!0);else if(J.ended)L(B,new S);else{if(J.destroyed)return!1;J.reading=!1,J.decoder&&!P?(N=J.decoder.write(N),J.objectMode||0!==N.length?p(B,J,N,!1):a(B,J)):p(B,J,N,!1)}else j||(J.reading=!1,a(B,J));return!J.ended&&(J.lengthN.highWaterMark&&(N.highWaterMark=((P=B)>=1073741824?P=1073741824:(P--,P|=P>>>1,P|=P>>>2,P|=P>>>4,P|=P>>>8,P|=P>>>16,P++),P)),B<=N.length?B:N.ended?N.length:(N.needReadable=!0,0));var P}function R(B){var N=B._readableState;i("emitReadable",N.needReadable,N.emittedReadable),N.needReadable=!1,N.emittedReadable||(i("emitReadable",N.flowing),N.emittedReadable=!0,m.nextTick(r,B))}function r(B){var N=B._readableState;i("emitReadable_",N.destroyed,N.length,N.ended),N.destroyed||!N.length&&!N.ended||(B.emit("readable"),N.emittedReadable=!1),N.needReadable=!N.flowing&&!N.ended&&N.length<=N.highWaterMark,U(B)}function a(B,N){N.readingMore||(N.readingMore=!0,m.nextTick(g,B,N))}function g(B,N){for(;!N.reading&&!N.ended&&(N.length0,N.resumeScheduled&&!N.paused?N.flowing=!0:B.listenerCount("data")>0&&B.resume()}function E(B){i("readable nexttick read 0"),B.read(0)}function C(B,N){i("resume",N.reading),N.reading||B.read(0),N.resumeScheduled=!1,B.emit("resume"),U(B),N.flowing&&!N.reading&&B.read(0)}function U(B){var N=B._readableState;for(i("flow",N.flowing);N.flowing&&null!==B.read(););}function V(B,N){return 0===N.length?null:(N.objectMode?P=N.buffer.shift():!B||B>=N.length?(P=N.decoder?N.buffer.join(""):1===N.buffer.length?N.buffer.first():N.buffer.concat(N.length),N.buffer.clear()):P=N.buffer.consume(B,N.decoder),P);var P}function I(B){var N=B._readableState;i("endReadable",N.endEmitted),N.endEmitted||(N.ended=!0,m.nextTick(W,N,B))}function W(B,N){if(i("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&0===B.length&&(B.endEmitted=!0,N.readable=!1,N.emit("end"),B.autoDestroy)){var P=N._writableState;(!P||P.autoDestroy&&P.finished)&&N.destroy()}}function F(B,N){for(var P=0,j=B.length;P=N.highWaterMark:N.length>0)||N.ended))return i("read: emitReadable",N.length,N.ended),0===N.length&&N.ended?I(this):R(this),null;if(0===(B=x(B,N))&&N.ended)return 0===N.length&&I(this),null;var j,K=N.needReadable;return i("need readable",K),(0===N.length||N.length-B0?V(B,N):null)?(N.needReadable=N.length<=N.highWaterMark,B=0):(N.length-=B,N.awaitDrain=0),0===N.length&&(N.ended||(N.needReadable=!0),P!==B&&N.ended&&I(this)),null!==j&&this.emit("data",j),j},q.prototype._read=function(B){L(this,new w("_read()"))},q.prototype.pipe=function(B,N){var P=this,j=this._readableState;switch(j.pipesCount){case 0:j.pipes=B;break;case 1:j.pipes=[j.pipes,B];break;default:j.pipes.push(B)}j.pipesCount+=1,i("pipe count=%d opts=%j",j.pipesCount,N);var K=N&&!1===N.end||B===m.stdout||B===m.stderr?de:J;function J(){i("onend"),B.end()}j.endEmitted?m.nextTick(K):P.once("end",K),B.on("unpipe",function Z(fe,re){i("onunpipe"),fe===P&&re&&!1===re.hasUnpiped&&(re.hasUnpiped=!0,i("cleanup"),B.removeListener("close",ve),B.removeListener("finish",ie),B.removeListener("drain",X),B.removeListener("error",oe),B.removeListener("unpipe",Z),P.removeListener("end",J),P.removeListener("end",de),P.removeListener("data",te),ee=!0,!j.awaitDrain||B._writableState&&!B._writableState.needDrain||X())});var fe,X=(fe=P,function(){var re=fe._readableState;i("pipeOnDrain",re.awaitDrain),re.awaitDrain&&re.awaitDrain--,0===re.awaitDrain&&n(fe,"data")&&(re.flowing=!0,U(fe))});B.on("drain",X);var ee=!1;function te(fe){i("ondata");var re=B.write(fe);i("dest.write",re),!1===re&&((1===j.pipesCount&&j.pipes===B||j.pipesCount>1&&-1!==F(j.pipes,B))&&!ee&&(i("false write response, pause",j.awaitDrain),j.awaitDrain++),P.pause())}function oe(fe){i("onerror",fe),de(),B.removeListener("error",oe),0===n(B,"error")&&L(B,fe)}function ve(){B.removeListener("finish",ie),de()}function ie(){i("onfinish"),B.removeListener("close",ve),de()}function de(){i("unpipe"),P.unpipe(B)}return P.on("data",te),function(fe,re,_e){if("function"==typeof fe.prependListener)return fe.prependListener(re,_e);fe._events&&fe._events[re]?Array.isArray(fe._events[re])?fe._events[re].unshift(_e):fe._events[re]=[_e,fe._events[re]]:fe.on(re,_e)}(B,"error",oe),B.once("close",ve),B.once("finish",ie),B.emit("pipe",P),j.flowing||(i("pipe resume"),P.resume()),B},q.prototype.unpipe=function(B){var N=this._readableState,P={hasUnpiped:!1};if(0===N.pipesCount)return this;if(1===N.pipesCount)return B&&B!==N.pipes||(B||(B=N.pipes),N.pipes=null,N.pipesCount=0,N.flowing=!1,B&&B.emit("unpipe",this,P)),this;if(!B){var j=N.pipes,K=N.pipesCount;N.pipes=null,N.pipesCount=0,N.flowing=!1;for(var Z=0;Z0,!1!==j.flowing&&this.resume()):"readable"===B&&(j.endEmitted||j.readableListening||(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,i("on readable",j.length,j.reading),j.length?R(this):j.reading||m.nextTick(E,this))),P},q.prototype.removeListener=function(B,N){var P=o.prototype.removeListener.call(this,B,N);return"readable"===B&&m.nextTick(M,this),P},q.prototype.removeAllListeners=function(B){var N=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==B&&void 0!==B||m.nextTick(M,this),N},q.prototype.resume=function(){var P,B=this._readableState;return B.flowing||(i("resume"),B.flowing=!B.readableListening,this,(P=B).resumeScheduled||(P.resumeScheduled=!0,m.nextTick(C,this,P))),B.paused=!1,this},q.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},q.prototype.wrap=function(B){var N=this,P=this._readableState,j=!1;for(var K in B.on("end",function(){if(i("wrapped end"),P.decoder&&!P.ended){var J=P.decoder.end();J&&J.length&&N.push(J)}N.push(null)}),B.on("data",function(J){i("wrapped data"),P.decoder&&(J=P.decoder.write(J)),P.objectMode&&null==J||(P.objectMode||J&&J.length)&&(N.push(J)||(j=!0,B.pause()))}),B)void 0===this[K]&&"function"==typeof B[K]&&(this[K]=function(J){return function(){return B[J].apply(B,arguments)}}(K));for(var Z=0;Z-1))throw new A(g);return this._writableState.defaultEncoding=g,this},Object.defineProperty(q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),q.prototype._write=function(g,M,E){E(new v("_write()"))},q.prototype._writev=null,q.prototype.end=function(g,M,E){var U,V,I,C=this._writableState;return"function"==typeof g?(E=g,g=null,M=null):"function"==typeof M&&(E=M,M=null),null!=g&&this.write(g,M),C.corked&&(C.corked=1,this.uncork()),C.ending||(U=this,I=E,(V=C).ending=!0,a(U,V),I&&(V.finished?m.nextTick(I):U.once("finish",I)),V.ended=!0,U.writable=!1),this},Object.defineProperty(q.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(q.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(g){this._writableState&&(this._writableState.destroyed=g)}}),q.prototype.destroy=h.destroy,q.prototype._undestroy=h.undestroy,q.prototype._destroy=function(g,M){M(g)}}).call(this,c(6),c(5))},function(z,l,c){"use strict";z.exports=i;var s=c(29).codes,m=s.ERR_METHOD_NOT_IMPLEMENTED,y=s.ERR_MULTIPLE_CALLBACK,n=s.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=s.ERR_TRANSFORM_WITH_LENGTH_0,e=c(30);function t(f,d){var _=this._transformState;_.transforming=!1;var v=_.writecb;if(null===v)return this.emit("error",new y);_.writechunk=null,_.writecb=null,null!=d&&this.push(d),v(f);var T=this._readableState;T.reading=!1,(T.needReadable||T.length>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10)}function h(d){return(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7)}function f(d){return(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3}s(e,m),e.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},e.prototype._update=function(d){for(var _,v=this._w,T=0|this._a,O=0|this._b,b=0|this._c,S=0|this._d,w=0|this._e,A=0|this._f,L=0|this._g,H=0|this._h,D=0;D<16;++D)v[D]=d.readInt32BE(4*D);for(;D<64;++D)v[D]=0|(((_=v[D-2])>>>17|_<<15)^(_>>>19|_<<13)^_>>>10)+v[D-7]+f(v[D-15])+v[D-16];for(var q=0;q<64;++q){var k=H+h(w)+t(w,A,L)+n[q]+v[q]|0,p=u(T)+i(T,O,b)|0;H=L,L=A,A=w,w=S+k|0,S=b,b=O,O=T,T=k+p|0}this._a=T+this._a|0,this._b=O+this._b|0,this._c=b+this._c|0,this._d=S+this._d|0,this._e=w+this._e|0,this._f=A+this._f|0,this._g=L+this._g|0,this._h=H+this._h|0},e.prototype._hash=function(){var d=y.allocUnsafe(32);return d.writeInt32BE(this._a,0),d.writeInt32BE(this._b,4),d.writeInt32BE(this._c,8),d.writeInt32BE(this._d,12),d.writeInt32BE(this._e,16),d.writeInt32BE(this._f,20),d.writeInt32BE(this._g,24),d.writeInt32BE(this._h,28),d},z.exports=e},function(z,l,c){var s=c(3),m=c(31),y=c(13).Buffer,n=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],o=new Array(160);function e(){this.init(),this._w=o,m.call(this,128,112)}function t(O,b,S){return S^O&(b^S)}function i(O,b,S){return O&b|S&(O|b)}function u(O,b){return(O>>>28|b<<4)^(b>>>2|O<<30)^(b>>>7|O<<25)}function h(O,b){return(O>>>14|b<<18)^(O>>>18|b<<14)^(b>>>9|O<<23)}function f(O,b){return(O>>>1|b<<31)^(O>>>8|b<<24)^O>>>7}function d(O,b){return(O>>>1|b<<31)^(O>>>8|b<<24)^(O>>>7|b<<25)}function _(O,b){return(O>>>19|b<<13)^(b>>>29|O<<3)^O>>>6}function v(O,b){return(O>>>19|b<<13)^(b>>>29|O<<3)^(O>>>6|b<<26)}function T(O,b){return O>>>0>>0?1:0}s(e,m),e.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},e.prototype._update=function(O){for(var b=this._w,S=0|this._ah,w=0|this._bh,A=0|this._ch,L=0|this._dh,H=0|this._eh,D=0|this._fh,q=0|this._gh,k=0|this._hh,p=0|this._al,x=0|this._bl,R=0|this._cl,r=0|this._dl,a=0|this._el,g=0|this._fl,M=0|this._gl,E=0|this._hl,C=0;C<32;C+=2)b[C]=O.readInt32BE(4*C),b[C+1]=O.readInt32BE(4*C+4);for(;C<160;C+=2){var U=b[C-30],V=b[C-30+1],I=f(U,V),W=d(V,U),F=_(U=b[C-4],V=b[C-4+1]),B=v(V,U),j=b[C-32],K=b[C-32+1],Z=W+b[C-14+1]|0,J=I+b[C-14]+T(Z,W)|0;J=(J=J+F+T(Z=Z+B|0,B)|0)+j+T(Z=Z+K|0,K)|0,b[C]=J,b[C+1]=Z}for(var X=0;X<160;X+=2){J=b[X],Z=b[X+1];var ee=i(S,w,A),te=i(p,x,R),oe=u(S,p),ve=u(p,S),ie=h(H,a),de=h(a,H),fe=n[X],re=n[X+1],_e=t(H,D,q),Ke=t(a,g,M),pe=E+de|0,Te=k+ie+T(pe,E)|0;Te=(Te=(Te=Te+_e+T(pe=pe+Ke|0,Ke)|0)+fe+T(pe=pe+re|0,re)|0)+J+T(pe=pe+Z|0,Z)|0;var Ve=ve+te|0,be=oe+ee+T(Ve,ve)|0;k=q,E=M,q=D,M=g,D=H,g=a,H=L+Te+T(a=r+pe|0,r)|0,L=A,r=R,A=w,R=x,w=S,x=p,S=Te+be+T(p=pe+Ve|0,pe)|0}this._al=this._al+p|0,this._bl=this._bl+x|0,this._cl=this._cl+R|0,this._dl=this._dl+r|0,this._el=this._el+a|0,this._fl=this._fl+g|0,this._gl=this._gl+M|0,this._hl=this._hl+E|0,this._ah=this._ah+S+T(this._al,p)|0,this._bh=this._bh+w+T(this._bl,x)|0,this._ch=this._ch+A+T(this._cl,R)|0,this._dh=this._dh+L+T(this._dl,r)|0,this._eh=this._eh+H+T(this._el,a)|0,this._fh=this._fh+D+T(this._fl,g)|0,this._gh=this._gh+q+T(this._gl,M)|0,this._hh=this._hh+k+T(this._hl,E)|0},e.prototype._hash=function(){var O=y.allocUnsafe(64);function b(S,w,A){O.writeInt32BE(S,A),O.writeInt32BE(w,A+4)}return b(this._ah,this._al,0),b(this._bh,this._bl,8),b(this._ch,this._cl,16),b(this._dh,this._dl,24),b(this._eh,this._el,32),b(this._fh,this._fl,40),b(this._gh,this._gl,48),b(this._hh,this._hl,56),O},z.exports=e},function(z,l){z.exports=function(c){if("string"!=typeof c)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof c+", while checking isHexPrefixed.");return"0x"===c.slice(0,2)}},function(z,l,c){"use strict";const s=(m,y)=>function(){const n=y.promiseModule,o=new Array(arguments.length);for(let e=0;e{o.push(y.errorFirst?function(i,u){if(y.multiArgs){const h=new Array(arguments.length-1);for(let f=1;f{y=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},y);const n=e=>{const t=i=>"string"==typeof i?e===i:i.test(e);return y.include?y.include.some(t):!y.exclude.some(t)};let o;o="function"==typeof m?function(){return y.excludeMain?m.apply(this,arguments):s(m,y).apply(this,arguments)}:Object.create(Object.getPrototypeOf(m));for(const e in m){const t=m[e];o[e]="function"==typeof t&&n(e)?s(t,y):t}return o}},function(z,l,c){const s=c(44),m=c(296)();function y(e){this.currentProvider=e}function n(e){return function(){const t=this;var i=[].slice.call(arguments),u=i.pop();t.sendAsync({method:e,params:i},u)}}function o(e,t){return function(){const i=this;var u=[].slice.call(arguments),h=u.pop();u.length-1&&c%1==0&&c<=9007199254740991}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default={},z.exports=l.default},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(t){return function(i,u,h){if(h=(0,m.default)(h||s.default),t<=0||!i)return h(null);var f=(0,y.default)(i),d=!1,_=0,v=!1;function T(b,S){if(_-=1,b)d=!0,h(b);else{if(S===o.default||d&&_<=0)return d=!0,h(null);v||O()}}function O(){for(v=!0;_=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function n(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function o(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}z.exports={cacheIdentifierForPayload:function(e,t={}){if(!m(e))return null;const{includeBlockRef:i}=t,u=i?e.params:y(e);return e.method+":"+s(u)},canCache:m,blockTagForPayload:function(e){var t=n(e);return t>=e.params.length?null:e.params[t]},paramsWithoutBlockTag:y,blockTagParamIndex:n,cacheTypeForPayload:o}},function(z,l,c){var s=typeof JSON<"u"?JSON:c(330);z.exports=function(n,o){o||(o={}),"function"==typeof o&&(o={cmp:o});var e=o.space||"";"number"==typeof e&&(e=Array(e+1).join(" "));var t,i="boolean"==typeof o.cycles&&o.cycles,u=o.replacer||function(d,_){return _},h=o.cmp&&(t=o.cmp,function(d){return function(_,v){return t({key:_,value:d[_]},{key:v,value:d[v]})}}),f=[];return function d(_,v,T,O){var b=e?"\n"+new Array(O+1).join(e):"",S=e?": ":":";if(T&&T.toJSON&&"function"==typeof T.toJSON&&(T=T.toJSON()),void 0!==(T=u.call(_,v,T))){if("object"!=typeof T||null===T)return s.stringify(T);if(m(T)){for(var w=[],A=0;Afunction(){var I=ge(function*(W,F,B,N){(yield U.acquire())(),V(W,F,B,N)});return function(W,F,B,N){return I.apply(this,arguments)}}()}({mutex:O}),S=y({eth_newFilter:b(u(A)),eth_newBlockFilter:b(u(H)),eth_newPendingTransactionFilter:b(u(q)),eth_uninstallFilter:b(h(a)),eth_getFilterChanges:b(h(p)),eth_getFilterLogs:b(h(R))}),w=function(){var U=ge(function*({oldBlock:V,newBlock:I}){if(0===T.length)return;const W=yield O.acquire();try{yield Promise.all(f(T).map(function(){var F=ge(function*(B){try{yield B.update({oldBlock:V,newBlock:I})}catch(N){console.error(N)}});return function(B){return F.apply(this,arguments)}}()))}catch(F){console.error(F)}W()});return function(I){return U.apply(this,arguments)}}();return S.newLogFilter=A,S.newBlockFilter=H,S.newPendingTransactionFilter=q,S.uninstallFilter=a,S.getFilterChanges=p,S.getFilterLogs=R,S.destroy=()=>{ge(function*(){const U=f(T).length;T={},C({prevFilterCount:U,newFilterCount:0})})()},S;function A(U){return L.apply(this,arguments)}function L(){return(L=ge(function*(U){const V=new n({provider:_,params:U});return yield M(V),V})).apply(this,arguments)}function H(){return D.apply(this,arguments)}function D(){return(D=ge(function*(){const U=new o({provider:_});return yield M(U),U})).apply(this,arguments)}function q(){return k.apply(this,arguments)}function k(){return(k=ge(function*(){const U=new e({provider:_});return yield M(U),U})).apply(this,arguments)}function p(U){return x.apply(this,arguments)}function x(){return(x=ge(function*(U){const V=i(U),I=T[V];if(!I)throw new Error(`No filter for index "${V}"`);return I.getChangesAndClear()})).apply(this,arguments)}function R(U){return r.apply(this,arguments)}function r(){return(r=ge(function*(U){const V=i(U),I=T[V];if(!I)throw new Error(`No filter for index "${V}"`);return results="log"===I.type?I.getAllResults():[],results})).apply(this,arguments)}function a(U){return g.apply(this,arguments)}function g(){return g=ge(function*(U){const V=i(U),W=Boolean(T[V]);return W&&(yield(F=ge(function*(B){const N=f(T).length;delete T[B],C({prevFilterCount:N,newFilterCount:f(T).length})}),function(B){return F.apply(this,arguments)})(V)),W;var F}),g.apply(this,arguments)}function M(U){return E.apply(this,arguments)}function E(){return(E=ge(function*(U){const V=f(T).length,I=yield d.getLatestBlock();return yield U.initialize({currentBlock:I}),v++,T[v]=U,U.id=v,U.idHex=t(v),C({prevFilterCount:V,newFilterCount:f(T).length}),v})).apply(this,arguments)}function C({prevFilterCount:U,newFilterCount:V}){0===U&&V>0?d.on("sync",w):U>0&&0===V&&d.removeListener("sync",w)}}},function(z,l,c){"use strict";var s=this&&this.__createBinding||(Object.create?function(y,n,o,e){void 0===e&&(e=o),Object.defineProperty(y,e,{enumerable:!0,get:function(){return n[o]}})}:function(y,n,o,e){void 0===e&&(e=o),y[e]=n[o]}),m=this&&this.__exportStar||function(y,n){for(var o in y)"default"===o||Object.prototype.hasOwnProperty.call(n,o)||s(n,y,o)};Object.defineProperty(l,"__esModule",{value:!0}),m(c(340),l),m(c(341),l),m(c(342),l),m(c(153),l),m(c(154),l),m(c(346),l)},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.getUniqueId=void 0;let s=Math.floor(4294967295*Math.random());l.getUniqueId=function(){return s=(s+1)%4294967295,s}},function(z,l,c){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l,"__esModule",{value:!0}),l.JsonRpcEngine=void 0;const m=s(c(69)),y=c(343);class n extends m.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,i){if(i&&"function"!=typeof i)throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?i?this._handleBatch(t,i):this._handleBatch(t):i?this._handle(t,i):this._promiseHandle(t)}asMiddleware(){var t=this;return function(){var i=ge(function*(u,h,f,d){try{const[_,v,T]=yield n._runAllMiddleware(u,h,t._middleware);return v?(yield n._runReturnHandlers(T),d(_)):f(function(){var O=ge(function*(b){try{yield n._runReturnHandlers(T)}catch(S){return b(S)}return b()});return function(b){return O.apply(this,arguments)}}())}catch(_){return d(_)}});return function(u,h,f,d){return i.apply(this,arguments)}}()}_handleBatch(t,i){var u=this;return ge(function*(){try{const h=yield Promise.all(t.map(u._promiseHandle.bind(u)));return i?i(null,h):h}catch(h){if(i)return i(h);throw h}})()}_promiseHandle(t){return new Promise(i=>{this._handle(t,(u,h)=>{i(h)})})}_handle(t,i){var u=this;return ge(function*(){if(!t||Array.isArray(t)||"object"!=typeof t){const _=new y.EthereumRpcError(y.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof t,{request:t});return i(_,{id:void 0,jsonrpc:"2.0",error:_})}if("string"!=typeof t.method){const _=new y.EthereumRpcError(y.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof t.method,{request:t});return i(_,{id:t.id,jsonrpc:"2.0",error:_})}const h=Object.assign({},t),f={id:h.id,jsonrpc:h.jsonrpc};let d=null;try{yield u._processRequest(h,f)}catch(_){d=_}return d&&(delete f.result,f.error||(f.error=y.serializeError(d))),i(d,f)})()}_processRequest(t,i){var u=this;return ge(function*(){const[h,f,d]=yield n._runAllMiddleware(t,i,u._middleware);if(n._checkForCompletion(t,i,f),yield n._runReturnHandlers(d),h)throw h})()}static _runAllMiddleware(t,i,u){return ge(function*(){const h=[];let f=null,d=!1;for(const _ of u)if([f,d]=yield n._runMiddleware(t,i,_,h),d)break;return[f,d,h.reverse()]})()}static _runMiddleware(t,i,u,h){return new Promise(f=>{const d=v=>{const T=v||i.error;T&&(i.error=y.serializeError(T)),f([T,!0])},_=v=>{i.error?d(i.error):(v&&("function"!=typeof v&&d(new y.EthereumRpcError(y.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof v}" for request:\n${o(t)}`,{request:t})),h.push(v)),f([null,!1]))};try{u(t,i,_,d)}catch(v){d(v)}})}static _runReturnHandlers(t){return ge(function*(){for(const i of t)yield new Promise((u,h)=>{i(f=>f?h(f):u())})})()}static _checkForCompletion(t,i,u){if(!("result"in i)&&!("error"in i))throw new y.EthereumRpcError(y.errorCodes.rpc.internal,"JsonRpcEngine: Response has no error or result for request:\n"+o(t),{request:t});if(!u)throw new y.EthereumRpcError(y.errorCodes.rpc.internal,"JsonRpcEngine: Nothing ended request:\n"+o(t),{request:t})}}function o(e){return JSON.stringify(e,null,2)}l.JsonRpcEngine=n},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.serializeError=l.isValidCode=l.getMessageFromCode=l.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const s=c(71),m=c(70),y=s.errorCodes.rpc.internal,n={code:y,message:o(y)};function o(h,f="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(h)){const d=h.toString();if(u(s.errorValues,d))return s.errorValues[d].message;if(t(h))return l.JSON_RPC_SERVER_ERROR_MESSAGE}return f}function e(h){if(!Number.isInteger(h))return!1;const f=h.toString();return!!s.errorValues[f]||!!t(h)}function t(h){return h>=-32099&&h<=-32e3}function i(h){return h&&"object"==typeof h&&!Array.isArray(h)?Object.assign({},h):h}function u(h,f){return Object.prototype.hasOwnProperty.call(h,f)}l.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",l.getMessageFromCode=o,l.isValidCode=e,l.serializeError=function(h,{fallbackError:f=n,shouldIncludeStack:d=!1}={}){var _,v;if(!f||!Number.isInteger(f.code)||"string"!=typeof f.message)throw new Error("Must provide fallback error with integer number code and string message.");if(h instanceof m.EthereumRpcError)return h.serialize();const T={};if(h&&"object"==typeof h&&!Array.isArray(h)&&u(h,"code")&&e(h.code)){const b=h;T.code=b.code,b.message&&"string"==typeof b.message?(T.message=b.message,u(b,"data")&&(T.data=b.data)):(T.message=o(T.code),T.data={originalError:i(h)})}else{T.code=f.code;const b=null===(_=h)||void 0===_?void 0:_.message;T.message=b&&"string"==typeof b?b:f.message,T.data={originalError:i(h)}}const O=null===(v=h)||void 0===v?void 0:v.stack;return d&&h&&O&&"string"==typeof O&&(T.stack=O),T}},function(z,l,c){z.exports=c(347)},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.getWindowMetadata=void 0;const s=c(10);l.getWindowMetadata=function(){let m,y;try{m=s.getDocumentOrThrow(),y=s.getLocationOrThrow()}catch{return null}function n(...e){const t=m.getElementsByTagName("meta");for(let i=0;iu.getAttribute(f)).filter(f=>!!f&&e.includes(f));if(h.length&&h){const f=u.getAttribute("content");if(f)return f}}return""}const o=function(){let e=n("name","og:site_name","og:title","twitter:title");return e||(e=m.title),e}();return{description:n("description","og:description","twitter:description","keywords"),url:y.origin,icons:function(){const e=m.getElementsByTagName("link"),t=[];for(let i=0;i-1){const f=u.getAttribute("href");if(f)if(-1===f.toLowerCase().indexOf("https:")&&-1===f.toLowerCase().indexOf("http:")&&0!==f.indexOf("//")){let d=y.protocol+"//"+y.host;if(0===f.indexOf("/"))d+=f;else{const _=y.pathname.split("/");_.pop(),d+=_.join("/")+"/"+f}t.push(d)}else 0===f.indexOf("//")?t.push(y.protocol+f):t.push(f)}}return t}(),name:o}}},function(z,l,c){"use strict";(function(s){c.d(l,"a",function(){return f});var y=function(v,T,O){this.name=v,this.version=T,this.os=O,this.type="browser"},n=function(v){this.version=v,this.type="node",this.name="node",this.os=s.platform},o=function(v,T,O,b){this.name=v,this.version=T,this.os=O,this.bot=b,this.type="bot-device"},e=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},t=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},i=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,u=[["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(v){return v?_(v):typeof document>"u"&&typeof navigator<"u"&&"ReactNative"===navigator.product?new t:typeof navigator<"u"?_(navigator.userAgent):void 0!==s&&s.version?new n(s.version.slice(1)):null}function _(v){var T=function d(v){return""!==v&&u.reduce(function(T,O){var b=O[0];if(T)return T;var w=O[1].exec(v);return!!w&&[b,w]},!1)}(v);if(!T)return null;var O=T[0],b=T[1];if("searchbot"===O)return new e;var S=b[1]&&b[1].split(/[._]/).slice(0,3);S?S.length<3&&(S=function(){for(var v=0,T=0,O=arguments.length;T>5,this.byteCount=this.blockCount<<2,this.outputBlocks=F>>5,this.extraBytes=(31&F)>>3;for(var B=0;B<50;++B)this.s[B]=0}function U(I,W,F){C.call(this,I,W,F)}C.prototype.update=function(I){if(this.finalized)throw new Error("finalize already called");var W,F=typeof I;if("string"!==F){if("object"!==F)throw new Error(n);if(null===I)throw new Error(n);if(h&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!(Array.isArray(I)||h&&ArrayBuffer.isView(I)))throw new Error(n);W=!0}for(var B,N,P=this.blocks,j=this.byteCount,K=I.length,Z=this.blockCount,J=0,X=this.s;J>2]|=I[J]<<_[3&B++];else for(B=this.start;J>2]|=N<<_[3&B++]:N<2048?(P[B>>2]|=(192|N>>6)<<_[3&B++],P[B>>2]|=(128|63&N)<<_[3&B++]):N<55296||N>=57344?(P[B>>2]|=(224|N>>12)<<_[3&B++],P[B>>2]|=(128|N>>6&63)<<_[3&B++],P[B>>2]|=(128|63&N)<<_[3&B++]):(N=65536+((1023&N)<<10|1023&I.charCodeAt(++J)),P[B>>2]|=(240|N>>18)<<_[3&B++],P[B>>2]|=(128|N>>12&63)<<_[3&B++],P[B>>2]|=(128|N>>6&63)<<_[3&B++],P[B>>2]|=(128|63&N)<<_[3&B++]);if(this.lastByteIndex=B,B>=j){for(this.start=B-j,this.block=P[Z],B=0;B>=8);F>0;)N.unshift(F),F=255&(I>>=8),++B;return W?N.push(B):N.unshift(B),this.update(N),N.length},C.prototype.encodeString=function(I){var W,F=typeof I;if("string"!==F){if("object"!==F)throw new Error(n);if(null===I)throw new Error(n);if(h&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!(Array.isArray(I)||h&&ArrayBuffer.isView(I)))throw new Error(n);W=!0}var B=0;if(W)B=I.length;else for(var P=0;P=57344?B+=3:(j=65536+((1023&j)<<10|1023&I.charCodeAt(++P)),B+=4)}return B+=this.encode(8*B),this.update(I),B},C.prototype.bytepad=function(I,W){for(var F=this.encode(W),B=0;B>2]|=this.padding[3&W],this.lastByteIndex===this.byteCount)for(I[0]=I[F],W=1;W>4&15]+f[15&I]+f[I>>12&15]+f[I>>8&15]+f[I>>20&15]+f[I>>16&15]+f[I>>28&15]+f[I>>24&15];j%W==0&&(V(F),P=0)}return N&&(K+=f[(I=F[P])>>4&15]+f[15&I],N>1&&(K+=f[I>>12&15]+f[I>>8&15]),N>2&&(K+=f[I>>20&15]+f[I>>16&15])),K},C.prototype.buffer=C.prototype.arrayBuffer=function(){this.finalize();var I,W=this.blockCount,F=this.s,B=this.outputBlocks,N=this.extraBytes,P=0,j=0,K=this.outputBits>>3;I=N?new ArrayBuffer(B+1<<2):new ArrayBuffer(K);for(var Z=new Uint32Array(I);j>8&255,Z[I+2]=W>>16&255,Z[I+3]=W>>24&255;K%F==0&&V(B)}return P&&(Z[I=K<<2]=255&(W=B[j]),P>1&&(Z[I+1]=W>>8&255),P>2&&(Z[I+2]=W>>16&255)),Z},(U.prototype=new C).finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var V=function(I){var W,F,B,N,P,j,K,Z,J,X,ee,te,oe,ve,ie,de,fe,re,_e,Ke,pe,Te,Ve,be,Pe,Ye,we,Be,$e,Me,je,Q,se,le,Le,he,Oe,Ge,me,ze,rt,Re,He,Qe,Ee,Ne,it,xe,qe,et,ke,We,tt,Se,Fe,nt,Ae,Ue,Y,G,$,ne,ce;for(B=0;B<48;B+=2)N=I[0]^I[10]^I[20]^I[30]^I[40],P=I[1]^I[11]^I[21]^I[31]^I[41],Z=I[4]^I[14]^I[24]^I[34]^I[44],J=I[5]^I[15]^I[25]^I[35]^I[45],X=I[6]^I[16]^I[26]^I[36]^I[46],ee=I[7]^I[17]^I[27]^I[37]^I[47],W=(te=I[8]^I[18]^I[28]^I[38]^I[48])^((j=I[2]^I[12]^I[22]^I[32]^I[42])<<1|(K=I[3]^I[13]^I[23]^I[33]^I[43])>>>31),F=(oe=I[9]^I[19]^I[29]^I[39]^I[49])^(K<<1|j>>>31),I[0]^=W,I[1]^=F,I[10]^=W,I[11]^=F,I[20]^=W,I[21]^=F,I[30]^=W,I[31]^=F,I[40]^=W,I[41]^=F,F=P^(J<<1|Z>>>31),I[2]^=W=N^(Z<<1|J>>>31),I[3]^=F,I[12]^=W,I[13]^=F,I[22]^=W,I[23]^=F,I[32]^=W,I[33]^=F,I[42]^=W,I[43]^=F,F=K^(ee<<1|X>>>31),I[4]^=W=j^(X<<1|ee>>>31),I[5]^=F,I[14]^=W,I[15]^=F,I[24]^=W,I[25]^=F,I[34]^=W,I[35]^=F,I[44]^=W,I[45]^=F,F=J^(oe<<1|te>>>31),I[6]^=W=Z^(te<<1|oe>>>31),I[7]^=F,I[16]^=W,I[17]^=F,I[26]^=W,I[27]^=F,I[36]^=W,I[37]^=F,I[46]^=W,I[47]^=F,F=ee^(P<<1|N>>>31),I[8]^=W=X^(N<<1|P>>>31),I[9]^=F,I[18]^=W,I[19]^=F,I[28]^=W,I[29]^=F,I[38]^=W,I[39]^=F,I[48]^=W,I[49]^=F,ie=I[1],Ne=I[11]<<4|I[10]>>>28,it=I[10]<<4|I[11]>>>28,Be=I[20]<<3|I[21]>>>29,$e=I[21]<<3|I[20]>>>29,G=I[31]<<9|I[30]>>>23,$=I[30]<<9|I[31]>>>23,Re=I[40]<<18|I[41]>>>14,He=I[41]<<18|I[40]>>>14,le=I[2]<<1|I[3]>>>31,Le=I[3]<<1|I[2]>>>31,fe=I[12]<<12|I[13]>>>20,xe=I[22]<<10|I[23]>>>22,qe=I[23]<<10|I[22]>>>22,Me=I[33]<<13|I[32]>>>19,je=I[32]<<13|I[33]>>>19,ne=I[42]<<2|I[43]>>>30,ce=I[43]<<2|I[42]>>>30,Se=I[5]<<30|I[4]>>>2,Fe=I[4]<<30|I[5]>>>2,he=I[14]<<6|I[15]>>>26,Oe=I[15]<<6|I[14]>>>26,_e=I[24]<<11|I[25]>>>21,et=I[34]<<15|I[35]>>>17,ke=I[35]<<15|I[34]>>>17,Q=I[45]<<29|I[44]>>>3,se=I[44]<<29|I[45]>>>3,be=I[6]<<28|I[7]>>>4,Pe=I[7]<<28|I[6]>>>4,nt=I[17]<<23|I[16]>>>9,Ae=I[16]<<23|I[17]>>>9,Ge=I[26]<<25|I[27]>>>7,me=I[27]<<25|I[26]>>>7,Ke=I[36]<<21|I[37]>>>11,pe=I[37]<<21|I[36]>>>11,We=I[47]<<24|I[46]>>>8,tt=I[46]<<24|I[47]>>>8,Qe=I[8]<<27|I[9]>>>5,Ee=I[9]<<27|I[8]>>>5,Ye=I[18]<<20|I[19]>>>12,we=I[19]<<20|I[18]>>>12,Ue=I[29]<<7|I[28]>>>25,Y=I[28]<<7|I[29]>>>25,ze=I[38]<<8|I[39]>>>24,rt=I[39]<<8|I[38]>>>24,Te=I[48]<<14|I[49]>>>18,Ve=I[49]<<14|I[48]>>>18,I[0]=(ve=I[0])^~(de=I[13]<<12|I[12]>>>20)&(re=I[25]<<11|I[24]>>>21),I[1]=ie^~fe&_e,I[10]=be^~Ye&Be,I[11]=Pe^~we&$e,I[20]=le^~he&Ge,I[21]=Le^~Oe&me,I[30]=Qe^~Ne&xe,I[31]=Ee^~it&qe,I[40]=Se^~nt&Ue,I[41]=Fe^~Ae&Y,I[2]=de^~re&Ke,I[3]=fe^~_e&pe,I[12]=Ye^~Be&Me,I[13]=we^~$e&je,I[22]=he^~Ge&ze,I[23]=Oe^~me&rt,I[32]=Ne^~xe&et,I[33]=it^~qe&ke,I[42]=nt^~Ue&G,I[43]=Ae^~Y&$,I[4]=re^~Ke&Te,I[5]=_e^~pe&Ve,I[14]=Be^~Me&Q,I[15]=$e^~je&se,I[24]=Ge^~ze&Re,I[25]=me^~rt&He,I[34]=xe^~et&We,I[35]=qe^~ke&tt,I[44]=Ue^~G&ne,I[45]=Y^~$&ce,I[6]=Ke^~Te&ve,I[7]=pe^~Ve&ie,I[16]=Me^~Q&be,I[17]=je^~se&Pe,I[26]=ze^~Re&le,I[27]=rt^~He&Le,I[36]=et^~We&Qe,I[37]=ke^~tt&Ee,I[46]=G^~ne&Se,I[47]=$^~ce&Fe,I[8]=Te^~ve&de,I[9]=Ve^~ie&fe,I[18]=Q^~be&Ye,I[19]=se^~Pe&we,I[28]=Re^~le&he,I[29]=He^~Le&Oe,I[38]=We^~Qe&Ne,I[39]=tt^~Ee&it,I[48]=ne^~Se&nt,I[49]=ce^~Fe&Ae,I[0]^=v[B],I[1]^=v[B+1]};if(i)z.exports=p;else{for(R=0;Rthis._socketCreate())}set readyState(o){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(o){}get connecting(){return 0===this.readyState}set connected(o){}get connected(){return 1===this.readyState}set closing(o){}get closing(){return 2===this.readyState}set closed(o){}get closed(){return 3===this.readyState}open(){this._socketCreate()}close(){this._socketClose()}send(o,e,t){if(!e||"string"!=typeof e)throw new Error("Missing or invalid topic field");this._socketSend({topic:e,type:"pub",payload:o,silent:!!t})}subscribe(o){this._socketSend({topic:o,type:"sub",payload:"",silent:!0})}on(o,e){this._events.push({event:o,callback:e})}_socketCreate(){if(this._nextSocket)return;const o=function(e,t,i){var u,h;const f=(e.startsWith("https")?e.replace("https","wss"):e.startsWith("http")?e.replace("http","ws"):e).split("?"),d=Object(m.isBrowser)()?{protocol:t,version:i,env:"browser",host:(null===(u=Object(m.getLocation)())||void 0===u?void 0:u.host)||""}:{protocol:t,version:i,env:(null===(h=Object(m.detectEnv)())||void 0===h?void 0:h.name)||""},_=Object(m.appendToQueryString)(Object(m.getQueryString)(f[1]||""),d);return f[0]+"?"+_}(this._url,this._protocol,this._version);if(this._nextSocket=new n(o),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=e=>this._socketReceive(e),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=e=>this._socketError(e),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(o){const e=JSON.stringify(o);this._socket&&1===this._socket.readyState?this._socket.send(e):(this._setToQueue(o),this._socketCreate())}_socketReceive(o){var e=this;return ge(function*(){let t;try{t=JSON.parse(o.data)}catch{return}if(e._socketSend({topic:t.topic,type:"ack",payload:"",silent:!0}),e._socket&&1===e._socket.readyState){const i=e._events.filter(u=>"message"===u.event);i&&i.length&&i.forEach(u=>u.callback(t))}})()}_socketError(o){const e=this._events.filter(t=>"error"===t.event);e&&e.length&&e.forEach(t=>t.callback(o))}_queueSubscriptions(){this._subscriptions.forEach(o=>this._queue.push({topic:o,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(o){this._queue.push(o)}_pushQueue(){this._queue.forEach(o=>this._socketSend(o)),this._queue=[]}}}).call(this,c(6))},function(z,l,c){"use strict";l.a=class{constructor(){this._eventEmitters=[],typeof window<"u"&&void 0!==window.addEventListener&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(s,m){this._eventEmitters.push({event:s,callback:m})}trigger(s){let m=[];s&&(m=this._eventEmitters.filter(y=>y.event===s)),m.forEach(y=>{y.callback()})}}},function(z,l,c){"use strict";var s=Object.prototype.hasOwnProperty,m="~";function y(){}function n(i,u,h){this.fn=i,this.context=u,this.once=h||!1}function o(i,u,h,f,d){if("function"!=typeof h)throw new TypeError("The listener must be a function");var _=new n(h,f||i,d),v=m?m+u:u;return i._events[v]?i._events[v].fn?i._events[v]=[i._events[v],_]:i._events[v].push(_):(i._events[v]=_,i._eventsCount++),i}function e(i,u){0==--i._eventsCount?i._events=new y:delete i._events[u]}function t(){this._events=new y,this._eventsCount=0}Object.create&&(y.prototype=Object.create(null),(new y).__proto__||(m=!1)),t.prototype.eventNames=function(){var i,u,h=[];if(0===this._eventsCount)return h;for(u in i=this._events)s.call(i,u)&&h.push(m?u.slice(1):u);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(i)):h},t.prototype.listeners=function(i){var h=this._events[m?m+i:i];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,d=h.length,_=new Array(d);fs.__awaiter(this,void 0,void 0,function*(){const v=yield this.getWalletConnector();if(v)return this.start(),this.subscribeWalletConnector(),v.accounts;throw new Error("Failed to connect to WalleConnect")}),this.request=v=>s.__awaiter(this,void 0,void 0,function*(){return this.send(v)}),this.send=(v,T)=>s.__awaiter(this,void 0,void 0,function*(){var O;if("string"==typeof v){const b=v;let S=T;return"personal_sign"===b&&(S=(0,o.parsePersonalSign)(S)),this.sendAsyncPromise(b,S)}if("personal_sign"===(v=Object.assign({id:(0,o.payloadId)(),jsonrpc:"2.0"},v)).method&&(v.params=(0,o.parsePersonalSign)(v.params)),!T){if("eth_signTypedData_v4"===v.method&&"MetaMask"===(null===(O=this.walletMeta)||void 0===O?void 0:O.name)){const{result:b}=yield this.handleOtherRequests(v);return b}return this.sendAsyncPromise(v.method,v.params)}this.sendAsync(v,T)}),this.onConnect=v=>{this.connectCallbacks.push(v)},this.triggerConnect=v=>{this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach(T=>T(v))},this.bridge=_.connector?_.connector.bridge:_.bridge||"https://bridge.walletconnect.org",this.qrcode=void 0===_.qrcode||!1!==_.qrcode,this.qrcodeModal=_.qrcodeModal||this.qrcodeModal,this.qrcodeModalOptions=_.qrcodeModalOptions,this.wc=_.connector||new m.default({bridge:this.bridge,qrcodeModal:this.qrcode?this.qrcodeModal:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:null==_?void 0:_.storageId,signingMethods:null==_?void 0:_.signingMethods,clientMeta:null==_?void 0:_.clientMeta}),this.rpc=_.rpc||null,!(this.rpc||_.infuraId&&"string"==typeof _.infuraId&&_.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");this.infuraId=_.infuraId||"",this.chainId=(null==_?void 0:_.chainId)||this.chainId,this.initialize()}get isWalletConnect(){return!0}get connector(){return this.wc}get walletMeta(){return this.wc.peerMeta}disconnect(){return s.__awaiter(this,void 0,void 0,function*(){this.close()})}close(){return s.__awaiter(this,void 0,void 0,function*(){yield(yield this.getWalletConnector({disableSessionCreation:!0})).killSession(),yield this.onDisconnect()})}handleRequest(_){return s.__awaiter(this,void 0,void 0,function*(){try{let v,T=null;const O=yield this.getWalletConnector();switch(_.method){case"wc_killSession":yield this.close(),T=null;break;case"eth_accounts":T=O.accounts;break;case"eth_coinbase":T=O.accounts[0];break;case"eth_chainId":case"net_version":T=O.chainId;break;case"eth_uninstallFilter":this.sendAsync(_,b=>b),T=!0;break;default:v=yield this.handleOtherRequests(_)}return v||this.formatResponse(_,T)}catch(v){throw this.emit("error",v),v}})}handleOtherRequests(_){return s.__awaiter(this,void 0,void 0,function*(){if(!o.signingMethods.includes(_.method)&&_.method.startsWith("eth_"))return this.handleReadRequests(_);const v=yield this.getWalletConnector(),T=yield v.sendCustomRequest(_);return this.formatResponse(_,T)})}handleReadRequests(_){return s.__awaiter(this,void 0,void 0,function*(){if(!this.http){const v=new Error("HTTP Connection not available");throw this.emit("error",v),v}return this.http.send(_)})}formatResponse(_,v){return{id:_.id,jsonrpc:_.jsonrpc,result:v}}getWalletConnector(_={}){const{disableSessionCreation:v=!1}=_;return new Promise((T,O)=>{const b=this.wc;this.isConnecting?this.onConnect(S=>T(S)):b.connected||v?(this.connected||(this.connected=!0,this.updateState(b.session)),T(b)):(this.isConnecting=!0,b.on("modal_closed",()=>{O(new Error("User closed modal"))}),b.createSession({chainId:this.chainId}).then(()=>{b.on("connect",(S,w)=>{if(S)return this.isConnecting=!1,O(S);this.isConnecting=!1,this.connected=!0,w&&this.updateState(w.params[0]),this.emit("connect"),this.triggerConnect(b),T(b)})}).catch(S=>{this.isConnecting=!1,O(S)}))})}subscribeWalletConnector(){return s.__awaiter(this,void 0,void 0,function*(){const _=yield this.getWalletConnector();_.on("disconnect",v=>{v?this.emit("error",v):this.onDisconnect()}),_.on("session_update",(v,T)=>{v?this.emit("error",v):this.updateState(T.params[0])})})}onDisconnect(){return s.__awaiter(this,void 0,void 0,function*(){yield this.stop(),this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected"),this.connected=!1})}updateState(_){return s.__awaiter(this,void 0,void 0,function*(){const{accounts:v,chainId:T,networkId:O,rpcUrl:b}=_;(!this.accounts||v&&this.accounts!==v)&&(this.accounts=v,this.emit("accountsChanged",v)),(!this.chainId||T&&this.chainId!==T)&&(this.chainId=T,this.emit("chainChanged",T)),(!this.networkId||O&&this.networkId!==O)&&(this.networkId=O,this.emit("networkChanged",O)),this.updateRpcUrl(this.chainId,b||"")})}updateRpcUrl(_,v=""){(v=v||(0,o.getRpcUrl)(_,{infuraId:this.infuraId,custom:this.rpc||void 0}))?(this.rpcUrl=v,this.updateHttpConnection()):this.emit("error",new Error("No RPC Url available for chainId: "+_))}updateHttpConnection(){this.rpcUrl&&(this.http=new n.default(this.rpcUrl),this.http.on("payload",_=>this.emit("payload",_)),this.http.on("error",_=>this.emit("error",_)))}sendAsyncPromise(_,v){return new Promise((T,O)=>{this.sendAsync({id:(0,o.payloadId)(),jsonrpc:"2.0",method:_,params:v||[]},(b,S)=>{b?O(b):T(S.result)})})}initialize(){this.updateRpcUrl(this.chainId),this.addProvider(new i({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),this.addProvider(new t),this.addProvider(new d),this.addProvider(new u),this.addProvider(new f),this.addProvider(new h(this.configWallet())),this.addProvider({handleRequest:(_,v,T)=>s.__awaiter(this,void 0,void 0,function*(){try{const{error:O,result:b}=yield this.handleRequest(_);T(O,b)}catch(O){T(O)}}),setEngine:_=>_})}configWallet(){return{getAccounts:_=>s.__awaiter(this,void 0,void 0,function*(){try{const v=(yield this.getWalletConnector()).accounts;v&&v.length?_(null,v):_(new Error("Failed to get accounts"))}catch(v){_(v)}}),processMessage:(_,v)=>s.__awaiter(this,void 0,void 0,function*(){try{const T=yield this.getWalletConnector(),O=yield T.signMessage([_.from,_.data]);v(null,O)}catch(T){v(T)}}),processPersonalMessage:(_,v)=>s.__awaiter(this,void 0,void 0,function*(){try{const T=yield this.getWalletConnector(),O=yield T.signPersonalMessage([_.data,_.from]);v(null,O)}catch(T){v(T)}}),processSignTransaction:(_,v)=>s.__awaiter(this,void 0,void 0,function*(){try{const T=yield this.getWalletConnector(),O=yield T.signTransaction(_);v(null,O)}catch(T){v(T)}}),processTransaction:(_,v)=>s.__awaiter(this,void 0,void 0,function*(){try{const T=yield this.getWalletConnector(),O=yield T.sendTransaction(_);v(null,O)}catch(T){v(T)}}),processTypedMessage:(_,v)=>s.__awaiter(this,void 0,void 0,function*(){try{const T=yield this.getWalletConnector(),O=yield T.signTypedData([_.from,_.data]);v(null,O)}catch(T){v(T)}})}}}},function(z,l,c){"use strict";c.r(l),c.d(l,"__extends",function(){return m}),c.d(l,"__assign",function(){return y}),c.d(l,"__rest",function(){return n}),c.d(l,"__decorate",function(){return o}),c.d(l,"__param",function(){return e}),c.d(l,"__metadata",function(){return t}),c.d(l,"__awaiter",function(){return i}),c.d(l,"__generator",function(){return u}),c.d(l,"__exportStar",function(){return h}),c.d(l,"__values",function(){return f}),c.d(l,"__read",function(){return d}),c.d(l,"__spread",function(){return _}),c.d(l,"__await",function(){return v}),c.d(l,"__asyncGenerator",function(){return T}),c.d(l,"__asyncDelegator",function(){return O}),c.d(l,"__asyncValues",function(){return b}),c.d(l,"__makeTemplateObject",function(){return S}),c.d(l,"__importStar",function(){return w}),c.d(l,"__importDefault",function(){return A});var s=function(L,H){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,q){D.__proto__=q}||function(D,q){for(var k in q)q.hasOwnProperty(k)&&(D[k]=q[k])})(L,H)};function m(L,H){function D(){this.constructor=L}s(L,H),L.prototype=null===H?Object.create(H):(D.prototype=H.prototype,new D)}var y=function(){return(y=Object.assign||function(L){for(var H,D=1,q=arguments.length;D=0;R--)(k=L[R])&&(x=(p<3?k(x):p>3?k(H,D,x):k(H,D))||x);return p>3&&x&&Object.defineProperty(H,D,x),x}function e(L,H){return function(D,q){H(D,q,L)}}function t(L,H){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(L,H)}function i(L,H,D,q){return new(D||(D=Promise))(function(k,p){function x(a){try{r(q.next(a))}catch(g){p(g)}}function R(a){try{r(q.throw(a))}catch(g){p(g)}}function r(a){a.done?k(a.value):new D(function(g){g(a.value)}).then(x,R)}r((q=q.apply(L,H||[])).next())})}function u(L,H){var D,q,k,p,x={label:0,sent:function(){if(1&k[0])throw k[1];return k[1]},trys:[],ops:[]};return p={next:R(0),throw:R(1),return:R(2)},"function"==typeof Symbol&&(p[Symbol.iterator]=function(){return this}),p;function R(r){return function(a){return function(g){if(D)throw new TypeError("Generator is already executing.");for(;x;)try{if(D=1,q&&(k=2&g[0]?q.return:g[0]?q.throw||((k=q.return)&&k.call(q),0):q.next)&&!(k=k.call(q,g[1])).done)return k;switch(q=0,k&&(g=[2&g[0],k.value]),g[0]){case 0:case 1:k=g;break;case 4:return x.label++,{value:g[1],done:!1};case 5:x.label++,q=g[1],g=[0];continue;case 7:g=x.ops.pop(),x.trys.pop();continue;default:if(!((k=(k=x.trys).length>0&&k[k.length-1])||6!==g[0]&&2!==g[0])){x=0;continue}if(3===g[0]&&(!k||g[1]>k[0]&&g[1]=L.length&&(L=void 0),{value:L&&L[D++],done:!L}}}}function d(L,H){var D="function"==typeof Symbol&&L[Symbol.iterator];if(!D)return L;var q,k,p=D.call(L),x=[];try{for(;(void 0===H||H-- >0)&&!(q=p.next()).done;)x.push(q.value)}catch(R){k={error:R}}finally{try{q&&!q.done&&(D=p.return)&&D.call(p)}finally{if(k)throw k.error}}return x}function _(){for(var L=[],H=0;H1||R(M,E)})})}function R(M,E){try{(C=k[M](E)).value instanceof v?Promise.resolve(C.value.v).then(r,a):g(p[0][2],C)}catch(U){g(p[0][3],U)}var C}function r(M){R("next",M)}function a(M){R("throw",M)}function g(M,E){M(E),p.shift(),p.length&&R(p[0][0],p[0][1])}}function O(L){var H,D;return H={},q("next"),q("throw",function(k){throw k}),q("return"),H[Symbol.iterator]=function(){return this},H;function q(k,p){H[k]=L[k]?function(x){return(D=!D)?{value:v(L[k](x)),done:"return"===k}:p?p(x):x}:p}}function b(L){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var H,D=L[Symbol.asyncIterator];return D?D.call(L):(L=f(L),H={},q("next"),q("throw"),q("return"),H[Symbol.asyncIterator]=function(){return this},H);function q(k){H[k]=L[k]&&function(p){return new Promise(function(x,R){var r,a,g;r=x,a=R,g=(p=L[k](p)).done,Promise.resolve(p.value).then(function(E){r({value:E,done:g})},a)})}}}function S(L,H){return Object.defineProperty?Object.defineProperty(L,"raw",{value:H}):L.raw=H,L}function w(L){if(L&&L.__esModule)return L;var H={};if(null!=L)for(var D in L)Object.hasOwnProperty.call(L,D)&&(H[D]=L[D]);return H.default=L,H}function A(L){return L&&L.__esModule?L:{default:L}}},function(z,l){},function(z,l,c){"use strict";l.byteLength=function(u){var h=t(u),d=h[1];return 3*(h[0]+d)/4-d},l.toByteArray=function(u){var h,f,A,d=t(u),_=d[0],v=d[1],T=new y(3*(_+(A=v))/4-A),O=0,b=v>0?_-4:_;for(f=0;f>16&255,T[O++]=h>>8&255,T[O++]=255&h;return 2===v&&(h=m[u.charCodeAt(f)]<<2|m[u.charCodeAt(f+1)]>>4,T[O++]=255&h),1===v&&(h=m[u.charCodeAt(f)]<<10|m[u.charCodeAt(f+1)]<<4|m[u.charCodeAt(f+2)]>>2,T[O++]=h>>8&255,T[O++]=255&h),T},l.fromByteArray=function(u){for(var h,f=u.length,d=f%3,_=[],v=0,T=f-d;vT?T:v+16383));return 1===d?_.push(s[(h=u[f-1])>>2]+s[h<<4&63]+"=="):2===d&&_.push(s[(h=(u[f-2]<<8)+u[f-1])>>10]+s[h>>4&63]+s[h<<2&63]+"="),_.join("")};for(var s=[],m=[],y=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,e=n.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var f=u.indexOf("=");return-1===f&&(f=h),[f,f===h?0:4-f%4]}function i(u,h,f){for(var _,v=[],T=h;T>18&63]+s[_>>12&63]+s[_>>6&63]+s[63&_]);return v.join("")}m["-".charCodeAt(0)]=62,m["_".charCodeAt(0)]=63},function(z,l){l.read=function(c,s,m,y,n){var o,e,t=8*n-y-1,i=(1<>1,h=-7,f=m?n-1:0,d=m?-1:1,_=c[s+f];for(f+=d,o=_&(1<<-h)-1,_>>=-h,h+=t;h>0;o=256*o+c[s+f],f+=d,h-=8);for(e=o&(1<<-h)-1,o>>=-h,h+=y;h>0;e=256*e+c[s+f],f+=d,h-=8);if(0===o)o=1-u;else{if(o===i)return e?NaN:1/0*(_?-1:1);e+=Math.pow(2,y),o-=u}return(_?-1:1)*e*Math.pow(2,o-y)},l.write=function(c,s,m,y,n,o){var e,t,i,u=8*o-n-1,h=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,_=y?0:o-1,v=y?1:-1,T=s<0||0===s&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(t=isNaN(s)?1:0,e=h):(e=Math.floor(Math.log(s)/Math.LN2),s*(i=Math.pow(2,-e))<1&&(e--,i*=2),(s+=e+f>=1?d/i:d*Math.pow(2,1-f))*i>=2&&(e++,i/=2),e+f>=h?(t=0,e=h):e+f>=1?(t=(s*i-1)*Math.pow(2,n),e+=f):(t=s*Math.pow(2,f-1)*Math.pow(2,n),e=0));n>=8;c[m+_]=255&t,_+=v,t/=256,n-=8);for(e=e<0;c[m+_]=255&e,_+=v,e/=256,u-=8);c[m+_-v]|=128*T}},function(z,l){(function(c){z.exports=c}).call(this,{})},function(z,l,c){"use strict";(function(s){function m(){return(null==s?void 0:s.crypto)||(null==s?void 0:s.msCrypto)||{}}function y(){const n=m();return n.subtle||n.webkitSubtle}Object.defineProperty(l,"__esModule",{value:!0}),l.isBrowserCryptoAvailable=l.getSubtleCrypto=l.getBrowerCrypto=void 0,l.getBrowerCrypto=m,l.getSubtleCrypto=y,l.isBrowserCryptoAvailable=function(){return!!m()&&!!y()}}).call(this,c(6))},function(z,l,c){"use strict";(function(s){function m(){return typeof document>"u"&&typeof navigator<"u"&&"ReactNative"===navigator.product}function y(){return void 0!==s&&void 0!==s.versions&&void 0!==s.versions.node}Object.defineProperty(l,"__esModule",{value:!0}),l.isBrowser=l.isNode=l.isReactNative=void 0,l.isReactNative=m,l.isNode=y,l.isBrowser=function(){return!m()&&!y()}}).call(this,c(5))},function(z,l,c){"use strict";z.exports=s=>encodeURIComponent(s).replace(/[!'()*]/g,m=>"%"+m.charCodeAt(0).toString(16).toUpperCase())},function(z,l,c){"use strict";var s=new RegExp("%[a-f0-9]{2}","gi"),m=new RegExp("(%[a-f0-9]{2})+","gi");function y(o,e){try{return decodeURIComponent(o.join(""))}catch{}if(1===o.length)return o;var t=o.slice(0,e=e||1),i=o.slice(e);return Array.prototype.concat.call([],y(t),y(i))}function n(o){try{return decodeURIComponent(o)}catch{for(var e=o.match(s),t=1;t{if("string"!=typeof s||"string"!=typeof m)throw new TypeError("Expected the arguments to be of type `string`");if(""===m)return[s];const y=s.indexOf(m);return-1===y?[s]:[s.slice(0,y),s.slice(y+m.length)]}},function(z,l,c){"use strict";z.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(z,l,c){(function(s){function m(L){return L&&"object"==typeof L&&"default"in L?L.default:L}var y=c(76),n=m(c(179)),o=m(c(200)),e=c(376);function t(L){return e.createElement("div",{className:"walletconnect-modal__header"},e.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"}),e.createElement("p",null,"WalletConnect"),e.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:L.onClose},e.createElement("div",{id:"walletconnect-qrcode-close",className:"walletconnect-modal__close__icon"},e.createElement("div",{className:"walletconnect-modal__close__line1"}),e.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function i(L){return e.createElement("a",{className:"walletconnect-connect__button",href:L.href,id:"walletconnect-connect-button-"+L.name,onClick:L.onClick,rel:"noopener noreferrer",style:{backgroundColor:L.color},target:"_blank"},L.name)}function u(L){var H=L.color,k=L.logo;return e.createElement("a",{className:"walletconnect-modal__base__row",href:L.href,onClick:L.onClick,rel:"noopener noreferrer",target:"_blank"},e.createElement("h3",{className:"walletconnect-modal__base__row__h3"},L.name),e.createElement("div",{className:"walletconnect-modal__base__row__right"},e.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+k+"') "+H,backgroundSize:"100%"}}),e.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(L){var q=L.name,x=window.innerWidth<768?(q.length>8?2.5:2.7)+"vw":"inherit";return e.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:L.href,onClick:L.onClick,rel:"noopener noreferrer",target:"_blank"},e.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+L.logo+"') "+L.color,backgroundSize:"100%"}}),e.createElement("div",{style:{fontSize:x},className:"walletconnect-connect__button__text"},q))}function f(L){var H=y.isAndroid(),D=e.useState(""),q=D[0],k=D[1],p=e.useState(""),x=p[0],R=p[1],r=e.useState(1),a=r[0],g=r[1],M=x?L.links.filter(function(B){return B.name.toLowerCase().includes(x.toLowerCase())}):L.links,E=L.errorMessage,C=x||M.length>5,U=Math.ceil(M.length/12),V=[12*(a-1)+1,12*a],I=M.length?M.filter(function(B,N){return N+1>=V[0]&&N+1<=V[1]}):[],W=!(H||!(U>1)),F=void 0;return e.createElement("div",null,e.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},H?L.text.connect_mobile_wallet:L.text.choose_preferred_wallet),!H&&e.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:q,onChange:function(B){k(B.target.value),clearTimeout(F),B.target.value?F=setTimeout(function(){R(B.target.value),g(1)},1e3):(k(""),R(""),g(1))}}),e.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(H?"__android":C&&M.length?"__wrap":"")},H?e.createElement(i,{name:L.text.connect,color:"rgb(64, 153, 255)",href:L.uri,onClick:e.useCallback(function(){y.saveMobileLinkInfo({name:"Unknown",href:L.uri})},[])}):I.length?I.map(function(B){var N=B.color,P=B.name,j=B.shortName,K=B.logo,Z=y.formatIOSMobile(L.uri,B),J=e.useCallback(function(){y.saveMobileLinkInfo({name:P,href:Z})},[I]);return C?e.createElement(h,{color:N,href:Z,name:j||P,logo:K,onClick:J}):e.createElement(u,{color:N,href:Z,name:P,logo:K,onClick:J})}):e.createElement(e.Fragment,null,e.createElement("p",null,E.length?L.errorMessage:L.links.length&&!M.length?L.text.no_wallets_found:L.text.loading))),W&&e.createElement("div",{className:"walletconnect-modal__footer"},Array(U).fill(0).map(function(B,N){var P=N+1;return e.createElement("a",{style:{margin:"auto 10px",fontWeight:a===P?"bold":"normal"},onClick:function(){return g(P)}},P)})))}function d(L){var H=!!L.message.trim();return e.createElement("div",{className:"walletconnect-qrcode__notification"+(H?" notification__show":"")},L.message)}function _(L){var H=e.useState(""),D=H[0],q=H[1],k=e.useState(""),p=k[0],x=k[1];return e.useEffect(function(){try{return Promise.resolve(function(R){try{var r="";return Promise.resolve(n.toString(R,{margin:0,type:"svg"})).then(function(a){return"string"==typeof a&&(r=a.replace("0||e.useEffect(function(){!function(){try{if(H)return Promise.resolve();x(!0);var te=function(oe,ve){try{var ie=function(){var oe=L.qrcodeModalOptions&&L.qrcodeModalOptions.registryUrl?L.qrcodeModalOptions.registryUrl:y.getWalletRegistryUrl();return Promise.resolve(fetch(oe)).then(function(ve){return Promise.resolve(ve.json()).then(function(ie){var re=y.getMobileLinkRegistry(y.formatMobileRegistry(ie.listings,D?"mobile":"desktop"),q);x(!1),a(!0),J(re.length?"":L.text.no_supported_wallets),j(re);var _e=1===re.length;_e&&(I(y.formatIOSMobile(L.uri,re[0])),E(!0)),B(_e)})})}()}catch(de){return ve(de)}return ie&&ie.then?ie.then(void 0,ve):ie}(0,function(oe){x(!1),a(!0),J(L.text.something_went_wrong),console.error(oe)});Promise.resolve(te&&te.then?te.then(function(){}):void 0)}catch(oe){return Promise.reject(oe)}}()})};X();var ee=D?M:!M;return e.createElement("div",{id:"walletconnect-qrcode-modal",className:"walletconnect-qrcode__base animated fadeIn"},e.createElement("div",{className:"walletconnect-modal__base"},e.createElement(t,{onClose:L.onClose}),F&&M?e.createElement("div",{className:"walletconnect-modal__single_wallet"},e.createElement("a",{onClick:function(){return y.saveMobileLinkInfo({name:P[0].name,href:V})},href:V,rel:"noopener noreferrer",target:"_blank"},L.text.connect_with+" "+(F?P[0].name:"")+" \u203a")):H||p||!p&&P.length?e.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(ee?" right__selected":"")},e.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),D?e.createElement(e.Fragment,null,e.createElement("a",{onClick:function(){return E(!1),X()}},L.text.mobile),e.createElement("a",{onClick:function(){return E(!0)}},L.text.qrcode)):e.createElement(e.Fragment,null,e.createElement("a",{onClick:function(){return E(!0)}},L.text.qrcode),e.createElement("a",{onClick:function(){return E(!1),X()}},L.text.desktop))):null,e.createElement("div",null,M||!H&&!p&&!P.length?e.createElement(_,Object.assign({},C)):e.createElement(f,Object.assign({},C,{links:P,errorMessage:Z})))))}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var T={de:{choose_preferred_wallet:"W\xe4hle 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\xfctzten 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\xf3vil",scan_qrcode_with_wallet:"Escanea el c\xf3digo QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"C\xf3digo QR",mobile:"M\xf3vil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo sali\xf3 mal",no_supported_wallets:"Todav\xeda no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},fr:{choose_preferred_wallet:"Choisissez votre portefeuille pr\xe9f\xe9r\xe9",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\xe9!",connect_with:"Connectez-vous \xe0 l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourn\xe9",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouv\xe9"},ko:{choose_preferred_wallet:"\uc6d0\ud558\ub294 \uc9c0\uac11\uc744 \uc120\ud0dd\ud558\uc138\uc694",connect_mobile_wallet:"\ubaa8\ubc14\uc77c \uc9c0\uac11\uacfc \uc5f0\uacb0",scan_qrcode_with_wallet:"WalletConnect \uc9c0\uc6d0 \uc9c0\uac11\uc5d0\uc11c QR\ucf54\ub4dc\ub97c \uc2a4\uce94\ud558\uc138\uc694",connect:"\uc5f0\uacb0",qrcode:"QR \ucf54\ub4dc",mobile:"\ubaa8\ubc14\uc77c",desktop:"\ub370\uc2a4\ud06c\ud0d1",copy_to_clipboard:"\ud074\ub9bd\ubcf4\ub4dc\uc5d0 \ubcf5\uc0ac",copied_to_clipboard:"\ud074\ub9bd\ubcf4\ub4dc\uc5d0 \ubcf5\uc0ac\ub418\uc5c8\uc2b5\ub2c8\ub2e4!",connect_with:"\uc640 \uc5f0\uacb0\ud558\ub2e4",loading:"\ub85c\ub4dc \uc911...",something_went_wrong:"\ubb38\uc81c\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4.",no_supported_wallets:"\uc544\uc9c1 \uc9c0\uc6d0\ub418\ub294 \uc9c0\uac11\uc774 \uc5c6\uc2b5\ub2c8\ub2e4",no_wallets_found:"\uc9c0\uac11\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4"},pt:{choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se \xe0 carteira m\xf3vel",scan_qrcode_with_wallet:"Ler o c\xf3digo QR com uma carteira compat\xedvel com WalletConnect",connect:"Conectar",qrcode:"C\xf3digo QR",mobile:"M\xf3vel",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\xe3o h\xe1 carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},zh:{choose_preferred_wallet:"\u9009\u62e9\u4f60\u7684\u94b1\u5305",connect_mobile_wallet:"\u8fde\u63a5\u81f3\u79fb\u52a8\u7aef\u94b1\u5305",scan_qrcode_with_wallet:"\u4f7f\u7528\u517c\u5bb9 WalletConnect \u7684\u94b1\u5305\u626b\u63cf\u4e8c\u7ef4\u7801",connect:"\u8fde\u63a5",qrcode:"\u4e8c\u7ef4\u7801",mobile:"\u79fb\u52a8",desktop:"\u684c\u9762",copy_to_clipboard:"\u590d\u5236\u5230\u526a\u8d34\u677f",copied_to_clipboard:"\u590d\u5236\u5230\u526a\u8d34\u677f\u6210\u529f\uff01",connect_with:"\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u8fde\u63a5",loading:"\u6b63\u5728\u52a0\u8f7d...",something_went_wrong:"\u51fa\u4e86\u95ee\u9898",no_supported_wallets:"\u76ee\u524d\u8fd8\u6ca1\u6709\u652f\u6301\u7684\u94b1\u5305",no_wallets_found:"\u6ca1\u6709\u627e\u5230\u94b1\u5305"},fa:{choose_preferred_wallet:"\u06a9\u06cc\u0641 \u067e\u0648\u0644 \u0645\u0648\u0631\u062f \u0646\u0638\u0631 \u062e\u0648\u062f \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f",connect_mobile_wallet:"\u0628\u0647 \u06a9\u06cc\u0641 \u067e\u0648\u0644 \u0645\u0648\u0628\u0627\u06cc\u0644 \u0648\u0635\u0644 \u0634\u0648\u06cc\u062f",scan_qrcode_with_wallet:"\u06a9\u062f QR \u0631\u0627 \u0628\u0627 \u06cc\u06a9 \u06a9\u06cc\u0641 \u067e\u0648\u0644 \u0633\u0627\u0632\u06af\u0627\u0631 \u0628\u0627 WalletConnect \u0627\u0633\u06a9\u0646 \u06a9\u0646\u06cc\u062f",connect:"\u0627\u062a\u0635\u0627\u0644",qrcode:"\u06a9\u062f QR",mobile:"\u0633\u06cc\u0627\u0631",desktop:"\u062f\u0633\u06a9\u062a\u0627\u067e",copy_to_clipboard:"\u06a9\u067e\u06cc \u0628\u0647 \u06a9\u0644\u06cc\u067e \u0628\u0648\u0631\u062f",copied_to_clipboard:"\u062f\u0631 \u06a9\u0644\u06cc\u067e \u0628\u0648\u0631\u062f \u06a9\u067e\u06cc \u0634\u062f!",connect_with:"\u0627\u0631\u062a\u0628\u0627\u0637 \u0628\u0627",loading:"...\u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc",something_went_wrong:"\u0645\u0634\u06a9\u0644\u06cc \u067e\u06cc\u0634 \u0622\u0645\u062f",no_supported_wallets:"\u0647\u0646\u0648\u0632 \u0647\u06cc\u0686 \u06a9\u06cc\u0641 \u067e\u0648\u0644 \u067e\u0634\u062a\u06cc\u0628\u0627\u0646\u06cc \u0634\u062f\u0647 \u0627\u06cc \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f",no_wallets_found:"\u0647\u06cc\u0686 \u06a9\u06cc\u0641 \u067e\u0648\u0644\u06cc \u067e\u06cc\u062f\u0627 \u0646\u0634\u062f"}};function O(){var L=y.getDocumentOrThrow(),H=L.getElementById("walletconnect-qrcode-modal");H&&(H.className=H.className.replace("fadeIn","fadeOut"),setTimeout(function(){var D=L.getElementById("walletconnect-wrapper");D&&L.body.removeChild(D)},300))}function b(L){return function(){O(),L&&L()}}var w=function(){return void 0!==s&&void 0!==s.versions&&void 0!==s.versions.node};z.exports={open:function(L,H,D){console.log(L),w()?n.toString(L,{type:"terminal"}).then(console.log):function S(L,H,D){!function(){var p=y.getDocumentOrThrow(),x=p.getElementById("walletconnect-style-sheet");x&&p.head.removeChild(x);var R=p.createElement("style");R.setAttribute("id","walletconnect-style-sheet"),R.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',p.head.appendChild(R)}();var q,p,x,k=((x=(p=y.getDocumentOrThrow()).createElement("div")).setAttribute("id","walletconnect-wrapper"),p.body.appendChild(x),x);e.render(e.createElement(v,{text:(q=y.getNavigatorOrThrow().language.split("-")[0]||"en",T[q]||T.en),uri:L,onClose:b(H),qrcodeModalOptions:D}),k)}(L,H,D)},close:function(){w()||O()}}}).call(this,c(5))},function(z,l,c){var s=c(180),m=c(181),y=c(198),n=c(199);function o(e,t,i,u,h){var f=[].slice.call(arguments,1),d=f.length,_="function"==typeof f[d-1];if(!_&&!s())throw new Error("Callback required as last argument");if(!_){if(d<1)throw new Error("Too few arguments provided");return 1===d?(i=t,t=u=void 0):2!==d||t.getContext||(u=i,i=t,t=void 0),new Promise(function(T,O){try{var b=m.create(i,u);T(e(b,t,u))}catch(S){O(S)}})}if(d<2)throw new Error("Too few arguments provided");2===d?(h=i,i=t,t=u=void 0):3===d&&(t.getContext&&void 0===h?(h=u,u=void 0):(h=u,u=i,i=t,t=void 0));try{var v=m.create(i,u);h(null,e(v,t,u))}catch(T){h(T)}}l.create=m.create,l.toCanvas=o.bind(null,y.render),l.toDataURL=o.bind(null,y.renderToDataURL),l.toString=o.bind(null,function(e,t,i){return n.render(e,i)})},function(z,l){z.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},function(z,l,c){var s=c(26),m=c(17),y=c(51),n=c(182),o=c(183),e=c(184),t=c(185),i=c(186),u=c(98),h=c(187),f=c(190),d=c(191),_=c(18),v=c(192),T=c(50);function O(w,A,L){var H,D,q=w.size,k=d.getEncodedBits(A,L);for(H=0;H<15;H++)w.set(H<6?H:H<8?H+1:q-15+H,8,D=1==(k>>H&1),!0),w.set(8,H<8?q-H-1:H<9?15-H-1+1:15-H-1,D,!0);w.set(q-8,8,1,!0)}function S(w,A,L,H){var D;if(T(w))D=v.fromArray(w);else{if("string"!=typeof w)throw new Error("Invalid data");var q=A;if(!q){var k=v.rawSplit(w);q=f.getBestVersionForData(k,L)}D=v.fromString(w,q||40)}var p=f.getBestVersionForData(D,L);if(!p)throw new Error("The amount of data is too big to be stored in a QR Code");if(A){if(A=0&&I<=6&&(0===W||6===W)||W>=0&&W<=6&&(0===I||6===I)||I>=2&&I<=4&&W>=2&&W<=4,!0)}(r,A),function(a){for(var g=a.size,M=8;M=7&&function(a,g){for(var M,E,C,U=a.size,V=f.getEncodedBits(g),I=0;I<18;I++)M=Math.floor(I/3),a.set(M,E=I%3+U-8-3,C=1==(V>>I&1),!0),a.set(E,M,C,!0)}(r,A),function(a,g){for(var M=a.size,E=-1,C=M-1,U=7,V=0,I=M-1;I>0;I-=2)for(6===I&&I--;;){for(var W=0;W<2;W++)if(!a.isReserved(C,I-W)){var F=!1;V>>U&1)),a.set(C,I-W,F),-1==--U&&(V++,U=7)}if((C+=E)<0||M<=C){C-=E,E=-E;break}}}(r,x),isNaN(H)&&(H=i.getBestMask(r,O.bind(null,r,L))),i.applyMask(H,r),O(r,L,H),{modules:r,version:A,errorCorrectionLevel:L,maskPattern:H,segments:D}}l.create=function(w,A){if(void 0===w||""===w)throw new Error("No input text");var L,H,D=y.M;return void 0!==A&&(D=y.from(A.errorCorrectionLevel,y.M),L=f.from(A.version),H=i.from(A.maskPattern),A.toSJISFunc&&m.setToSJISFunction(A.toSJISFunc)),S(w,L,D,H)}},function(z,l){function c(){this.buffer=[],this.length=0}c.prototype={get:function(s){var m=Math.floor(s/8);return 1==(this.buffer[m]>>>7-s%8&1)},put:function(s,m){for(var y=0;y>>m-y-1&1))},getLengthInBits:function(){return this.length},putBit:function(s){var m=Math.floor(this.length/8);this.buffer.length<=m&&this.buffer.push(0),s&&(this.buffer[m]|=128>>>this.length%8),this.length++}},z.exports=c},function(z,l,c){var s=c(26);function m(y){if(!y||y<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=y,this.data=s.alloc(y*y),this.reservedBit=s.alloc(y*y)}m.prototype.set=function(y,n,o,e){var t=y*this.size+n;this.data[t]=o,e&&(this.reservedBit[t]=!0)},m.prototype.get=function(y,n){return this.data[y*this.size+n]},m.prototype.xor=function(y,n,o){this.data[y*this.size+n]^=o},m.prototype.isReserved=function(y,n){return this.reservedBit[y*this.size+n]},z.exports=m},function(z,l,c){var s=c(17).getSymbolSize;l.getRowColCoords=function(m){if(1===m)return[];for(var y=Math.floor(m/7)+2,n=s(m),o=145===n?26:2*Math.ceil((n-13)/(2*y-2)),e=[n-7],t=1;t=0&&o<=7},l.from=function(o){return l.isValid(o)?parseInt(o,10):void 0},l.getPenaltyN1=function(o){for(var e=o.size,t=0,i=0,u=0,h=null,f=null,d=0;d=5&&(t+=i-5+3),h=v,i=1),(v=o.get(_,d))===f?u++:(u>=5&&(t+=u-5+3),f=v,u=1)}i>=5&&(t+=i-5+3),u>=5&&(t+=u-5+3)}return t},l.getPenaltyN2=function(o){for(var e=o.size,t=0,i=0;i=10&&(1488===i||93===i)&&t++,u=u<<1&2047|o.get(f,h),f>=10&&(1488===u||93===u)&&t++}return 40*t},l.getPenaltyN4=function(o){for(var e=0,t=o.data.length,i=0;i0){var h=s.alloc(this.degree);return i.copy(h,u),h}return i},z.exports=n},function(z,l,c){var s=c(26),m=c(189);l.mul=function(y,n){for(var o=s.alloc(y.length+n.length-1),e=0;e=0;){for(var e=o[0],t=0;t1)return function(v,T){for(var O=1;O<=40;O++)if(u(v,O)<=l.getCapacity(O,T,n.MIXED))return O}(h,_);if(0===h.length)return 1;d=h[0]}else d=h;return function(v,T,O){for(var b=1;b<=40;b++)if(T<=l.getCapacity(b,O,v))return b}(d.mode,d.getLength(),_)},l.getEncodedBits=function(h){if(!o.isValid(h)||h<7)throw new Error("Invalid QR Code version");for(var f=h<<12;s.getBCHDigit(f)-t>=0;)f^=7973<=0;)e^=1335<=0?L[L.length-1]:null;return D&&D.mode===H.mode?(L[L.length-1].data+=H.data,L):(L.push(H),L)},[]))},l.rawSplit=function(v){return l.fromArray(f(v,t.isKanjiModeEnabled()))}},function(z,l,c){var s=c(18);function m(y){this.mode=s.NUMERIC,this.data=y.toString()}m.getBitsLength=function(y){return 10*Math.floor(y/3)+(y%3?y%3*3+1:0)},m.prototype.getLength=function(){return this.data.length},m.prototype.getBitsLength=function(){return m.getBitsLength(this.data.length)},m.prototype.write=function(y){var n,o,e;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),e=parseInt(o,10),y.put(e,10);var t=this.data.length-n;t>0&&(o=this.data.substr(n),e=parseInt(o,10),y.put(e,3*t+1))},z.exports=m},function(z,l,c){var s=c(18),m=["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 y(n){this.mode=s.ALPHANUMERIC,this.data=n}y.getBitsLength=function(n){return 11*Math.floor(n/2)+n%2*6},y.prototype.getLength=function(){return this.data.length},y.prototype.getBitsLength=function(){return y.getBitsLength(this.data.length)},y.prototype.write=function(n){var o;for(o=0;o+2<=this.data.length;o+=2){var e=45*m.indexOf(this.data[o]);e+=m.indexOf(this.data[o+1]),n.put(e,11)}this.data.length%2&&n.put(m.indexOf(this.data[o]),6)},z.exports=y},function(z,l,c){var s=c(26),m=c(18);function y(n){this.mode=m.BYTE,this.data=s.from(n)}y.getBitsLength=function(n){return 8*n},y.prototype.getLength=function(){return this.data.length},y.prototype.getBitsLength=function(){return y.getBitsLength(this.data.length)},y.prototype.write=function(n){for(var o=0,e=this.data.length;o=33088&&e<=40956)e-=33088;else{if(!(e>=57408&&e<=60351))throw new Error("Invalid SJIS character: "+this.data[o]+"\nMake sure your charset is UTF-8");e-=49472}n.put(e=192*(e>>>8&255)+(255&e),13)}},z.exports=y},function(z,l,c){"use strict";var s={single_source_shortest_paths:function(m,y,n){var o={},e={};e[y]=0;var t,i,u,h,f,d,v=s.PriorityQueue.make();for(v.push(y,0);!v.empty();)for(u in i=(t=v.pop()).value,h=t.cost,f=m[i]||{})f.hasOwnProperty(u)&&(d=h+f[u],(void 0===e[u]||e[u]>d)&&(e[u]=d,v.push(u,d),o[u]=i));if(void 0!==n&&void 0===e[n]){var T=["Could not find a path from ",y," to ",n,"."].join("");throw new Error(T)}return o},extract_shortest_path_from_predecessor_list:function(m,y){for(var n=[],o=y;o;)n.push(o),o=m[o];return n.reverse(),n},find_path:function(m,y,n){var o=s.single_source_shortest_paths(m,y,n);return s.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(m){var y,n=s.PriorityQueue,o={};for(y in m=m||{},n)n.hasOwnProperty(y)&&(o[y]=n[y]);return o.queue=[],o.sorter=m.sorter||n.default_sorter,o},default_sorter:function(m,y){return m.cost-y.cost},push:function(m,y){this.queue.push({value:m,cost:y}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};z.exports=s},function(z,l,c){var s=c(101);l.render=function(m,y,n){var o=n,e=y;void 0!==o||y&&y.getContext||(o=y,y=void 0),y||(e=function(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}()),o=s.getOptions(o);var f,d,t=s.getImageWidth(m.modules.size,o),i=e.getContext("2d"),u=i.createImageData(t,t);return s.qrToImageData(u.data,m,o),d=t,i.clearRect(0,0,(f=e).width,f.height),f.style||(f.style={}),f.height=d,f.width=d,f.style.height=d+"px",f.style.width=d+"px",i.putImageData(u,0,0),e},l.renderToDataURL=function(m,y,n){var o=n;return void 0!==o||y&&y.getContext||(o=y,y=void 0),o||(o={}),l.render(m,y,o).toDataURL(o.type||"image/png",(o.rendererOpts||{}).quality)}},function(z,l,c){var s=c(101);function m(n,o){var e=n.a/255,t=o+'="'+n.hex+'"';return e<1?t+" "+o+'-opacity="'+e.toFixed(2).slice(1)+'"':t}function y(n,o,e){var t=n+o;return void 0!==e&&(t+=" "+e),t}l.render=function(n,o,e){var t=s.getOptions(o),i=n.modules.size,u=n.modules.data,h=i+2*t.margin,f=t.color.light.a?"':"",d="0&&D>0&&T[H-1]||(S+=A?y("M",D+b,.5+q+b):y("m",w,0),w=0,A=!1),D+1',v=''+f+d+"\n";return"function"==typeof e&&e(null,v),v}},function(z,l,c){"use strict";var s=c(201),m={"text/plain":"Text","text/html":"Url",default:"Text"};z.exports=function(y,n){var o,e,t,i,u,h,v,T,f=!1;n||(n={}),o=n.debug||!1;try{if(t=s(),i=document.createRange(),u=document.getSelection(),(h=document.createElement("span")).textContent=y,h.style.all="unset",h.style.position="fixed",h.style.top=0,h.style.clip="rect(0, 0, 0, 0)",h.style.whiteSpace="pre",h.style.webkitUserSelect="text",h.style.MozUserSelect="text",h.style.msUserSelect="text",h.style.userSelect="text",h.addEventListener("copy",function(d){d.stopPropagation(),n.format&&(d.preventDefault(),void 0===d.clipboardData?(o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData(),window.clipboardData.setData(m[n.format]||m.default,y)):(d.clipboardData.clearData(),d.clipboardData.setData(n.format,y))),n.onCopy&&(d.preventDefault(),n.onCopy(d.clipboardData))}),document.body.appendChild(h),i.selectNodeContents(h),u.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");f=!0}catch(d){o&&console.error("unable to copy using execCommand: ",d),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",y),n.onCopy&&n.onCopy(window.clipboardData),f=!0}catch(_){o&&console.error("unable to copy using clipboardData: ",_),o&&console.error("falling back to prompt"),v="message"in n?n.message:"Copy to clipboard: #{key}, Enter",T=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C",e=v.replace(/#{\s*key\s*}/g,T),window.prompt(e,y)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(i):u.removeAllRanges()),h&&document.body.removeChild(h),t()}return f}},function(z,l){z.exports=function(){var c=document.getSelection();if(!c.rangeCount)return function(){};for(var s=document.activeElement,m=[],y=0;y{if("eth_subscribe"===i.method){const v=this.formatError(i,"Subscriptions are not supported by this HTTP endpoint");return this.emit("error",v),h(v)}const f=new o;let d=!1;const _=(v,T)=>{if(!d)if(f.abort(),d=!0,u)u(v,T);else{const{id:O,jsonrpc:b}=i,S=v?{id:O,jsonrpc:b,error:{message:v.message,code:v.code}}:{id:O,jsonrpc:b,result:T};this.emit("payload",S),h(S)}};f.open("POST",this.url,!0),f.setRequestHeader("Content-Type","application/json"),f.timeout=6e4,f.onerror=_,f.ontimeout=_,f.onreadystatechange=()=>{if(4===f.readyState)try{const v=JSON.parse(f.responseText);_(v.error,v.result)}catch(v){_(v)}},f.send(JSON.stringify(i))})}}},function(z,l,c){"use strict";(function(s,m){var y,n=this&&this.__extends||(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,b){O.__proto__=b}||function(O,b){for(var S in b)b.hasOwnProperty(S)&&(O[S]=b[S])},function(O,b){function S(){this.constructor=O}y(O,b),O.prototype=null===b?Object.create(b):(S.prototype=b.prototype,new S)}),o=this&&this.__assign||Object.assign||function(O){for(var b,S=1,w=arguments.length;S=0)return this._url=this._parseUrl(w.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=w,this._response.on("data",function(H){return A._onHttpResponseData(w,H)}),this._response.on("end",function(){return A._onHttpResponseEnd(w)}),this._response.on("close",function(){return A._onHttpResponseClose(w)}),this.responseUrl=this._url.href.split("#")[0],this.status=w.statusCode,this.statusText=e.STATUS_CODES[this.status],this._parseResponseHeaders(w);var L=this._responseHeaders["content-length"]||"";this._totalBytes=+L,this._lengthComputable=!!L,this._setReadyState(b.HEADERS_RECEIVED)}},b.prototype._onHttpResponseData=function(S,w){this._response===S&&(this._responseParts.push(new m(w)),this._loadedBytes+=w.length,this.readyState!==b.LOADING&&this._setReadyState(b.LOADING),this._dispatchProgress("progress"))},b.prototype._onHttpResponseEnd=function(S){this._response===S&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(b.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},b.prototype._onHttpResponseClose=function(S){if(this._response===S){var w=this._request;this._setError(),w.abort(),this._setReadyState(b.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},b.prototype._onHttpTimeout=function(S){this._request===S&&(this._setError(),S.abort(),this._setReadyState(b.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},b.prototype._onHttpRequestError=function(S,w){this._request===S&&(this._setError(),S.abort(),this._setReadyState(b.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},b.prototype._dispatchProgress=function(S){var w=new b.ProgressEvent(S);w.lengthComputable=this._lengthComputable,w.loaded=this._loadedBytes,w.total=this._totalBytes,this.dispatchEvent(w)},b.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},b.prototype._parseUrl=function(S,w,A){var L=null==this.nodejsBaseUrl?S:u.resolve(this.nodejsBaseUrl,S),H=u.parse(L,!1,!0);H.hash=null;var D=(H.auth||"").split(":"),q=D[0],k=D[1];return(q||k||w||A)&&(H.auth=(w||q||"")+":"+(A||k||"")),H},b.prototype._parseResponseHeaders=function(S){for(var w in this._responseHeaders={},S.headers){var A=w.toLowerCase();this._privateHeaders[A]||(this._responseHeaders[A]=S.headers[w])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},b.prototype._parseResponse=function(){var S=m.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(S.toString("utf-8"))}catch{this.response=null}return;case"buffer":return this.responseText=null,void(this.response=S);case"arraybuffer":this.responseText=null;for(var w=new ArrayBuffer(S.length),A=new Uint8Array(w),L=0;L0?this.tail.next=o:this.head=o,this.tail=o,++this.length},y.prototype.unshift=function(n){var o={data:n,next:this.head};0===this.length&&(this.tail=o),this.head=o,++this.length},y.prototype.shift=function(){if(0!==this.length){var n=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,n}},y.prototype.clear=function(){this.head=this.tail=null,this.length=0},y.prototype.join=function(n){if(0===this.length)return"";for(var o=this.head,e=""+o.data;o=o.next;)e+=n+o.data;return e},y.prototype.concat=function(n){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var i=s.allocUnsafe(n>>>0),u=this.head,h=0;u;)u.data.copy(i,h),h+=u.data.length,u=u.next;return i},y}(),m&&m.inspect&&m.inspect.custom&&(z.exports.prototype[m.inspect.custom]=function(){var y=m.inspect({length:this.length});return this.constructor.name+" "+y})},function(z,l){},function(z,l,c){(function(s,m){!function(y,n){"use strict";if(!y.setImmediate){var o,e,t,i,u,h=1,f={},d=!1,_=y.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(y);v=v&&v.setTimeout?v:y,"[object process]"==={}.toString.call(y.process)?o=function(b){m.nextTick(function(){O(b)})}:function(){if(y.postMessage&&!y.importScripts){var b=!0,S=y.onmessage;return y.onmessage=function(){b=!1},y.postMessage("","*"),y.onmessage=S,b}}()?(i="setImmediate$"+Math.random()+"$",u=function(b){b.source===y&&"string"==typeof b.data&&0===b.data.indexOf(i)&&O(+b.data.slice(i.length))},y.addEventListener?y.addEventListener("message",u,!1):y.attachEvent("onmessage",u),o=function(b){y.postMessage(i+b,"*")}):y.MessageChannel?((t=new MessageChannel).port1.onmessage=function(b){O(b.data)},o=function(b){t.port2.postMessage(b)}):_&&"onreadystatechange"in _.createElement("script")?(e=_.documentElement,o=function(b){var S=_.createElement("script");S.onreadystatechange=function(){O(b),S.onreadystatechange=null,e.removeChild(S),S=null},e.appendChild(S)}):o=function(b){setTimeout(O,0,b)},v.setImmediate=function(b){"function"!=typeof b&&(b=new Function(""+b));for(var S=new Array(arguments.length-1),w=0;w"u"?void 0===s?this:s:self)}).call(this,c(6),c(5))},function(z,l,c){var s=c(2),m=s.Buffer;function y(o,e){for(var t in o)e[t]=o[t]}function n(o,e,t){return m(o,e,t)}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?z.exports=s:(y(s,l),l.Buffer=n),y(m,n),n.from=function(o,e,t){if("number"==typeof o)throw new TypeError("Argument must not be a number");return m(o,e,t)},n.alloc=function(o,e,t){if("number"!=typeof o)throw new TypeError("Argument must be a number");var i=m(o);return void 0!==e?"string"==typeof t?i.fill(e,t):i.fill(e):i.fill(0),i},n.allocUnsafe=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return m(o)},n.allocUnsafeSlow=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return s.SlowBuffer(o)}},function(z,l,c){"use strict";z.exports=y;var s=c(109),m=Object.create(c(35));function y(n){if(!(this instanceof y))return new y(n);s.call(this,n)}m.inherits=c(3),m.inherits(y,s),y.prototype._transform=function(n,o,e){e(null,n)}},function(z,l,c){var s=c(2).Buffer;z.exports=function(m){if(m instanceof Uint8Array){if(0===m.byteOffset&&m.byteLength===m.buffer.byteLength)return m.buffer;if("function"==typeof m.buffer.slice)return m.buffer.slice(m.byteOffset,m.byteOffset+m.byteLength)}if(s.isBuffer(m)){for(var y=new Uint8Array(m.length),n=m.length,o=0;o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,_=String.fromCharCode;function v(D){throw new RangeError(f[D])}function T(D,q){for(var k=D.length,p=[];k--;)p[k]=q(D[k]);return p}function O(D,q){var k=D.split("@"),p="";return k.length>1&&(p=k[0]+"@",D=k[1]),p+T((D=D.replace(h,".")).split("."),q).join(".")}function b(D){for(var q,k,p=[],x=0,R=D.length;x=55296&&q<=56319&&x65535&&(k+=_((q-=65536)>>>10&1023|55296),q=56320|1023&q),k+_(q)}).join("")}function w(D,q){return D+22+75*(D<26)-((0!=q)<<5)}function A(D,q,k){var p=0;for(D=k?d(D/700):D>>1,D+=d(D/q);D>455;p+=36)D=d(D/35);return d(p+36*D/(D+38))}function L(D){var q,k,p,x,R,r,a,g,M,E,C,U=[],V=D.length,I=0,W=128,F=72;for((k=D.lastIndexOf("-"))<0&&(k=0),p=0;p=128&&v("not-basic"),U.push(D.charCodeAt(p));for(x=k>0?k+1:0;x=V&&v("invalid-input"),((g=(C=D.charCodeAt(x++))-48<10?C-22:C-65<26?C-65:C-97<26?C-97:36)>=36||g>d((t-I)/r))&&v("overflow"),I+=g*r,!(g<(M=a<=F?1:a>=F+26?26:a-F));a+=36)r>d(t/(E=36-M))&&v("overflow"),r*=E;F=A(I-R,q=U.length+1,0==R),d(I/q)>t-W&&v("overflow"),W+=d(I/q),I%=q,U.splice(I++,0,W)}return S(U)}function H(D){var q,k,p,x,R,r,a,g,M,E,C,U,V,I,W,F=[];for(U=(D=b(D)).length,q=128,k=0,R=72,r=0;r=q&&Cd((t-k)/(V=p+1))&&v("overflow"),k+=(a-q)*V,q=a,r=0;rt&&v("overflow"),C==q){for(g=k,M=36;!(g<(E=M<=R?1:M>=R+26?26:M-R));M+=36)F.push(_(w(E+(W=g-E)%(I=36-E),0))),g=d(W/I);F.push(_(w(g,0))),R=A(k,V,p==x),k=0,++p}++k,++q}return F.join("")}e={version:"1.4.1",ucs2:{decode:b,encode:S},decode:L,encode:H,toASCII:function(D){return O(D,function(q){return u.test(q)?"xn--"+H(q):q})},toUnicode:function(D){return O(D,function(q){return i.test(q)?L(q.slice(4).toLowerCase()):q})}},void 0===(y=function(){return e}.call(l,c,l,s))||(s.exports=y)}()}).call(this,c(25)(z),c(6))},function(z,l,c){"use strict";z.exports={isString:function(s){return"string"==typeof s},isObject:function(s){return"object"==typeof s&&null!==s},isNull:function(s){return null===s},isNullOrUndefined:function(s){return null==s}}},function(z,l,c){"use strict";l.decode=l.parse=c(216),l.encode=l.stringify=c(217)},function(z,l,c){"use strict";function s(y,n){return Object.prototype.hasOwnProperty.call(y,n)}z.exports=function(y,n,o,e){o=o||"=";var t={};if("string"!=typeof y||0===y.length)return t;var i=/\+/g;y=y.split(n=n||"&");var u=1e3;e&&"number"==typeof e.maxKeys&&(u=e.maxKeys);var h=y.length;u>0&&h>u&&(h=u);for(var f=0;f=0?(d=O.substr(0,b),_=O.substr(b+1)):(d=O,_=""),v=decodeURIComponent(d),T=decodeURIComponent(_),s(t,v)?m(t[v])?t[v].push(T):t[v]=[t[v],T]:t[v]=T}return t};var m=Array.isArray||function(y){return"[object Array]"===Object.prototype.toString.call(y)}},function(z,l,c){"use strict";var s=function(o){switch(typeof o){case"string":return o;case"boolean":return o?"true":"false";case"number":return isFinite(o)?o:"";default:return""}};z.exports=function(o,e,t,i){return e=e||"&",t=t||"=",null===o&&(o=void 0),"object"==typeof o?y(n(o),function(u){var h=encodeURIComponent(s(u))+t;return m(o[u])?y(o[u],function(f){return h+encodeURIComponent(s(f))}).join(e):h+encodeURIComponent(s(o[u]))}).join(e):i?encodeURIComponent(s(i))+t+encodeURIComponent(s(o)):""};var m=Array.isArray||function(o){return"[object Array]"===Object.prototype.toString.call(o)};function y(o,e){if(o.map)return o.map(e);for(var t=[],i=0;i{d._getBlockByNumberWithRetry(_,(v,T)=>{if(v)return void this.emit("error",v);if(!T)return console.log(T),void this.emit("error",new Error("Could not find block"));const O={number:y.toBuffer((b=T).number),hash:y.toBuffer(b.hash),parentHash:y.toBuffer(b.parentHash),nonce:y.toBuffer(b.nonce),mixHash:y.toBuffer(b.mixHash),sha3Uncles:y.toBuffer(b.sha3Uncles),logsBloom:y.toBuffer(b.logsBloom),transactionsRoot:y.toBuffer(b.transactionsRoot),stateRoot:y.toBuffer(b.stateRoot),receiptsRoot:y.toBuffer(b.receiptRoot||b.receiptsRoot),miner:y.toBuffer(b.miner),difficulty:y.toBuffer(b.difficulty),totalDifficulty:y.toBuffer(b.totalDifficulty),size:y.toBuffer(b.size),extraData:y.toBuffer(b.extraData),gasLimit:y.toBuffer(b.gasLimit),gasUsed:y.toBuffer(b.gasUsed),timestamp:y.toBuffer(b.timestamp),transactions:b.transactions};var b;d._setCurrentBlock(O),d.emit("rawBlock",T),d.emit("latest",T)})}),d._blockTracker.on("sync",d.emit.bind(d,"sync")),d._blockTracker.on("error",d.emit.bind(d,"error")),d._running=!0,d.emit("start")},h.prototype.stop=function(){this._blockTracker.removeAllListeners(),this._running=!1,this.emit("stop")},h.prototype.isRunning=function(){return this._running},h.prototype.addProvider=function(f,d){"number"==typeof d?this._providers.splice(d,0,f):this._providers.push(f),f.setEngine(this)},h.prototype.removeProvider=function(f){const d=this._providers.indexOf(f);if(d<0)throw new Error("Provider not found.");this._providers.splice(d,1)},h.prototype.send=function(f){throw new Error("Web3ProviderEngine does not support synchronous requests.")},h.prototype.sendAsync=function(f,d){const _=this;_._ready.await(function(){Array.isArray(f)?o(f,_._handleAsync.bind(_),d):_._handleAsync(f,d)})},h.prototype._getBlockByNumberWithRetry=function(f,d){const _=this;let v=5;return void T();function T(){_._getBlockByNumber(f,O)}function O(b,S){return b?d(b):S?void d(null,S):v>0?(v--,void setTimeout(function(){T()},1e3)):void d(null,null)}},h.prototype._getBlockByNumber=function(f,d){const _=i({method:"eth_getBlockByNumber",params:[f,!1],skipCache:!0});this._handleAsync(_,(v,T)=>v?d(v):d(null,T.result))},h.prototype._handleAsync=function(f,d){var _=this,v=-1,T=null,O=null,b=[];function S(w,A){O=w,T=A,e(b,function(L,H){L?L(O,T,H):H()},function(){var L={id:f.id,jsonrpc:f.jsonrpc,result:T};null!=O?(L.error={message:O.stack||O.message||O,code:-32e3},d(O,L)):d(null,L)})}!function w(A){if(v+=1,b.unshift(A),v>=_._providers.length)S(new Error('Request for method "'+f.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{_._providers[v].handleRequest(f,w,S)}catch(L){S(L)}}()},h.prototype._setCurrentBlock=function(f){this.currentBlock=f,this.emit("block",f)}},function(z,l){z.exports=function(c){return c&&"object"==typeof c&&"function"==typeof c.copy&&"function"==typeof c.fill&&"function"==typeof c.readUInt8}},function(z,l){z.exports="function"==typeof Object.create?function(c,s){c.super_=s,c.prototype=Object.create(s.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}})}:function(c,s){c.super_=s;var m=function(){};m.prototype=s.prototype,c.prototype=new m,c.prototype.constructor=c}},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.createHashFunction=function(m){return function(y){var n=m();return n.update(y),s.from(n.digest())}}}).call(this,c(2).Buffer)},function(z,l,c){z.exports=c(229)(c(239))},function(z,l,c){const s=c(230),m=c(238);z.exports=function(y){const n=s(y),o=m(y);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new n(1152,448,null,224,t);case"keccak256":return new n(1088,512,null,256,t);case"keccak384":return new n(832,768,null,384,t);case"keccak512":return new n(576,1024,null,512,t);case"sha3-224":return new n(1152,448,6,224,t);case"sha3-256":return new n(1088,512,6,256,t);case"sha3-384":return new n(832,768,6,384,t);case"sha3-512":return new n(576,1024,6,512,t);case"shake128":return new o(1344,256,31,t);case"shake256":return new o(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},function(z,l,c){(function(s){const{Transform:m}=c(111);z.exports=y=>class gt extends m{constructor(o,e,t,i,u){super(u),this._rate=o,this._capacity=e,this._delimitedSuffix=t,this._hashBitLength=i,this._options=u,this._state=new y,this._state.initialize(o,e),this._finalized=!1}_transform(o,e,t){let i=null;try{this.update(o,e)}catch(u){i=u}t(i)}_flush(o){let e=null;try{this.push(this.digest())}catch(t){e=t}o(e)}update(o,e){if(!s.isBuffer(o)&&"string"!=typeof o)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return s.isBuffer(o)||(o=s.from(o,e)),this._state.absorb(o),this}digest(o){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let e=this._state.squeeze(this._hashBitLength/8);return void 0!==o&&(e=e.toString(o)),this._resetState(),e}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const o=new gt(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(o._state),o._finalized=this._finalized,o}}}).call(this,c(2).Buffer)},function(z,l){},function(z,l,c){"use strict";function s(t,i){var u=Object.keys(t);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(t);i&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(t,f).enumerable})),u.push.apply(u,h)}return u}function m(t,i,u){return i in t?Object.defineProperty(t,i,{value:u,enumerable:!0,configurable:!0,writable:!0}):t[i]=u,t}function y(t,i){for(var u=0;u0?this.tail.next=d:this.head=d,this.tail=d,++this.length}},{key:"unshift",value:function(f){var d={data:f,next:this.head};0===this.length&&(this.tail=d),this.head=d,++this.length}},{key:"shift",value:function(){if(0!==this.length){var f=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(0===this.length)return"";for(var d=this.head,_=""+d.data;d=d.next;)_+=f+d.data;return _}},{key:"concat",value:function(f){if(0===this.length)return n.alloc(0);for(var T=n.allocUnsafe(f>>>0),O=this.head,b=0;O;)n.prototype.copy.call(O.data,T,b),b+=O.data.length,O=O.next;return T}},{key:"consume",value:function(f,d){var _;return fT.length?T.length:f;if(v+=O===T.length?T:T.slice(0,f),0==(f-=O)){O===T.length?(++_,this.head=d.next?d.next:this.tail=null):(this.head=d,d.data=T.slice(O));break}++_}return this.length-=_,v}},{key:"_getBuffer",value:function(f){var d=n.allocUnsafe(f),_=this.head,v=1;for(_.data.copy(d),f-=_.data.length;_=_.next;){var T=_.data,O=f>T.length?T.length:f;if(T.copy(d,d.length-f,0,O),0==(f-=O)){O===T.length?(++v,this.head=_.next?_.next:this.tail=null):(this.head=_,_.data=T.slice(O));break}++v}return this.length-=v,d}},{key:e,value:function(f,d){return o(this,function(_){for(var v=1;v0,function(w){_||(_=w),w&&T.forEach(t),S||(T.forEach(t),v(_))})});return f.reduce(i)}},function(z,l,c){(function(s){const{Transform:m}=c(111);z.exports=y=>class bt extends m{constructor(o,e,t,i){super(i),this._rate=o,this._capacity=e,this._delimitedSuffix=t,this._options=i,this._state=new y,this._state.initialize(o,e),this._finalized=!1}_transform(o,e,t){let i=null;try{this.update(o,e)}catch(u){i=u}t(i)}_flush(){}_read(o){this.push(this.squeeze(o))}update(o,e){if(!s.isBuffer(o)&&"string"!=typeof o)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return s.isBuffer(o)||(o=s.from(o,e)),this._state.absorb(o),this}squeeze(o,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let t=this._state.squeeze(o);return void 0!==e&&(t=t.toString(e)),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const o=new bt(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(o._state),o._finalized=this._finalized,o}}}).call(this,c(2).Buffer)},function(z,l,c){(function(s){const m=c(240);function y(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}y.prototype.initialize=function(n,o){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=n/8,this.count=0,this.squeezing=!1},y.prototype.absorb=function(n){for(let o=0;o>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(m.p1600(this.state),this.count=0);return o},y.prototype.copy=function(n){for(let o=0;o<50;++o)n.state[o]=this.state[o];n.blockSize=this.blockSize,n.count=this.count,n.squeezing=this.squeezing},z.exports=y}).call(this,c(2).Buffer)},function(z,l){const c=[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];l.p1600=function(s){for(let m=0;m<24;++m){const y=s[0]^s[10]^s[20]^s[30]^s[40],n=s[1]^s[11]^s[21]^s[31]^s[41],o=s[2]^s[12]^s[22]^s[32]^s[42],e=s[3]^s[13]^s[23]^s[33]^s[43],t=s[4]^s[14]^s[24]^s[34]^s[44],i=s[5]^s[15]^s[25]^s[35]^s[45],u=s[6]^s[16]^s[26]^s[36]^s[46],h=s[7]^s[17]^s[27]^s[37]^s[47],f=s[8]^s[18]^s[28]^s[38]^s[48],d=s[9]^s[19]^s[29]^s[39]^s[49];let _=f^(o<<1|e>>>31),v=d^(e<<1|o>>>31);const T=s[0]^_,O=s[1]^v,b=s[10]^_,S=s[11]^v,w=s[20]^_,A=s[21]^v,L=s[30]^_,H=s[31]^v,D=s[40]^_,q=s[41]^v;_=y^(t<<1|i>>>31),v=n^(i<<1|t>>>31);const k=s[2]^_,p=s[3]^v,x=s[12]^_,R=s[13]^v,r=s[22]^_,a=s[23]^v,g=s[32]^_,M=s[33]^v,E=s[42]^_,C=s[43]^v;_=o^(u<<1|h>>>31),v=e^(h<<1|u>>>31);const U=s[4]^_,V=s[5]^v,I=s[14]^_,W=s[15]^v,F=s[24]^_,B=s[25]^v,N=s[34]^_,P=s[35]^v,j=s[44]^_,K=s[45]^v;_=t^(f<<1|d>>>31),v=i^(d<<1|f>>>31);const Z=s[6]^_,J=s[7]^v,X=s[16]^_,ee=s[17]^v,te=s[26]^_,oe=s[27]^v,ve=s[36]^_,ie=s[37]^v,de=s[46]^_,fe=s[47]^v;_=u^(y<<1|n>>>31),v=h^(n<<1|y>>>31);const re=s[8]^_,_e=s[9]^v,Ke=s[18]^_,pe=s[19]^v,Te=s[28]^_,Ve=s[29]^v,be=s[38]^_,Pe=s[39]^v,Ye=s[48]^_,we=s[49]^v,Be=T,$e=O,Me=S<<4|b>>>28,je=b<<4|S>>>28,Q=w<<3|A>>>29,se=A<<3|w>>>29,le=H<<9|L>>>23,Le=L<<9|H>>>23,he=D<<18|q>>>14,Oe=q<<18|D>>>14,Ge=k<<1|p>>>31,me=p<<1|k>>>31,ze=R<<12|x>>>20,rt=x<<12|R>>>20,Re=r<<10|a>>>22,He=a<<10|r>>>22,Qe=M<<13|g>>>19,Ee=g<<13|M>>>19,Ne=E<<2|C>>>30,it=C<<2|E>>>30,xe=V<<30|U>>>2,qe=U<<30|V>>>2,et=I<<6|W>>>26,ke=W<<6|I>>>26,We=B<<11|F>>>21,tt=F<<11|B>>>21,Se=N<<15|P>>>17,Fe=P<<15|N>>>17,nt=K<<29|j>>>3,Ae=j<<29|K>>>3,Ue=Z<<28|J>>>4,Y=J<<28|Z>>>4,G=ee<<23|X>>>9,$=X<<23|ee>>>9,ne=te<<25|oe>>>7,ce=oe<<25|te>>>7,ue=ve<<21|ie>>>11,Ce=ie<<21|ve>>>11,Ie=fe<<24|de>>>8,De=de<<24|fe>>>8,ye=re<<27|_e>>>5,ae=_e<<27|re>>>5,Je=Ke<<20|pe>>>12,ot=pe<<20|Ke>>>12,at=Ve<<7|Te>>>25,st=Te<<7|Ve>>>25,ut=be<<8|Pe>>>24,Ze=Pe<<8|be>>>24,ct=Ye<<14|we>>>18,Xe=we<<14|Ye>>>18;s[0]=Be^~ze&We,s[1]=$e^~rt&tt,s[10]=Ue^~Je&Q,s[11]=Y^~ot&se,s[20]=Ge^~et&ne,s[21]=me^~ke&ce,s[30]=ye^~Me&Re,s[31]=ae^~je&He,s[40]=xe^~G&at,s[41]=qe^~$&st,s[2]=ze^~We&ue,s[3]=rt^~tt&Ce,s[12]=Je^~Q&Qe,s[13]=ot^~se&Ee,s[22]=et^~ne&ut,s[23]=ke^~ce&Ze,s[32]=Me^~Re&Se,s[33]=je^~He&Fe,s[42]=G^~at&le,s[43]=$^~st&Le,s[4]=We^~ue&ct,s[5]=tt^~Ce&Xe,s[14]=Q^~Qe&nt,s[15]=se^~Ee&Ae,s[24]=ne^~ut&he,s[25]=ce^~Ze&Oe,s[34]=Re^~Se&Ie,s[35]=He^~Fe&De,s[44]=at^~le&Ne,s[45]=st^~Le&it,s[6]=ue^~ct&Be,s[7]=Ce^~Xe&$e,s[16]=Qe^~nt&Ue,s[17]=Ee^~Ae&Y,s[26]=ut^~he&Ge,s[27]=Ze^~Oe&me,s[36]=Se^~Ie&ye,s[37]=Fe^~De&ae,s[46]=le^~Ne&xe,s[47]=Le^~it&qe,s[8]=ct^~Be&ze,s[9]=Xe^~$e&rt,s[18]=nt^~Ue&Je,s[19]=Ae^~Y&ot,s[28]=he^~Ge&et,s[29]=Oe^~me&ke,s[38]=Ie^~ye&Me,s[39]=De^~ae&je,s[48]=Ne^~xe&G,s[49]=it^~qe&$,s[0]^=c[2*m],s[1]^=c[2*m+1]}}},function(z,l,c){"use strict";(function(s){var m=c(118),y=c(266),n=c(267),o=function(e){return 32===e.length&&m.privateKeyVerify(Uint8Array.from(e))};z.exports={privateKeyVerify:o,privateKeyExport:function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var i=y.privateKeyExport(e,t);return n.privateKeyExport(e,i,t)},privateKeyImport:function(e){if(null!==(e=n.privateKeyImport(e))&&32===e.length&&o(e))return e;throw new Error("couldn't import from DER format")},privateKeyNegate:function(e){return s.from(m.privateKeyNegate(Uint8Array.from(e)))},privateKeyModInverse:function(e){if(32!==e.length)throw new Error("private key length is invalid");return s.from(y.privateKeyModInverse(Uint8Array.from(e)))},privateKeyTweakAdd:function(e,t){return s.from(m.privateKeyTweakAdd(Uint8Array.from(e),t))},privateKeyTweakMul:function(e,t){return s.from(m.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t)))},publicKeyCreate:function(e,t){return s.from(m.publicKeyCreate(Uint8Array.from(e),t))},publicKeyConvert:function(e,t){return s.from(m.publicKeyConvert(Uint8Array.from(e),t))},publicKeyVerify:function(e){return(33===e.length||65===e.length)&&m.publicKeyVerify(Uint8Array.from(e))},publicKeyTweakAdd:function(e,t,i){return s.from(m.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(t),i))},publicKeyTweakMul:function(e,t,i){return s.from(m.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t),i))},publicKeyCombine:function(e,t){var i=[];return e.forEach(function(u){i.push(Uint8Array.from(u))}),s.from(m.publicKeyCombine(i,t))},signatureNormalize:function(e){return s.from(m.signatureNormalize(Uint8Array.from(e)))},signatureExport:function(e){return s.from(m.signatureExport(Uint8Array.from(e)))},signatureImport:function(e){return s.from(m.signatureImport(Uint8Array.from(e)))},signatureImportLax:function(e){if(0===e.length)throw new RangeError("signature length is invalid");var t=n.signatureImportLax(e);if(null===t)throw new Error("couldn't parse DER signature");return y.signatureImport(t)},sign:function(e,t,i){if(null===i)throw new TypeError("options should be an Object");var u=void 0;if(i){if(u={},null===i.data)throw new TypeError("options.data should be a Buffer");if(i.data){if(32!==i.data.length)throw new RangeError("options.data length is invalid");u.data=new Uint8Array(i.data)}if(null===i.noncefn)throw new TypeError("options.noncefn should be a Function");i.noncefn&&(u.noncefn=function(f,d,_,v,T){var O=null!=_?s.from(_):null,b=null!=v?s.from(v):null,S=s.from("");return i.noncefn&&(S=i.noncefn(s.from(f),s.from(d),O,b,T)),Uint8Array.from(S)})}var h=m.ecdsaSign(Uint8Array.from(e),Uint8Array.from(t),u);return{signature:s.from(h.signature),recovery:h.recid}},verify:function(e,t,i){return m.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),i)},recover:function(e,t,i,u){return s.from(m.ecdsaRecover(Uint8Array.from(t),i,Uint8Array.from(e),u))},ecdh:function(e,t){return s.from(m.ecdh(Uint8Array.from(e),Uint8Array.from(t),{}))},ecdhUnsafe:function(e,t,i){if(33!==e.length&&65!==e.length)throw new RangeError("public key length is invalid");if(32!==t.length)throw new RangeError("private key length is invalid");return s.from(y.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(t),i))}}}).call(this,c(2).Buffer)},function(z,l){const c="Impossible case. Please create issue.",s="The tweak was out of range or the resulted private key is invalid",m="The tweak was out of range or equal to zero",o="Public Key could not be parsed",e="Public Key serialization error",i="Signature could not be parsed";function d(b,S){if(!b)throw new Error(S)}function _(b,S,w){if(d(S instanceof Uint8Array,`Expected ${b} to be an Uint8Array`),void 0!==w)if(Array.isArray(w)){const A=`Expected ${b} to be an Uint8Array with length [${w.join(", ")}]`;d(w.includes(S.length),A)}else d(S.length===w,`Expected ${b} to be an Uint8Array with length ${w}`)}function v(b){d("Boolean"===O(b),"Expected compressed to be a Boolean")}function T(b=(w=>new Uint8Array(w)),S){return"function"==typeof b&&(b=b(S)),_("output",b,S),b}function O(b){return Object.prototype.toString.call(b).slice(8,-1)}z.exports=b=>({contextRandomize(S){if(1===(d(null===S||S instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==S&&_("seed",S,32),b.contextRandomize(S)))throw new Error("Unknow error on context randomization")},privateKeyVerify:S=>(_("private key",S,32),0===b.privateKeyVerify(S)),privateKeyNegate(S){switch(_("private key",S,32),b.privateKeyNegate(S)){case 0:return S;case 1:throw new Error(c)}},privateKeyTweakAdd(S,w){switch(_("private key",S,32),_("tweak",w,32),b.privateKeyTweakAdd(S,w)){case 0:return S;case 1:throw new Error(s)}},privateKeyTweakMul(S,w){switch(_("private key",S,32),_("tweak",w,32),b.privateKeyTweakMul(S,w)){case 0:return S;case 1:throw new Error(m)}},publicKeyVerify:S=>(_("public key",S,[33,65]),0===b.publicKeyVerify(S)),publicKeyCreate(S,w=!0,A){switch(_("private key",S,32),v(w),A=T(A,w?33:65),b.publicKeyCreate(A,S)){case 0:return A;case 1:throw new Error("Private Key is invalid");case 2:throw new Error(e)}},publicKeyConvert(S,w=!0,A){switch(_("public key",S,[33,65]),v(w),A=T(A,w?33:65),b.publicKeyConvert(A,S)){case 0:return A;case 1:throw new Error(o);case 2:throw new Error(e)}},publicKeyNegate(S,w=!0,A){switch(_("public key",S,[33,65]),v(w),A=T(A,w?33:65),b.publicKeyNegate(A,S)){case 0:return A;case 1:throw new Error(o);case 2:throw new Error(c);case 3:throw new Error(e)}},publicKeyCombine(S,w=!0,A){d(Array.isArray(S),"Expected public keys to be an Array"),d(S.length>0,"Expected public keys array will have more than zero items");for(const L of S)_("public key",L,[33,65]);switch(v(w),A=T(A,w?33:65),b.publicKeyCombine(A,S)){case 0:return A;case 1:throw new Error(o);case 2:throw new Error("The sum of the public keys is not valid");case 3:throw new Error(e)}},publicKeyTweakAdd(S,w,A=!0,L){switch(_("public key",S,[33,65]),_("tweak",w,32),v(A),L=T(L,A?33:65),b.publicKeyTweakAdd(L,S,w)){case 0:return L;case 1:throw new Error(o);case 2:throw new Error(s)}},publicKeyTweakMul(S,w,A=!0,L){switch(_("public key",S,[33,65]),_("tweak",w,32),v(A),L=T(L,A?33:65),b.publicKeyTweakMul(L,S,w)){case 0:return L;case 1:throw new Error(o);case 2:throw new Error(m)}},signatureNormalize(S){switch(_("signature",S,64),b.signatureNormalize(S)){case 0:return S;case 1:throw new Error(i)}},signatureExport(S,w){_("signature",S,64);const A={output:w=T(w,72),outputlen:72};switch(b.signatureExport(A,S)){case 0:return w.slice(0,A.outputlen);case 1:throw new Error(i);case 2:throw new Error(c)}},signatureImport(S,w){switch(_("signature",S),w=T(w,64),b.signatureImport(w,S)){case 0:return w;case 1:throw new Error(i);case 2:throw new Error(c)}},ecdsaSign(S,w,A={},L){_("message",S,32),_("private key",w,32),d("Object"===O(A),"Expected options to be an Object"),void 0!==A.data&&_("options.data",A.data),void 0!==A.noncefn&&d("Function"===O(A.noncefn),"Expected options.noncefn to be a Function");const H={signature:L=T(L,64),recid:null};switch(b.ecdsaSign(H,S,w,A.data,A.noncefn)){case 0:return H;case 1:throw new Error("The nonce generation function failed, or the private key was invalid");case 2:throw new Error(c)}},ecdsaVerify(S,w,A){switch(_("signature",S,64),_("message",w,32),_("public key",A,[33,65]),b.ecdsaVerify(S,w,A)){case 0:return!0;case 3:return!1;case 1:throw new Error(i);case 2:throw new Error(o)}},ecdsaRecover(S,w,A,L=!0,H){switch(_("signature",S,64),d("Number"===O(w)&&w>=0&&w<=3,"Expected recovery id to be a Number within interval [0, 3]"),_("message",A,32),v(L),H=T(H,L?33:65),b.ecdsaRecover(H,S,w,A)){case 0:return H;case 1:throw new Error(i);case 2:throw new Error("Public key could not be recover");case 3:throw new Error(c)}},ecdh(S,w,A={},L){switch(_("public key",S,[33,65]),_("private key",w,32),d("Object"===O(A),"Expected options to be an Object"),void 0!==A.data&&_("options.data",A.data),void 0!==A.hashfn?(d("Function"===O(A.hashfn),"Expected options.hashfn to be a Function"),void 0!==A.xbuf&&_("options.xbuf",A.xbuf,32),void 0!==A.ybuf&&_("options.ybuf",A.ybuf,32),_("output",L)):L=T(L,32),b.ecdh(L,S,w,A.data,A.hashfn,A.xbuf,A.ybuf)){case 0:return L;case 1:throw new Error(o);case 2:throw new Error("Scalar was invalid (zero or overflow)")}}})},function(z,l,c){const s=new(c(58).ec)("secp256k1"),m=s.curve,y=m.n.constructor;function n(e){const t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(i,u){let h=new y(u);if(h.cmp(m.p)>=0)return null;h=h.toRed(m.red);let f=h.redSqr().redIMul(h).redIAdd(m.b).redSqrt();return 3===i!==f.isOdd()&&(f=f.redNeg()),s.keyPair({pub:{x:h,y:f}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(i,u,h){let f=new y(u),d=new y(h);if(f.cmp(m.p)>=0||d.cmp(m.p)>=0||(f=f.toRed(m.red),d=d.toRed(m.red),(6===i||7===i)&&d.isOdd()!==(7===i)))return null;const _=f.redSqr().redIMul(f);return d.redSqr().redISub(_.redIAdd(m.b)).isZero()?s.keyPair({pub:{x:f,y:d}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function o(e,t){const i=t.encode(null,33===e.length);for(let u=0;u0,privateKeyVerify(e){const t=new y(e);return t.cmp(m.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new y(e),i=m.n.sub(t).umod(m.n).toArrayLike(Uint8Array,"be",32);return e.set(i),0},privateKeyTweakAdd(e,t){const i=new y(t);if(i.cmp(m.n)>=0||(i.iadd(new y(e)),i.cmp(m.n)>=0&&i.isub(m.n),i.isZero()))return 1;const u=i.toArrayLike(Uint8Array,"be",32);return e.set(u),0},privateKeyTweakMul(e,t){let i=new y(t);if(i.cmp(m.n)>=0||i.isZero())return 1;i.imul(new y(e)),i.cmp(m.n)>=0&&(i=i.umod(m.n));const u=i.toArrayLike(Uint8Array,"be",32);return e.set(u),0},publicKeyVerify:e=>null===n(e)?1:0,publicKeyCreate(e,t){const i=new y(t);return i.cmp(m.n)>=0||i.isZero()?1:(o(e,s.keyFromPrivate(t).getPublic()),0)},publicKeyConvert(e,t){const i=n(t);return null===i?1:(o(e,i.getPublic()),0)},publicKeyNegate(e,t){const i=n(t);if(null===i)return 1;const u=i.getPublic();return u.y=u.y.redNeg(),o(e,u),0},publicKeyCombine(e,t){const i=new Array(t.length);for(let h=0;h=0)return 2;const h=u.getPublic().add(m.g.mul(i));return h.isInfinity()?2:(o(e,h),0)},publicKeyTweakMul(e,t,i){const u=n(t);return null===u?1:(i=new y(i)).cmp(m.n)>=0||i.isZero()?2:(o(e,u.getPublic().mul(i)),0)},signatureNormalize(e){const t=new y(e.subarray(0,32)),i=new y(e.subarray(32,64));return t.cmp(m.n)>=0||i.cmp(m.n)>=0?1:(1===i.cmp(s.nh)&&e.set(m.n.sub(i).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const i=t.subarray(0,32),u=t.subarray(32,64);if(new y(i).cmp(m.n)>=0||new y(u).cmp(m.n)>=0)return 1;const{output:h}=e;let f=h.subarray(4,37);f[0]=0,f.set(i,1);let d=33,_=0;for(;d>1&&0===f[_]&&!(128&f[_+1]);--d,++_);if(f=f.subarray(_),128&f[0]||d>1&&0===f[0]&&!(128&f[1]))return 1;let v=h.subarray(39,72);v[0]=0,v.set(u,1);let T=33,O=0;for(;T>1&&0===v[O]&&!(128&v[O+1]);--T,++O);return v=v.subarray(O),128&v[0]||T>1&&0===v[0]&&!(128&v[1])?1:(e.outputlen=6+d+T,h[0]=48,h[1]=e.outputlen-2,h[2]=2,h[3]=f.length,h.set(f,4),h[4+d]=2,h[5+d]=v.length,h.set(v,6+d),0)},signatureImport(e,t){if(t.length<8||t.length>72||48!==t[0]||t[1]!==t.length-2||2!==t[2])return 1;const i=t[3];if(0===i||5+i>=t.length||2!==t[4+i])return 1;const u=t[5+i];if(0===u||6+i+u!==t.length||128&t[4]||i>1&&0===t[4]&&!(128&t[5])||128&t[i+6]||u>1&&0===t[i+6]&&!(128&t[i+7]))return 1;let h=t.subarray(4,4+i);if(33===h.length&&0===h[0]&&(h=h.subarray(1)),h.length>32)return 1;let f=t.subarray(6+i);if(33===f.length&&0===f[0]&&(f=f.slice(1)),f.length>32)throw new Error("S length is too long");let d=new y(h);d.cmp(m.n)>=0&&(d=new y(0));let _=new y(t.subarray(6+i));return _.cmp(m.n)>=0&&(_=new y(0)),e.set(d.toArrayLike(Uint8Array,"be",32),0),e.set(_.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,i,u,h){if(h){const _=h;h=v=>{const T=_(t,i,null,u,v);if(!(T instanceof Uint8Array&&32===T.length))throw new Error("This is the way");return new y(T)}}const f=new y(i);if(f.cmp(m.n)>=0||f.isZero())return 1;let d;try{d=s.sign(t,i,{canonical:!0,k:h,pers:u})}catch{return 1}return e.signature.set(d.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(d.s.toArrayLike(Uint8Array,"be",32),32),e.recid=d.recoveryParam,0},ecdsaVerify(e,t,i){const u={r:e.subarray(0,32),s:e.subarray(32,64)},h=new y(u.r),f=new y(u.s);if(h.cmp(m.n)>=0||f.cmp(m.n)>=0)return 1;if(1===f.cmp(s.nh)||h.isZero()||f.isZero())return 3;const d=n(i);if(null===d)return 2;const _=d.getPublic();return s.verify(t,u,_)?0:3},ecdsaRecover(e,t,i,u){const h={r:t.slice(0,32),s:t.slice(32,64)},f=new y(h.r),d=new y(h.s);if(f.cmp(m.n)>=0||d.cmp(m.n)>=0)return 1;if(f.isZero()||d.isZero())return 2;let _;try{_=s.recoverPubKey(u,h,i)}catch{return 2}return o(e,_),0},ecdh(e,t,i,u,h,f,d){const _=n(t);if(null===_)return 1;const v=new y(i);if(v.cmp(m.n)>=0||v.isZero())return 2;const T=_.getPublic().mul(v);if(void 0===h){const O=T.encode(null,!0),b=s.hash().update(O).digest();for(let S=0;S<32;++S)e[S]=b[S]}else{f||(f=new Uint8Array(32));const O=T.getX().toArray("be",32);for(let w=0;w<32;++w)f[w]=O[w];d||(d=new Uint8Array(32));const b=T.getY().toArray("be",32);for(let w=0;w<32;++w)d[w]=b[w];const S=h(f,d,u);if(!(S instanceof Uint8Array&&S.length===e.length))return 2;e.set(S)}return 0}}},function(z){z.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny ","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(z,l){},function(z,l){},function(z,l,c){"use strict";var s=c(11),m=c(16),y=c(3),n=c(45),o=s.assert;function e(u){n.call(this,"short",u),this.a=new m(u.a,16).toRed(this.red),this.b=new m(u.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(u),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function t(u,h,f,d){n.BasePoint.call(this,u,"affine"),null===h&&null===f?(this.x=null,this.y=null,this.inf=!0):(this.x=new m(h,16),this.y=new m(f,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function i(u,h,f,d){n.BasePoint.call(this,u,"jacobian"),null===h&&null===f&&null===d?(this.x=this.curve.one,this.y=this.curve.one,this.z=new m(0)):(this.x=new m(h,16),this.y=new m(f,16),this.z=new m(d,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}y(e,n),z.exports=e,e.prototype._getEndomorphism=function(u){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var h,f;if(u.beta)h=new m(u.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);h=(h=d[0].cmp(d[1])<0?d[0]:d[1]).toRed(this.red)}if(u.lambda)f=new m(u.lambda,16);else{var _=this._getEndoRoots(this.n);0===this.g.mul(_[0]).x.cmp(this.g.x.redMul(h))?f=_[0]:o(0===this.g.mul(f=_[1]).x.cmp(this.g.x.redMul(h)))}return{beta:h,lambda:f,basis:u.basis?u.basis.map(function(v){return{a:new m(v.a,16),b:new m(v.b,16)}}):this._getEndoBasis(f)}}},e.prototype._getEndoRoots=function(u){var h=u===this.p?this.red:m.mont(u),f=new m(2).toRed(h).redInvm(),d=f.redNeg(),_=new m(3).toRed(h).redNeg().redSqrt().redMul(f);return[d.redAdd(_).fromRed(),d.redSub(_).fromRed()]},e.prototype._getEndoBasis=function(u){for(var h,f,d,_,v,T,O,b,S,w=this.n.ushrn(Math.floor(this.n.bitLength()/2)),A=u,L=this.n.clone(),H=new m(1),D=new m(0),q=new m(0),k=new m(1),p=0;0!==A.cmpn(0);){var x=L.div(A);b=L.sub(x.mul(A)),S=q.sub(x.mul(H));var R=k.sub(x.mul(D));if(!d&&b.cmp(w)<0)h=O.neg(),f=H,d=b.neg(),_=S;else if(d&&2==++p)break;O=b,L=A,A=b,q=H,H=S,k=D,D=R}v=b.neg(),T=S;var r=d.sqr().add(_.sqr());return v.sqr().add(T.sqr()).cmp(r)>=0&&(v=h,T=f),d.negative&&(d=d.neg(),_=_.neg()),v.negative&&(v=v.neg(),T=T.neg()),[{a:d,b:_},{a:v,b:T}]},e.prototype._endoSplit=function(u){var h=this.endo.basis,f=h[0],d=h[1],_=d.b.mul(u).divRound(this.n),v=f.b.neg().mul(u).divRound(this.n),T=_.mul(f.a),O=v.mul(d.a),b=_.mul(f.b),S=v.mul(d.b);return{k1:u.sub(T).sub(O),k2:b.add(S).neg()}},e.prototype.pointFromX=function(u,h){(u=new m(u,16)).red||(u=u.toRed(this.red));var f=u.redSqr().redMul(u).redIAdd(u.redMul(this.a)).redIAdd(this.b),d=f.redSqrt();if(0!==d.redSqr().redSub(f).cmp(this.zero))throw new Error("invalid point");var _=d.fromRed().isOdd();return(h&&!_||!h&&_)&&(d=d.redNeg()),this.point(u,d)},e.prototype.validate=function(u){if(u.inf)return!0;var h=u.x,f=u.y,d=this.a.redMul(h),_=h.redSqr().redMul(h).redIAdd(d).redIAdd(this.b);return 0===f.redSqr().redISub(_).cmpn(0)},e.prototype._endoWnafMulAdd=function(u,h,f){for(var d=this._endoWnafT1,_=this._endoWnafT2,v=0;v":""},t.prototype.isInfinity=function(){return this.inf},t.prototype.add=function(u){if(this.inf)return u;if(u.inf)return this;if(this.eq(u))return this.dbl();if(this.neg().eq(u))return this.curve.point(null,null);if(0===this.x.cmp(u.x))return this.curve.point(null,null);var h=this.y.redSub(u.y);0!==h.cmpn(0)&&(h=h.redMul(this.x.redSub(u.x).redInvm()));var f=h.redSqr().redISub(this.x).redISub(u.x),d=h.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,d)},t.prototype.dbl=function(){if(this.inf)return this;var u=this.y.redAdd(this.y);if(0===u.cmpn(0))return this.curve.point(null,null);var h=this.curve.a,f=this.x.redSqr(),d=u.redInvm(),_=f.redAdd(f).redIAdd(f).redIAdd(h).redMul(d),v=_.redSqr().redISub(this.x.redAdd(this.x)),T=_.redMul(this.x.redSub(v)).redISub(this.y);return this.curve.point(v,T)},t.prototype.getX=function(){return this.x.fromRed()},t.prototype.getY=function(){return this.y.fromRed()},t.prototype.mul=function(u){return u=new m(u,16),this.isInfinity()?this:this._hasDoubles(u)?this.curve._fixedNafMul(this,u):this.curve.endo?this.curve._endoWnafMulAdd([this],[u]):this.curve._wnafMul(this,u)},t.prototype.mulAdd=function(u,h,f){var d=[this,h],_=[u,f];return this.curve.endo?this.curve._endoWnafMulAdd(d,_):this.curve._wnafMulAdd(1,d,_,2)},t.prototype.jmulAdd=function(u,h,f){var d=[this,h],_=[u,f];return this.curve.endo?this.curve._endoWnafMulAdd(d,_,!0):this.curve._wnafMulAdd(1,d,_,2,!0)},t.prototype.eq=function(u){return this===u||this.inf===u.inf&&(this.inf||0===this.x.cmp(u.x)&&0===this.y.cmp(u.y))},t.prototype.neg=function(u){if(this.inf)return this;var h=this.curve.point(this.x,this.y.redNeg());if(u&&this.precomputed){var f=this.precomputed,d=function(_){return _.neg()};h.precomputed={naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(d)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(d)}}}return h},t.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(i,n.BasePoint),e.prototype.jpoint=function(u,h,f){return new i(this,u,h,f)},i.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var u=this.z.redInvm(),h=u.redSqr(),f=this.x.redMul(h),d=this.y.redMul(h).redMul(u);return this.curve.point(f,d)},i.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},i.prototype.add=function(u){if(this.isInfinity())return u;if(u.isInfinity())return this;var h=u.z.redSqr(),f=this.z.redSqr(),d=this.x.redMul(h),_=u.x.redMul(f),v=this.y.redMul(h.redMul(u.z)),T=u.y.redMul(f.redMul(this.z)),O=d.redSub(_),b=v.redSub(T);if(0===O.cmpn(0))return 0!==b.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var S=O.redSqr(),w=S.redMul(O),A=d.redMul(S),L=b.redSqr().redIAdd(w).redISub(A).redISub(A),H=b.redMul(A.redISub(L)).redISub(v.redMul(w)),D=this.z.redMul(u.z).redMul(O);return this.curve.jpoint(L,H,D)},i.prototype.mixedAdd=function(u){if(this.isInfinity())return u.toJ();if(u.isInfinity())return this;var h=this.z.redSqr(),f=this.x,d=u.x.redMul(h),_=this.y,v=u.y.redMul(h).redMul(this.z),T=f.redSub(d),O=_.redSub(v);if(0===T.cmpn(0))return 0!==O.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var b=T.redSqr(),S=b.redMul(T),w=f.redMul(b),A=O.redSqr().redIAdd(S).redISub(w).redISub(w),L=O.redMul(w.redISub(A)).redISub(_.redMul(S)),H=this.z.redMul(T);return this.curve.jpoint(A,L,H)},i.prototype.dblp=function(u){if(0===u)return this;if(this.isInfinity())return this;if(!u)return this.dbl();var h;if(this.curve.zeroA||this.curve.threeA){var f=this;for(h=0;h=0)return!1;if(f.redIAdd(_),0===this.x.cmp(f))return!0}},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(z,l,c){"use strict";var s=c(16),m=c(3),y=c(45),n=c(11);function o(t){y.call(this,"mont",t),this.a=new s(t.a,16).toRed(this.red),this.b=new s(t.b,16).toRed(this.red),this.i4=new s(4).toRed(this.red).redInvm(),this.two=new s(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function e(t,i,u){y.BasePoint.call(this,t,"projective"),null===i&&null===u?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new s(i,16),this.z=new s(u,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}m(o,y),z.exports=o,o.prototype.validate=function(t){var i=t.normalize().x,u=i.redSqr(),h=u.redMul(i).redAdd(u.redMul(this.a)).redAdd(i);return 0===h.redSqrt().redSqr().cmp(h)},m(e,y.BasePoint),o.prototype.decodePoint=function(t,i){return this.point(n.toArray(t,i),1)},o.prototype.point=function(t,i){return new e(this,t,i)},o.prototype.pointFromJSON=function(t){return e.fromJSON(this,t)},e.prototype.precompute=function(){},e.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},e.fromJSON=function(t,i){return new e(t,i[0],i[1]||t.one)},e.prototype.inspect=function(){return this.isInfinity()?"":""},e.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},e.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),i=this.x.redSub(this.z).redSqr(),u=t.redSub(i),h=t.redMul(i),f=u.redMul(i.redAdd(this.curve.a24.redMul(u)));return this.curve.point(h,f)},e.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},e.prototype.diffAdd=function(t,i){var u=this.x.redAdd(this.z),h=this.x.redSub(this.z),f=t.x.redAdd(t.z),d=t.x.redSub(t.z).redMul(u),_=f.redMul(h),v=i.z.redMul(d.redAdd(_).redSqr()),T=i.x.redMul(d.redISub(_).redSqr());return this.curve.point(v,T)},e.prototype.mul=function(t){for(var i=t.clone(),u=this,h=this.curve.point(null,null),f=[];0!==i.cmpn(0);i.iushrn(1))f.push(i.andln(1));for(var d=f.length-1;d>=0;d--)0===f[d]?(u=u.diffAdd(h,this),h=h.dbl()):(h=u.diffAdd(h,this),u=u.dbl());return h},e.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},e.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},e.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},e.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},e.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(z,l,c){"use strict";var s=c(11),m=c(16),y=c(3),n=c(45),o=s.assert;function e(i){this.twisted=1!=(0|i.a),this.mOneA=this.twisted&&-1==(0|i.a),this.extended=this.mOneA,n.call(this,"edwards",i),this.a=new m(i.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new m(i.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new m(i.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|i.c)}function t(i,u,h,f,d){n.BasePoint.call(this,i,"projective"),null===u&&null===h&&null===f?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new m(u,16),this.y=new m(h,16),this.z=f?new m(f,16):this.curve.one,this.t=d&&new m(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}y(e,n),z.exports=e,e.prototype._mulA=function(i){return this.mOneA?i.redNeg():this.a.redMul(i)},e.prototype._mulC=function(i){return this.oneC?i:this.c.redMul(i)},e.prototype.jpoint=function(i,u,h,f){return this.point(i,u,h,f)},e.prototype.pointFromX=function(i,u){(i=new m(i,16)).red||(i=i.toRed(this.red));var h=i.redSqr(),f=this.c2.redSub(this.a.redMul(h)),d=this.one.redSub(this.c2.redMul(this.d).redMul(h)),_=f.redMul(d.redInvm()),v=_.redSqrt();if(0!==v.redSqr().redSub(_).cmp(this.zero))throw new Error("invalid point");var T=v.fromRed().isOdd();return(u&&!T||!u&&T)&&(v=v.redNeg()),this.point(i,v)},e.prototype.pointFromY=function(i,u){(i=new m(i,16)).red||(i=i.toRed(this.red));var h=i.redSqr(),f=h.redSub(this.c2),d=h.redMul(this.d).redMul(this.c2).redSub(this.a),_=f.redMul(d.redInvm());if(0===_.cmp(this.zero)){if(u)throw new Error("invalid point");return this.point(this.zero,i)}var v=_.redSqrt();if(0!==v.redSqr().redSub(_).cmp(this.zero))throw new Error("invalid point");return v.fromRed().isOdd()!==u&&(v=v.redNeg()),this.point(v,i)},e.prototype.validate=function(i){if(i.isInfinity())return!0;i.normalize();var u=i.x.redSqr(),h=i.y.redSqr(),f=u.redMul(this.a).redAdd(h),d=this.c2.redMul(this.one.redAdd(this.d.redMul(u).redMul(h)));return 0===f.cmp(d)},y(t,n.BasePoint),e.prototype.pointFromJSON=function(i){return t.fromJSON(this,i)},e.prototype.point=function(i,u,h,f){return new t(this,i,u,h,f)},t.fromJSON=function(i,u){return new t(i,u[0],u[1],u[2])},t.prototype.inspect=function(){return this.isInfinity()?"":""},t.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},t.prototype._extDbl=function(){var i=this.x.redSqr(),u=this.y.redSqr(),h=this.z.redSqr();h=h.redIAdd(h);var f=this.curve._mulA(i),d=this.x.redAdd(this.y).redSqr().redISub(i).redISub(u),_=f.redAdd(u),v=_.redSub(h),T=f.redSub(u),O=d.redMul(v),b=_.redMul(T),S=d.redMul(T),w=v.redMul(_);return this.curve.point(O,b,w,S)},t.prototype._projDbl=function(){var i,u,h,f,d,_,v=this.x.redAdd(this.y).redSqr(),T=this.x.redSqr(),O=this.y.redSqr();if(this.curve.twisted){var b=(f=this.curve._mulA(T)).redAdd(O);this.zOne?(i=v.redSub(T).redSub(O).redMul(b.redSub(this.curve.two)),u=b.redMul(f.redSub(O)),h=b.redSqr().redSub(b).redSub(b)):(d=this.z.redSqr(),_=b.redSub(d).redISub(d),i=v.redSub(T).redISub(O).redMul(_),u=b.redMul(f.redSub(O)),h=b.redMul(_))}else f=T.redAdd(O),d=this.curve._mulC(this.z).redSqr(),_=f.redSub(d).redSub(d),i=this.curve._mulC(v.redISub(f)).redMul(_),u=this.curve._mulC(f).redMul(T.redISub(O)),h=f.redMul(_);return this.curve.point(i,u,h)},t.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},t.prototype._extAdd=function(i){var u=this.y.redSub(this.x).redMul(i.y.redSub(i.x)),h=this.y.redAdd(this.x).redMul(i.y.redAdd(i.x)),f=this.t.redMul(this.curve.dd).redMul(i.t),d=this.z.redMul(i.z.redAdd(i.z)),_=h.redSub(u),v=d.redSub(f),T=d.redAdd(f),O=h.redAdd(u),b=_.redMul(v),S=T.redMul(O),w=_.redMul(O),A=v.redMul(T);return this.curve.point(b,S,A,w)},t.prototype._projAdd=function(i){var u,h,f=this.z.redMul(i.z),d=f.redSqr(),_=this.x.redMul(i.x),v=this.y.redMul(i.y),T=this.curve.d.redMul(_).redMul(v),O=d.redSub(T),b=d.redAdd(T),S=this.x.redAdd(this.y).redMul(i.x.redAdd(i.y)).redISub(_).redISub(v),w=f.redMul(O).redMul(S);return this.curve.twisted?(u=f.redMul(b).redMul(v.redSub(this.curve._mulA(_))),h=O.redMul(b)):(u=f.redMul(b).redMul(v.redSub(_)),h=this.curve._mulC(O).redMul(b)),this.curve.point(w,u,h)},t.prototype.add=function(i){return this.isInfinity()?i:i.isInfinity()?this:this.curve.extended?this._extAdd(i):this._projAdd(i)},t.prototype.mul=function(i){return this._hasDoubles(i)?this.curve._fixedNafMul(this,i):this.curve._wnafMul(this,i)},t.prototype.mulAdd=function(i,u,h){return this.curve._wnafMulAdd(1,[this,u],[i,h],2,!1)},t.prototype.jmulAdd=function(i,u,h){return this.curve._wnafMulAdd(1,[this,u],[i,h],2,!0)},t.prototype.normalize=function(){if(this.zOne)return this;var i=this.z.redInvm();return this.x=this.x.redMul(i),this.y=this.y.redMul(i),this.t&&(this.t=this.t.redMul(i)),this.z=this.curve.one,this.zOne=!0,this},t.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},t.prototype.getX=function(){return this.normalize(),this.x.fromRed()},t.prototype.getY=function(){return this.normalize(),this.y.fromRed()},t.prototype.eq=function(i){return this===i||0===this.getX().cmp(i.getX())&&0===this.getY().cmp(i.getY())},t.prototype.eqXToP=function(i){var u=i.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(u))return!0;for(var h=i.clone(),f=this.curve.redN.redMul(this.z);;){if(h.iadd(this.curve.n),h.cmp(this.curve.p)>=0)return!1;if(u.redIAdd(f),0===this.x.cmp(u))return!0}},t.prototype.toP=t.prototype.normalize,t.prototype.mixedAdd=t.prototype.add},function(z,l,c){"use strict";l.sha1=c(251),l.sha224=c(252),l.sha256=c(124),l.sha384=c(253),l.sha512=c(125)},function(z,l,c){"use strict";var s=c(15),m=c(37),y=c(123),n=s.rotl32,o=s.sum32,e=s.sum32_5,t=y.ft_1,i=m.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;i.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}s.inherits(h,i),z.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(f,d){for(var _=this.W,v=0;v<16;v++)_[v]=f[d+v];for(;v<_.length;v++)_[v]=n(_[v-3]^_[v-8]^_[v-14]^_[v-16],1);var T=this.h[0],O=this.h[1],b=this.h[2],S=this.h[3],w=this.h[4];for(v=0;v<_.length;v++){var A=~~(v/20),L=e(n(T,5),t(A,O,b,S),w,_[v],u[A]);w=S,S=b,b=n(O,30),O=T,T=L}this.h[0]=o(this.h[0],T),this.h[1]=o(this.h[1],O),this.h[2]=o(this.h[2],b),this.h[3]=o(this.h[3],S),this.h[4]=o(this.h[4],w)},h.prototype._digest=function(f){return"hex"===f?s.toHex32(this.h,"big"):s.split32(this.h,"big")}},function(z,l,c){"use strict";var s=c(15),m=c(124);function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}s.inherits(y,m),z.exports=y,y.blockSize=512,y.outSize=224,y.hmacStrength=192,y.padLength=64,y.prototype._digest=function(n){return"hex"===n?s.toHex32(this.h.slice(0,7),"big"):s.split32(this.h.slice(0,7),"big")}},function(z,l,c){"use strict";var s=c(15),m=c(125);function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}s.inherits(y,m),z.exports=y,y.blockSize=1024,y.outSize=384,y.hmacStrength=192,y.padLength=128,y.prototype._digest=function(n){return"hex"===n?s.toHex32(this.h.slice(0,12),"big"):s.split32(this.h.slice(0,12),"big")}},function(z,l,c){"use strict";var s=c(15),m=c(37),y=s.rotl32,n=s.sum32,o=s.sum32_3,e=s.sum32_4,t=m.BlockHash;function i(){if(!(this instanceof i))return new i;t.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(O,b,S,w){return O<=15?b^S^w:O<=31?b&S|~b&w:O<=47?(b|~S)^w:O<=63?b&w|S&~w:b^(S|~w)}function h(O){return O<=15?0:O<=31?1518500249:O<=47?1859775393:O<=63?2400959708:2840853838}function f(O){return O<=15?1352829926:O<=31?1548603684:O<=47?1836072691:O<=63?2053994217:0}s.inherits(i,t),l.ripemd160=i,i.blockSize=512,i.outSize=160,i.hmacStrength=192,i.padLength=64,i.prototype._update=function(O,b){for(var S=this.h[0],w=this.h[1],A=this.h[2],L=this.h[3],H=this.h[4],D=S,q=w,k=A,p=L,x=H,R=0;R<80;R++){var r=n(y(e(S,u(R,w,A,L),O[d[R]+b],h(R)),v[R]),H);S=H,H=L,L=y(A,10),A=w,w=r,r=n(y(e(D,u(79-R,q,k,p),O[_[R]+b],f(R)),T[R]),x),D=x,x=p,p=y(k,10),k=q,q=r}r=o(this.h[1],A,p),this.h[1]=o(this.h[2],L,x),this.h[2]=o(this.h[3],H,D),this.h[3]=o(this.h[4],S,q),this.h[4]=o(this.h[0],w,k),this.h[0]=r},i.prototype._digest=function(O){return"hex"===O?s.toHex32(this.h,"little"):s.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],_=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],v=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],T=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(z,l,c){"use strict";var s=c(15),m=c(22);function y(n,o,e){if(!(this instanceof y))return new y(n,o,e);this.Hash=n,this.blockSize=n.blockSize/8,this.outSize=n.outSize/8,this.inner=null,this.outer=null,this._init(s.toArray(o,e))}z.exports=y,y.prototype._init=function(n){n.length>this.blockSize&&(n=(new this.Hash).update(n).digest()),m(n.length<=this.blockSize);for(var o=n.length;o0))return v.iaddn(1),this.keyFromPrivate(v)}},u.prototype._truncateToN=function(h,f){var d=8*h.byteLength()-this.n.bitLength();return d>0&&(h=h.ushrn(d)),!f&&h.cmp(this.n)>=0?h.sub(this.n):h},u.prototype.sign=function(h,f,d,_){"object"==typeof d&&(_=d,d=null),_||(_={}),f=this.keyFromPrivate(f,d),h=this._truncateToN(new s(h,16));for(var v=this.n.byteLength(),T=f.getPrivate().toArray("be",v),O=h.toArray("be",v),b=new m({hash:this.hash,entropy:T,nonce:O,pers:_.pers,persEnc:_.persEnc||"utf8"}),S=this.n.sub(new s(1)),w=0;;w++){var A=_.k?_.k(w):new s(b.generate(this.n.byteLength()));if(!((A=this._truncateToN(A,!0)).cmpn(1)<=0||A.cmp(S)>=0)){var L=this.g.mul(A);if(!L.isInfinity()){var H=L.getX(),D=H.umod(this.n);if(0!==D.cmpn(0)){var q=A.invm(this.n).mul(D.mul(f.getPrivate()).iadd(h));if(0!==(q=q.umod(this.n)).cmpn(0)){var k=(L.getY().isOdd()?1:0)|(0!==H.cmp(D)?2:0);return _.canonical&&q.cmp(this.nh)>0&&(q=this.n.sub(q),k^=1),new i({r:D,s:q,recoveryParam:k})}}}}}},u.prototype.verify=function(h,f,d,_){h=this._truncateToN(new s(h,16)),d=this.keyFromPublic(d,_);var v=(f=new i(f,"hex")).r,T=f.s;if(v.cmpn(1)<0||v.cmp(this.n)>=0||T.cmpn(1)<0||T.cmp(this.n)>=0)return!1;var O,b=T.invm(this.n),S=b.mul(h).umod(this.n),w=b.mul(v).umod(this.n);return this.curve._maxwellTrick?!(O=this.g.jmulAdd(S,d.getPublic(),w)).isInfinity()&&O.eqXToP(v):!(O=this.g.mulAdd(S,d.getPublic(),w)).isInfinity()&&0===O.getX().umod(this.n).cmp(v)},u.prototype.recoverPubKey=function(h,f,d,_){e((3&d)===d,"The recovery param is more than two bits"),f=new i(f,_);var v=this.n,T=new s(h),O=f.r,b=f.s,S=1&d,w=d>>1;if(O.cmp(this.curve.p.umod(this.curve.n))>=0&&w)throw new Error("Unable to find sencond key candinate");O=this.curve.pointFromX(w?O.add(this.curve.n):O,S);var A=f.r.invm(v),L=v.sub(T).mul(A).umod(v),H=b.mul(A).umod(v);return this.g.mulAdd(L,O,H)},u.prototype.getKeyRecoveryParam=function(h,f,d,_){if(null!==(f=new i(f,_)).recoveryParam)return f.recoveryParam;for(var v=0;v<4;v++){var T;try{T=this.recoverPubKey(h,f,v)}catch{continue}if(T.eq(d))return v}throw new Error("Unable to find valid recovery factor")}},function(z,l,c){"use strict";var s=c(60),m=c(120),y=c(22);function n(o){if(!(this instanceof n))return new n(o);this.hash=o.hash,this.predResist=!!o.predResist,this.outLen=this.hash.outSize,this.minEntropy=o.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=m.toArray(o.entropy,o.entropyEnc||"hex"),t=m.toArray(o.nonce,o.nonceEnc||"hex"),i=m.toArray(o.pers,o.persEnc||"hex");y(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}z.exports=n,n.prototype._init=function(o,e,t){var i=o.concat(e).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var u=0;u=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(o.concat(t||[])),this._reseed=1},n.prototype.generate=function(o,e,t,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=t,t=e,e=null),t&&(t=m.toArray(t,i||"hex"),this._update(t));for(var u=[];u.length"}},function(z,l,c){"use strict";var s=c(16),m=c(11),y=m.assert;function n(u,h){if(u instanceof n)return u;this._importDER(u,h)||(y(u.r&&u.s,"Signature without r or s"),this.r=new s(u.r,16),this.s=new s(u.s,16),this.recoveryParam=void 0===u.recoveryParam?null:u.recoveryParam)}function o(){this.place=0}function e(u,h){var f=u[h.place++];if(!(128&f))return f;var d=15&f;if(0===d||d>4)return!1;for(var _=0,v=0,T=h.place;v>>=0;return!(_<=127)&&(h.place=T,_)}function t(u){for(var h=0,f=u.length-1;!u[h]&&!(128&u[h+1])&&h>>3);for(u.push(128|f);--f;)u.push(h>>>(f<<3)&255);u.push(h)}}z.exports=n,n.prototype._importDER=function(u,h){u=m.toArray(u,h);var f=new o;if(48!==u[f.place++])return!1;var d=e(u,f);if(!1===d||d+f.place!==u.length||2!==u[f.place++])return!1;var _=e(u,f);if(!1===_)return!1;var v=u.slice(f.place,_+f.place);if(f.place+=_,2!==u[f.place++])return!1;var T=e(u,f);if(!1===T||u.length!==T+f.place)return!1;var O=u.slice(f.place,T+f.place);if(0===v[0]){if(!(128&v[1]))return!1;v=v.slice(1)}if(0===O[0]){if(!(128&O[1]))return!1;O=O.slice(1)}return this.r=new s(v),this.s=new s(O),this.recoveryParam=null,!0},n.prototype.toDER=function(u){var h=this.r.toArray(),f=this.s.toArray();for(128&h[0]&&(h=[0].concat(h)),128&f[0]&&(f=[0].concat(f)),h=t(h),f=t(f);!(f[0]||128&f[1]);)f=f.slice(1);var d=[2];i(d,h.length),(d=d.concat(h)).push(2),i(d,f.length);var _=d.concat(f),v=[48];return i(v,_.length),v=v.concat(_),m.encode(v,u)}},function(z,l,c){"use strict";var s=c(60),m=c(59),y=c(11),n=y.assert,o=y.parseBytes,e=c(262),t=c(263);function i(u){if(n("ed25519"===u,"only tested with ed25519 so far"),!(this instanceof i))return new i(u);this.curve=u=m[u].curve,this.g=u.g,this.g.precompute(u.n.bitLength()+1),this.pointClass=u.point().constructor,this.encodingLength=Math.ceil(u.n.bitLength()/8),this.hash=s.sha512}z.exports=i,i.prototype.sign=function(u,h){u=o(u);var f=this.keyFromSecret(h),d=this.hashInt(f.messagePrefix(),u),_=this.g.mul(d),v=this.encodePoint(_),T=this.hashInt(v,f.pubBytes(),u).mul(f.priv()),O=d.add(T).umod(this.curve.n);return this.makeSignature({R:_,S:O,Rencoded:v})},i.prototype.verify=function(u,h,f){u=o(u),h=this.makeSignature(h);var d=this.keyFromPublic(f),_=this.hashInt(h.Rencoded(),d.pubBytes(),u),v=this.g.mul(h.S());return h.R().add(d.pub().mul(_)).eq(v)},i.prototype.hashInt=function(){for(var u=this.hash(),h=0;h4294967295)throw new RangeError("requested too many random bytes");var t=y.allocUnsafe(o);if(o>0)if(o>65536)for(var i=0;i=0)throw new Error("couldn't export to DER format");var u=y.g.mul(i);return o(u.getX(),u.getY(),t)},l.privateKeyModInverse=function(e){var t=new m(e);if(t.ucmp(n.n)>=0||t.isZero())throw new Error("private key range is invalid");return t.invm(n.n).toArrayLike(s,"be",32)},l.signatureImport=function(e){var t=new m(e.r);t.ucmp(n.n)>=0&&(t=new m(0));var i=new m(e.s);return i.ucmp(n.n)>=0&&(i=new m(0)),s.concat([t.toArrayLike(s,"be",32),i.toArrayLike(s,"be",32)])},l.ecdhUnsafe=function(e,t,i){var u=y.keyFromPublic(e),h=new m(t);if(h.ucmp(n.n)>=0||h.isZero())throw new Error("scalar was invalid (zero or overflow)");var f=u.pub.mul(h);return o(f.getX(),f.getY(),i)};var o=function(e,t,i){var u=void 0;return i?((u=s.alloc(33))[0]=t.isOdd()?3:2,e.toArrayLike(s,"be",32).copy(u,1)):((u=s.alloc(65))[0]=4,e.toArrayLike(s,"be",32).copy(u,1),t.toArrayLike(s,"be",32).copy(u,33)),u}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){var m=s.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),y=s.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);l.privateKeyExport=function(n,o,e){var t=s.from(e?m:y);return n.copy(t,e?8:9),o.copy(t,e?181:214),t},l.privateKeyImport=function(n){var o=n.length,e=0;if(o2||o<(e+=1)+t)return null;var i=n[e+t-1]|(t>1?n[e+t-2]<<8:0);return o<(e+=t)+i||o32||ot||2!==n[i++])return null;var h=n[i++];if(128&h){if(i+(u=h-128)>t)return null;for(;u>0&&0===n[i];i+=1,u-=1);for(h=0;u>0;i+=1,u-=1)h=(h<<8)+n[i]}if(h>t-i)return null;var f=i;if(i+=h,2!==n[i++])return null;var d=n[i++];if(128&d){if(i+(u=d-128)>t)return null;for(;u>0&&0===n[i];i+=1,u-=1);for(d=0;u>0;i+=1,u-=1)d=(d<<8)+n[i]}if(d>t-i)return null;var _=i;for(i+=d;h>0&&0===n[f];h-=1,f+=1);if(h>32)return null;var v=n.slice(f,f+h);for(v.copy(o,32-v.length);d>0&&0===n[_];d-=1,_+=1);if(d>32)return null;var T=n.slice(_,_+d);return T.copy(e,32-T.length),{r:o,s:e}}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";var s=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;function n(o){if(null==o)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}z.exports=function(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de","5"===Object.getOwnPropertyNames(o)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(u){return e[u]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(u){i[u]=u}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch{return!1}}()?Object.assign:function(o,e){for(var t,i,u=n(o),h=1;h=48&&g<=57?g-48:g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:void n(!1,"Invalid character in "+r)}function u(r,a,g){var M=i(r,g);return g-1>=a&&(M|=i(r,g-1)<<4),M}function h(r,a,g,M){for(var E=0,C=0,U=Math.min(r.length,g),V=a;V=49?I-49+10:I>=17?I-17+10:I,n(I>=0&&C0?r:a},e.min=function(r,a){return r.cmp(a)<0?r:a},e.prototype._init=function(r,a,g){if("number"==typeof r)return this._initNumber(r,a,g);if("object"==typeof r)return this._initArray(r,a,g);"hex"===a&&(a=16),n(a===(0|a)&&a>=2&&a<=36);var M=0;"-"===(r=r.toString().replace(/\s+/g,""))[0]&&(M++,this.negative=1),M=0;M-=3)this.words[E]|=(C=r[M]|r[M-1]<<8|r[M-2]<<16)<>>26-U&67108863,(U+=24)>=26&&(U-=26,E++);else if("le"===g)for(M=0,E=0;M>>26-U&67108863,(U+=24)>=26&&(U-=26,E++);return this._strip()},e.prototype._parseHex=function(r,a,g){this.length=Math.ceil((r.length-a)/6),this.words=new Array(this.length);for(var M=0;M=a;M-=2)E=u(r,a,M)<=18?(C-=18,this.words[U+=1]|=E>>>26):C+=8;else for(M=(r.length-a)%2==0?a+1:a;M=18?(C-=18,this.words[U+=1]|=E>>>26):C+=8;this._strip()},e.prototype._parseBase=function(r,a,g){this.words=[0],this.length=1;for(var M=0,E=1;E<=67108863;E*=a)M++;M--,E=E/a|0;for(var C=r.length-g,U=C%M,V=Math.min(C,C-U)+g,I=0,W=g;W1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},typeof Symbol<"u"&&"function"==typeof Symbol.for)try{e.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch{e.prototype.inspect=d}else e.prototype.inspect=d;function d(){return(this.red?""}var _=["","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"],v=[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],T=[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 O(r,a,g){g.negative=a.negative^r.negative;var M=r.length+a.length|0;g.length=M,M=M-1|0;var E=0|r.words[0],C=0|a.words[0],U=E*C,I=U/67108864|0;g.words[0]=67108863&U;for(var W=1;W>>26,B=67108863&I,N=Math.min(W,a.length-1),P=Math.max(0,W-r.length+1);P<=N;P++)F+=(U=(E=0|r.words[W-P|0])*(C=0|a.words[P])+B)/67108864|0,B=67108863&U;g.words[W]=0|B,I=0|F}return 0!==I?g.words[W]=0|I:g.length--,g._strip()}e.prototype.toString=function(r,a){var g;if(a=0|a||1,16===(r=r||10)||"hex"===r){g="";for(var M=0,E=0,C=0;C>>24-M&16777215,(M+=2)>=26&&(M-=26,C--),g=0!==E||C!==this.length-1?_[6-V.length]+V+g:V+g}for(0!==E&&(g=E.toString(16)+g);g.length%a!=0;)g="0"+g;return 0!==this.negative&&(g="-"+g),g}if(r===(0|r)&&r>=2&&r<=36){var I=v[r],W=T[r];g="";var F=this.clone();for(F.negative=0;!F.isZero();){var B=F.modrn(W).toString(r);g=(F=F.idivn(W)).isZero()?B+g:_[I-B.length]+B+g}for(this.isZero()&&(g="0"+g);g.length%a!=0;)g="0"+g;return 0!==this.negative&&(g="-"+g),g}n(!1,"Base should be between 2 and 36")},e.prototype.toNumber=function(){var r=this.words[0];return 2===this.length?r+=67108864*this.words[1]:3===this.length&&1===this.words[2]?r+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-r:r},e.prototype.toJSON=function(){return this.toString(16,2)},t&&(e.prototype.toBuffer=function(r,a){return this.toArrayLike(t,r,a)}),e.prototype.toArray=function(r,a){return this.toArrayLike(Array,r,a)},e.prototype.toArrayLike=function(r,a,g){this._strip();var M=this.byteLength(),E=g||Math.max(1,M);n(M<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var U,V,C=(V=E,(U=r).allocUnsafe?U.allocUnsafe(V):new U(V));return this["_toArrayLike"+("le"===a?"LE":"BE")](C,M),C},e.prototype._toArrayLikeLE=function(r,a){for(var g=0,M=0,E=0,C=0;E>8&255),g>16&255),6===C?(g>24&255),M=0,C=0):(M=U>>>24,C+=2)}if(g=0&&(r[g--]=U>>8&255),g>=0&&(r[g--]=U>>16&255),6===C?(g>=0&&(r[g--]=U>>24&255),M=0,C=0):(M=U>>>24,C+=2)}if(g>=0)for(r[g--]=M;g>=0;)r[g--]=0},e.prototype._countBits=Math.clz32?function(r){return 32-Math.clz32(r)}:function(r){var a=r,g=0;return a>=4096&&(g+=13,a>>>=13),a>=64&&(g+=7,a>>>=7),a>=8&&(g+=4,a>>>=4),a>=2&&(g+=2,a>>>=2),g+a},e.prototype._zeroBits=function(r){if(0===r)return 26;var a=r,g=0;return 0==(8191&a)&&(g+=13,a>>>=13),0==(127&a)&&(g+=7,a>>>=7),0==(15&a)&&(g+=4,a>>>=4),0==(3&a)&&(g+=2,a>>>=2),0==(1&a)&&g++,g},e.prototype.bitLength=function(){var a=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+a},e.prototype.zeroBits=function(){if(this.isZero())return 0;for(var r=0,a=0;ar.length?this.clone().ior(r):r.clone().ior(this)},e.prototype.uor=function(r){return this.length>r.length?this.clone().iuor(r):r.clone().iuor(this)},e.prototype.iuand=function(r){var a;a=this.length>r.length?r:this;for(var g=0;gr.length?this.clone().iand(r):r.clone().iand(this)},e.prototype.uand=function(r){return this.length>r.length?this.clone().iuand(r):r.clone().iuand(this)},e.prototype.iuxor=function(r){var a,g;this.length>r.length?(a=this,g=r):(a=r,g=this);for(var M=0;Mr.length?this.clone().ixor(r):r.clone().ixor(this)},e.prototype.uxor=function(r){return this.length>r.length?this.clone().iuxor(r):r.clone().iuxor(this)},e.prototype.inotn=function(r){n("number"==typeof r&&r>=0);var a=0|Math.ceil(r/26),g=r%26;this._expand(a),g>0&&a--;for(var M=0;M0&&(this.words[M]=~this.words[M]&67108863>>26-g),this._strip()},e.prototype.notn=function(r){return this.clone().inotn(r)},e.prototype.setn=function(r,a){n("number"==typeof r&&r>=0);var g=r/26|0,M=r%26;return this._expand(g+1),this.words[g]=a?this.words[g]|1<r.length?(g=this,M=r):(g=r,M=this);for(var E=0,C=0;C>>26;for(;0!==E&&C>>26;if(this.length=g.length,0!==E)this.words[this.length]=E,this.length++;else if(g!==this)for(;Cr.length?this.clone().iadd(r):r.clone().iadd(this)},e.prototype.isub=function(r){if(0!==r.negative){r.negative=0;var a=this.iadd(r);return r.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(r),this.negative=1,this._normSign();var g,M,E=this.cmp(r);if(0===E)return this.negative=0,this.length=1,this.words[0]=0,this;E>0?(g=this,M=r):(g=r,M=this);for(var C=0,U=0;U>26,this.words[U]=67108863&a;for(;0!==C&&U>26,this.words[U]=67108863&a;if(0===C&&U>>13,P=0|U[1],j=8191&P,K=P>>>13,Z=0|U[2],J=8191&Z,X=Z>>>13,ee=0|U[3],te=8191&ee,oe=ee>>>13,ve=0|U[4],ie=8191&ve,de=ve>>>13,fe=0|U[5],re=8191&fe,_e=fe>>>13,Ke=0|U[6],pe=8191&Ke,Te=Ke>>>13,Ve=0|U[7],be=8191&Ve,Pe=Ve>>>13,Ye=0|U[8],we=8191&Ye,Be=Ye>>>13,$e=0|U[9],Me=8191&$e,je=$e>>>13,Q=0|V[0],se=8191&Q,le=Q>>>13,Le=0|V[1],he=8191&Le,Oe=Le>>>13,Ge=0|V[2],me=8191&Ge,ze=Ge>>>13,rt=0|V[3],Re=8191&rt,He=rt>>>13,Qe=0|V[4],Ee=8191&Qe,Ne=Qe>>>13,it=0|V[5],xe=8191&it,qe=it>>>13,et=0|V[6],ke=8191&et,We=et>>>13,tt=0|V[7],Se=8191&tt,Fe=tt>>>13,nt=0|V[8],Ae=8191&nt,Ue=nt>>>13,Y=0|V[9],G=8191&Y,$=Y>>>13;g.negative=r.negative^a.negative,g.length=19;var ne=(W+(M=Math.imul(B,se))|0)+((8191&(E=(E=Math.imul(B,le))+Math.imul(N,se)|0))<<13)|0;W=((C=Math.imul(N,le))+(E>>>13)|0)+(ne>>>26)|0,ne&=67108863,M=Math.imul(j,se),E=(E=Math.imul(j,le))+Math.imul(K,se)|0,C=Math.imul(K,le);var ce=(W+(M=M+Math.imul(B,he)|0)|0)+((8191&(E=(E=E+Math.imul(B,Oe)|0)+Math.imul(N,he)|0))<<13)|0;W=((C=C+Math.imul(N,Oe)|0)+(E>>>13)|0)+(ce>>>26)|0,ce&=67108863,M=Math.imul(J,se),E=(E=Math.imul(J,le))+Math.imul(X,se)|0,C=Math.imul(X,le),M=M+Math.imul(j,he)|0,E=(E=E+Math.imul(j,Oe)|0)+Math.imul(K,he)|0,C=C+Math.imul(K,Oe)|0;var ue=(W+(M=M+Math.imul(B,me)|0)|0)+((8191&(E=(E=E+Math.imul(B,ze)|0)+Math.imul(N,me)|0))<<13)|0;W=((C=C+Math.imul(N,ze)|0)+(E>>>13)|0)+(ue>>>26)|0,ue&=67108863,M=Math.imul(te,se),E=(E=Math.imul(te,le))+Math.imul(oe,se)|0,C=Math.imul(oe,le),M=M+Math.imul(J,he)|0,E=(E=E+Math.imul(J,Oe)|0)+Math.imul(X,he)|0,C=C+Math.imul(X,Oe)|0,M=M+Math.imul(j,me)|0,E=(E=E+Math.imul(j,ze)|0)+Math.imul(K,me)|0,C=C+Math.imul(K,ze)|0;var Ce=(W+(M=M+Math.imul(B,Re)|0)|0)+((8191&(E=(E=E+Math.imul(B,He)|0)+Math.imul(N,Re)|0))<<13)|0;W=((C=C+Math.imul(N,He)|0)+(E>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,M=Math.imul(ie,se),E=(E=Math.imul(ie,le))+Math.imul(de,se)|0,C=Math.imul(de,le),M=M+Math.imul(te,he)|0,E=(E=E+Math.imul(te,Oe)|0)+Math.imul(oe,he)|0,C=C+Math.imul(oe,Oe)|0,M=M+Math.imul(J,me)|0,E=(E=E+Math.imul(J,ze)|0)+Math.imul(X,me)|0,C=C+Math.imul(X,ze)|0,M=M+Math.imul(j,Re)|0,E=(E=E+Math.imul(j,He)|0)+Math.imul(K,Re)|0,C=C+Math.imul(K,He)|0;var Ie=(W+(M=M+Math.imul(B,Ee)|0)|0)+((8191&(E=(E=E+Math.imul(B,Ne)|0)+Math.imul(N,Ee)|0))<<13)|0;W=((C=C+Math.imul(N,Ne)|0)+(E>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,M=Math.imul(re,se),E=(E=Math.imul(re,le))+Math.imul(_e,se)|0,C=Math.imul(_e,le),M=M+Math.imul(ie,he)|0,E=(E=E+Math.imul(ie,Oe)|0)+Math.imul(de,he)|0,C=C+Math.imul(de,Oe)|0,M=M+Math.imul(te,me)|0,E=(E=E+Math.imul(te,ze)|0)+Math.imul(oe,me)|0,C=C+Math.imul(oe,ze)|0,M=M+Math.imul(J,Re)|0,E=(E=E+Math.imul(J,He)|0)+Math.imul(X,Re)|0,C=C+Math.imul(X,He)|0,M=M+Math.imul(j,Ee)|0,E=(E=E+Math.imul(j,Ne)|0)+Math.imul(K,Ee)|0,C=C+Math.imul(K,Ne)|0;var De=(W+(M=M+Math.imul(B,xe)|0)|0)+((8191&(E=(E=E+Math.imul(B,qe)|0)+Math.imul(N,xe)|0))<<13)|0;W=((C=C+Math.imul(N,qe)|0)+(E>>>13)|0)+(De>>>26)|0,De&=67108863,M=Math.imul(pe,se),E=(E=Math.imul(pe,le))+Math.imul(Te,se)|0,C=Math.imul(Te,le),M=M+Math.imul(re,he)|0,E=(E=E+Math.imul(re,Oe)|0)+Math.imul(_e,he)|0,C=C+Math.imul(_e,Oe)|0,M=M+Math.imul(ie,me)|0,E=(E=E+Math.imul(ie,ze)|0)+Math.imul(de,me)|0,C=C+Math.imul(de,ze)|0,M=M+Math.imul(te,Re)|0,E=(E=E+Math.imul(te,He)|0)+Math.imul(oe,Re)|0,C=C+Math.imul(oe,He)|0,M=M+Math.imul(J,Ee)|0,E=(E=E+Math.imul(J,Ne)|0)+Math.imul(X,Ee)|0,C=C+Math.imul(X,Ne)|0,M=M+Math.imul(j,xe)|0,E=(E=E+Math.imul(j,qe)|0)+Math.imul(K,xe)|0,C=C+Math.imul(K,qe)|0;var ye=(W+(M=M+Math.imul(B,ke)|0)|0)+((8191&(E=(E=E+Math.imul(B,We)|0)+Math.imul(N,ke)|0))<<13)|0;W=((C=C+Math.imul(N,We)|0)+(E>>>13)|0)+(ye>>>26)|0,ye&=67108863,M=Math.imul(be,se),E=(E=Math.imul(be,le))+Math.imul(Pe,se)|0,C=Math.imul(Pe,le),M=M+Math.imul(pe,he)|0,E=(E=E+Math.imul(pe,Oe)|0)+Math.imul(Te,he)|0,C=C+Math.imul(Te,Oe)|0,M=M+Math.imul(re,me)|0,E=(E=E+Math.imul(re,ze)|0)+Math.imul(_e,me)|0,C=C+Math.imul(_e,ze)|0,M=M+Math.imul(ie,Re)|0,E=(E=E+Math.imul(ie,He)|0)+Math.imul(de,Re)|0,C=C+Math.imul(de,He)|0,M=M+Math.imul(te,Ee)|0,E=(E=E+Math.imul(te,Ne)|0)+Math.imul(oe,Ee)|0,C=C+Math.imul(oe,Ne)|0,M=M+Math.imul(J,xe)|0,E=(E=E+Math.imul(J,qe)|0)+Math.imul(X,xe)|0,C=C+Math.imul(X,qe)|0,M=M+Math.imul(j,ke)|0,E=(E=E+Math.imul(j,We)|0)+Math.imul(K,ke)|0,C=C+Math.imul(K,We)|0;var ae=(W+(M=M+Math.imul(B,Se)|0)|0)+((8191&(E=(E=E+Math.imul(B,Fe)|0)+Math.imul(N,Se)|0))<<13)|0;W=((C=C+Math.imul(N,Fe)|0)+(E>>>13)|0)+(ae>>>26)|0,ae&=67108863,M=Math.imul(we,se),E=(E=Math.imul(we,le))+Math.imul(Be,se)|0,C=Math.imul(Be,le),M=M+Math.imul(be,he)|0,E=(E=E+Math.imul(be,Oe)|0)+Math.imul(Pe,he)|0,C=C+Math.imul(Pe,Oe)|0,M=M+Math.imul(pe,me)|0,E=(E=E+Math.imul(pe,ze)|0)+Math.imul(Te,me)|0,C=C+Math.imul(Te,ze)|0,M=M+Math.imul(re,Re)|0,E=(E=E+Math.imul(re,He)|0)+Math.imul(_e,Re)|0,C=C+Math.imul(_e,He)|0,M=M+Math.imul(ie,Ee)|0,E=(E=E+Math.imul(ie,Ne)|0)+Math.imul(de,Ee)|0,C=C+Math.imul(de,Ne)|0,M=M+Math.imul(te,xe)|0,E=(E=E+Math.imul(te,qe)|0)+Math.imul(oe,xe)|0,C=C+Math.imul(oe,qe)|0,M=M+Math.imul(J,ke)|0,E=(E=E+Math.imul(J,We)|0)+Math.imul(X,ke)|0,C=C+Math.imul(X,We)|0,M=M+Math.imul(j,Se)|0,E=(E=E+Math.imul(j,Fe)|0)+Math.imul(K,Se)|0,C=C+Math.imul(K,Fe)|0;var Je=(W+(M=M+Math.imul(B,Ae)|0)|0)+((8191&(E=(E=E+Math.imul(B,Ue)|0)+Math.imul(N,Ae)|0))<<13)|0;W=((C=C+Math.imul(N,Ue)|0)+(E>>>13)|0)+(Je>>>26)|0,Je&=67108863,M=Math.imul(Me,se),E=(E=Math.imul(Me,le))+Math.imul(je,se)|0,C=Math.imul(je,le),M=M+Math.imul(we,he)|0,E=(E=E+Math.imul(we,Oe)|0)+Math.imul(Be,he)|0,C=C+Math.imul(Be,Oe)|0,M=M+Math.imul(be,me)|0,E=(E=E+Math.imul(be,ze)|0)+Math.imul(Pe,me)|0,C=C+Math.imul(Pe,ze)|0,M=M+Math.imul(pe,Re)|0,E=(E=E+Math.imul(pe,He)|0)+Math.imul(Te,Re)|0,C=C+Math.imul(Te,He)|0,M=M+Math.imul(re,Ee)|0,E=(E=E+Math.imul(re,Ne)|0)+Math.imul(_e,Ee)|0,C=C+Math.imul(_e,Ne)|0,M=M+Math.imul(ie,xe)|0,E=(E=E+Math.imul(ie,qe)|0)+Math.imul(de,xe)|0,C=C+Math.imul(de,qe)|0,M=M+Math.imul(te,ke)|0,E=(E=E+Math.imul(te,We)|0)+Math.imul(oe,ke)|0,C=C+Math.imul(oe,We)|0,M=M+Math.imul(J,Se)|0,E=(E=E+Math.imul(J,Fe)|0)+Math.imul(X,Se)|0,C=C+Math.imul(X,Fe)|0,M=M+Math.imul(j,Ae)|0,E=(E=E+Math.imul(j,Ue)|0)+Math.imul(K,Ae)|0,C=C+Math.imul(K,Ue)|0;var ot=(W+(M=M+Math.imul(B,G)|0)|0)+((8191&(E=(E=E+Math.imul(B,$)|0)+Math.imul(N,G)|0))<<13)|0;W=((C=C+Math.imul(N,$)|0)+(E>>>13)|0)+(ot>>>26)|0,ot&=67108863,M=Math.imul(Me,he),E=(E=Math.imul(Me,Oe))+Math.imul(je,he)|0,C=Math.imul(je,Oe),M=M+Math.imul(we,me)|0,E=(E=E+Math.imul(we,ze)|0)+Math.imul(Be,me)|0,C=C+Math.imul(Be,ze)|0,M=M+Math.imul(be,Re)|0,E=(E=E+Math.imul(be,He)|0)+Math.imul(Pe,Re)|0,C=C+Math.imul(Pe,He)|0,M=M+Math.imul(pe,Ee)|0,E=(E=E+Math.imul(pe,Ne)|0)+Math.imul(Te,Ee)|0,C=C+Math.imul(Te,Ne)|0,M=M+Math.imul(re,xe)|0,E=(E=E+Math.imul(re,qe)|0)+Math.imul(_e,xe)|0,C=C+Math.imul(_e,qe)|0,M=M+Math.imul(ie,ke)|0,E=(E=E+Math.imul(ie,We)|0)+Math.imul(de,ke)|0,C=C+Math.imul(de,We)|0,M=M+Math.imul(te,Se)|0,E=(E=E+Math.imul(te,Fe)|0)+Math.imul(oe,Se)|0,C=C+Math.imul(oe,Fe)|0,M=M+Math.imul(J,Ae)|0,E=(E=E+Math.imul(J,Ue)|0)+Math.imul(X,Ae)|0,C=C+Math.imul(X,Ue)|0;var at=(W+(M=M+Math.imul(j,G)|0)|0)+((8191&(E=(E=E+Math.imul(j,$)|0)+Math.imul(K,G)|0))<<13)|0;W=((C=C+Math.imul(K,$)|0)+(E>>>13)|0)+(at>>>26)|0,at&=67108863,M=Math.imul(Me,me),E=(E=Math.imul(Me,ze))+Math.imul(je,me)|0,C=Math.imul(je,ze),M=M+Math.imul(we,Re)|0,E=(E=E+Math.imul(we,He)|0)+Math.imul(Be,Re)|0,C=C+Math.imul(Be,He)|0,M=M+Math.imul(be,Ee)|0,E=(E=E+Math.imul(be,Ne)|0)+Math.imul(Pe,Ee)|0,C=C+Math.imul(Pe,Ne)|0,M=M+Math.imul(pe,xe)|0,E=(E=E+Math.imul(pe,qe)|0)+Math.imul(Te,xe)|0,C=C+Math.imul(Te,qe)|0,M=M+Math.imul(re,ke)|0,E=(E=E+Math.imul(re,We)|0)+Math.imul(_e,ke)|0,C=C+Math.imul(_e,We)|0,M=M+Math.imul(ie,Se)|0,E=(E=E+Math.imul(ie,Fe)|0)+Math.imul(de,Se)|0,C=C+Math.imul(de,Fe)|0,M=M+Math.imul(te,Ae)|0,E=(E=E+Math.imul(te,Ue)|0)+Math.imul(oe,Ae)|0,C=C+Math.imul(oe,Ue)|0;var st=(W+(M=M+Math.imul(J,G)|0)|0)+((8191&(E=(E=E+Math.imul(J,$)|0)+Math.imul(X,G)|0))<<13)|0;W=((C=C+Math.imul(X,$)|0)+(E>>>13)|0)+(st>>>26)|0,st&=67108863,M=Math.imul(Me,Re),E=(E=Math.imul(Me,He))+Math.imul(je,Re)|0,C=Math.imul(je,He),M=M+Math.imul(we,Ee)|0,E=(E=E+Math.imul(we,Ne)|0)+Math.imul(Be,Ee)|0,C=C+Math.imul(Be,Ne)|0,M=M+Math.imul(be,xe)|0,E=(E=E+Math.imul(be,qe)|0)+Math.imul(Pe,xe)|0,C=C+Math.imul(Pe,qe)|0,M=M+Math.imul(pe,ke)|0,E=(E=E+Math.imul(pe,We)|0)+Math.imul(Te,ke)|0,C=C+Math.imul(Te,We)|0,M=M+Math.imul(re,Se)|0,E=(E=E+Math.imul(re,Fe)|0)+Math.imul(_e,Se)|0,C=C+Math.imul(_e,Fe)|0,M=M+Math.imul(ie,Ae)|0,E=(E=E+Math.imul(ie,Ue)|0)+Math.imul(de,Ae)|0,C=C+Math.imul(de,Ue)|0;var ut=(W+(M=M+Math.imul(te,G)|0)|0)+((8191&(E=(E=E+Math.imul(te,$)|0)+Math.imul(oe,G)|0))<<13)|0;W=((C=C+Math.imul(oe,$)|0)+(E>>>13)|0)+(ut>>>26)|0,ut&=67108863,M=Math.imul(Me,Ee),E=(E=Math.imul(Me,Ne))+Math.imul(je,Ee)|0,C=Math.imul(je,Ne),M=M+Math.imul(we,xe)|0,E=(E=E+Math.imul(we,qe)|0)+Math.imul(Be,xe)|0,C=C+Math.imul(Be,qe)|0,M=M+Math.imul(be,ke)|0,E=(E=E+Math.imul(be,We)|0)+Math.imul(Pe,ke)|0,C=C+Math.imul(Pe,We)|0,M=M+Math.imul(pe,Se)|0,E=(E=E+Math.imul(pe,Fe)|0)+Math.imul(Te,Se)|0,C=C+Math.imul(Te,Fe)|0,M=M+Math.imul(re,Ae)|0,E=(E=E+Math.imul(re,Ue)|0)+Math.imul(_e,Ae)|0,C=C+Math.imul(_e,Ue)|0;var Ze=(W+(M=M+Math.imul(ie,G)|0)|0)+((8191&(E=(E=E+Math.imul(ie,$)|0)+Math.imul(de,G)|0))<<13)|0;W=((C=C+Math.imul(de,$)|0)+(E>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,M=Math.imul(Me,xe),E=(E=Math.imul(Me,qe))+Math.imul(je,xe)|0,C=Math.imul(je,qe),M=M+Math.imul(we,ke)|0,E=(E=E+Math.imul(we,We)|0)+Math.imul(Be,ke)|0,C=C+Math.imul(Be,We)|0,M=M+Math.imul(be,Se)|0,E=(E=E+Math.imul(be,Fe)|0)+Math.imul(Pe,Se)|0,C=C+Math.imul(Pe,Fe)|0,M=M+Math.imul(pe,Ae)|0,E=(E=E+Math.imul(pe,Ue)|0)+Math.imul(Te,Ae)|0,C=C+Math.imul(Te,Ue)|0;var ct=(W+(M=M+Math.imul(re,G)|0)|0)+((8191&(E=(E=E+Math.imul(re,$)|0)+Math.imul(_e,G)|0))<<13)|0;W=((C=C+Math.imul(_e,$)|0)+(E>>>13)|0)+(ct>>>26)|0,ct&=67108863,M=Math.imul(Me,ke),E=(E=Math.imul(Me,We))+Math.imul(je,ke)|0,C=Math.imul(je,We),M=M+Math.imul(we,Se)|0,E=(E=E+Math.imul(we,Fe)|0)+Math.imul(Be,Se)|0,C=C+Math.imul(Be,Fe)|0,M=M+Math.imul(be,Ae)|0,E=(E=E+Math.imul(be,Ue)|0)+Math.imul(Pe,Ae)|0,C=C+Math.imul(Pe,Ue)|0;var Xe=(W+(M=M+Math.imul(pe,G)|0)|0)+((8191&(E=(E=E+Math.imul(pe,$)|0)+Math.imul(Te,G)|0))<<13)|0;W=((C=C+Math.imul(Te,$)|0)+(E>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,M=Math.imul(Me,Se),E=(E=Math.imul(Me,Fe))+Math.imul(je,Se)|0,C=Math.imul(je,Fe),M=M+Math.imul(we,Ae)|0,E=(E=E+Math.imul(we,Ue)|0)+Math.imul(Be,Ae)|0,C=C+Math.imul(Be,Ue)|0;var ht=(W+(M=M+Math.imul(be,G)|0)|0)+((8191&(E=(E=E+Math.imul(be,$)|0)+Math.imul(Pe,G)|0))<<13)|0;W=((C=C+Math.imul(Pe,$)|0)+(E>>>13)|0)+(ht>>>26)|0,ht&=67108863,M=Math.imul(Me,Ae),E=(E=Math.imul(Me,Ue))+Math.imul(je,Ae)|0,C=Math.imul(je,Ue);var ft=(W+(M=M+Math.imul(we,G)|0)|0)+((8191&(E=(E=E+Math.imul(we,$)|0)+Math.imul(Be,G)|0))<<13)|0;W=((C=C+Math.imul(Be,$)|0)+(E>>>13)|0)+(ft>>>26)|0,ft&=67108863;var pt=(W+(M=Math.imul(Me,G))|0)+((8191&(E=(E=Math.imul(Me,$))+Math.imul(je,G)|0))<<13)|0;return W=((C=Math.imul(je,$))+(E>>>13)|0)+(pt>>>26)|0,pt&=67108863,I[0]=ne,I[1]=ce,I[2]=ue,I[3]=Ce,I[4]=Ie,I[5]=De,I[6]=ye,I[7]=ae,I[8]=Je,I[9]=ot,I[10]=at,I[11]=st,I[12]=ut,I[13]=Ze,I[14]=ct,I[15]=Xe,I[16]=ht,I[17]=ft,I[18]=pt,0!==W&&(I[19]=W,g.length++),g};function S(r,a,g){g.negative=a.negative^r.negative,g.length=r.length+a.length;for(var M=0,E=0,C=0;C>>26)|0)>>>26,U&=67108863}g.words[C]=V,M=U,U=E}return 0!==M?g.words[C]=M:g.length--,g._strip()}function w(r,a,g){return S(r,a,g)}function A(r,a){this.x=r,this.y=a}Math.imul||(b=O),e.prototype.mulTo=function(r,a){var g=this.length+r.length;return 10===this.length&&10===r.length?b(this,r,a):g<63?O(this,r,a):g<1024?S(this,r,a):w(this,r,a)},A.prototype.makeRBT=function(r){for(var a=new Array(r),g=e.prototype._countBits(r)-1,M=0;M>=1;return M},A.prototype.permute=function(r,a,g,M,E,C){for(var U=0;U>>=1)E++;return 1<>>=13),E>>>=13;for(C=2*a;C>=26,g+=E/67108864|0,g+=C>>>26,this.words[M]=67108863&C}return 0!==g&&(this.words[M]=g,this.length++),a?this.ineg():this},e.prototype.muln=function(r){return this.clone().imuln(r)},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.imul(this.clone())},e.prototype.pow=function(r){var a=function(C){for(var U=new Array(C.bitLength()),V=0;V>>V%26&1;return U}(r);if(0===a.length)return new e(1);for(var g=this,M=0;M=0);var a,g=r%26,M=(r-g)/26,E=67108863>>>26-g<<26-g;if(0!==g){var C=0;for(a=0;a>>26-g}C&&(this.words[a]=C,this.length++)}if(0!==M){for(a=this.length-1;a>=0;a--)this.words[a+M]=this.words[a];for(a=0;a=0),M=a?(a-a%26)/26:0;var E=r%26,C=Math.min((r-E)/26,this.length),U=67108863^67108863>>>E<C)for(this.length-=C,I=0;I=0&&(0!==W||I>=M);I--){var F=0|this.words[I];this.words[I]=W<<26-E|F>>>E,W=F&U}return V&&0!==W&&(V.words[V.length++]=W),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},e.prototype.ishrn=function(r,a,g){return n(0===this.negative),this.iushrn(r,a,g)},e.prototype.shln=function(r){return this.clone().ishln(r)},e.prototype.ushln=function(r){return this.clone().iushln(r)},e.prototype.shrn=function(r){return this.clone().ishrn(r)},e.prototype.ushrn=function(r){return this.clone().iushrn(r)},e.prototype.testn=function(r){n("number"==typeof r&&r>=0);var a=r%26,g=(r-a)/26;return!(this.length<=g||!(this.words[g]&1<=0);var a=r%26,g=(r-a)/26;return n(0===this.negative,"imaskn works only with positive numbers"),this.length<=g?this:(0!==a&&g++,this.length=Math.min(g,this.length),0!==a&&(this.words[this.length-1]&=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},e.prototype.isubn=function(r){if(n("number"==typeof r),n(r<67108864),r<0)return this.iaddn(-r);if(0!==this.negative)return this.negative=0,this.iaddn(r),this.negative=1,this;if(this.words[0]-=r,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(V/67108864|0),this.words[M+g]=67108863&E}for(;M>26,this.words[M+g]=67108863&E;if(0===U)return this._strip();for(n(-1===U),U=0,M=0;M>26,this.words[M]=67108863&E;return this.negative=1,this._strip()},e.prototype._wordDiv=function(r,a){var g,M=this.clone(),E=r,C=0|E.words[E.length-1];0!=(g=26-this._countBits(C))&&(E=E.ushln(g),M.iushln(g),C=0|E.words[E.length-1]);var U,V=M.length-E.length;if("mod"!==a){(U=new e(null)).length=V+1,U.words=new Array(U.length);for(var I=0;I=0;F--){var B=67108864*(0|M.words[E.length+F])+(0|M.words[E.length+F-1]);for(B=Math.min(B/C|0,67108863),M._ishlnsubmul(E,B,F);0!==M.negative;)B--,M.negative=0,M._ishlnsubmul(E,1,F),M.isZero()||(M.negative^=1);U&&(U.words[F]=B)}return U&&U._strip(),M._strip(),"div"!==a&&0!==g&&M.iushrn(g),{div:U||null,mod:M}},e.prototype.divmod=function(r,a,g){return n(!r.isZero()),this.isZero()?{div:new e(0),mod:new e(0)}:0!==this.negative&&0===r.negative?(C=this.neg().divmod(r,a),"mod"!==a&&(M=C.div.neg()),"div"!==a&&(E=C.mod.neg(),g&&0!==E.negative&&E.iadd(r)),{div:M,mod:E}):0===this.negative&&0!==r.negative?(C=this.divmod(r.neg(),a),"mod"!==a&&(M=C.div.neg()),{div:M,mod:C.mod}):0!=(this.negative&r.negative)?(C=this.neg().divmod(r.neg(),a),"div"!==a&&(E=C.mod.neg(),g&&0!==E.negative&&E.isub(r)),{div:C.div,mod:E}):r.length>this.length||this.cmp(r)<0?{div:new e(0),mod:this}:1===r.length?"div"===a?{div:this.divn(r.words[0]),mod:null}:"mod"===a?{div:null,mod:new e(this.modrn(r.words[0]))}:{div:this.divn(r.words[0]),mod:new e(this.modrn(r.words[0]))}:this._wordDiv(r,a);var M,E,C},e.prototype.div=function(r){return this.divmod(r,"div",!1).div},e.prototype.mod=function(r){return this.divmod(r,"mod",!1).mod},e.prototype.umod=function(r){return this.divmod(r,"mod",!0).mod},e.prototype.divRound=function(r){var a=this.divmod(r);if(a.mod.isZero())return a.div;var g=0!==a.div.negative?a.mod.isub(r):a.mod,M=r.ushrn(1),E=r.andln(1),C=g.cmp(M);return C<0||1===E&&0===C?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},e.prototype.modrn=function(r){var a=r<0;a&&(r=-r),n(r<=67108863);for(var g=(1<<26)%r,M=0,E=this.length-1;E>=0;E--)M=(g*M+(0|this.words[E]))%r;return a?-M:M},e.prototype.modn=function(r){return this.modrn(r)},e.prototype.idivn=function(r){var a=r<0;a&&(r=-r),n(r<=67108863);for(var g=0,M=this.length-1;M>=0;M--){var E=(0|this.words[M])+67108864*g;this.words[M]=E/r|0,g=E%r}return this._strip(),a?this.ineg():this},e.prototype.divn=function(r){return this.clone().idivn(r)},e.prototype.egcd=function(r){n(0===r.negative),n(!r.isZero());var a=this,g=r.clone();a=0!==a.negative?a.umod(r):a.clone();for(var M=new e(1),E=new e(0),C=new e(0),U=new e(1),V=0;a.isEven()&&g.isEven();)a.iushrn(1),g.iushrn(1),++V;for(var I=g.clone(),W=a.clone();!a.isZero();){for(var F=0,B=1;0==(a.words[0]&B)&&F<26;++F,B<<=1);if(F>0)for(a.iushrn(F);F-- >0;)(M.isOdd()||E.isOdd())&&(M.iadd(I),E.isub(W)),M.iushrn(1),E.iushrn(1);for(var N=0,P=1;0==(g.words[0]&P)&&N<26;++N,P<<=1);if(N>0)for(g.iushrn(N);N-- >0;)(C.isOdd()||U.isOdd())&&(C.iadd(I),U.isub(W)),C.iushrn(1),U.iushrn(1);a.cmp(g)>=0?(a.isub(g),M.isub(C),E.isub(U)):(g.isub(a),C.isub(M),U.isub(E))}return{a:C,b:U,gcd:g.iushln(V)}},e.prototype._invmp=function(r){n(0===r.negative),n(!r.isZero());var a=this,g=r.clone();a=0!==a.negative?a.umod(r):a.clone();for(var M,E=new e(1),C=new e(0),U=g.clone();a.cmpn(1)>0&&g.cmpn(1)>0;){for(var V=0,I=1;0==(a.words[0]&I)&&V<26;++V,I<<=1);if(V>0)for(a.iushrn(V);V-- >0;)E.isOdd()&&E.iadd(U),E.iushrn(1);for(var W=0,F=1;0==(g.words[0]&F)&&W<26;++W,F<<=1);if(W>0)for(g.iushrn(W);W-- >0;)C.isOdd()&&C.iadd(U),C.iushrn(1);a.cmp(g)>=0?(a.isub(g),E.isub(C)):(g.isub(a),C.isub(E))}return(M=0===a.cmpn(1)?E:C).cmpn(0)<0&&M.iadd(r),M},e.prototype.gcd=function(r){if(this.isZero())return r.abs();if(r.isZero())return this.abs();var a=this.clone(),g=r.clone();a.negative=0,g.negative=0;for(var M=0;a.isEven()&&g.isEven();M++)a.iushrn(1),g.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;g.isEven();)g.iushrn(1);var E=a.cmp(g);if(E<0){var C=a;a=g,g=C}else if(0===E||0===g.cmpn(1))break;a.isub(g)}return g.iushln(M)},e.prototype.invm=function(r){return this.egcd(r).a.umod(r)},e.prototype.isEven=function(){return 0==(1&this.words[0])},e.prototype.isOdd=function(){return 1==(1&this.words[0])},e.prototype.andln=function(r){return this.words[0]&r},e.prototype.bincn=function(r){n("number"==typeof r);var a=r%26,g=(r-a)/26,M=1<>>26,this.words[C]=U&=67108863}return 0!==E&&(this.words[C]=E,this.length++),this},e.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},e.prototype.cmpn=function(r){var a,g=r<0;if(0!==this.negative&&!g)return-1;if(0===this.negative&&g)return 1;if(this._strip(),this.length>1)a=1;else{g&&(r=-r),n(r<=67108863,"Number is too big");var M=0|this.words[0];a=M===r?0:Mr.length)return 1;if(this.length=0;g--){var M=0|this.words[g],E=0|r.words[g];if(M!==E){ME&&(a=1);break}}return a},e.prototype.gtn=function(r){return 1===this.cmpn(r)},e.prototype.gt=function(r){return 1===this.cmp(r)},e.prototype.gten=function(r){return this.cmpn(r)>=0},e.prototype.gte=function(r){return this.cmp(r)>=0},e.prototype.ltn=function(r){return-1===this.cmpn(r)},e.prototype.lt=function(r){return-1===this.cmp(r)},e.prototype.lten=function(r){return this.cmpn(r)<=0},e.prototype.lte=function(r){return this.cmp(r)<=0},e.prototype.eqn=function(r){return 0===this.cmpn(r)},e.prototype.eq=function(r){return 0===this.cmp(r)},e.red=function(r){return new x(r)},e.prototype.toRed=function(r){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),r.convertTo(this)._forceRed(r)},e.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(r){return this.red=r,this},e.prototype.forceRed=function(r){return n(!this.red,"Already a number in reduction context"),this._forceRed(r)},e.prototype.redAdd=function(r){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,r)},e.prototype.redIAdd=function(r){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,r)},e.prototype.redSub=function(r){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,r)},e.prototype.redISub=function(r){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,r)},e.prototype.redShl=function(r){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,r)},e.prototype.redMul=function(r){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,r),this.red.mul(this,r)},e.prototype.redIMul=function(r){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,r),this.red.imul(this,r)},e.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(r){return n(this.red&&!r.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,r)};var L={k256:null,p224:null,p192:null,p25519:null};function H(r,a){this.name=r,this.p=new e(a,16),this.n=this.p.bitLength(),this.k=new e(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function D(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function q(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function p(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(r){if("string"==typeof r){var a=e._prime(r);this.m=a.p,this.prime=a}else n(r.gtn(1),"modulus must be greater than 1"),this.m=r,this.prime=null}function R(r){x.call(this,r),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new e(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)}H.prototype._tmp=function(){var r=new e(null);return r.words=new Array(Math.ceil(this.n/13)),r},H.prototype.ireduce=function(r){var a,g=r;do{this.split(g,this.tmp),a=(g=(g=this.imulK(g)).iadd(this.tmp)).bitLength()}while(a>this.n);var M=a0?g.isub(this.p):void 0!==g.strip?g.strip():g._strip(),g},H.prototype.split=function(r,a){r.iushrn(this.n,0,a)},H.prototype.imulK=function(r){return r.imul(this.k)},o(D,H),D.prototype.split=function(r,a){for(var g=Math.min(r.length,9),M=0;M>>22,E=C}r.words[M-10]=E>>>=22,r.length-=0===E&&r.length>10?10:9},D.prototype.imulK=function(r){r.words[r.length]=0,r.words[r.length+1]=0,r.length+=2;for(var a=0,g=0;g>>=26,r.words[g]=E,a=M}return 0!==a&&(r.words[r.length++]=a),r},e._prime=function(r){if(L[r])return L[r];var a;if("k256"===r)a=new D;else if("p224"===r)a=new q;else if("p192"===r)a=new k;else{if("p25519"!==r)throw new Error("Unknown prime "+r);a=new p}return L[r]=a,a},x.prototype._verify1=function(r){n(0===r.negative,"red works only with positives"),n(r.red,"red works only with red numbers")},x.prototype._verify2=function(r,a){n(0==(r.negative|a.negative),"red works only with positives"),n(r.red&&r.red===a.red,"red works only with red numbers")},x.prototype.imod=function(r){return this.prime?this.prime.ireduce(r)._forceRed(this):(f(r,r.umod(this.m)._forceRed(this)),r)},x.prototype.neg=function(r){return r.isZero()?r.clone():this.m.sub(r)._forceRed(this)},x.prototype.add=function(r,a){this._verify2(r,a);var g=r.add(a);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},x.prototype.iadd=function(r,a){this._verify2(r,a);var g=r.iadd(a);return g.cmp(this.m)>=0&&g.isub(this.m),g},x.prototype.sub=function(r,a){this._verify2(r,a);var g=r.sub(a);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},x.prototype.isub=function(r,a){this._verify2(r,a);var g=r.isub(a);return g.cmpn(0)<0&&g.iadd(this.m),g},x.prototype.shl=function(r,a){return this._verify1(r),this.imod(r.ushln(a))},x.prototype.imul=function(r,a){return this._verify2(r,a),this.imod(r.imul(a))},x.prototype.mul=function(r,a){return this._verify2(r,a),this.imod(r.mul(a))},x.prototype.isqr=function(r){return this.imul(r,r.clone())},x.prototype.sqr=function(r){return this.mul(r,r)},x.prototype.sqrt=function(r){if(r.isZero())return r.clone();var a=this.m.andln(3);if(n(a%2==1),3===a){var g=this.m.add(new e(1)).iushrn(2);return this.pow(r,g)}for(var M=this.m.subn(1),E=0;!M.isZero()&&0===M.andln(1);)E++,M.iushrn(1);n(!M.isZero());var C=new e(1).toRed(this),U=C.redNeg(),V=this.m.subn(1).iushrn(1),I=this.m.bitLength();for(I=new e(2*I*I).toRed(this);0!==this.pow(I,V).cmp(U);)I.redIAdd(U);for(var W=this.pow(I,M),F=this.pow(r,M.addn(1).iushrn(1)),B=this.pow(r,M),N=E;0!==B.cmp(C);){for(var P=B,j=0;0!==P.cmp(C);j++)P=P.redSqr();n(j=0;M--){for(var I=a.words[M],W=V-1;W>=0;W--){var F=I>>W&1;E!==g[0]&&(E=this.sqr(E)),0!==F||0!==C?(C<<=1,C|=F,(4==++U||0===M&&0===W)&&(E=this.mul(E,g[C]),U=0,C=0)):U=0}V=26}return E},x.prototype.convertTo=function(r){var a=r.umod(this.m);return a===r?a.clone():a},x.prototype.convertFrom=function(r){var a=r.clone();return a.red=null,a},e.mont=function(r){return new R(r)},o(R,x),R.prototype.convertTo=function(r){return this.imod(r.ushln(this.shift))},R.prototype.convertFrom=function(r){var a=this.imod(r.mul(this.rinv));return a.red=null,a},R.prototype.imul=function(r,a){if(r.isZero()||a.isZero())return r.words[0]=0,r.length=1,r;var g=r.imul(a),M=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=g.isub(M).iushrn(this.shift),C=E;return E.cmp(this.m)>=0?C=E.isub(this.m):E.cmpn(0)<0&&(C=E.iadd(this.m)),C._forceRed(this)},R.prototype.mul=function(r,a){if(r.isZero()||a.isZero())return new e(0)._forceRed(this);var g=r.mul(a),M=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=g.isub(M).iushrn(this.shift),C=E;return E.cmp(this.m)>=0?C=E.isub(this.m):E.cmpn(0)<0&&(C=E.iadd(this.m)),C._forceRed(this)},R.prototype.invm=function(r){return this.imod(r._invmp(this.m).mul(this.r2))._forceRed(this)}}(s,this)}).call(this,c(25)(z))},function(z,l){},function(z,l,c){"use strict";var s=c(3),m=c(127),y=c(13).Buffer,n=new Array(16);function o(){m.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function e(f,d){return f<>>32-d}function t(f,d,_,v,T,O,b){return e(f+(d&_|~d&v)+T+O|0,b)+d|0}function i(f,d,_,v,T,O,b){return e(f+(d&v|_&~v)+T+O|0,b)+d|0}function u(f,d,_,v,T,O,b){return e(f+(d^_^v)+T+O|0,b)+d|0}function h(f,d,_,v,T,O,b){return e(f+(_^(d|~v))+T+O|0,b)+d|0}s(o,m),o.prototype._update=function(){for(var f=n,d=0;d<16;++d)f[d]=this._block.readInt32LE(4*d);var _=this._a,v=this._b,T=this._c,O=this._d;_=t(_,v,T,O,f[0],3614090360,7),O=t(O,_,v,T,f[1],3905402710,12),T=t(T,O,_,v,f[2],606105819,17),v=t(v,T,O,_,f[3],3250441966,22),_=t(_,v,T,O,f[4],4118548399,7),O=t(O,_,v,T,f[5],1200080426,12),T=t(T,O,_,v,f[6],2821735955,17),v=t(v,T,O,_,f[7],4249261313,22),_=t(_,v,T,O,f[8],1770035416,7),O=t(O,_,v,T,f[9],2336552879,12),T=t(T,O,_,v,f[10],4294925233,17),v=t(v,T,O,_,f[11],2304563134,22),_=t(_,v,T,O,f[12],1804603682,7),O=t(O,_,v,T,f[13],4254626195,12),T=t(T,O,_,v,f[14],2792965006,17),_=i(_,v=t(v,T,O,_,f[15],1236535329,22),T,O,f[1],4129170786,5),O=i(O,_,v,T,f[6],3225465664,9),T=i(T,O,_,v,f[11],643717713,14),v=i(v,T,O,_,f[0],3921069994,20),_=i(_,v,T,O,f[5],3593408605,5),O=i(O,_,v,T,f[10],38016083,9),T=i(T,O,_,v,f[15],3634488961,14),v=i(v,T,O,_,f[4],3889429448,20),_=i(_,v,T,O,f[9],568446438,5),O=i(O,_,v,T,f[14],3275163606,9),T=i(T,O,_,v,f[3],4107603335,14),v=i(v,T,O,_,f[8],1163531501,20),_=i(_,v,T,O,f[13],2850285829,5),O=i(O,_,v,T,f[2],4243563512,9),T=i(T,O,_,v,f[7],1735328473,14),_=u(_,v=i(v,T,O,_,f[12],2368359562,20),T,O,f[5],4294588738,4),O=u(O,_,v,T,f[8],2272392833,11),T=u(T,O,_,v,f[11],1839030562,16),v=u(v,T,O,_,f[14],4259657740,23),_=u(_,v,T,O,f[1],2763975236,4),O=u(O,_,v,T,f[4],1272893353,11),T=u(T,O,_,v,f[7],4139469664,16),v=u(v,T,O,_,f[10],3200236656,23),_=u(_,v,T,O,f[13],681279174,4),O=u(O,_,v,T,f[0],3936430074,11),T=u(T,O,_,v,f[3],3572445317,16),v=u(v,T,O,_,f[6],76029189,23),_=u(_,v,T,O,f[9],3654602809,4),O=u(O,_,v,T,f[12],3873151461,11),T=u(T,O,_,v,f[15],530742520,16),_=h(_,v=u(v,T,O,_,f[2],3299628645,23),T,O,f[0],4096336452,6),O=h(O,_,v,T,f[7],1126891415,10),T=h(T,O,_,v,f[14],2878612391,15),v=h(v,T,O,_,f[5],4237533241,21),_=h(_,v,T,O,f[12],1700485571,6),O=h(O,_,v,T,f[3],2399980690,10),T=h(T,O,_,v,f[10],4293915773,15),v=h(v,T,O,_,f[1],2240044497,21),_=h(_,v,T,O,f[8],1873313359,6),O=h(O,_,v,T,f[15],4264355552,10),T=h(T,O,_,v,f[6],2734768916,15),v=h(v,T,O,_,f[13],1309151649,21),_=h(_,v,T,O,f[4],4149444226,6),O=h(O,_,v,T,f[11],3174756917,10),T=h(T,O,_,v,f[2],718787259,15),v=h(v,T,O,_,f[9],3951481745,21),this._a=this._a+_|0,this._b=this._b+v|0,this._c=this._c+T|0,this._d=this._d+O|0},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var f=y.allocUnsafe(16);return f.writeInt32LE(this._a,0),f.writeInt32LE(this._b,4),f.writeInt32LE(this._c,8),f.writeInt32LE(this._d,12),f},z.exports=o},function(z,l,c){(l=z.exports=c(128)).Stream=l,l.Readable=l,l.Writable=c(132),l.Duplex=c(30),l.Transform=c(133),l.PassThrough=c(278),l.finished=c(62),l.pipeline=c(279)},function(z,l){},function(z,l,c){"use strict";function s(t,i){var u=Object.keys(t);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(t);i&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(t,f).enumerable})),u.push.apply(u,h)}return u}function m(t,i,u){return i in t?Object.defineProperty(t,i,{value:u,enumerable:!0,configurable:!0,writable:!0}):t[i]=u,t}function y(t,i){for(var u=0;u0?this.tail.next=d:this.head=d,this.tail=d,++this.length}},{key:"unshift",value:function(f){var d={data:f,next:this.head};0===this.length&&(this.tail=d),this.head=d,++this.length}},{key:"shift",value:function(){if(0!==this.length){var f=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(0===this.length)return"";for(var d=this.head,_=""+d.data;d=d.next;)_+=f+d.data;return _}},{key:"concat",value:function(f){if(0===this.length)return n.alloc(0);for(var T=n.allocUnsafe(f>>>0),O=this.head,b=0;O;)n.prototype.copy.call(O.data,T,b),b+=O.data.length,O=O.next;return T}},{key:"consume",value:function(f,d){var _;return fT.length?T.length:f;if(v+=O===T.length?T:T.slice(0,f),0==(f-=O)){O===T.length?(++_,this.head=d.next?d.next:this.tail=null):(this.head=d,d.data=T.slice(O));break}++_}return this.length-=_,v}},{key:"_getBuffer",value:function(f){var d=n.allocUnsafe(f),_=this.head,v=1;for(_.data.copy(d),f-=_.data.length;_=_.next;){var T=_.data,O=f>T.length?T.length:f;if(T.copy(d,d.length-f,0,O),0==(f-=O)){O===T.length?(++v,this.head=_.next?_.next:this.tail=null):(this.head=_,_.data=T.slice(O));break}++v}return this.length-=v,d}},{key:e,value:function(f,d){return o(this,function(_){for(var v=1;v0,function(w){_||(_=w),w&&T.forEach(t),S||(T.forEach(t),v(_))})});return f.reduce(i)}},function(z,l,c){"use strict";var s=c(2).Buffer,m=c(3),y=c(127),n=new Array(16),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],e=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],t=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],i=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],u=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function f(){y.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function d(S,w){return S<>>32-w}function _(S,w,A,L,H,D,q,k){return d(S+(w^A^L)+D+q|0,k)+H|0}function v(S,w,A,L,H,D,q,k){return d(S+(w&A|~w&L)+D+q|0,k)+H|0}function T(S,w,A,L,H,D,q,k){return d(S+((w|~A)^L)+D+q|0,k)+H|0}function O(S,w,A,L,H,D,q,k){return d(S+(w&L|A&~L)+D+q|0,k)+H|0}function b(S,w,A,L,H,D,q,k){return d(S+(w^(A|~L))+D+q|0,k)+H|0}m(f,y),f.prototype._update=function(){for(var S=n,w=0;w<16;++w)S[w]=this._block.readInt32LE(4*w);for(var A=0|this._a,L=0|this._b,H=0|this._c,D=0|this._d,q=0|this._e,k=0|this._a,p=0|this._b,x=0|this._c,R=0|this._d,r=0|this._e,a=0;a<80;a+=1){var g,M;a<16?(g=_(A,L,H,D,q,S[o[a]],u[0],t[a]),M=b(k,p,x,R,r,S[e[a]],h[0],i[a])):a<32?(g=v(A,L,H,D,q,S[o[a]],u[1],t[a]),M=O(k,p,x,R,r,S[e[a]],h[1],i[a])):a<48?(g=T(A,L,H,D,q,S[o[a]],u[2],t[a]),M=T(k,p,x,R,r,S[e[a]],h[2],i[a])):a<64?(g=O(A,L,H,D,q,S[o[a]],u[3],t[a]),M=v(k,p,x,R,r,S[e[a]],h[3],i[a])):(g=b(A,L,H,D,q,S[o[a]],u[4],t[a]),M=_(k,p,x,R,r,S[e[a]],h[4],i[a])),A=q,q=D,D=d(H,10),H=L,L=g,k=r,r=R,R=d(x,10),x=p,p=M}var E=this._b+H+R|0;this._b=this._c+D+r|0,this._c=this._d+q+k|0,this._d=this._e+A+p|0,this._e=this._a+L+x|0,this._a=E},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var S=s.alloc?s.alloc(20):new s(20);return S.writeInt32LE(this._a,0),S.writeInt32LE(this._b,4),S.writeInt32LE(this._c,8),S.writeInt32LE(this._d,12),S.writeInt32LE(this._e,16),S},z.exports=f},function(z,l,c){(l=z.exports=function(s){s=s.toLowerCase();var m=l[s];if(!m)throw new Error(s+" is not supported (we accept pull requests)");return new m}).sha=c(282),l.sha1=c(283),l.sha224=c(284),l.sha256=c(134),l.sha384=c(285),l.sha512=c(135)},function(z,l,c){var s=c(3),m=c(31),y=c(13).Buffer,n=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function e(){this.init(),this._w=o,m.call(this,64,56)}function t(u){return u<<30|u>>>2}function i(u,h,f,d){return 0===u?h&f|~h&d:2===u?h&f|h&d|f&d:h^f^d}s(e,m),e.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},e.prototype._update=function(u){for(var h,f=this._w,d=0|this._a,_=0|this._b,v=0|this._c,T=0|this._d,O=0|this._e,b=0;b<16;++b)f[b]=u.readInt32BE(4*b);for(;b<80;++b)f[b]=f[b-3]^f[b-8]^f[b-14]^f[b-16];for(var S=0;S<80;++S){var w=~~(S/20),A=0|((h=d)<<5|h>>>27)+i(w,_,v,T)+O+f[S]+n[w];O=T,T=v,v=t(_),_=d,d=A}this._a=d+this._a|0,this._b=_+this._b|0,this._c=v+this._c|0,this._d=T+this._d|0,this._e=O+this._e|0},e.prototype._hash=function(){var u=y.allocUnsafe(20);return u.writeInt32BE(0|this._a,0),u.writeInt32BE(0|this._b,4),u.writeInt32BE(0|this._c,8),u.writeInt32BE(0|this._d,12),u.writeInt32BE(0|this._e,16),u},z.exports=e},function(z,l,c){var s=c(3),m=c(31),y=c(13).Buffer,n=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function e(){this.init(),this._w=o,m.call(this,64,56)}function t(h){return h<<5|h>>>27}function i(h){return h<<30|h>>>2}function u(h,f,d,_){return 0===h?f&d|~f&_:2===h?f&d|f&_|d&_:f^d^_}s(e,m),e.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},e.prototype._update=function(h){for(var f,d=this._w,_=0|this._a,v=0|this._b,T=0|this._c,O=0|this._d,b=0|this._e,S=0;S<16;++S)d[S]=h.readInt32BE(4*S);for(;S<80;++S)d[S]=(f=d[S-3]^d[S-8]^d[S-14]^d[S-16])<<1|f>>>31;for(var w=0;w<80;++w){var A=~~(w/20),L=t(_)+u(A,v,T,O)+b+d[w]+n[A]|0;b=O,O=T,T=i(v),v=_,_=L}this._a=_+this._a|0,this._b=v+this._b|0,this._c=T+this._c|0,this._d=O+this._d|0,this._e=b+this._e|0},e.prototype._hash=function(){var h=y.allocUnsafe(20);return h.writeInt32BE(0|this._a,0),h.writeInt32BE(0|this._b,4),h.writeInt32BE(0|this._c,8),h.writeInt32BE(0|this._d,12),h.writeInt32BE(0|this._e,16),h},z.exports=e},function(z,l,c){var s=c(3),m=c(134),y=c(31),n=c(13).Buffer,o=new Array(64);function e(){this.init(),this._w=o,y.call(this,64,56)}s(e,m),e.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},e.prototype._hash=function(){var t=n.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},z.exports=e},function(z,l,c){var s=c(3),m=c(135),y=c(31),n=c(13).Buffer,o=new Array(160);function e(){this.init(),this._w=o,y.call(this,128,112)}s(e,m),e.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},e.prototype._hash=function(){var t=n.allocUnsafe(48);function i(u,h,f){t.writeInt32BE(u,f),t.writeInt32BE(h,f+4)}return i(this._ah,this._al,0),i(this._bh,this._bl,8),i(this._ch,this._cl,16),i(this._dh,this._dl,24),i(this._eh,this._el,32),i(this._fh,this._fl,40),t},z.exports=e},function(z,l,c){var s=c(13).Buffer,m=c(287).Transform,y=c(20).StringDecoder;function n(o){m.call(this),this.hashMode="string"==typeof o,this.hashMode?this[o]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}c(3)(n,m),n.prototype.update=function(o,e,t){"string"==typeof o&&(o=s.from(o,e));var i=this._update(o);return this.hashMode?this:(t&&(i=this._toString(i,t)),i)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(o,e,t){var i;try{this.hashMode?this._update(o):this.push(this._update(o))}catch(u){i=u}finally{t(i)}},n.prototype._flush=function(o){var e;try{this.push(this.__final())}catch(t){e=t}o(e)},n.prototype._finalOrDigest=function(o){var e=this.__final()||s.alloc(0);return o&&(e=this._toString(e,o,!0)),e},n.prototype._toString=function(o,e,t){if(this._decoder||(this._decoder=new y(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(o);return t&&(i+=this._decoder.end()),i},z.exports=n},function(z,l,c){z.exports=m;var s=c(12).EventEmitter;function m(){s.call(this)}c(3)(m,s),m.Readable=c(34),m.Writable=c(288),m.Duplex=c(289),m.Transform=c(290),m.PassThrough=c(291),m.Stream=m,m.prototype.pipe=function(y,n){var o=this;function e(_){y.writable&&!1===y.write(_)&&o.pause&&o.pause()}function t(){o.readable&&o.resume&&o.resume()}o.on("data",e),y.on("drain",t),y._isStdio||n&&!1===n.end||(o.on("end",u),o.on("close",h));var i=!1;function u(){i||(i=!0,y.end())}function h(){i||(i=!0,"function"==typeof y.destroy&&y.destroy())}function f(_){if(d(),0===s.listenerCount(this,"error"))throw _}function d(){o.removeListener("data",e),y.removeListener("drain",t),o.removeListener("end",u),o.removeListener("close",h),o.removeListener("error",f),y.removeListener("error",f),o.removeListener("end",d),o.removeListener("close",d),y.removeListener("close",d)}return o.on("error",f),y.on("error",f),o.on("end",d),o.on("close",d),y.on("close",d),y.emit("pipe",o),y}},function(z,l,c){z.exports=c(53)},function(z,l,c){z.exports=c(19)},function(z,l,c){z.exports=c(34).Transform},function(z,l,c){z.exports=c(34).PassThrough},function(z,l,c){var s=c(2),m=s.Buffer;function y(o,e){for(var t in o)e[t]=o[t]}function n(o,e,t){return m(o,e,t)}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?z.exports=s:(y(s,l),l.Buffer=n),y(m,n),n.from=function(o,e,t){if("number"==typeof o)throw new TypeError("Argument must not be a number");return m(o,e,t)},n.alloc=function(o,e,t){if("number"!=typeof o)throw new TypeError("Argument must be a number");var i=m(o);return void 0!==e?"string"==typeof t?i.fill(e,t):i.fill(e):i.fill(0),i},n.allocUnsafe=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return m(o)},n.allocUnsafeSlow=function(o){if("number"!=typeof o)throw new TypeError("Argument must be a number");return s.SlowBuffer(o)}},function(z,l,c){var s=c(136);z.exports=function(m){return"string"!=typeof m?m:s(m)?m.slice(2):m}},function(z,l,c){const s=c(137),m=c(295);function y(n,o){return new Promise(e=>{const t=setTimeout(e,n);t.unref&&o&&t.unref()})}z.exports=class extends m{constructor(n={}){if(!n.provider)throw new Error("PollingBlockTracker - no provider specified.");const o=n.pollingInterval||2e4,e=n.retryTimeout||o/10,t=void 0===n.keepEventLoopActive||n.keepEventLoopActive,i=n.setSkipCacheFlag||!1;super(Object.assign({blockResetDuration:o},n)),this._provider=n.provider,this._pollingInterval=o,this._retryTimeout=e,this._keepEventLoopActive=t,this._setSkipCacheFlag=i}checkForLatestBlock(){var n=this;return ge(function*(){return yield n._updateLatestBlock(),yield n.getLatestBlock()})()}_start(){this._performSync().catch(n=>this.emit("error",n))}_performSync(){var n=this;return ge(function*(){for(;n._isRunning;)try{yield n._updateLatestBlock(),yield y(n._pollingInterval,!n._keepEventLoopActive)}catch(o){const e=new Error("PollingBlockTracker - encountered an error while attempting to update latest block:\n"+o.stack);try{n.emit("error",e)}catch{console.error(e)}yield y(n._retryTimeout,!n._keepEventLoopActive)}})()}_updateLatestBlock(){var n=this;return ge(function*(){const o=yield n._fetchLatestBlock();n._newPotentialLatest(o)})()}_fetchLatestBlock(){var n=this;return ge(function*(){const o={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]};n._setSkipCacheFlag&&(o.skipCache=!0);const e=yield s(t=>n._provider.sendAsync(o,t))();if(e.error)throw new Error("PollingBlockTracker - encountered error fetching block:\n"+e.error);return e.result})()}}},function(z,l,c){c(138),c(137);const s=c(297),m=(o,e)=>o+e,y=["sync","latest"];function n(o){return Number.parseInt(o,16)}z.exports=class extends s{constructor(o={}){super(),this._blockResetDuration=o.blockResetDuration||2e4,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}getLatestBlock(){var o=this;return ge(function*(){return o._currentBlock?o._currentBlock:yield new Promise(e=>o.once("latest",e))})()}removeAllListeners(o){o?super.removeAllListeners(o):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener()}_start(){}_end(){}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(o,e){y.includes(o)&&this._maybeStart()}_onRemoveListener(o,e){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return y.map(o=>this.listenerCount(o)).reduce(m)}_newPotentialLatest(o){const e=this._currentBlock;e&&n(o)<=n(e)||this._setCurrentBlock(o)}_setCurrentBlock(o){const e=this._currentBlock;this._currentBlock=o,this.emit("latest",o),this.emit("sync",{oldBlock:e,newBlock:o})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}},function(z,l){z.exports=function(c){var s=(c=c||{}).max||Number.MAX_SAFE_INTEGER,m=void 0!==c.start?c.start:Math.floor(Math.random()*s);return function(){return m%=s,m++}}},function(z,l,c){const s=c(21),m=c(12);var y="object"==typeof Reflect?Reflect:null,n=y&&"function"==typeof y.apply?y.apply:function(i,u,h){return Function.prototype.apply.call(i,u,h)};function o(){m.call(this)}function e(i,u,h){try{n(i,u,h)}catch(f){setTimeout(()=>{throw f})}}function t(i,u){for(var h=new Array(u),f=0;f0&&(_=u[0]),_ instanceof Error)throw _;var v=new Error("Unhandled error."+(_?" ("+_.message+")":""));throw v.context=_,v}var T=d[i];if(void 0===T)return!1;if("function"==typeof T)e(T,this,u);else{var O=T.length,b=t(T,O);for(h=0;h-1&&s%1==0&&s="0"&&s<="9";)f+=s,e();if("."===s)for(f+=".";e()&&s>="0"&&s<="9";)f+=s;if("e"===s||"E"===s)for(f+=s,e(),"-"!==s&&"+"!==s||(f+=s,e());s>="0"&&s<="9";)f+=s,e();if(h=+f,isFinite(h))return h;o("Bad number")},i=function(){var h,f,d,_="";if('"'===s)for(;e();){if('"'===s)return e(),_;if("\\"===s)if(e(),"u"===s){for(d=0,f=0;f<4&&(h=parseInt(e(),16),isFinite(h));f+=1)d=16*d+h;_+=String.fromCharCode(d)}else{if("string"!=typeof n[s])break;_+=n[s]}else _+=s}o("Bad string")},u=function(){for(;s&&s<=" ";)e()};y=function(){switch(u(),s){case"{":return function(){var h,f={};if("{"===s){if(e("{"),u(),"}"===s)return e("}"),f;for(;s;){if(h=i(),u(),e(":"),Object.hasOwnProperty.call(f,h)&&o('Duplicate key "'+h+'"'),f[h]=y(),u(),"}"===s)return e("}"),f;e(","),u()}}o("Bad object")}();case"[":return function(){var h=[];if("["===s){if(e("["),u(),"]"===s)return e("]"),h;for(;s;){if(h.push(y()),u(),"]"===s)return e("]"),h;e(","),u()}}o("Bad array")}();case'"':return i();case"-":return t();default:return s>="0"&&s<="9"?t():function(){switch(s){case"t":return e("t"),e("r"),e("u"),e("e"),!0;case"f":return e("f"),e("a"),e("l"),e("s"),e("e"),!1;case"n":return e("n"),e("u"),e("l"),e("l"),null}o("Unexpected '"+s+"'")}()}},z.exports=function(h,f){var d;return m=h,c=0,s=" ",d=y(),u(),s&&o("Syntax error"),"function"==typeof f?function _(v,T){var O,b,S=v[T];if(S&&"object"==typeof S)for(O in S)Object.prototype.hasOwnProperty.call(S,O)&&(void 0!==(b=_(S,O))?S[O]=b:delete S[O]);return f.call(v,T,S)}({"":d},""):d}},function(z,l){var c,s,m,y=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function o(e){return y.lastIndex=0,y.test(e)?'"'+e.replace(y,function(t){var i=n[t];return"string"==typeof i?i:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}z.exports=function(e,t,i){var u;if(c="",s="","number"==typeof i)for(u=0;um(Object.assign({blockTracker:n},y)))}}},function(z,l,c){const s=c(336),m=c(337),y=[void 0,null,""];z.exports=function(o={}){const{blockTracker:e}=o;if(!e)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");const t=new n,i={perma:t,block:t,fork:t};return m(function(){var u=ge(function*(h,f,d){if(h.skipCache)return d();const _=s.cacheTypeForPayload(h),v=i[_];if(!v||!v.canCacheRequest(h))return d();let T,O=s.blockTagForPayload(h);if(O||(O="latest"),"earliest"===O)T="0x00";else if("latest"===O){const S=yield e.getLatestBlock();t.clearBefore(S),T=S}else T=O;const b=yield v.get(h,T);void 0===b?(yield d(),yield v.set(h,T,f.result)):f.result=b});return function(h,f,d){return u.apply(this,arguments)}}())};class n{constructor(){this.cache={}}getBlockCacheForPayload(e,t){const i=Number.parseInt(t,16);let u=this.cache[i];if(!u){const h={};this.cache[i]=h,u=h}return u}get(e,t){var i=this;return ge(function*(){const u=i.getBlockCacheForPayload(e,t);if(u)return u[s.cacheIdentifierForPayload(e,!0)]})()}set(e,t,i){var u=this;return ge(function*(){!u.canCacheResult(e,i)||(u.getBlockCacheForPayload(e,t)[s.cacheIdentifierForPayload(e,!0)]=i)})()}canCacheRequest(e){return!!s.canCache(e)&&"pending"!==s.blockTagForPayload(e)}canCacheResult(e,t){if(!y.includes(t))return!!(!["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(e.method)||t&&t.blockHash&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==t.blockHash)}clearBefore(e){const t=this,i=Number.parseInt(e,16);Object.keys(t.cache).map(Number).filter(u=>udelete t.cache[u])}}},function(z,l,c){const s=c(150);function m(e){return"never"!==o(e)}function y(e){const t=n(e);return t>=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function n(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function o(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}z.exports={cacheIdentifierForPayload:function(e,t){const i=t?y(e):e.params;return m(e)?e.method+":"+s(i):null},canCache:m,blockTagForPayload:function(e){let t=n(e);return t>=e.params.length?null:e.params[t]},paramsWithoutBlockTag:y,blockTagParamIndex:n,cacheTypeForPayload:o}},function(z,l){z.exports=function(c){return(s,m,y,n)=>{let o;const e=new Promise(u=>{o=u});let t,i;c(s,m,ge(function*(){i=!0,y(u=>{t=u,o()}),yield e})).then(ge(function*(){i?(yield e,t(null)):n(null)})).catch(u=>{t?t(u):n(u)})}}},function(z,l,c){const s=c(21).inherits,m=c(49);function y(n){this.staticResponses=n=n||{}}z.exports=y,s(y,m),y.prototype.handleRequest=function(n,o,e){var t=this.staticResponses[n.method];"function"==typeof t?t(n,o,e):void 0!==t?setTimeout(()=>e(null,t)):o()}},function(z,l,c){const s=c(68),m=c(151);z.exports=class extends s{constructor(){super(({blockTracker:y,provider:n})=>m({blockTracker:y,provider:n}))}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.createIdRemapMiddleware=void 0;const s=c(153);l.createIdRemapMiddleware=function(){return(m,y,n,o)=>{const e=m.id,t=s.getUniqueId();m.id=t,y.id=t,n(i=>{m.id=e,y.id=e,i()})}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.createAsyncMiddleware=void 0,l.createAsyncMiddleware=function(s){return function(){var m=ge(function*(y,n,o,e){let t;const i=new Promise(d=>{t=d});let u=null,h=!1;const f=function(){var d=ge(function*(){h=!0,o(_=>{u=_,t()}),yield i});return function(){return d.apply(this,arguments)}}();try{yield s(y,n,f),h?(yield i,u(null)):e(null)}catch(d){u?u(d):e(d)}});return function(y,n,o,e){return m.apply(this,arguments)}}()}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.createScaffoldMiddleware=void 0,l.createScaffoldMiddleware=function(s){return(m,y,n,o)=>{const e=s[m.method];return void 0===e?n():"function"==typeof e?e(m,y,n,o):(y.result=e,o())}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.getMessageFromCode=l.serializeError=l.EthereumProviderError=l.EthereumRpcError=l.ethErrors=l.errorCodes=void 0;const s=c(70);Object.defineProperty(l,"EthereumRpcError",{enumerable:!0,get:function(){return s.EthereumRpcError}}),Object.defineProperty(l,"EthereumProviderError",{enumerable:!0,get:function(){return s.EthereumProviderError}});const m=c(155);Object.defineProperty(l,"serializeError",{enumerable:!0,get:function(){return m.serializeError}}),Object.defineProperty(l,"getMessageFromCode",{enumerable:!0,get:function(){return m.getMessageFromCode}});const y=c(345);Object.defineProperty(l,"ethErrors",{enumerable:!0,get:function(){return y.ethErrors}});const n=c(71);Object.defineProperty(l,"errorCodes",{enumerable:!0,get:function(){return n.errorCodes}})},function(z,l){z.exports=y,y.default=y,y.stable=e,y.stableStringify=e;var c=[],s=[];function m(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function y(i,u,h,f){var d;void 0===f&&(f=m()),function v(T,O,b,S,w,A,L){var H;if(A+=1,"object"==typeof T&&null!==T){for(H=0;HL.depthLimit||void 0!==L.edgesLimit&&b+1>L.edgesLimit)return void n("[...]",T,O,w);if(S.push(T),Array.isArray(T))for(H=0;Hu?1:0}function e(i,u,h,f){void 0===f&&(f=m());var d,_=function T(O,b,S,w,A,L,H){var D;if(L+=1,"object"==typeof O&&null!==O){for(D=0;DH.depthLimit||void 0!==H.edgesLimit&&S+1>H.edgesLimit)return void n("[...]",O,b,A);if(w.push(O),Array.isArray(O))for(D=0;D0)for(var f=0;fn(y.errorCodes.rpc.parse,t),invalidRequest:t=>n(y.errorCodes.rpc.invalidRequest,t),invalidParams:t=>n(y.errorCodes.rpc.invalidParams,t),methodNotFound:t=>n(y.errorCodes.rpc.methodNotFound,t),internal:t=>n(y.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:i}=t;if(!Number.isInteger(i)||i>-32005||i<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(i,t)},invalidInput:t=>n(y.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>n(y.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>n(y.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>n(y.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>n(y.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>n(y.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>o(y.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>o(y.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>o(y.errorCodes.provider.unsupportedMethod,t),disconnected:t=>o(y.errorCodes.provider.disconnected,t),chainDisconnected:t=>o(y.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:i,message:u,data:h}=t;if(!u||"string"!=typeof u)throw new Error('"message" must be a nonempty string');return new s.EthereumProviderError(i,u,h)}}}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.mergeMiddleware=void 0;const s=c(154);l.mergeMiddleware=function(m){const y=new s.JsonRpcEngine;return m.forEach(n=>y.push(n)),y.asMiddleware()}},function(z,l){z.exports=function(c){return(s,m,y,n)=>{const o=c[s.method];return void 0===o?y():"function"==typeof o?o(s,m,y,n):(m.result=o,n())}}},function(z,l,c){const s=c(138),m=c(349),y=c(350),{hexToInt:o,incrementHexInt:e,minBlockRef:t,blockRefIsNumber:i}=c(39);z.exports=class extends y{constructor({provider:u,params:h}){super(),this.type="log",this.ethQuery=new s(u),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},h),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(f=>f.toLowerCase()))}initialize({currentBlock:u}){var h=this;return ge(function*(){let f=h.params.fromBlock;["latest","pending"].includes(f)&&(f=u),"earliest"===f&&(f="0x0"),h.params.fromBlock=f;const d=t(h.params.toBlock,u),_=Object.assign({},h.params,{toBlock:d}),v=yield h._fetchLogs(_);h.addInitialResults(v)})()}update({oldBlock:u,newBlock:h}){var f=this;return ge(function*(){const d=h;let _;_=u?e(u):h;const v=Object.assign({},f.params,{fromBlock:_,toBlock:d}),T=(yield f._fetchLogs(v)).filter(O=>f.matchLog(O));f.addResults(T)})()}_fetchLogs(u){var h=this;return ge(function*(){return yield m(f=>h.ethQuery.getLogs(u,f))()})()}matchLog(u){if(o(this.params.fromBlock)>=o(u.blockNumber)||i(this.params.toBlock)&&o(this.params.toBlock)<=o(u.blockNumber))return!1;const h=u.address&&u.address.toLowerCase();return!(this.params.address&&h&&!this.params.address.includes(h))&&this.params.topics.every((f,d)=>{let _=u.topics[d];if(!_)return!1;_=_.toLowerCase();let v=Array.isArray(f)?f:[f];return!!v.includes(null)||(v=v.map(T=>T.toLowerCase()),v.includes(_))})}}},function(z,l,c){"use strict";const s=(y,n,o,e)=>function(...t){return new n.promiseModule((i,u)=>{t.push(n.multiArgs?(...f)=>{n.errorFirst?f[0]?u(f):(f.shift(),i(f)):i(f)}:n.errorFirst?(f,d)=>{f?u(f):i(d)}:i),Reflect.apply(y,this===o?e:this,t)})},m=new WeakMap;z.exports=(y,n)=>{n={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...n};const o=typeof y;if(null===y||"object"!==o&&"function"!==o)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===y?"null":o}\``);const e=new WeakMap,t=new Proxy(y,{apply(i,u,h){const f=e.get(i);if(f)return Reflect.apply(f,u,h);const d=n.excludeMain?i:s(i,n,t,i);return e.set(i,d),Reflect.apply(d,u,h)},get(i,u){const h=i[u];if(!((d,_)=>{let v=m.get(d);if(v||(v={},m.set(d,v)),_ in v)return v[_];const T=w=>"string"==typeof w||"symbol"==typeof _?_===w:w.test(_),O=Reflect.getOwnPropertyDescriptor(d,_),b=void 0===O||O.writable||O.configurable,S=(n.include?n.include.some(T):!n.exclude.some(T))&&b;return v[_]=S,S})(i,u)||h===Function.prototype[u])return h;const f=e.get(h);if(f)return f;if("function"==typeof h){const d=s(h,n,t,i);return e.set(h,d),d}return h}});return t}},function(z,l,c){const s=c(72);z.exports=class extends s{constructor(){super(),this.allResults=[]}update(){return ge(function*(){throw new Error("BaseFilterWithHistory - no update method specified")})()}addResults(m){this.allResults=this.allResults.concat(m),super.addResults(m)}addInitialResults(m){this.allResults=this.allResults.concat(m),super.addInitialResults(m)}getAllResults(){return this.allResults}}},function(z,l,c){const s=c(72),m=c(73),{incrementHexInt:y}=c(39);z.exports=class extends s{constructor({provider:n}){super(),this.type="block",this.provider=n}update({oldBlock:n,newBlock:o}){var e=this;return ge(function*(){const t=o,i=y(n),u=(yield m({provider:e.provider,fromBlock:i,toBlock:t})).map(h=>h.hash);e.addResults(u)})()}}},function(z,l,c){const s=c(72),m=c(73),{incrementHexInt:y}=c(39);z.exports=class extends s{constructor({provider:n}){super(),this.type="tx",this.provider=n}update({oldBlock:n}){var o=this;return ge(function*(){const e=n,t=y(n),i=yield m({provider:o.provider,fromBlock:t,toBlock:e}),u=[];for(const h of i)u.push(...h.transactions);o.addResults(u)})()}}},function(z,l,c){const s=c(354),m=c(355),y=c(21).inherits,n=c(36),o=c(357),e=c(44),t=c(367),i=c(49),u=c(368),h=/^[0-9A-Fa-f]+$/g;function f(b){this.nonceLock=t(1),b.getAccounts&&(this.getAccounts=b.getAccounts),b.processTransaction&&(this.processTransaction=b.processTransaction),b.processMessage&&(this.processMessage=b.processMessage),b.processPersonalMessage&&(this.processPersonalMessage=b.processPersonalMessage),b.processTypedMessage&&(this.processTypedMessage=b.processTypedMessage),this.approveTransaction=b.approveTransaction||this.autoApprove,this.approveMessage=b.approveMessage||this.autoApprove,this.approvePersonalMessage=b.approvePersonalMessage||this.autoApprove,this.approveDecryptMessage=b.approveDecryptMessage||this.autoApprove,this.approveEncryptionPublicKey=b.approveEncryptionPublicKey||this.autoApprove,this.approveTypedMessage=b.approveTypedMessage||this.autoApprove,b.signTransaction&&(this.signTransaction=b.signTransaction||O("signTransaction")),b.signMessage&&(this.signMessage=b.signMessage||O("signMessage")),b.signPersonalMessage&&(this.signPersonalMessage=b.signPersonalMessage||O("signPersonalMessage")),b.decryptMessage&&(this.decryptMessage=b.decryptMessage||O("decryptMessage")),b.encryptionPublicKey&&(this.encryptionPublicKey=b.encryptionPublicKey||O("encryptionPublicKey")),b.signTypedMessage&&(this.signTypedMessage=b.signTypedMessage||O("signTypedMessage")),b.recoverPersonalSignature&&(this.recoverPersonalSignature=b.recoverPersonalSignature),b.publishTransaction&&(this.publishTransaction=b.publishTransaction),this.estimateGas=b.estimateGas||this.estimateGas,this.getGasPrice=b.getGasPrice||this.getGasPrice}function d(b){return b.toLowerCase()}function _(b){const S=n.addHexPrefix(b);return n.isValidAddress(S)}function v(b){const S=n.addHexPrefix(b);return!n.isValidAddress(S)&&T(b)}function T(b){return"string"==typeof b&&"0x"===b.slice(0,2)&&b.slice(2).match(h)}function O(b){return function(S,w){w(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+b+'" fn in constructor options'))}}z.exports=f,y(f,i),f.prototype.handleRequest=function(b,S,w){const A=this;let L,H,D,q,k;switch(A._parityRequests={},A._parityRequestCount=0,b.method){case"eth_coinbase":case"parity_defaultAccount":return void A.getAccounts(function(p,x){if(p)return w(p);w(null,x[0]||null)});case"eth_accounts":return void A.getAccounts(function(p,x){if(p)return w(p);w(null,x)});case"eth_sendTransaction":return L=b.params[0],void s([p=>A.validateTransaction(L,p),p=>A.processTransaction(L,p)],w);case"eth_signTransaction":return L=b.params[0],void s([p=>A.validateTransaction(L,p),p=>A.processSignTransaction(L,p)],w);case"eth_sign":return k=b.params[0],q=b.params[1],D=b.params[2]||{},H=e(D,{from:k,data:q}),void s([p=>A.validateMessage(H,p),p=>A.processMessage(H,p)],w);case"personal_sign":return function(){const p=b.params[0];if(v(b.params[1])&&_(p)){let x="The eth_personalSign method requires params ordered ";x+="[message, address]. This was previously handled incorrectly, ",x+="and has been corrected automatically. ",x+="Please switch this param order for smooth behavior in the future.",console.warn(x),k=b.params[0],q=b.params[1]}else q=b.params[0],k=b.params[1];D=b.params[2]||{},H=e(D,{from:k,data:q}),s([x=>A.validatePersonalMessage(H,x),x=>A.processPersonalMessage(H,x)],w)}();case"eth_decryptMessage":return function(){const p=b.params[0];if(v(b.params[1])&&_(p)){let x="The eth_decryptMessage method requires params ordered ";x+="[message, address]. This was previously handled incorrectly, ",x+="and has been corrected automatically. ",x+="Please switch this param order for smooth behavior in the future.",console.warn(x),k=b.params[0],q=b.params[1]}else q=b.params[0],k=b.params[1];D=b.params[2]||{},H=e(D,{from:k,data:q}),s([x=>A.validateDecryptMessage(H,x),x=>A.processDecryptMessage(H,x)],w)}();case"encryption_public_key":return function(){const p=b.params[0];s([x=>A.validateEncryptionPublicKey(p,x),x=>A.processEncryptionPublicKey(p,x)],w)}();case"personal_ecRecover":return q=b.params[0],D=b.params[2]||{},H=e(D,{sig:b.params[1],data:q}),void A.recoverPersonalSignature(H,w);case"eth_signTypedData":case"eth_signTypedData_v3":case"eth_signTypedData_v4":return function(){const p=b.params[0],x=b.params[1];_(p)?(k=p,q=x):(q=p,k=x),D=b.params[2]||{},H=e(D,{from:k,data:q}),s([R=>A.validateTypedMessage(H,R),R=>A.processTypedMessage(H,R)],w)}();case"parity_postTransaction":return L=b.params[0],void A.parityPostTransaction(L,w);case"parity_postSign":return k=b.params[0],q=b.params[1],void A.parityPostSign(k,q,w);case"parity_checkRequest":return void A.parityCheckRequest(b.params[0],w);default:return void S()}},f.prototype.getAccounts=function(b){b(null,[])},f.prototype.processTransaction=function(b,S){const w=this;s([A=>w.approveTransaction(b,A),(A,L)=>w.checkApproval("transaction",A,L),A=>w.finalizeAndSubmitTx(b,A)],S)},f.prototype.processSignTransaction=function(b,S){const w=this;s([A=>w.approveTransaction(b,A),(A,L)=>w.checkApproval("transaction",A,L),A=>w.finalizeTx(b,A)],S)},f.prototype.processMessage=function(b,S){const w=this;s([A=>w.approveMessage(b,A),(A,L)=>w.checkApproval("message",A,L),A=>w.signMessage(b,A)],S)},f.prototype.processPersonalMessage=function(b,S){const w=this;s([A=>w.approvePersonalMessage(b,A),(A,L)=>w.checkApproval("message",A,L),A=>w.signPersonalMessage(b,A)],S)},f.prototype.processDecryptMessage=function(b,S){const w=this;s([A=>w.approveDecryptMessage(b,A),(A,L)=>w.checkApproval("decryptMessage",A,L),A=>w.decryptMessage(b,A)],S)},f.prototype.processEncryptionPublicKey=function(b,S){const w=this;s([A=>w.approveEncryptionPublicKey(b,A),(A,L)=>w.checkApproval("encryptionPublicKey",A,L),A=>w.encryptionPublicKey(b,A)],S)},f.prototype.processTypedMessage=function(b,S){const w=this;s([A=>w.approveTypedMessage(b,A),(A,L)=>w.checkApproval("message",A,L),A=>w.signTypedMessage(b,A)],S)},f.prototype.autoApprove=function(b,S){S(null,!0)},f.prototype.checkApproval=function(b,S,w){w(S?null:new Error("User denied "+b+" signature."))},f.prototype.parityPostTransaction=function(b,S){const w=this,A="0x"+w._parityRequestCount.toString(16);w._parityRequestCount++,w.emitPayload({method:"eth_sendTransaction",params:[b]},function(L,H){w._parityRequests[A]=L?{error:L}:H.result}),S(null,A)},f.prototype.parityPostSign=function(b,S,w){const A=this,L="0x"+A._parityRequestCount.toString(16);A._parityRequestCount++,A.emitPayload({method:"eth_sign",params:[b,S]},function(H,D){A._parityRequests[L]=H?{error:H}:D.result}),w(null,L)},f.prototype.parityCheckRequest=function(b,S){const w=this._parityRequests[b]||null;return w?w.error?S(w.error):void S(null,w):S(null,null)},f.prototype.recoverPersonalSignature=function(b,S){let w;try{w=o.recoverPersonalSignature(b)}catch(A){return S(A)}S(null,w)},f.prototype.validateTransaction=function(b,S){if(void 0===b.from)return S(new Error("Undefined address - from address required to sign transaction."));this.validateSender(b.from,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to sign transaction for this address: "${b.from}"`))})},f.prototype.validateMessage=function(b,S){if(void 0===b.from)return S(new Error("Undefined address - from address required to sign message."));this.validateSender(b.from,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to sign message for this address: "${b.from}"`))})},f.prototype.validatePersonalMessage=function(b,S){return void 0===b.from?S(new Error("Undefined address - from address required to sign personal message.")):void 0===b.data?S(new Error("Undefined message - message required to sign personal message.")):T(b.data)?void this.validateSender(b.from,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to sign message for this address: "${b.from}"`))}):S(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},f.prototype.validateDecryptMessage=function(b,S){return void 0===b.from?S(new Error("Undefined address - from address required to decrypt message.")):void 0===b.data?S(new Error("Undefined message - message required to decrypt message.")):T(b.data)?void this.validateSender(b.from,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to decrypt message for this address: "${b.from}"`))}):S(new Error("HookedWalletSubprovider - validateDecryptMessage - message was not encoded as hex."))},f.prototype.validateEncryptionPublicKey=function(b,S){this.validateSender(b,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to obtain encryption public key for this address: "${b}"`))})},f.prototype.validateTypedMessage=function(b,S){return void 0===b.from?S(new Error("Undefined address - from address required to sign typed data.")):void 0===b.data?S(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(b.from,function(w,A){return w?S(w):A?void S():S(new Error(`Unknown address - unable to sign message for this address: "${b.from}"`))})},f.prototype.validateSender=function(b,S){if(!b)return S(null,!1);this.getAccounts(function(w,A){if(w)return S(w);const L=-1!==A.map(d).indexOf(b.toLowerCase());S(null,L)})},f.prototype.finalizeAndSubmitTx=function(b,S){const w=this;w.nonceLock.take(function(){s([w.fillInTxExtras.bind(w,b),w.signTransaction.bind(w),w.publishTransaction.bind(w)],function(A,L){if(w.nonceLock.leave(),A)return S(A);S(null,L)})})},f.prototype.finalizeTx=function(b,S){const w=this;w.nonceLock.take(function(){s([w.fillInTxExtras.bind(w,b),w.signTransaction.bind(w)],function(A,L){if(w.nonceLock.leave(),A)return S(A);S(null,{raw:L,tx:b})})})},f.prototype.publishTransaction=function(b,S){this.emitPayload({method:"eth_sendRawTransaction",params:[b]},function(w,A){if(w)return S(w);S(null,A.result)})},f.prototype.estimateGas=function(b,S){u(this.engine,b,S)},f.prototype.getGasPrice=function(b){this.emitPayload({method:"eth_gasPrice",params:[]},function(S,w){if(S)return b(S);b(null,w.result)})},f.prototype.fillInTxExtras=function(b,S){const w=this,A=b.from,L={};var H;void 0===b.gasPrice&&(L.gasPrice=w.getGasPrice.bind(w)),void 0===b.nonce&&(L.nonce=w.emitPayload.bind(w,{method:"eth_getTransactionCount",params:[A,"pending"]})),void 0===b.gas&&(L.gas=w.estimateGas.bind(w,{from:(H=b).from,to:H.to,value:H.value,data:H.data,gas:H.gas,gasPrice:H.gasPrice,nonce:H.nonce})),m(L,function(H,D){if(H)return S(H);const q={};D.gasPrice&&(q.gasPrice=D.gasPrice),D.nonce&&(q.nonce=D.nonce.result),D.gas&&(q.gas=D.gas),S(null,e(b,q))})}},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(i,u){if(u=(0,y.default)(u||m.default),!(0,s.default)(i))return u(new Error("First argument to waterfall must be an array of functions"));if(!i.length)return u();var h=0;function f(_){var v=(0,e.default)(i[h++]);_.push((0,o.default)(d)),v.apply(null,_)}function d(_){if(_||h===i.length)return u.apply(null,arguments);f((0,n.default)(arguments,1))}f([])};var s=t(c(147)),m=t(c(38)),y=t(c(64)),n=t(c(48)),o=t(c(66)),e=t(c(23));function t(i){return i&&i.__esModule?i:{default:i}}z.exports=l.default},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(n,o){(0,m.default)(s.default,n,o)};var s=y(c(139)),m=y(c(356));function y(n){return n&&n.__esModule?n:{default:n}}z.exports=l.default},function(z,l,c){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(e,t,i){i=i||s.default;var u=(0,m.default)(t)?[]:{};e(t,function(h,f,d){(0,n.default)(h)(function(_,v){arguments.length>2&&(v=(0,y.default)(arguments,1)),u[f]=v,d(_)})},function(h){i(h,u)})};var s=o(c(38)),m=o(c(47)),y=o(c(48)),n=o(c(23));function o(e){return e&&e.__esModule?e:{default:e}}z.exports=l.default},function(z,l,c){const s=c(36),m=c(358);function y(t){const i=new Error("Expect argument to be non-empty array");if("object"!=typeof t||!t.length)throw i;const u=t.map(function(d){return"bytes"===d.type?s.toBuffer(d.value):d.value}),h=t.map(function(d){return d.type}),f=t.map(function(d){if(!d.name)throw i;return d.type+" "+d.name});return m.soliditySHA3(["bytes32","bytes32"],[m.soliditySHA3(new Array(t.length).fill("string"),f),m.soliditySHA3(h,u)])}function n(t,i){const u=s.toBuffer(i),h=s.fromRpcSig(u);return s.ecrecover(t,h.v,h.r,h.s)}function o(t){const i=s.toBuffer(t.data);return n(s.hashPersonalMessage(i),t.sig)}function e(t,i){for(var u=""+t;u.lengthw)throw new Error("Elements exceed array size: "+w);for(H in L=[],b=b.slice(0,b.lastIndexOf("[")),"string"==typeof S&&(S=JSON.parse(S)),S)L.push(f(b,S[H]));if("dynamic"===w){var D=f("uint256",S.length);L.unshift(D)}return s.concat(L)}if("bytes"===b)return S=s.from(S),L=s.concat([f("uint256",S.length),S]),S.length%32!=0&&(L=s.concat([L,m.zeros(32-S.length%32)])),L;if(b.startsWith("bytes")){if((w=e(b))<1||w>32)throw new Error("Invalid bytes width: "+w);return m.setLengthRight(S,32)}if(b.startsWith("uint")){if((w=e(b))%8||w<8||w>256)throw new Error("Invalid uint width: "+w);if((A=u(S)).bitLength()>w)throw new Error("Supplied uint exceeds width: "+w+" vs "+A.bitLength());if(A<0)throw new Error("Supplied uint is negative");return A.toArrayLike(s,"be",32)}if(b.startsWith("int")){if((w=e(b))%8||w<8||w>256)throw new Error("Invalid int width: "+w);if((A=u(S)).bitLength()>w)throw new Error("Supplied int exceeds width: "+w+" vs "+A.bitLength());return A.toTwos(256).toArrayLike(s,"be",32)}if(b.startsWith("ufixed")){if(w=t(b),(A=u(S))<0)throw new Error("Supplied ufixed is negative");return f("uint256",A.mul(new y(2).pow(new y(w[1]))))}if(b.startsWith("fixed"))return w=t(b),f("int256",u(S).mul(new y(2).pow(new y(w[1]))));throw new Error("Unsupported or invalid type: "+b)}function d(b,S,w){var A,L,H,D;if("string"==typeof b&&(b=_(b)),"address"===b.name)return d(b.rawType,S,w).toArrayLike(s,"be",20).toString("hex");if("bool"===b.name)return d(b.rawType,S,w).toString()===new y(1).toString();if("string"===b.name){var q=d(b.rawType,S,w);return s.from(q,"utf8").toString()}if(b.isArray){for(H=[],A=b.size,"dynamic"===b.size&&(w=d("uint256",S,w).toNumber(),A=d("uint256",S,w).toNumber(),w+=32),D=0;Db.size)throw new Error("Decoded int exceeds width: "+b.size+" vs "+L.bitLength());return L}if(b.name.startsWith("int")){if((L=new y(S.slice(w,w+32),16,"be").fromTwos(256)).bitLength()>b.size)throw new Error("Decoded uint exceeds width: "+b.size+" vs "+L.bitLength());return L}if(b.name.startsWith("ufixed")){if(A=new y(2).pow(new y(b.size[1])),!(L=d("uint256",S,w)).mod(A).isZero())throw new Error("Decimals not supported yet");return L.div(A)}if(b.name.startsWith("fixed")){if(A=new y(2).pow(new y(b.size[1])),!(L=d("int256",S,w)).mod(A).isZero())throw new Error("Decimals not supported yet");return L.div(A)}throw new Error("Unsupported or invalid type: "+b.name)}function _(b){var S,w,A;if(T(b)){S=i(b);var L=b.slice(0,b.lastIndexOf("["));return L=_(L),{isArray:!0,name:b,size:S,memoryUsage:"dynamic"===S?32:L.memoryUsage*S,subArray:L}}switch(b){case"address":A="uint160";break;case"bool":A="uint8";break;case"string":A="bytes"}if(w={rawType:A,name:b,memoryUsage:32},b.startsWith("bytes")&&"bytes"!==b||b.startsWith("uint")||b.startsWith("int")?w.size=e(b):(b.startsWith("ufixed")||b.startsWith("fixed"))&&(w.size=t(b)),b.startsWith("bytes")&&"bytes"!==b&&(w.size<1||w.size>32))throw new Error("Invalid bytes width: "+w.size);if((b.startsWith("uint")||b.startsWith("int"))&&(w.size%8||w.size<8||w.size>256))throw new Error("Invalid int/uint width: "+w.size);return w}function v(b){return"string"===b||"bytes"===b||"dynamic"===i(b)}function T(b){return b.lastIndexOf("]")===b.length-1}function O(b,S){return b.startsWith("address")||b.startsWith("bytes")?"0x"+S.toString("hex"):S.toString()}n.eventID=function(b,S){var w=b+"("+S.map(o).join(",")+")";return m.keccak256(s.from(w))},n.methodID=function(b,S){return n.eventID(b,S).slice(0,4)},n.rawEncode=function(b,S){var w=[],A=[],L=0;b.forEach(function(k){if(T(k)){var p=i(k);L+="dynamic"!==p?32*p:32}else L+=32});for(var H=0;HD)throw new Error("Elements exceed array size: "+D)}var q=S.map(function(x){return n.solidityHexValue(H,x,256)});return s.concat(q)}if("bytes"===b)return S;if("string"===b)return s.from(S,"utf8");if("bool"===b){w=w||8;var k=Array(w/4).join("0");return s.from(S?k+"1":k+"0","hex")}if("address"===b){var p=20;return w&&(p=w/8),m.setLengthLeft(S,p)}if(b.startsWith("bytes")){if((A=e(b))<1||A>32)throw new Error("Invalid bytes width: "+A);return m.setLengthRight(S,A)}if(b.startsWith("uint")){if((A=e(b))%8||A<8||A>256)throw new Error("Invalid uint width: "+A);if((L=u(S)).bitLength()>A)throw new Error("Supplied uint exceeds width: "+A+" vs "+L.bitLength());return L.toArrayLike(s,"be",(w=w||A)/8)}if(b.startsWith("int")){if((A=e(b))%8||A<8||A>256)throw new Error("Invalid int width: "+A);if((L=u(S)).bitLength()>A)throw new Error("Supplied int exceeds width: "+A+" vs "+L.bitLength());return w=w||A,L.toTwos(A).toArrayLike(s,"be",w/8)}throw new Error("Unsupported or invalid type: "+b)},n.solidityPack=function(b,S){if(b.length!==S.length)throw new Error("Number of types are not matching the values");for(var w=[],A=0;A="0"&&S<="9";)H+=b[D]-"0",D++;A=D-1,w.push(H)}else if("i"===L)w.push("int256");else{if("a"!==L)throw new Error("Unsupported or invalid type: "+L);w.push("int256[]")}}return w},n.toSerpent=function(b){for(var S=[],w=0;w=0)throw new Error("couldn't export to DER format");var u=y.g.mul(i);return o(u.getX(),u.getY(),t)},l.privateKeyModInverse=function(e){var t=new m(e);if(t.ucmp(n.n)>=0||t.isZero())throw new Error("private key range is invalid");return t.invm(n.n).toArrayLike(s,"be",32)},l.signatureImport=function(e){var t=new m(e.r);t.ucmp(n.n)>=0&&(t=new m(0));var i=new m(e.s);return i.ucmp(n.n)>=0&&(i=new m(0)),s.concat([t.toArrayLike(s,"be",32),i.toArrayLike(s,"be",32)])},l.ecdhUnsafe=function(e,t,i){void 0===i&&(i=!0);var u=y.keyFromPublic(e),h=new m(t);if(h.ucmp(n.n)>=0||h.isZero())throw new Error("scalar was invalid (zero or overflow)");var f=u.pub.mul(h);return o(f.getX(),f.getY(),i)};var o=function(e,t,i){var u;return i?((u=s.alloc(33))[0]=t.isOdd()?3:2,e.toArrayLike(s,"be",32).copy(u,1)):((u=s.alloc(65))[0]=4,e.toArrayLike(s,"be",32).copy(u,1),t.toArrayLike(s,"be",32).copy(u,33)),u}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0});var m=s.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),y=s.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);l.privateKeyExport=function(n,o,e){void 0===e&&(e=!0);var t=s.from(e?m:y);return n.copy(t,e?8:9),o.copy(t,e?181:214),t},l.privateKeyImport=function(n){var o=n.length,e=0;if(o2||o<(e+=1)+t)return null;var i=n[e+t-1]|(t>1?n[e+t-2]<<8:0);return o<(e+=t)+i||o32||ot||2!==n[i++])return null;var h=n[i++];if(128&h){if(i+(u=h-128)>t)return null;for(;u>0&&0===n[i];i+=1,u-=1);for(h=0;u>0;i+=1,u-=1)h=(h<<8)+n[i]}if(h>t-i)return null;var f=i;if(i+=h,2!==n[i++])return null;var d=n[i++];if(128&d){if(i+(u=d-128)>t)return null;for(;u>0&&0===n[i];i+=1,u-=1);for(d=0;u>0;i+=1,u-=1)d=(d<<8)+n[i]}if(d>t-i)return null;var _=i;for(i+=d;h>0&&0===n[f];h-=1,f+=1);if(h>32)return null;var v=n.slice(f,f+h);for(v.copy(o,32-v.length);d>0&&0===n[_];d-=1,_+=1);if(d>32)return null;var T=n.slice(_,_+d);return T.copy(e,32-T.length),{r:o,s:e}}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.KECCAK256_RLP=l.KECCAK256_RLP_S=l.KECCAK256_RLP_ARRAY=l.KECCAK256_RLP_ARRAY_S=l.KECCAK256_NULL=l.KECCAK256_NULL_S=l.TWO_POW256=l.MAX_INTEGER=void 0;var m=c(9);l.MAX_INTEGER=new m("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),l.TWO_POW256=new m("10000000000000000000000000000000000000000000000000000000000000000",16),l.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",l.KECCAK256_NULL=s.from(l.KECCAK256_NULL_S,"hex"),l.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",l.KECCAK256_RLP_ARRAY=s.from(l.KECCAK256_RLP_ARRAY_S,"hex"),l.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",l.KECCAK256_RLP=s.from(l.KECCAK256_RLP_S,"hex")}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.importPublic=l.privateToPublic=l.privateToAddress=l.publicToAddress=l.pubToAddress=l.isValidPublic=l.isValidPrivate=l.isPrecompiled=l.generateAddress2=l.generateAddress=l.isValidChecksumAddress=l.toChecksumAddress=l.isZeroAddress=l.isValidAddress=l.zeroAddress=void 0;var m=c(61),y=c(32),n=c(74),o=c(9),e=c(40),t=c(75);l.zeroAddress=function(){var i=e.zeros(20);return e.bufferToHex(i)},l.isValidAddress=function(i){return/^0x[0-9a-fA-F]{40}$/.test(i)},l.isZeroAddress=function(i){return l.zeroAddress()===e.addHexPrefix(i)},l.toChecksumAddress=function(i,u){i=y.stripHexPrefix(i).toLowerCase();for(var h=void 0!==u?u.toString()+"0x":"",f=t.keccak(h+i).toString("hex"),d="0x",_=0;_=8?d+=i[_].toUpperCase():d+=i[_];return d},l.isValidChecksumAddress=function(i,u){return l.isValidAddress(i)&&l.toChecksumAddress(i,u)===i},l.generateAddress=function(i,u){i=e.toBuffer(i);var h=new o(u);return h.isZero()?t.rlphash([i,null]).slice(-20):t.rlphash([i,s.from(h.toArray())]).slice(-20)},l.generateAddress2=function(i,u,h){var f=e.toBuffer(i),d=e.toBuffer(u),_=e.toBuffer(h);return m(20===f.length),m(32===d.length),t.keccak256(s.concat([s.from("ff","hex"),f,d,t.keccak256(_)])).slice(-20)},l.isPrecompiled=function(i){var u=e.unpad(i);return 1===u.length&&u[0]>=1&&u[0]<=8},l.isValidPrivate=function(i){return n.privateKeyVerify(i)},l.isValidPublic=function(i,u){return void 0===u&&(u=!1),64===i.length?n.publicKeyVerify(s.concat([s.from([4]),i])):!!u&&n.publicKeyVerify(i)},l.pubToAddress=function(i,u){return void 0===u&&(u=!1),i=e.toBuffer(i),u&&64!==i.length&&(i=n.publicKeyConvert(i,!1).slice(1)),m(64===i.length),t.keccak(i).slice(-20)},l.publicToAddress=l.pubToAddress,l.privateToAddress=function(i){return l.publicToAddress(l.privateToPublic(i))},l.privateToPublic=function(i){return i=e.toBuffer(i),n.publicKeyCreate(i,!1).slice(1)},l.importPublic=function(i){return 64!==(i=e.toBuffer(i)).length&&(i=n.publicKeyConvert(i,!1).slice(1)),i}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.hashPersonalMessage=l.isValidSignature=l.fromRpcSig=l.toRpcSig=l.ecrecover=l.ecsign=void 0;var m=c(74),y=c(9),n=c(40),o=c(75);function e(i,u){return u?i-(2*u+35):i-27}function t(i){return 0===i||1===i}l.ecsign=function(i,u,h){var f=m.sign(i,u),d=f.recovery;return{r:f.signature.slice(0,32),s:f.signature.slice(32,64),v:h?d+(2*h+35):d+27}},l.ecrecover=function(i,u,h,f,d){var _=s.concat([n.setLength(h,32),n.setLength(f,32)],64),v=e(u,d);if(!t(v))throw new Error("Invalid signature v value");var T=m.recover(i,_,v);return m.publicKeyConvert(T,!1).slice(1)},l.toRpcSig=function(i,u,h,f){if(!t(e(i,f)))throw new Error("Invalid signature v value");return n.bufferToHex(s.concat([n.setLengthLeft(u,32),n.setLengthLeft(h,32),n.toBuffer(i)]))},l.fromRpcSig=function(i){var u=n.toBuffer(i);if(65!==u.length)throw new Error("Invalid signature length");var h=u[64];return h<27&&(h+=27),{v:h,r:u.slice(0,32),s:u.slice(32,64)}},l.isValidSignature=function(i,u,h,f,d){void 0===f&&(f=!0);var _=new y("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),v=new y("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==u.length||32!==h.length||!t(e(i,d)))return!1;var T=new y(u),O=new y(h);return!(T.isZero()||T.gt(v)||O.isZero()||O.gt(v)||f&&1===O.cmp(_))},l.hashPersonalMessage=function(i){var u=s.from("\x19Ethereum Signed Message:\n"+i.length.toString(),"utf-8");return o.keccak(s.concat([u,i]))}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){Object.defineProperty(l,"__esModule",{value:!0}),l.defineProperties=void 0;var m=c(61),y=c(32),n=c(46),o=c(40);l.defineProperties=function(e,t,i){if(e.raw=[],e._fields=[],e.toJSON=function(h){if(void 0===h&&(h=!1),h){var f={};return e._fields.forEach(function(d){f[d]="0x"+e[d].toString("hex")}),f}return o.baToJSON(e.raw)},e.serialize=function(){return n.encode(e.raw)},t.forEach(function(h,f){function d(){return e.raw[f]}function _(v){"00"!==(v=o.toBuffer(v)).toString("hex")||h.allowZero||(v=s.allocUnsafe(0)),h.allowLess&&h.length?(v=o.stripZeros(v),m(h.length>=v.length,"The field "+h.name+" must not have more "+h.length+" bytes")):h.allowZero&&0===v.length||!h.length||m(h.length===v.length,"The field "+h.name+" must have byte length of "+h.length),e.raw[f]=v}e._fields.push(h.name),Object.defineProperty(e,h.name,{enumerable:!0,configurable:!0,get:d,set:_}),h.default&&(e[h.name]=h.default),h.alias&&Object.defineProperty(e,h.alias,{enumerable:!1,configurable:!0,set:_,get:d})}),i)if("string"==typeof i&&(i=s.from(y.stripHexPrefix(i),"hex")),s.isBuffer(i)&&(i=n.decode(i)),Array.isArray(i)){if(i.length>e._fields.length)throw new Error("wrong number of fields in data");i.forEach(function(h,f){e[e._fields[f]]=o.toBuffer(h)})}else{if("object"!=typeof i)throw new Error("invalid data");var u=Object.keys(i);t.forEach(function(h){-1!==u.indexOf(h.name)&&(e[h.name]=i[h.name]),-1!==u.indexOf(h.alias)&&(e[h.alias]=i[h.alias])})}}}).call(this,c(2).Buffer)},function(z,l,c){(function(s){!function(m){"use strict";var y=function(n){setTimeout(n,0)};void 0!==s&&s&&"function"==typeof s.nextTick&&(y=s.nextTick),z.exports=function(n){var o={capacity:n||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===o.firstHere){o.current++,o.firstHere=!0;var e=1}else e=0;var t={n:1};"function"==typeof arguments[0]?t.task=arguments[0]:t.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?t.task=arguments[1]:t.n=arguments[1]);var i=t.task;if(t.task=function(){i(o.leave)},o.current+t.n-e>o.capacity)return 1===e&&(o.current--,o.firstHere=!1),o.queue.push(t);o.current+=t.n-e,t.task(o.leave),1===e&&(o.firstHere=!1)},leave:function(e){if(o.current-=e=e||1,o.queue.length){var t=o.queue[0];t.n+o.current>o.capacity||(o.queue.shift(),o.current+=t.n,y(t.task))}else if(o.current<0)throw new Error("leave called too many times.")},available:function(e){return o.current+(e=e||1)<=o.capacity}};return o}}()}).call(this,c(5))},function(z,l,c){const s=c(67);z.exports=function(m,y,n){m.sendAsync(s({method:"eth_estimateGas",params:[y]}),function(o,e){if(o)return"no contract code at given address"===o.message?n(null,"0xcf08"):n(o);n(null,e.result)})}},function(z,l,c){(function(s){const m=c(21).inherits,y=c(370),n=c(36),o=c(49),e=c(149).blockTagForPayload;function t(i){this.nonceCache={}}z.exports=t,m(t,o),t.prototype.handleRequest=function(i,u,h){const f=this;switch(i.method){case"eth_getTransactionCount":var d=e(i),_=i.params[0].toLowerCase(),v=f.nonceCache[_];return void("pending"===d?v?h(null,v):u(function(T,O,b){if(T)return b();void 0===f.nonceCache[_]&&(f.nonceCache[_]=O),b()}):u());case"eth_sendRawTransaction":return void u(function(T,O,b){if(T)return b();var S=i.params[0],w=(n.stripHexPrefix(S),s.from(n.stripHexPrefix(S),"hex"),new y(s.from(n.stripHexPrefix(S),"hex"))),A="0x"+w.getSenderAddress().toString("hex").toLowerCase(),L=n.bufferToInt(w.nonce),H=(++L).toString(16);H.length%2&&(H="0"+H),f.nonceCache[A]=H="0x"+H,b()});case"evm_revert":return f.nonceCache={},void u();default:return void u()}}}).call(this,c(2).Buffer)},function(z,l,c){"use strict";(function(s){var m=c(36),y=c(371),n=m.BN,o=new n("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),e=function(){function t(i){(function(d,_){if(!(d instanceof _))throw new TypeError("Cannot call a class as a function")})(this,t),i=i||{};var u=[{name:"nonce",length:32,allowLess:!0,default:new s([])},{name:"gasPrice",length:32,allowLess:!0,default:new s([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new s([])},{name:"to",allowZero:!0,length:20,default:new s([])},{name:"value",length:32,allowLess:!0,default:new s([])},{name:"data",alias:"input",allowZero:!0,default:new s([])},{name:"v",allowZero:!0,default:new s([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new s([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new s([])}];m.defineProperties(this,u,i),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var h=m.bufferToInt(this.v),f=Math.floor((h-35)/2);f<0&&(f=0),this._chainId=f||i.chainId||0,this._homestead=!0}return t.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},t.prototype.hash=function(i){void 0===i&&(i=!0);var u=void 0;if(i)u=this.raw;else if(this._chainId>0){var h=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,u=this.raw,this.raw=h}else u=this.raw.slice(0,6);return m.rlphash(u)},t.prototype.getChainId=function(){return this._chainId},t.prototype.getSenderAddress=function(){if(this._from)return this._from;var i=this.getSenderPublicKey();return this._from=m.publicToAddress(i),this._from},t.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},t.prototype.verifySignature=function(){var i=this.hash(!1);if(this._homestead&&1===new n(this.s).cmp(o))return!1;try{var u=m.bufferToInt(this.v);this._chainId>0&&(u-=2*this._chainId+8),this._senderPubKey=m.ecrecover(i,u,this.r,this.s)}catch{return!1}return!!this._senderPubKey},t.prototype.sign=function(i){var u=this.hash(!1),h=m.ecsign(u,i);this._chainId>0&&(h.v+=2*this._chainId+8),Object.assign(this,h)},t.prototype.getDataFee=function(){for(var i=this.raw[5],u=new n(0),h=0;h0&&u.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===i||!1===i?0===u.length:u.join(" ")},t}();z.exports=e}).call(this,c(2).Buffer)},function(z){z.exports=JSON.parse('{"genesisGasLimit":{"v":5000,"d":"Gas limit of the Genesis block."},"genesisDifficulty":{"v":17179869184,"d":"Difficulty of the Genesis block."},"genesisNonce":{"v":"0x0000000000000042","d":"the geneis nonce"},"genesisExtraData":{"v":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","d":"extra data "},"genesisHash":{"v":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","d":"genesis hash"},"genesisStateRoot":{"v":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544","d":"the genesis state root"},"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be."},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations."},"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be."},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations."},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},"maximumExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis."},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs."},"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed."},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack."},"tierStepGas":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them."},"expGas":{"v":10,"d":"Once per EXP instuction."},"expByteGas":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction."},"sha3Gas":{"v":30,"d":"Once per SHA3 operation."},"sha3WordGas":{"v":6,"d":"Once per word of the SHA3 operation\'s data."},"sloadGas":{"v":50,"d":"Once per SLOAD operation."},"sstoreSetGas":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero."},"sstoreResetGas":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero."},"sstoreRefundGas":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero."},"jumpdestGas":{"v":1,"d":"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},"logGas":{"v":375,"d":"Per LOG* operation."},"logDataGas":{"v":8,"d":"Per byte in a LOG* operation\'s data."},"logTopicGas":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},"createGas":{"v":32000,"d":"Once per CREATE operation & contract-creation transaction."},"callGas":{"v":40,"d":"Once per CALL operation & message call transaction."},"callStipend":{"v":2300,"d":"Free gas given at beginning of call."},"callValueTransferGas":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero."},"callNewAccountGas":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior."},"suicideRefundGas":{"v":24000,"d":"Refunded following a suicide operation."},"memoryGas":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation."},"createDataGas":{"v":200,"d":""},"txGas":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions."},"txCreation":{"v":32000,"d":"the cost of creating a contract via tx"},"txDataZeroGas":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},"txDataNonZeroGas":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},"copyGas":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},"ecrecoverGas":{"v":3000,"d":""},"sha256Gas":{"v":60,"d":""},"sha256WordGas":{"v":12,"d":""},"ripemd160Gas":{"v":600,"d":""},"ripemd160WordGas":{"v":120,"d":""},"identityGas":{"v":15,"d":""},"identityWordGas":{"v":3,"d":""},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"ommerReward":{"v":"625000000000000000","d":"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},"niblingReward":{"v":"156250000000000000","d":"the amount a miner gets for inculding a uncle"},"homeSteadForkNumber":{"v":1150000,"d":"the block that the Homestead fork started at"},"homesteadRepriceForkNumber":{"v":2463000,"d":"the block that the Homestead Reprice (EIP150) fork started at"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"freeBlockPeriod":{"v":2}}')},function(z,l,c){const s=c(68),m=c(373);z.exports=class extends s{constructor(){super(({blockTracker:y,provider:n,engine:o})=>{const{events:e,middleware:t}=m({blockTracker:y,provider:n});return e.on("notification",i=>o.emit("data",null,i)),t})}}},function(z,l,c){const s=c(69).default,m=c(156),{createAsyncMiddleware:y}=c(152),n=c(151),{unsafeRandomBytes:o,incrementHexInt:e}=c(39),t=c(73);function i(u){return{hash:u.hash,parentHash:u.parentHash,sha3Uncles:u.sha3Uncles,miner:u.miner,stateRoot:u.stateRoot,transactionsRoot:u.transactionsRoot,receiptsRoot:u.receiptsRoot,logsBloom:u.logsBloom,difficulty:u.difficulty,number:u.number,gasLimit:u.gasLimit,gasUsed:u.gasUsed,nonce:u.nonce,mixHash:u.mixHash,timestamp:u.timestamp,extraData:u.extraData}}z.exports=function({blockTracker:u,provider:h}){const f={},d=n({blockTracker:u,provider:h});let _=!1;const v=new s,T=m({eth_subscribe:y(function(){var b=ge(function*(S,w){if(_)throw new Error("SubscriptionManager - attempting to use after destroying");const A=S.params[0],L=o(16);let H;switch(A){case"newHeads":H=function({subId:k}){const p={type:A,destroy:(x=ge(function*(){u.removeListener("sync",p.update)}),function(){return x.apply(this,arguments)}),update:function(){var x=ge(function*({oldBlock:R,newBlock:r}){const a=r,g=e(R);(yield t({provider:h,fromBlock:g,toBlock:a})).map(i).forEach(M=>{O(k,M)})});return function(r){return x.apply(this,arguments)}}()};var x;return u.on("sync",p.update),p}({subId:L});break;case"logs":const D=S.params[1];H=function({subId:k,filter:p}){return p.on("update",x=>O(k,x)),{type:A,destroy:(x=ge(function*(){return yield d.uninstallFilter(p.idHex)}),function(){return x.apply(this,arguments)})};var x}({subId:L,filter:yield d.newLogFilter(D)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${A}"`)}return f[L]=H,void(w.result=L)});return function(S,w){return b.apply(this,arguments)}}()),eth_unsubscribe:y(function(){var b=ge(function*(S,w){if(_)throw new Error("SubscriptionManager - attempting to use after destroying");const A=S.params[0],L=f[A];L?(delete f[A],yield L.destroy(),w.result=!0):w.result=!1});return function(S,w){return b.apply(this,arguments)}}())});return T.destroy=function(){v.removeAllListeners();for(const b in f)f[b].destroy(),delete f[b];_=!0},{events:v,middleware:T};function O(b,S){v.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:b,result:S}})}}},function(z,l,c){"use strict";c.r(l);var s={};c.r(s),c.d(s,"generateKey",function(){return f}),c.d(s,"verifyHmac",function(){return _}),c.d(s,"encrypt",function(){return T}),c.d(s,"decrypt",function(){return b});var m=c(1),y=c(162);const e="abcdefghijklmnopqrstuvwxyz0123456789".split("").map(w=>`https://${w}.bridge.walletconnect.org`);var u=c(33),h=c(0);function f(w){return d.apply(this,arguments)}function d(){return(d=ge(function*(w){const L=u.randomBytes((w||256)/8);return Object(m.convertBufferToArrayBuffer)(h.b(L))})).apply(this,arguments)}function _(w,A){return v.apply(this,arguments)}function v(){return(v=ge(function*(w,A){const L=h.n(w.data),H=h.n(w.iv),D=h.n(w.hmac),q=h.c(D,!1),k=h.j(L,H),p=yield u.hmacSha256Sign(A,k),x=h.c(p,!1);return h.x(q)===h.x(x)})).apply(this,arguments)}function T(w,A,L){return O.apply(this,arguments)}function O(){return(O=ge(function*(w,A,L){const H=h.f(Object(m.convertArrayBufferToBuffer)(A)),D=L||(yield f(128)),q=h.f(Object(m.convertArrayBufferToBuffer)(D)),k=h.c(q,!1),p=JSON.stringify(w),x=h.z(p),R=yield u.aesCbcEncrypt(q,H,x),r=h.c(R,!1),a=h.j(R,q),g=yield u.hmacSha256Sign(H,a);return{data:r,hmac:h.c(g,!1),iv:k}})).apply(this,arguments)}function b(w,A){return S.apply(this,arguments)}function S(){return(S=ge(function*(w,A){const L=h.f(Object(m.convertArrayBufferToBuffer)(A));if(!L)throw new Error("Missing key: required for decryption");if(!(yield _(w,L)))return null;const H=h.n(w.data),D=h.n(w.iv),q=yield u.aesCbcDecrypt(D,L,H),k=h.e(q);let p;try{p=JSON.parse(k)}catch{return null}return p})).apply(this,arguments)}l.default=class extends class{constructor(w){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 class{constructor(){this._eventEmitters=[]}subscribe(w){this._eventEmitters.push(w)}unsubscribe(w){this._eventEmitters=this._eventEmitters.filter(A=>A.event!==w)}trigger(w){let A,L=[];A=Object(m.isJsonRpcRequest)(w)?w.method:Object(m.isJsonRpcResponseSuccess)(w)||Object(m.isJsonRpcResponseError)(w)?"response:"+w.id:Object(m.isInternalEvent)(w)?w.event:"",A&&(L=this._eventEmitters.filter(H=>H.event===A)),L&&L.length||Object(m.isReservedEvent)(A)||Object(m.isInternalEvent)(A)||(L=this._eventEmitters.filter(H=>"call_request"===H.event)),L.forEach(H=>{if(Object(m.isJsonRpcResponseError)(w)){const D=new Error(w.error.message);H.callback(D,null)}else H.callback(null,w)})}},this._clientMeta=Object(m.getClientMeta)()||w.connectorOpts.clientMeta||null,this._cryptoLib=w.cryptoLib,this._sessionStorage=w.sessionStorage||new class{constructor(w="walletconnect"){this.storageId=w}getSession(){let w=null;const A=Object(m.getLocal)(this.storageId);return A&&Object(m.isWalletConnectSession)(A)&&(w=A),w}setSession(w){return Object(m.setLocal)(this.storageId,w),w}removeSession(){Object(m.removeLocal)(this.storageId)}}(w.connectorOpts.storageId),this._qrcodeModal=w.connectorOpts.qrcodeModal,this._qrcodeModalOptions=w.connectorOpts.qrcodeModalOptions,this._signingMethods=[...m.signingMethods,...w.connectorOpts.signingMethods||[]],!w.connectorOpts.bridge&&!w.connectorOpts.uri&&!w.connectorOpts.session)throw new Error("Missing one of the required parameters: bridge / uri / session");var A;w.connectorOpts.bridge&&(this.bridge="walletconnect.org"===function(q){let k=q.indexOf("//")>-1?q.split("/")[2]:q.split("/")[0];return k=k.split(":")[0],k=k.split("?")[0],k}(A=w.connectorOpts.bridge).split(".").slice(-2).join(".")?function t(){return e[Math.floor(Math.random()*e.length)]}():A),w.connectorOpts.uri&&(this.uri=w.connectorOpts.uri);const L=w.connectorOpts.session||this._getStorageSession();L&&(this.session=L),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=w.transport||new y.a({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),w.connectorOpts.uri&&this._subscribeToSessionRequest(),w.pushServerOpts&&this._registerPushServer(w.pushServerOpts)}set bridge(w){w&&(this._bridge=w)}get bridge(){return this._bridge}set key(w){if(!w)return;const A=Object(m.convertHexToArrayBuffer)(w);this._key=A}get key(){return this._key?Object(m.convertArrayBufferToHex)(this._key,!0):""}set clientId(w){w&&(this._clientId=w)}get clientId(){let w=this._clientId;return w||(w=this._clientId=Object(m.uuid)()),this._clientId}set peerId(w){w&&(this._peerId=w)}get peerId(){return this._peerId}set clientMeta(w){}get clientMeta(){let w=this._clientMeta;return w||(w=this._clientMeta=Object(m.getClientMeta)()),w}set peerMeta(w){this._peerMeta=w}get peerMeta(){return this._peerMeta}set handshakeTopic(w){w&&(this._handshakeTopic=w)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(w){w&&(this._handshakeId=w)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(w){if(!w)return;const{handshakeTopic:A,bridge:L,key:H}=this._parseUri(w);this.handshakeTopic=A,this.bridge=L,this.key=H}set chainId(w){this._chainId=w}get chainId(){return this._chainId}set networkId(w){this._networkId=w}get networkId(){return this._networkId}set accounts(w){this._accounts=w}get accounts(){return this._accounts}set rpcUrl(w){this._rpcUrl=w}get rpcUrl(){return this._rpcUrl}set connected(w){}get connected(){return this._connected}set pending(w){}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(w){w&&(this._connected=w.connected,this.accounts=w.accounts,this.chainId=w.chainId,this.bridge=w.bridge,this.key=w.key,this.clientId=w.clientId,this.clientMeta=w.clientMeta,this.peerId=w.peerId,this.peerMeta=w.peerMeta,this.handshakeId=w.handshakeId,this.handshakeTopic=w.handshakeTopic)}on(w,A){this._eventManager.subscribe({event:w,callback:A})}off(w){this._eventManager.unsubscribe(w)}createInstantRequest(w){var A=this;return ge(function*(){A._key=yield A._generateKey();const L=A._formatRequest({method:"wc_instantRequest",params:[{peerId:A.clientId,peerMeta:A.clientMeta,request:A._formatRequest(w)}]});A.handshakeId=L.id,A.handshakeTopic=Object(m.uuid)(),A._eventManager.trigger({event:"display_uri",params:[A.uri]}),A.on("modal_closed",()=>{throw new Error("User close QRCode Modal")});const H=()=>{A.killSession()};try{const D=yield A._sendCallRequest(L);return D&&H(),D}catch(D){throw H(),D}})()}connect(w){var A=this;return ge(function*(){if(!A._qrcodeModal)throw new Error("QRCode Modal not provided");return A.connected?{chainId:A.chainId,accounts:A.accounts}:(yield A.createSession(w),new Promise(function(){var L=ge(function*(H,D){A.on("modal_closed",()=>D(new Error("User close QRCode Modal"))),A.on("connect",(q,k)=>{if(q)return D(q);H(k.params[0])})});return function(H,D){return L.apply(this,arguments)}}()))})()}createSession(w){var A=this;return ge(function*(){if(A._connected)throw new Error("Session currently connected");if(A.pending)return;A._key=yield A._generateKey();const L=A._formatRequest({method:"wc_sessionRequest",params:[{peerId:A.clientId,peerMeta:A.clientMeta,chainId:w&&w.chainId?w.chainId:null}]});A.handshakeId=L.id,A.handshakeTopic=Object(m.uuid)(),A._sendSessionRequest(L,"Session update rejected",{topic:A.handshakeTopic}),A._eventManager.trigger({event:"display_uri",params:[A.uri]})})()}approveSession(w){if(this._connected)throw new Error("Session currently connected");this.chainId=w.chainId,this.accounts=w.accounts,this.networkId=w.networkId||0,this.rpcUrl=w.rpcUrl||"",this._sendResponse({id:this.handshakeId,jsonrpc:"2.0",result:{approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta}}),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(w){if(this._connected)throw new Error("Session currently connected");const A=w&&w.message?w.message:"Session Rejected",L=this._formatResponse({id:this.handshakeId,error:{message:A}});this._sendResponse(L),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:A}]}),this._removeStorageSession()}updateSession(w){if(!this._connected)throw new Error("Session currently disconnected");this.chainId=w.chainId,this.accounts=w.accounts,this.networkId=w.networkId||0,this.rpcUrl=w.rpcUrl||"";const L=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl}]});this._sendSessionRequest(L,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}killSession(w){var A=this;return ge(function*(){const L=w?w.message:"Session Disconnected",H=A._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]});yield A._sendRequest(H),A._handleSessionDisconnect(L)})()}sendTransaction(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");const L=Object(m.parseTransactionData)(w),H=A._formatRequest({method:"eth_sendTransaction",params:[L]});return yield A._sendCallRequest(H)})()}signTransaction(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");const L=Object(m.parseTransactionData)(w),H=A._formatRequest({method:"eth_signTransaction",params:[L]});return yield A._sendCallRequest(H)})()}signMessage(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");const L=A._formatRequest({method:"eth_sign",params:w});return yield A._sendCallRequest(L)})()}signPersonalMessage(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");w=Object(m.parsePersonalSign)(w);const L=A._formatRequest({method:"personal_sign",params:w});return yield A._sendCallRequest(L)})()}signTypedData(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");const L=A._formatRequest({method:"eth_signTypedData",params:w});return yield A._sendCallRequest(L)})()}updateChain(w){var A=this;return ge(function*(){if(!A._connected)throw new Error("Session currently disconnected");const L=A._formatRequest({method:"wallet_updateChain",params:[w]});return yield A._sendCallRequest(L)})()}unsafeSend(w,A){return this._sendRequest(w,A),this._eventManager.trigger({event:"call_request_sent",params:[{request:w,options:A}]}),new Promise((L,H)=>{this._subscribeToResponse(w.id,(D,q)=>{if(D)H(D);else{if(!q)throw new Error("Missing JSON RPC response");L(q)}})})}sendCustomRequest(w,A){var L=this;return ge(function*(){if(!L._connected)throw new Error("Session currently disconnected");switch(w.method){case"eth_accounts":return L.accounts;case"eth_chainId":return Object(m.convertNumberToHex)(L.chainId);case"eth_sendTransaction":case"eth_signTransaction":w.params&&(w.params[0]=Object(m.parseTransactionData)(w.params[0]));break;case"personal_sign":w.params&&(w.params=Object(m.parsePersonalSign)(w.params))}const H=L._formatRequest(w);return yield L._sendCallRequest(H,A)})()}approveRequest(w){if(!Object(m.isJsonRpcResponseSuccess)(w))throw new Error('JSON-RPC success response must include "result" field');{const A=this._formatResponse(w);this._sendResponse(A)}}rejectRequest(w){if(!Object(m.isJsonRpcResponseError)(w))throw new Error('JSON-RPC error response must include "error" field');{const A=this._formatResponse(w);this._sendResponse(A)}}transportClose(){this._transport.close()}_sendRequest(w,A){var L=this;return ge(function*(){const H=L._formatRequest(w),D=yield L._encrypt(H),q=void 0!==(null==A?void 0:A.topic)?A.topic:L.peerId,k=JSON.stringify(D),p=void 0!==(null==A?void 0:A.forcePushNotification)?!A.forcePushNotification:Object(m.isSilentPayload)(H);L._transport.send(k,q,p)})()}_sendResponse(w){var A=this;return ge(function*(){const L=yield A._encrypt(w),H=A.peerId,D=JSON.stringify(L);A._transport.send(D,H,!0)})()}_sendSessionRequest(w,A,L){var H=this;return ge(function*(){H._sendRequest(w,L),H._subscribeToSessionResponse(w.id,A)})()}_sendCallRequest(w,A){return this._sendRequest(w,A),this._eventManager.trigger({event:"call_request_sent",params:[{request:w,options:A}]}),this._subscribeToCallResponse(w.id)}_formatRequest(w){if(void 0===w.method)throw new Error('JSON RPC request must have valid "method" value');return{id:void 0===w.id?Object(m.payloadId)():w.id,jsonrpc:"2.0",method:w.method,params:void 0===w.params?[]:w.params}}_formatResponse(w){if(void 0===w.id)throw new Error('JSON RPC request must have valid "id" value');const A={id:w.id,jsonrpc:"2.0"};if(Object(m.isJsonRpcResponseError)(w)){const L=Object(m.formatRpcError)(w.error);return Object.assign(Object.assign(Object.assign({},A),w),{error:L})}if(Object(m.isJsonRpcResponseSuccess)(w))return Object.assign(Object.assign({},A),w);throw new Error("JSON RPC response format is invalid")}_handleSessionDisconnect(w){const A=w||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),Object(m.removeLocal)(m.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:A}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(w,A){A&&A.approved?(this._connected?(A.chainId&&(this.chainId=A.chainId),A.accounts&&(this.accounts=A.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,A.chainId&&(this.chainId=A.chainId),A.accounts&&(this.accounts=A.accounts),A.peerId&&!this.peerId&&(this.peerId=A.peerId),A.peerMeta&&!this.peerMeta&&(this.peerMeta=A.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(w)}_handleIncomingMessages(w){var A=this;return ge(function*(){if(![A.clientId,A.handshakeTopic].includes(w.topic))return;let L;try{L=JSON.parse(w.payload)}catch{return}const H=yield A._decrypt(L);H&&A._eventManager.trigger(H)})()}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(w,A){this.on("response:"+w,A)}_subscribeToSessionResponse(w,A){this._subscribeToResponse(w,(L,H)=>{L?this._handleSessionResponse(L.message):Object(m.isJsonRpcResponseSuccess)(H)?this._handleSessionResponse(A,H.result):this._handleSessionResponse(H.error&&H.error.message?H.error.message:A)})}_subscribeToCallResponse(w){return new Promise((A,L)=>{this._subscribeToResponse(w,(H,D)=>{H?L(H):Object(m.isJsonRpcResponseSuccess)(D)?A(D.result):L(D.error&&D.error.message?D.error: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",(w,A)=>{const{request:L}=A.params[0];if(Object(m.isMobile)()&&this._signingMethods.includes(L.method)){const H=Object(m.getLocal)(m.mobileLinkChoiceKey);H&&(window.location.href=H.href)}}),this.on("wc_sessionRequest",(w,A)=>{w&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:w.toString()}]}),this.handshakeId=A.id,this.peerId=A.params[0].peerId,this.peerMeta=A.params[0].peerMeta;const L=Object.assign(Object.assign({},A),{method:"session_request"});this._eventManager.trigger(L)}),this.on("wc_sessionUpdate",(w,A)=>{w&&this._handleSessionResponse(w.message),this._handleSessionResponse("Session disconnected",A.params[0])})}_initTransport(){this._transport.on("message",w=>this._handleIncomingMessages(w)),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(w){const A=Object(m.parseWalletConnectUri)(w);if(A.protocol===this.protocol){if(!A.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const L=A.handshakeTopic;if(!A.bridge)throw Error("Invalid or missing bridge url parameter value");const H=decodeURIComponent(A.bridge);if(!A.key)throw Error("Invalid or missing key parameter value");return{handshakeTopic:L,bridge:H,key:A.key}}throw new Error("URI format is invalid")}_generateKey(){var w=this;return ge(function*(){return w._cryptoLib?yield w._cryptoLib.generateKey():null})()}_encrypt(w){var A=this;return ge(function*(){const L=A._key;return A._cryptoLib&&L?yield A._cryptoLib.encrypt(w,L):null})()}_decrypt(w){var A=this;return ge(function*(){const L=A._key;return A._cryptoLib&&L?yield A._cryptoLib.decrypt(w,L):null})()}_getStorageSession(){let w=null;return this._sessionStorage&&(w=this._sessionStorage.getSession()),w}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(w){if(!w.url||"string"!=typeof w.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!w.type||"string"!=typeof w.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!w.token||"string"!=typeof w.token)throw Error("Invalid or missing pushServerOpts.token parameter value");const A={bridge:this.bridge,topic:this.clientId,type:w.type,token:w.token,peerName:"",language:w.language||""};this.on("connect",function(){var L=ge(function*(H,D){if(H)throw H;w.peerMeta&&(A.peerName=D.params[0].peerMeta.name);try{if(!(yield(yield fetch(w.url+"/new",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(A)})).json()).success)throw Error("Failed to register in Push Server")}catch{throw Error("Failed to register in Push Server")}});return function(H,D){return L.apply(this,arguments)}}())}}{constructor(w,A){super({cryptoLib:s,connectorOpts:w,pushServerOpts:A})}}},function(z,l,c){"use strict";function s(e,t,i,u){return new(i||(i=Promise))(function(h,f){function d(T){try{v(u.next(T))}catch(O){f(O)}}function _(T){try{v(u.throw(T))}catch(O){f(O)}}function v(T){var O;T.done?h(T.value):(O=T.value,O instanceof i?O:new i(function(b){b(O)})).then(d,_)}v((u=u.apply(e,t||[])).next())})}function m(e,t){var i,u,h,f,d={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return f={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function _(v){return function(T){return function(O){if(i)throw new TypeError("Generator is already executing.");for(;d;)try{if(i=1,u&&(h=2&O[0]?u.return:O[0]?u.throw||((h=u.return)&&h.call(u),0):u.next)&&!(h=h.call(u,O[1])).done)return h;switch(u=0,h&&(O=[2&O[0],h.value]),O[0]){case 0:case 1:h=O;break;case 4:return d.label++,{value:O[1],done:!1};case 5:d.label++,u=O[1],O=[0];continue;case 7:O=d.ops.pop(),d.trys.pop();continue;default:if(!((h=(h=d.trys).length>0&&h[h.length-1])||6!==O[0]&&2!==O[0])){d=0;continue}if(3===O[0]&&(!h||O[1]>h[0]&&O[1]1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,i=this._queue.shift();if(i){var u=!1;this._currentReleaser=function(){u||(u=!0,t._value++,t._dispatch())},i([this._value--,this._currentReleaser])}},e}(),n=function(){function e(){this._semaphore=new y(1)}return e.prototype.acquire=function(){return s(this,void 0,void 0,function(){return m(this,function(i){switch(i.label){case 0:return[4,this._semaphore.acquire()];case 1:return[2,i.sent()[1]]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();function o(e,t,i){var u=this;return void 0===i&&(i=new Error("timeout")),{acquire:function(){return new Promise(function(h,f){return s(u,void 0,void 0,function(){var d,_;return m(this,function(v){switch(v.label){case 0:return d=!1,setTimeout(function(){d=!0,f(i)},t),[4,e.acquire()];case 1:return _=v.sent(),d?(Array.isArray(_)?_[1]:_)():h(_),[2]}})})})},runExclusive:function(h){return s(this,void 0,void 0,function(){var f,d;return m(this,function(_){switch(_.label){case 0:f=function(){},_.label=1;case 1:return _.trys.push([1,,7,8]),[4,this.acquire()];case 2:return d=_.sent(),Array.isArray(d)?(f=d[1],[4,h(d[0])]):[3,4];case 3:return[2,_.sent()];case 4:return f=d,[4,h()];case 5:return[2,_.sent()];case 6:return[3,8];case 7:return f(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}c.d(l,"Mutex",function(){return n}),c.d(l,"Semaphore",function(){return y}),c.d(l,"withTimeout",function(){return o})},function(z,l,c){"use strict";c.r(l);var s,m,y,n,o,e,t,i={},u=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function f(Y,G){for(var $ in G)Y[$]=G[$];return Y}function d(Y){var G=Y.parentNode;G&&G.removeChild(Y)}function _(Y,G,$){var ne,ce=arguments,ue={};for(ne in G)"key"!==ne&&"ref"!==ne&&(ue[ne]=G[ne]);if(arguments.length>3)for($=[$],ne=3;ne2&&(G.children=u.slice.call(arguments,2)),$={},G)"key"!==ne&&"ref"!==ne&&($[ne]=G[ne]);return v(Y.type,$,G.key||Y.key,G.ref||Y.ref,null)}function V(Y){var G={},$={__c:"__cC"+t++,__:Y,Consumer:function(ne,ce){return ne.children(ce)},Provider:function(ne){var ce,ue=this;return this.getChildContext||(ce=[],this.getChildContext=function(){return G[$.__c]=ue,G},this.shouldComponentUpdate=function(Ce){ue.props.value!==Ce.value&&ce.some(function(Ie){Ie.context=Ce.value,A(Ie)})},this.sub=function(Ce){ce.push(Ce);var Ie=Ce.componentWillUnmount;Ce.componentWillUnmount=function(){ce.splice(ce.indexOf(Ce),1),Ie&&Ie.call(Ce)}}),ne.children}};return $.Consumer.contextType=$,$.Provider.__=$,$}s={__e:function(Y,G){for(var $,ne;G=G.__;)if(($=G.__c)&&!$.__)try{if($.constructor&&null!=$.constructor.getDerivedStateFromError&&(ne=!0,$.setState($.constructor.getDerivedStateFromError(Y))),null!=$.componentDidCatch&&(ne=!0,$.componentDidCatch(Y)),ne)return A($.__E=$)}catch(ce){Y=ce}throw Y}},b.prototype.setState=function(Y,G){var $;$=this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof Y&&(Y=Y($,this.props)),Y&&f($,Y),null!=Y&&this.__v&&(G&&this.__h.push(G),A(this))},b.prototype.forceUpdate=function(Y){this.__v&&(this.__e=!0,Y&&this.__h.push(Y),A(this))},b.prototype.render=O,m=[],y=0,n="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=i,t=0;var I,W,F,B=0,N=[],P=s.__r,j=s.diffed,K=s.__c,Z=s.unmount;function J(Y,G){s.__h&&s.__h(W,Y,B||G),B=0;var $=W.__H||(W.__H={__:[],__h:[]});return Y>=$.__.length&&$.__.push({}),$.__[Y]}function X(Y){return B=1,ee(Pe,Y)}function ee(Y,G,$){var ne=J(I++,2);return ne.__c||(ne.__c=W,ne.__=[$?$(G):Pe(void 0,G),function(ce){var ue=Y(ne.__[0],ce);ne.__[0]!==ue&&(ne.__[0]=ue,ne.__c.setState({}))}]),ne.__}function te(Y,G){var $=J(I++,3);!s.__s&&be($.__H,G)&&($.__=Y,$.__H=G,W.__H.__h.push($))}function oe(Y,G){var $=J(I++,4);!s.__s&&be($.__H,G)&&($.__=Y,$.__H=G,W.__h.push($))}function ve(Y){return B=5,de(function(){return{current:Y}},[])}function ie(Y,G,$){B=6,oe(function(){"function"==typeof Y?Y(G()):Y&&(Y.current=G())},null==$?$:$.concat(Y))}function de(Y,G){var $=J(I++,7);return be($.__H,G)?($.__H=G,$.__h=Y,$.__=Y()):$.__}function fe(Y,G){return B=8,de(function(){return Y},G)}function re(Y){var G=W.context[Y.__c],$=J(I++,9);return $.__c=Y,G?(null==$.__&&($.__=!0,G.sub(W)),G.props.value):Y.__}function _e(Y,G){s.useDebugValue&&s.useDebugValue(G?G(Y):Y)}function Ke(Y){var G=J(I++,10),$=X();return G.__=Y,W.componentDidCatch||(W.componentDidCatch=function(ne){G.__&&G.__(ne),$[1](ne)}),[$[0],function(){$[1](void 0)}]}function pe(){N.some(function(Y){if(Y.__P)try{Y.__H.__h.forEach(Te),Y.__H.__h.forEach(Ve),Y.__H.__h=[]}catch(G){return Y.__H.__h=[],s.__e(G,Y.__v),!0}}),N=[]}function Te(Y){Y.t&&Y.t()}function Ve(Y){var G=Y.__();"function"==typeof G&&(Y.t=G)}function be(Y,G){return!Y||G.some(function($,ne){return $!==Y[ne]})}function Pe(Y,G){return"function"==typeof G?G(Y):G}function Ye(Y,G){for(var $ in G)Y[$]=G[$];return Y}function we(Y,G){for(var $ in Y)if("__source"!==$&&!($ in G))return!0;for(var ne in G)if("__source"!==ne&&Y[ne]!==G[ne])return!0;return!1}s.__r=function(Y){P&&P(Y),I=0,(W=Y.__c).__H&&(W.__H.__h.forEach(Te),W.__H.__h.forEach(Ve),W.__H.__h=[])},s.diffed=function(Y){j&&j(Y);var G=Y.__c;if(G){var $=G.__H;$&&$.__h.length&&(1!==N.push(G)&&F===s.requestAnimationFrame||((F=s.requestAnimationFrame)||function(ne){var ce,ue=function(){clearTimeout(Ce),cancelAnimationFrame(ce),setTimeout(ne)},Ce=setTimeout(ue,100);typeof window<"u"&&(ce=requestAnimationFrame(ue))})(pe))}},s.__c=function(Y,G){G.some(function($){try{$.__h.forEach(Te),$.__h=$.__h.filter(function(ne){return!ne.__||Ve(ne)})}catch(ne){G.some(function(ce){ce.__h&&(ce.__h=[])}),G=[],s.__e(ne,$.__v)}}),K&&K(Y,G)},s.unmount=function(Y){Z&&Z(Y);var G=Y.__c;if(G){var $=G.__H;if($)try{$.__.forEach(function(ne){return ne.t&&ne.t()})}catch(ne){s.__e(ne,G.__v)}}},c.d(l,"version",function(){return We}),c.d(l,"Children",function(){return se}),c.d(l,"render",function(){return Ne}),c.d(l,"hydrate",function(){return it}),c.d(l,"unmountComponentAtNode",function(){return nt}),c.d(l,"createPortal",function(){return He}),c.d(l,"createFactory",function(){return tt}),c.d(l,"cloneElement",function(){return Fe}),c.d(l,"isValidElement",function(){return Se}),c.d(l,"findDOMNode",function(){return Ae}),c.d(l,"PureComponent",function(){return Be}),c.d(l,"memo",function(){return $e}),c.d(l,"forwardRef",function(){return je}),c.d(l,"unstable_batchedUpdates",function(){return Ue}),c.d(l,"Suspense",function(){return he}),c.d(l,"SuspenseList",function(){return me}),c.d(l,"lazy",function(){return Ge}),c.d(l,"useState",function(){return X}),c.d(l,"useReducer",function(){return ee}),c.d(l,"useEffect",function(){return te}),c.d(l,"useLayoutEffect",function(){return oe}),c.d(l,"useRef",function(){return ve}),c.d(l,"useImperativeHandle",function(){return ie}),c.d(l,"useMemo",function(){return de}),c.d(l,"useCallback",function(){return fe}),c.d(l,"useContext",function(){return re}),c.d(l,"useDebugValue",function(){return _e}),c.d(l,"useErrorBoundary",function(){return Ke}),c.d(l,"createElement",function(){return _}),c.d(l,"createContext",function(){return V}),c.d(l,"createRef",function(){return T}),c.d(l,"Fragment",function(){return O}),c.d(l,"Component",function(){return b});var Be=function(Y){var G,$;function ne(ce){var ue;return(ue=Y.call(this,ce)||this).isPureReactComponent=!0,ue}return $=Y,(G=ne).prototype=Object.create($.prototype),G.prototype.constructor=G,G.__proto__=$,ne.prototype.shouldComponentUpdate=function(ce,ue){return we(this.props,ce)||we(this.state,ue)},ne}(b);function $e(Y,G){function $(ce){var ue=this.props.ref,Ce=ue==ce.ref;return!Ce&&ue&&(ue.call?ue(null):ue.current=null),G?!G(this.props,ce)||!Ce:we(this.props,ce)}function ne(ce){return this.shouldComponentUpdate=$,_(Y,Ye({},ce))}return ne.prototype.isReactComponent=!0,ne.displayName="Memo("+(Y.displayName||Y.name)+")",ne.t=!0,ne}var Me=s.__b;function je(Y){function G($){var ne=Ye({},$);return delete ne.ref,Y(ne,$.ref)}return G.prototype.isReactComponent=G.t=!0,G.displayName="ForwardRef("+(Y.displayName||Y.name)+")",G}s.__b=function(Y){Y.type&&Y.type.t&&Y.ref&&(Y.props.ref=Y.ref,Y.ref=null),Me&&Me(Y)};var Q=function(Y,G){return Y?D(Y).reduce(function($,ne,ce){return $.concat(G(ne,ce))},[]):null},se={map:Q,forEach:Q,count:function(Y){return Y?D(Y).length:0},only:function(Y){if(1!==(Y=D(Y)).length)throw new Error("Children.only() expects only one child.");return Y[0]},toArray:D},le=s.__e;function Le(Y){return Y&&((Y=Ye({},Y)).__c=null,Y.__k=Y.__k&&Y.__k.map(Le)),Y}function he(){this.__u=0,this.o=null,this.__b=null}function Oe(Y){var G=Y.__.__c;return G&&G.u&&G.u(Y)}function Ge(Y){var G,$,ne;function ce(ue){if(G||(G=Y()).then(function(Ce){$=Ce.default||Ce},function(Ce){ne=Ce}),ne)throw ne;if(!$)throw G;return _($,ue)}return ce.displayName="Lazy",ce.t=!0,ce}function me(){this.i=null,this.l=null}s.__e=function(Y,G,$){if(Y.then)for(var ne,ce=G;ce=ce.__;)if((ne=ce.__c)&&ne.__c)return ne.__c(Y,G.__c);le(Y,G,$)},(he.prototype=new b).__c=function(Y,G){var $=this;null==$.o&&($.o=[]),$.o.push(G);var ne=Oe($.__v),ce=!1,ue=function(){ce||(ce=!0,ne?ne(Ce):Ce())};G.__c=G.componentWillUnmount,G.componentWillUnmount=function(){ue(),G.__c&&G.__c()};var Ce=function(){var Ie;if(!--$.__u)for($.__v.__k[0]=$.state.u,$.setState({u:$.__b=null});Ie=$.o.pop();)Ie.forceUpdate()};$.__u++||$.setState({u:$.__b=$.__v.__k[0]}),Y.then(ue,ue)},he.prototype.render=function(Y,G){return this.__b&&(this.__v.__k[0]=Le(this.__b),this.__b=null),[_(b,null,G.u?null:Y.children),G.u&&Y.fallback]};var ze=function(Y,G,$){if(++$[1]===$[0]&&Y.l.delete(G),Y.props.revealOrder&&("t"!==Y.props.revealOrder[0]||!Y.l.size))for($=Y.i;$;){for(;$.length>3;)$.pop()();if($[1]<$[0])break;Y.i=$=$[2]}};(me.prototype=new b).u=function(Y){var G=this,$=Oe(G.__v),ne=G.l.get(Y);return ne[0]++,function(ce){var ue=function(){G.props.revealOrder?(ne.push(ce),ze(G,Y,ne)):ce()};$?$(ue):ue()}},me.prototype.render=function(Y){this.i=null,this.l=new Map;var G=D(Y.children);Y.revealOrder&&"b"===Y.revealOrder[0]&&G.reverse();for(var $=G.length;$--;)this.l.set(G[$],this.i=[1,0,this.i]);return Y.children},me.prototype.componentDidUpdate=me.prototype.componentDidMount=function(){var Y=this;Y.l.forEach(function(G,$){ze(Y,$,G)})};var rt=function(){function Y(){}var G=Y.prototype;return G.getChildContext=function(){return this.props.context},G.render=function($){return $.children},Y}();function Re(Y){var G=this,$=Y.container,ne=_(rt,{context:G.context},Y.vnode);return G.s&&G.s!==$&&(G.v.parentNode&&G.s.removeChild(G.v),g(G.h),G.p=!1),Y.vnode?G.p?($.__k=G.__k,E(ne,$),G.__k=$.__k):(G.v=document.createTextNode(""),C("",$),$.appendChild(G.v),G.p=!0,G.s=$,E(ne,$,G.v),G.__k=G.v.__k):G.p&&(G.v.parentNode&&G.s.removeChild(G.v),g(G.h)),G.h=ne,G.componentWillUnmount=function(){G.v.parentNode&&G.s.removeChild(G.v),g(G.h)},null}function He(Y,G){return _(Re,{vnode:Y,container:G})}var Qe=/^(?: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]/;b.prototype.isReactComponent={};var Ee=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103;function Ne(Y,G,$){if(null==G.__k)for(;G.firstChild;)G.removeChild(G.firstChild);return E(Y,G),"function"==typeof $&&$(),Y?Y.__c:null}function it(Y,G,$){return C(Y,G),"function"==typeof $&&$(),Y?Y.__c:null}var xe=s.event;function qe(Y,G){Y["UNSAFE_"+G]&&!Y[G]&&Object.defineProperty(Y,G,{configurable:!1,get:function(){return this["UNSAFE_"+G]},set:function($){this["UNSAFE_"+G]=$}})}s.event=function(Y){xe&&(Y=xe(Y)),Y.persist=function(){};var G=!1,$=!1,ne=Y.stopPropagation;Y.stopPropagation=function(){ne.call(Y),G=!0};var ce=Y.preventDefault;return Y.preventDefault=function(){ce.call(Y),$=!0},Y.isPropagationStopped=function(){return G},Y.isDefaultPrevented=function(){return $},Y.nativeEvent=Y};var et={configurable:!0,get:function(){return this.class}},ke=s.vnode;s.vnode=function(Y){Y.$$typeof=Ee;var G=Y.type,$=Y.props;if(G){if($.class!=$.className&&(et.enumerable="className"in $,null!=$.className&&($.class=$.className),Object.defineProperty($,"className",et)),"function"!=typeof G){var ne,ce,ue;for(ue in $.defaultValue&&void 0!==$.value&&($.value||0===$.value||($.value=$.defaultValue),delete $.defaultValue),Array.isArray($.value)&&$.multiple&&"select"===G&&(D($.children).forEach(function(Ce){-1!=$.value.indexOf(Ce.props.value)&&(Ce.props.selected=!0)}),delete $.value),$)if(ne=Qe.test(ue))break;if(ne)for(ue in ce=Y.props={},$)ce[Qe.test(ue)?ue.replace(/[A-Z0-9]/,"-$&").toLowerCase():ue]=$[ue]}(function(Ce){var Ie=Y.type,De=Y.props;if(De&&"string"==typeof Ie){var ye={};for(var ae in De)/^on(Ani|Tra|Tou)/.test(ae)&&(De[ae.toLowerCase()]=De[ae],delete De[ae]),ye[ae.toLowerCase()]=ae;if(ye.ondoubleclick&&(De.ondblclick=De[ye.ondoubleclick],delete De[ye.ondoubleclick]),ye.onbeforeinput&&(De.onbeforeinput=De[ye.onbeforeinput],delete De[ye.onbeforeinput]),ye.onchange&&("textarea"===Ie||"input"===Ie.toLowerCase()&&!/^fil|che|ra/i.test(De.type))){var Je=ye.oninput||"oninput";De[Je]||(De[Je]=De[ye.onchange],delete De[ye.onchange])}}})(),"function"==typeof G&&!G.m&&G.prototype&&(qe(G.prototype,"componentWillMount"),qe(G.prototype,"componentWillReceiveProps"),qe(G.prototype,"componentWillUpdate"),G.m=!0)}ke&&ke(Y)};var We="16.8.0";function tt(Y){return _.bind(null,Y)}function Se(Y){return!!Y&&Y.$$typeof===Ee}function Fe(Y){return Se(Y)?U.apply(null,arguments):Y}function nt(Y){return!!Y.__k&&(E(null,Y),!0)}function Ae(Y){return Y&&(Y.base||1===Y.nodeType&&Y)||null}var Ue=function(Y,G){return Y(G)};l.default={useState:X,useReducer:ee,useEffect:te,useLayoutEffect:oe,useRef:ve,useImperativeHandle:ie,useMemo:de,useCallback:fe,useContext:re,useDebugValue:_e,version:"16.8.0",Children:se,render:Ne,hydrate:Ne,unmountComponentAtNode:nt,createPortal:He,createElement:_,createContext:V,createFactory:tt,cloneElement:Fe,createRef:T,Fragment:O,isValidElement:Se,findDOMNode:Ae,Component:b,PureComponent:Be,memo:$e,forwardRef:je,unstable_batchedUpdates:Ue,Suspense:he,SuspenseList:me,lazy:Ge}}])}}]); \ No newline at end of file diff --git a/angular-bare-bones-demo/dist/178.98f1ea41dd03415e.js b/angular-bare-bones-demo/dist/178.98f1ea41dd03415e.js new file mode 100644 index 000000000..a7a2c9968 --- /dev/null +++ b/angular-bare-bones-demo/dist/178.98f1ea41dd03415e.js @@ -0,0 +1 @@ +(self.webpackChunkAngular_bare_bones_demo=self.webpackChunkAngular_bare_bones_demo||[]).push([[178],{88178:(Pe,g,D)=>{"use strict";D.r(g),D.d(g,{WC_DEFAULT_RPC_MAP:()=>ev,WC_V2_DEFAULT_CHAINS:()=>tv,getWalletConnectV2ProviderInstance:()=>rv});var I={};D.r(I),D.d(I,{identity:()=>Ye});var re={};D.r(re),D.d(re,{base2:()=>lt});var ne={};D.r(ne),D.d(ne,{base8:()=>dt});var k={};D.r(k),D.d(k,{base10:()=>bt});var $={};D.r($),D.d($,{base16:()=>Et,base16upper:()=>yt});var te={};D.r(te),D.d(te,{base36:()=>St,base36upper:()=>qr});var H={};D.r(H),D.d(H,{base64:()=>cn,base64pad:()=>Rn,base64url:()=>Kn,base64urlpad:()=>Pn});var M={};D.r(M),D.d(M,{base256emoji:()=>ir});var C={};D.r(C),D.d(C,{sha256:()=>sr,sha512:()=>or});var L={};D.r(L),D.d(L,{identity:()=>ar});var ce={};D.r(ce),D.d(ce,{code:()=>ea,decode:()=>ta,encode:()=>ln,name:()=>ur});var de={};function ue(u,t,r,o,a,l,m){try{var T=u[l](m),X=T.value}catch(Q){return void r(Q)}T.done?t(X):Promise.resolve(X).then(o,a)}function O(u){return function(){var t=this,r=arguments;return new Promise(function(o,a){var l=u.apply(t,r);function m(X){ue(l,o,a,m,T,"next",X)}function T(X){ue(l,o,a,m,T,"throw",X)}m(void 0)})}}D.r(de),D.d(de,{code:()=>sa,decode:()=>oa,encode:()=>An,name:()=>ia});var _e=D(2272),De=D.n(_e),we=D(83169),ee=D(40851),B=D(71268),J=D(43795);class F extends J.q{constructor(t){super(),this.opts=t,this.protocol="wc",this.version=2}}class U extends J.q{constructor(t,r){super(),this.core=t,this.logger=r,this.records=new Map}}class f extends J.q{constructor(t,r){super(),this.relayer=t,this.logger=r}}class _ extends J.q{constructor(t){super()}}class b extends J.q{constructor(t,r){super(),this.relayer=t,this.logger=r}}class x extends J.q{constructor(t,r){super(),this.core=t,this.logger=r}}function xe(u){if("string"!=typeof u)throw new Error("Cannot safe json parse value of type "+typeof u);try{return(u=>{const r=u.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(r,(o,a)=>"string"==typeof a&&a.match(/^\d+n$/)?BigInt(a.substring(0,a.length-1)):a)})(u)}catch{return u}}function Ce(u){return"string"==typeof u?u:(u=>JSON.stringify(u,(t,r)=>"bigint"==typeof r?r.toString()+"n":r))(u)||""}var Fe=D(52877),je=D(7841),Z=D(40145);const Y="base64url",wt="did",ct="key",_t="base58btc";function it(u){return null!=globalThis.Buffer?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):u}function rt(u=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?it(globalThis.Buffer.allocUnsafe(u)):new Uint8Array(u)}function Ge(u,t){t||(t=u.reduce((a,l)=>a+l.length,0));const r=rt(t);let o=0;for(const a of u)r.set(a,o),o+=a.length;return it(r)}var He=D(29161),We=D(91744);const Ye=(0,He.Dp)({prefix:"\0",name:"identity",encode:u=>(0,We.toString)(u),decode:u=>(0,We.fromString)(u)}),lt=(0,He.ET)({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),dt=(0,He.ET)({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),bt=(0,He.kU)({prefix:"9",name:"base10",alphabet:"0123456789"}),Et=(0,He.ET)({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),yt=(0,He.ET)({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Dt=D(79515);const St=(0,He.kU)({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),qr=(0,He.kU)({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Er=D(59942);const cn=(0,He.ET)({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Rn=(0,He.ET)({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Kn=(0,He.ET)({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Pn=(0,He.ET)({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),fn=Array.from("\u{1f680}\u{1fa90}\u2604\u{1f6f0}\u{1f30c}\u{1f311}\u{1f312}\u{1f313}\u{1f314}\u{1f315}\u{1f316}\u{1f317}\u{1f318}\u{1f30d}\u{1f30f}\u{1f30e}\u{1f409}\u2600\u{1f4bb}\u{1f5a5}\u{1f4be}\u{1f4bf}\u{1f602}\u2764\u{1f60d}\u{1f923}\u{1f60a}\u{1f64f}\u{1f495}\u{1f62d}\u{1f618}\u{1f44d}\u{1f605}\u{1f44f}\u{1f601}\u{1f525}\u{1f970}\u{1f494}\u{1f496}\u{1f499}\u{1f622}\u{1f914}\u{1f606}\u{1f644}\u{1f4aa}\u{1f609}\u263a\u{1f44c}\u{1f917}\u{1f49c}\u{1f614}\u{1f60e}\u{1f607}\u{1f339}\u{1f926}\u{1f389}\u{1f49e}\u270c\u2728\u{1f937}\u{1f631}\u{1f60c}\u{1f338}\u{1f64c}\u{1f60b}\u{1f497}\u{1f49a}\u{1f60f}\u{1f49b}\u{1f642}\u{1f493}\u{1f929}\u{1f604}\u{1f600}\u{1f5a4}\u{1f603}\u{1f4af}\u{1f648}\u{1f447}\u{1f3b6}\u{1f612}\u{1f92d}\u2763\u{1f61c}\u{1f48b}\u{1f440}\u{1f62a}\u{1f611}\u{1f4a5}\u{1f64b}\u{1f61e}\u{1f629}\u{1f621}\u{1f92a}\u{1f44a}\u{1f973}\u{1f625}\u{1f924}\u{1f449}\u{1f483}\u{1f633}\u270b\u{1f61a}\u{1f61d}\u{1f634}\u{1f31f}\u{1f62c}\u{1f643}\u{1f340}\u{1f337}\u{1f63b}\u{1f613}\u2b50\u2705\u{1f97a}\u{1f308}\u{1f608}\u{1f918}\u{1f4a6}\u2714\u{1f623}\u{1f3c3}\u{1f490}\u2639\u{1f38a}\u{1f498}\u{1f620}\u261d\u{1f615}\u{1f33a}\u{1f382}\u{1f33b}\u{1f610}\u{1f595}\u{1f49d}\u{1f64a}\u{1f639}\u{1f5e3}\u{1f4ab}\u{1f480}\u{1f451}\u{1f3b5}\u{1f91e}\u{1f61b}\u{1f534}\u{1f624}\u{1f33c}\u{1f62b}\u26bd\u{1f919}\u2615\u{1f3c6}\u{1f92b}\u{1f448}\u{1f62e}\u{1f646}\u{1f37b}\u{1f343}\u{1f436}\u{1f481}\u{1f632}\u{1f33f}\u{1f9e1}\u{1f381}\u26a1\u{1f31e}\u{1f388}\u274c\u270a\u{1f44b}\u{1f630}\u{1f928}\u{1f636}\u{1f91d}\u{1f6b6}\u{1f4b0}\u{1f353}\u{1f4a2}\u{1f91f}\u{1f641}\u{1f6a8}\u{1f4a8}\u{1f92c}\u2708\u{1f380}\u{1f37a}\u{1f913}\u{1f619}\u{1f49f}\u{1f331}\u{1f616}\u{1f476}\u{1f974}\u25b6\u27a1\u2753\u{1f48e}\u{1f4b8}\u2b07\u{1f628}\u{1f31a}\u{1f98b}\u{1f637}\u{1f57a}\u26a0\u{1f645}\u{1f61f}\u{1f635}\u{1f44e}\u{1f932}\u{1f920}\u{1f927}\u{1f4cc}\u{1f535}\u{1f485}\u{1f9d0}\u{1f43e}\u{1f352}\u{1f617}\u{1f911}\u{1f30a}\u{1f92f}\u{1f437}\u260e\u{1f4a7}\u{1f62f}\u{1f486}\u{1f446}\u{1f3a4}\u{1f647}\u{1f351}\u2744\u{1f334}\u{1f4a3}\u{1f438}\u{1f48c}\u{1f4cd}\u{1f940}\u{1f922}\u{1f445}\u{1f4a1}\u{1f4a9}\u{1f450}\u{1f4f8}\u{1f47b}\u{1f910}\u{1f92e}\u{1f3bc}\u{1f975}\u{1f6a9}\u{1f34e}\u{1f34a}\u{1f47c}\u{1f48d}\u{1f4e3}\u{1f942}"),Wt=fn.reduce((u,t,r)=>(u[r]=t,u),[]),Gt=fn.reduce((u,t,r)=>(u[t.codePointAt(0)]=r,u),[]),ir=(0,He.Dp)({prefix:"\u{1f680}",name:"base256emoji",encode:function Yt(u){return u.reduce((t,r)=>t+Wt[r],"")},decode:function $t(u){const t=[];for(const r of u){const o=Gt[r.codePointAt(0)];if(void 0===o)throw new Error(`Non-base256emoji character: ${r}`);t.push(o)}return new Uint8Array(t)}});var Zt=D(53907);const Qt=u=>function(){var t=O(function*(r){return new Uint8Array(yield crypto.subtle.digest(u,r))});return function(r){return t.apply(this,arguments)}}(),sr=(0,Zt.from)({name:"sha2-256",code:18,encode:Qt("SHA-256")}),or=(0,Zt.from)({name:"sha2-512",code:19,encode:Qt("SHA-512")});var kt=D(22834);const er=We.coerce,ar={code:0,name:"identity",encode:er,digest:u=>kt.create(0,er(u))},ur="raw",ea=85,ln=u=>(0,We.coerce)(u),ta=u=>(0,We.coerce)(u),ra=new TextEncoder,na=new TextDecoder,ia="json",sa=512,An=u=>ra.encode(JSON.stringify(u)),oa=u=>JSON.parse(na.decode(u));D(8422);const js={...I,...re,...ne,...k,...$,...Dt,...te,...Er,...H,...M};function ai(u,t,r,o){return{name:u,prefix:t,encoder:{name:u,prefix:t,encode:r},decoder:{decode:o}}}const Ms=ai("utf8","u",u=>"u"+new TextDecoder("utf8").decode(u),u=>(new TextEncoder).encode(u.substring(1))),ki=ai("ascii","a",u=>{let t="a";for(let r=0;r{const t=rt((u=u.substring(1)).length);for(let r=0;r"u")throw new Error("missing sender public key");if(typeof u?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:u?.senderPublicKey,receiverPublicKey:u?.receiverPublicKey}}function Dc(u){return 1===u.type&&"string"==typeof u.senderPublicKey&&"string"==typeof u.receiverPublicKey}var Id=Object.defineProperty,xc=Object.getOwnPropertySymbols,Rd=Object.prototype.hasOwnProperty,Pd=Object.prototype.propertyIsEnumerable,Sc=(u,t,r)=>t in u?Id(u,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[t]=r,Oc=(u,t)=>{for(var r in t||(t={}))Rd.call(t,r)&&Sc(u,r,t[r]);if(xc)for(var r of xc(t))Pd.call(t,r)&&Sc(u,r,t[r]);return u};const Td="js";function Sa(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Oa(){return!Sa()&&!!(0,Ai.getNavigator)()}function Md(u,t,r){const o=function Fd(){const u=function ns(u){return u?is(u):typeof document>"u"&&typeof navigator<"u"&&"ReactNative"===navigator.product?new ya:typeof navigator<"u"?is(navigator.userAgent):function fi(){return typeof process<"u"&&process.version?new da(process.version.slice(1)):null}()}();if(null===u)return"unknown";const t=u.os?u.os.replace(" ","").toLowerCase():"unknown";return"browser"===u.type?[t,u.name,u.version].join("-"):[t,u.version].join("-")}(),a=function jd(){var u;const t=function Rc(){return function Nd(){return!(0,Ai.getDocument)()&&!!(0,Ai.getNavigator)()&&"ReactNative"===navigator.product}()?"react-native":Sa()?"node":Oa()?"browser":"unknown"}();return"browser"===t?[t,(null==(u=(0,Ai.getLocation)())?void 0:u.host)||"unknown"].join(":"):t}();return[[u,t].join("-"),[Td,r].join("-"),o,a].join("/")}function di(u,t){return u.filter(r=>t.includes(r)).length===u.length}function Pc(u){return Object.fromEntries(u.entries())}function Ac(u){return new Map(Object.entries(u))}function Ni(u=Z.FIVE_MINUTES,t){const r=(0,Z.toMiliseconds)(u||Z.FIVE_MINUTES);let o,a,l;return{resolve:m=>{l&&o&&(clearTimeout(l),o(m))},reject:m=>{l&&a&&(clearTimeout(l),a(m))},done:()=>new Promise((m,T)=>{l=setTimeout(()=>{T(new Error(t))},r),o=m,a=T})}}function Qs(u,t,r){return new Promise(function(){var o=O(function*(a,l){const m=setTimeout(()=>l(new Error(r)),t);try{a(yield u)}catch(T){l(T)}clearTimeout(m)});return function(a,l){return o.apply(this,arguments)}}())}function Cc(u,t){if("string"==typeof t&&t.startsWith(`${u}:`))return t;if("topic"===u.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===u.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${u}`)}function Tc(u){const[t,r]=u.split(":"),o={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)o.topic=r;else{if("id"!==t||!Number.isInteger(Number(r)))throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);o.id=Number(r)}return o}function pn(u,t){return(0,Z.fromMiliseconds)((t||Date.now())+(0,Z.toMiliseconds)(u))}function Wn(u){return Date.now()>=(0,Z.toMiliseconds)(u)}function cr(u,t){return`${u}${t?`:${t}`:""}`}function En(u=[],t=[]){return[...new Set([...u,...t])]}function Ia(u){return u?.relay||{protocol:"irn"}}function ks(u){const t=oe[u];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${u}`);return t}var Wd=Object.defineProperty,Nc=Object.getOwnPropertySymbols,Gd=Object.prototype.hasOwnProperty,Yd=Object.prototype.propertyIsEnumerable,Uc=(u,t,r)=>t in u?Wd(u,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[t]=r;function Xd(u,t="-"){const r={},o="relay"+t;return Object.keys(u).forEach(a=>{if(a.startsWith(o)){const l=a.replace(o,"");r[l]=u[a]}}),r}function Ui(u){const t=[];return u.forEach(r=>{const[o,a]=r.split(":");t.push(`${o}:${a}`)}),t}function Ra(u){return u.includes(":")}function us(u){return Ra(u)?u.split(":")[0]:u}const lp={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},hp={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Ne(u,t){const{message:r,code:o}=hp[u];return{message:t?`${r} ${t}`:r,code:o}}function fr(u,t){const{message:r,code:o}=lp[u];return{message:t?`${r} ${t}`:r,code:o}}function Li(u,t){return!!Array.isArray(u)&&(!(typeof t<"u"&&u.length)||u.every(t))}function pi(u){return Object.getPrototypeOf(u)===Object.prototype&&Object.keys(u).length}function Ar(u){return typeof u>"u"}function vr(u,t){return!(!t||!Ar(u))||"string"==typeof u&&Boolean(u.trim().length)}function Pa(u,t){return!(!t||!Ar(u))||"number"==typeof u&&!isNaN(u)}function Aa(u){return!(!vr(u,!1)||!u.includes(":"))&&2===u.split(":").length}function Mc(u){let t=!0;return Li(u)?u.length&&(t=u.every(r=>vr(r,!1))):t=!1,t}function Bc(u,t){let r=null;return Object.values(u).forEach(o=>{if(r)return;const a=function Dp(u,t){let r=null;return Mc(u?.methods)?Mc(u?.events)||(r=fr("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=fr("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}(o,`${t}, namespace`);a&&(r=a)}),r}function eo(u,t){let r=null;if(u&&pi(u)){const o=Bc(u,t);o&&(r=o);const a=function wp(u,t){let r=null;return Object.values(u).forEach(o=>{if(r)return;const a=function Ep(u,t){let r=null;return Li(u)?u.forEach(o=>{r||function pp(u){if(vr(u,!1)&&u.includes(":")){const t=u.split(":");if(3===t.length){const r=t[0]+":"+t[1];return!!t[2]&&Aa(r)}}return!1}(o)||(r=fr("UNSUPPORTED_ACCOUNTS",`${t}, account ${o} should be a string and conform to "namespace:chainId:address" format`))}):r=fr("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}(o?.accounts,`${t} namespace`);a&&(r=a)}),r}(u,t);a&&(r=a)}else r=Ne("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function Hc(u){return vr(u.protocol,!0)}function Lr(u){return typeof u<"u"&&null!==typeof u}function $c(u,t){return!(!Aa(t)||!function ap(u){const t=[];return Object.values(u).forEach(r=>{t.push(...Ui(r.accounts))}),t}(u).includes(t))}function Ca(u,t,r){let o=null;const a=function Np(u){const t={};return Object.keys(u).forEach(r=>{var o;r.includes(":")?t[r]=u[r]:null==(o=u[r].chains)||o.forEach(a=>{t[a]={methods:u[r].methods,events:u[r].events}})}),t}(u),l=function Up(u){const t={};return Object.keys(u).forEach(r=>{r.includes(":")?t[r]=u[r]:Ui(u[r].accounts)?.forEach(a=>{t[a]={accounts:u[r].accounts.filter(l=>l.includes(`${a}:`)),methods:u[r].methods,events:u[r].events}})}),t}(t),m=Object.keys(a),T=Object.keys(l),X=zc(Object.keys(u)),Q=zc(Object.keys(t)),ge=X.filter(Oe=>!Q.includes(Oe));return ge.length&&(o=Ne("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${ge.toString()}\n Received: ${Object.keys(t).toString()}`)),di(m,T)||(o=Ne("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${m.toString()}\n Approved: ${T.toString()}`)),Object.keys(t).forEach(Oe=>{if(!Oe.includes(":")||o)return;const Xe=Ui(t[Oe].accounts);Xe.includes(Oe)||(o=Ne("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${Oe}\n Required: ${Oe}\n Approved: ${Xe.toString()}`))}),m.forEach(Oe=>{o||(di(a[Oe].methods,l[Oe].methods)?di(a[Oe].events,l[Oe].events)||(o=Ne("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${Oe}`)):o=Ne("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${Oe}`))}),o}function zc(u){return[...new Set(u.map(t=>t.includes(":")?t.split(":")[0]:t))]}var qe=D(80663);class Gn extends qe.IJsonRpcProvider{constructor(t){super(t),this.events=new _e.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}connect(t=this.connection){var r=this;return O(function*(){yield r.open(t)})()}disconnect(){var t=this;return O(function*(){yield t.close()})()}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}request(t,r){var o=this;return O(function*(){return o.requestStrict((0,qe.formatJsonRpcRequest)(t.method,t.params||[],(0,qe.getBigIntRpcId)().toString()),r)})()}requestStrict(t,r){var o=this;return O(function*(){return new Promise(function(){var a=O(function*(l,m){if(!o.connection.connected)try{yield o.open()}catch(T){m(T)}o.events.on(`${t.id}`,T=>{(0,qe.isJsonRpcError)(T)?m(T.error):l(T.result)});try{yield o.connection.send(t,r)}catch(T){m(T)}});return function(l,m){return a.apply(this,arguments)}}())})()}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),(0,qe.isJsonRpcResponse)(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&3e3===t.code&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}open(t=this.connection){var r=this;return O(function*(){r.connection===t&&r.connection.connected||(r.connection.connected&&r.close(),"string"==typeof t&&(yield r.connection.open(t),t=r.connection),r.connection=r.setConnection(t),yield r.connection.open(),r.registerEventListeners(),r.events.emit("connect"))})()}close(){var t=this;return O(function*(){yield t.connection.close()})()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const Mp=typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:D(82791);var $p=D(60066),zp=D.n($p),Vp=function Jp(u,t){if(u.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),o=0;o>>0,Ct=new Uint8Array(dr);Be[tt];){var Pt=r[Be.charCodeAt(tt)];if(255===Pt)return;for(var vt=0,Ut=dr-1;(0!==Pt||vt>>0)%256>>>0,Pt=Pt/256>>>0;if(0!==Pt)throw new Error("Non-zero carry");Nt=vt,tt++}if(" "!==Be[tt]){for(var Ot=dr-Nt;Ot!==dr&&0===Ct[Ot];)Ot++;for(var _r=new Uint8Array(Qe+(dr-Ot)),Xn=Qe;Ot!==dr;)_r[Xn++]=Ct[Ot++];return _r}}}return{encode:function Oe(Be){if(Be instanceof Uint8Array||(ArrayBuffer.isView(Be)?Be=new Uint8Array(Be.buffer,Be.byteOffset,Be.byteLength):Array.isArray(Be)&&(Be=Uint8Array.from(Be))),!(Be instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===Be.length)return"";for(var tt=0,Qe=0,Nt=0,dr=Be.length;Nt!==dr&&0===Be[Nt];)Nt++,tt++;for(var Ct=(dr-Nt)*ge+1>>>0,Pt=new Uint8Array(Ct);Nt!==dr;){for(var vt=Be[Nt],Ut=0,Ot=Ct-1;(0!==vt||Ut>>0)%T>>>0,vt=vt/T>>>0;if(0!==vt)throw new Error("Non-zero carry");Qe=Ut,Nt++}for(var _r=Ct-Qe;_r!==Ct&&0===Pt[_r];)_r++;for(var Xn=X.repeat(tt);_r{if(u instanceof Uint8Array&&"Uint8Array"===u.constructor.name)return u;if(u instanceof ArrayBuffer)return new Uint8Array(u);if(ArrayBuffer.isView(u))return new Uint8Array(u.buffer,u.byteOffset,u.byteLength);throw new Error("Unknown type, must be binary type")};class Yp{constructor(t,r,o){this.name=t,this.prefix=r,this.baseEncode=o}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class qp{constructor(t,r,o){if(this.name=t,this.prefix=r,void 0===r.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=o}decode(t){if("string"==typeof t){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return Vc(this,t)}}class Xp{constructor(t){this.decoders=t}or(t){return Vc(this,t)}decode(t){const o=this.decoders[t[0]];if(o)return o.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Vc=(u,t)=>new Xp({...u.decoders||{[u.prefix]:u},...t.decoders||{[t.prefix]:t}});class Zp{constructor(t,r,o,a){this.name=t,this.prefix=r,this.baseEncode=o,this.baseDecode=a,this.encoder=new Yp(t,r,o),this.decoder=new qp(t,r,a)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const to=({name:u,prefix:t,encode:r,decode:o})=>new Zp(u,t,r,o),cs=({prefix:u,name:t,alphabet:r})=>{const{encode:o,decode:a}=Vp(r,t);return to({prefix:u,name:t,encode:o,decode:l=>Kc(a(l))})},Dr=({name:u,prefix:t,bitsPerChar:r,alphabet:o})=>to({prefix:t,name:u,encode:a=>((u,t,r)=>{const o="="===t[t.length-1],a=(1<r;)m-=r,l+=t[a&T>>m];if(m&&(l+=t[a&T<((u,t,r,o)=>{const a={};for(let ge=0;ge=8&&(T-=8,m[Q++]=255&X>>T)}if(T>=r||255&X<<8-T)throw new SyntaxError("Unexpected end of data");return m})(a,o,r,u)}),eg=to({prefix:"\0",name:"identity",encode:u=>(u=>(new TextDecoder).decode(u))(u),decode:u=>(u=>(new TextEncoder).encode(u))(u)});var tg=Object.freeze({__proto__:null,identity:eg});const rg=Dr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ng=Object.freeze({__proto__:null,base2:rg});const ig=Dr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var sg=Object.freeze({__proto__:null,base8:ig});const og=cs({prefix:"9",name:"base10",alphabet:"0123456789"});var ag=Object.freeze({__proto__:null,base10:og});const ug=Dr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),cg=Dr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var fg=Object.freeze({__proto__:null,base16:ug,base16upper:cg});const lg=Dr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),hg=Dr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),dg=Dr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),pg=Dr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),gg=Dr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),yg=Dr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),vg=Dr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),mg=Dr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),_g=Dr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var bg=Object.freeze({__proto__:null,base32:lg,base32upper:hg,base32pad:dg,base32padupper:pg,base32hex:gg,base32hexupper:yg,base32hexpad:vg,base32hexpadupper:mg,base32z:_g});const Eg=cs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),wg=cs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Dg=Object.freeze({__proto__:null,base36:Eg,base36upper:wg});const xg=cs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Sg=cs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Og=Object.freeze({__proto__:null,base58btc:xg,base58flickr:Sg});const Ig=Dr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Rg=Dr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Pg=Dr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ag=Dr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Cg=Object.freeze({__proto__:null,base64:Ig,base64pad:Rg,base64url:Pg,base64urlpad:Ag});const Wc=Array.from("\u{1f680}\u{1fa90}\u2604\u{1f6f0}\u{1f30c}\u{1f311}\u{1f312}\u{1f313}\u{1f314}\u{1f315}\u{1f316}\u{1f317}\u{1f318}\u{1f30d}\u{1f30f}\u{1f30e}\u{1f409}\u2600\u{1f4bb}\u{1f5a5}\u{1f4be}\u{1f4bf}\u{1f602}\u2764\u{1f60d}\u{1f923}\u{1f60a}\u{1f64f}\u{1f495}\u{1f62d}\u{1f618}\u{1f44d}\u{1f605}\u{1f44f}\u{1f601}\u{1f525}\u{1f970}\u{1f494}\u{1f496}\u{1f499}\u{1f622}\u{1f914}\u{1f606}\u{1f644}\u{1f4aa}\u{1f609}\u263a\u{1f44c}\u{1f917}\u{1f49c}\u{1f614}\u{1f60e}\u{1f607}\u{1f339}\u{1f926}\u{1f389}\u{1f49e}\u270c\u2728\u{1f937}\u{1f631}\u{1f60c}\u{1f338}\u{1f64c}\u{1f60b}\u{1f497}\u{1f49a}\u{1f60f}\u{1f49b}\u{1f642}\u{1f493}\u{1f929}\u{1f604}\u{1f600}\u{1f5a4}\u{1f603}\u{1f4af}\u{1f648}\u{1f447}\u{1f3b6}\u{1f612}\u{1f92d}\u2763\u{1f61c}\u{1f48b}\u{1f440}\u{1f62a}\u{1f611}\u{1f4a5}\u{1f64b}\u{1f61e}\u{1f629}\u{1f621}\u{1f92a}\u{1f44a}\u{1f973}\u{1f625}\u{1f924}\u{1f449}\u{1f483}\u{1f633}\u270b\u{1f61a}\u{1f61d}\u{1f634}\u{1f31f}\u{1f62c}\u{1f643}\u{1f340}\u{1f337}\u{1f63b}\u{1f613}\u2b50\u2705\u{1f97a}\u{1f308}\u{1f608}\u{1f918}\u{1f4a6}\u2714\u{1f623}\u{1f3c3}\u{1f490}\u2639\u{1f38a}\u{1f498}\u{1f620}\u261d\u{1f615}\u{1f33a}\u{1f382}\u{1f33b}\u{1f610}\u{1f595}\u{1f49d}\u{1f64a}\u{1f639}\u{1f5e3}\u{1f4ab}\u{1f480}\u{1f451}\u{1f3b5}\u{1f91e}\u{1f61b}\u{1f534}\u{1f624}\u{1f33c}\u{1f62b}\u26bd\u{1f919}\u2615\u{1f3c6}\u{1f92b}\u{1f448}\u{1f62e}\u{1f646}\u{1f37b}\u{1f343}\u{1f436}\u{1f481}\u{1f632}\u{1f33f}\u{1f9e1}\u{1f381}\u26a1\u{1f31e}\u{1f388}\u274c\u270a\u{1f44b}\u{1f630}\u{1f928}\u{1f636}\u{1f91d}\u{1f6b6}\u{1f4b0}\u{1f353}\u{1f4a2}\u{1f91f}\u{1f641}\u{1f6a8}\u{1f4a8}\u{1f92c}\u2708\u{1f380}\u{1f37a}\u{1f913}\u{1f619}\u{1f49f}\u{1f331}\u{1f616}\u{1f476}\u{1f974}\u25b6\u27a1\u2753\u{1f48e}\u{1f4b8}\u2b07\u{1f628}\u{1f31a}\u{1f98b}\u{1f637}\u{1f57a}\u26a0\u{1f645}\u{1f61f}\u{1f635}\u{1f44e}\u{1f932}\u{1f920}\u{1f927}\u{1f4cc}\u{1f535}\u{1f485}\u{1f9d0}\u{1f43e}\u{1f352}\u{1f617}\u{1f911}\u{1f30a}\u{1f92f}\u{1f437}\u260e\u{1f4a7}\u{1f62f}\u{1f486}\u{1f446}\u{1f3a4}\u{1f647}\u{1f351}\u2744\u{1f334}\u{1f4a3}\u{1f438}\u{1f48c}\u{1f4cd}\u{1f940}\u{1f922}\u{1f445}\u{1f4a1}\u{1f4a9}\u{1f450}\u{1f4f8}\u{1f47b}\u{1f910}\u{1f92e}\u{1f3bc}\u{1f975}\u{1f6a9}\u{1f34e}\u{1f34a}\u{1f47c}\u{1f48d}\u{1f4e3}\u{1f942}"),Tg=Wc.reduce((u,t,r)=>(u[r]=t,u),[]),Ng=Wc.reduce((u,t,r)=>(u[t.codePointAt(0)]=r,u),[]),Fg=to({prefix:"\u{1f680}",name:"base256emoji",encode:function Ug(u){return u.reduce((t,r)=>t+Tg[r],"")},decode:function Lg(u){const t=[];for(const r of u){const o=Ng[r.codePointAt(0)];if(void 0===o)throw new Error(`Non-base256emoji character: ${r}`);t.push(o)}return new Uint8Array(t)}});var jg=Object.freeze({__proto__:null,base256emoji:Fg}),$g=Math.pow(2,31),Kg=Math.pow(2,7),Vg=Math.pow(2,14),Wg=Math.pow(2,21),Gg=Math.pow(2,28),Yg=Math.pow(2,35),qg=Math.pow(2,42),Xg=Math.pow(2,49),Zg=Math.pow(2,56),Qg=Math.pow(2,63),e0={encode:function Yc(u,t,r){t=t||[];for(var o=r=r||0;u>=$g;)t[r++]=255&u|128,u/=128;for(;-128&u;)t[r++]=255&u|128,u>>>=7;return t[r]=0|u,Yc.bytes=r-o+1,t},decode:function Ta(u,o){var m,r=0,a=0,l=o=o||0,T=u.length;do{if(l>=T)throw Ta.bytes=0,new RangeError("Could not decode varint");m=u[l++],r+=a<28?(127&m)<=128);return Ta.bytes=l-o,r},encodingLength:function(u){return u(Xc.encode(u,t,r),t),Qc=u=>Xc.encodingLength(u),Na=(u,t)=>{const r=t.byteLength,o=Qc(u),a=o+Qc(r),l=new Uint8Array(a+r);return Zc(u,l,0),Zc(r,l,o),l.set(t,a),new t0(u,r,t,l)};class t0{constructor(t,r,o,a){this.code=t,this.size=r,this.digest=o,this.bytes=a}}const kc=({name:u,code:t,encode:r})=>new r0(u,t,r);class r0{constructor(t,r,o){this.name=t,this.code=r,this.encode=o}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?Na(this.code,r):r.then(o=>Na(this.code,o))}throw Error("Unknown type, must be binary type")}}const ef=u=>function(){var t=O(function*(r){return new Uint8Array(yield crypto.subtle.digest(u,r))});return function(r){return t.apply(this,arguments)}}(),n0=kc({name:"sha2-256",code:18,encode:ef("SHA-256")}),i0=kc({name:"sha2-512",code:19,encode:ef("SHA-512")});Object.freeze({__proto__:null,sha256:n0,sha512:i0});const rf=Kc;Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:rf,digest:u=>Na(0,rf(u))}}),new TextEncoder,new TextDecoder;const nf={...tg,...ng,...sg,...ag,...fg,...bg,...Dg,...Og,...Cg,...jg};function sf(u,t,r,o){return{name:u,prefix:t,encoder:{name:u,prefix:t,encode:r},decoder:{decode:o}}}const of=sf("utf8","u",u=>"u"+new TextDecoder("utf8").decode(u),u=>(new TextEncoder).encode(u.substring(1))),Ua=sf("ascii","a",u=>{let t="a";for(let r=0;r{const t=function u0(u=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(u):new Uint8Array(u)}((u=u.substring(1)).length);for(let r=0;r(this.isInitialized(),this.keychain.has(a)),this.set=function(){var a=O(function*(l,m){o.isInitialized(),o.keychain.set(l,m),yield o.persist()});return function(l,m){return a.apply(this,arguments)}}(),this.get=a=>{this.isInitialized();const l=this.keychain.get(a);if(typeof l>"u"){const{message:m}=Ne("NO_MATCHING_KEY",`${this.name}: ${a}`);throw new Error(m)}return l},this.del=function(){var a=O(function*(l){o.isInitialized(),o.keychain.delete(l),yield o.persist()});return function(l){return a.apply(this,arguments)}}(),this.core=t,this.logger=(0,B.generateChildLogger)(r,this.name)}get context(){return(0,B.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}setKeyChain(t){var r=this;return O(function*(){yield r.core.storage.setItem(r.storageKey,Pc(t))})()}getKeyChain(){var t=this;return O(function*(){const r=yield t.core.storage.getItem(t.storageKey);return typeof r<"u"?Ac(r):void 0})()}persist(){var t=this;return O(function*(){yield t.setKeyChain(t.keychain)})()}isInitialized(){if(!this.initialized){const{message:t}=Ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}class M0{constructor(t,r,o){var a=this;this.core=t,this.logger=r,this.name="crypto",this.initialized=!1,this.init=O(function*(){a.initialized||(yield a.keychain.init(),a.initialized=!0)}),this.hasKeys=l=>(this.isInitialized(),this.keychain.has(l)),this.getClientId=O(function*(){return a.isInitialized(),Hs(zs(yield a.getClientSeed()).publicKey)}),this.generateKeyPair=()=>{this.isInitialized();const l=function _d(){const u=Js.Au();return{privateKey:wr(u.secretKey,Pr),publicKey:wr(u.publicKey,Pr)}}();return this.setPrivateKey(l.publicKey,l.privateKey)},this.signJWT=function(){var l=O(function*(m){a.isInitialized();const X=zs(yield a.getClientSeed()),Q=Da();return yield function fa(u,t,r,o){return Ri.apply(this,arguments)}(Q,m,g0,X)});return function(m){return l.apply(this,arguments)}}(),this.generateSharedKey=(l,m,T)=>{this.isInitialized();const Q=function bd(u,t){const r=Js.gi(Or(u,Pr),Or(t,Pr));return wr(new Vn.t(rs.mE,r).expand(32),Pr)}(this.getPrivateKey(l),m);return this.setSymKey(Q,T)},this.setSymKey=function(){var l=O(function*(m,T){a.isInitialized();const X=T||function Ed(u){return wr((0,rs.vp)(Or(u,Pr)),Pr)}(m);return yield a.keychain.set(X,m),X});return function(m,T){return l.apply(this,arguments)}}(),this.deleteKeyPair=function(){var l=O(function*(m){a.isInitialized(),yield a.keychain.del(m)});return function(m){return l.apply(this,arguments)}}(),this.deleteSymKey=function(){var l=O(function*(m){a.isInitialized(),yield a.keychain.del(m)});return function(m){return l.apply(this,arguments)}}(),this.encode=function(){var l=O(function*(m,T,X){a.isInitialized();const Q=wc(X),ge=Ce(T);if(Dc(Q)){const Be=Q.senderPublicKey,tt=Q.receiverPublicKey;m=yield a.generateSharedKey(Be,tt)}const Oe=a.getSymKey(m),{type:Xe,senderPublicKey:xt}=Q;return function Dd(u){const t=function wd(u){return Or(`${u}`,"base10")}(typeof u.type<"u"?u.type:0);if(1===os(t)&&typeof u.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof u.senderPublicKey<"u"?Or(u.senderPublicKey,Pr):void 0,o=typeof u.iv<"u"?Or(u.iv,Pr):(0,je.randomBytes)(12);return function Sd(u){if(1===os(u.type)){if(typeof u.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return wr(Ge([u.type,u.senderPublicKey,u.iv,u.sealed]),_a)}return wr(Ge([u.type,u.iv,u.sealed]),_a)}({type:t,sealed:new ci.OK(Or(u.symKey,Pr)).seal(o,Or(u.message,ba)),iv:o,senderPublicKey:r})}({type:Xe,symKey:Oe,message:ge,senderPublicKey:xt})});return function(m,T,X){return l.apply(this,arguments)}}(),this.decode=function(){var l=O(function*(m,T,X){a.isInitialized();const Q=function Od(u,t){const r=Zs(u);return wc({type:os(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?wr(r.senderPublicKey,Pr):void 0,receiverPublicKey:t?.receiverPublicKey})}(T,X);if(Dc(Q)){const Xe=Q.receiverPublicKey,xt=Q.senderPublicKey;m=yield a.generateSharedKey(Xe,xt)}const Oe=function xd(u){const t=new ci.OK(Or(u.symKey,Pr)),{sealed:r,iv:o}=Zs(u.encoded),a=t.open(o,r);if(null===a)throw new Error("Failed to decrypt");return wr(a,ba)}({symKey:a.getSymKey(m),encoded:T});return xe(Oe)});return function(m,T,X){return l.apply(this,arguments)}}(),this.getPayloadType=l=>os(Zs(l).type),this.getPayloadSenderPublicKey=l=>{const m=Zs(l);return m.senderPublicKey?wr(m.senderPublicKey,Pr):void 0},this.core=t,this.logger=(0,B.generateChildLogger)(r,this.name),this.keychain=o||new j0(this.core,this.logger)}get context(){return(0,B.getLoggerContext)(this.logger)}setPrivateKey(t,r){var o=this;return O(function*(){return yield o.keychain.set(t,r),t})()}getPrivateKey(t){return this.keychain.get(t)}getClientSeed(){var t=this;return O(function*(){let r="";try{r=t.keychain.get(uf)}catch{r=Da(),yield t.keychain.set(uf,r)}return function f0(u,t="utf8"){const r=c0[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${u}`):globalThis.Buffer.from(u,"utf8")}(r,"base16")})()}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){const{message:t}=Ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}class B0 extends class h{constructor(t,r){this.logger=t,this.core=r}}{constructor(t,r){var o;super(t,r),o=this,this.logger=t,this.core=r,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=Yn,this.init=O(function*(){if(!o.initialized){o.logger.trace("Initialized");try{const a=yield o.getRelayerMessages();typeof a<"u"&&(o.messages=a),o.logger.debug(`Successfully Restored records for ${o.name}`),o.logger.trace({type:"method",method:"restore",size:o.messages.size})}catch(a){o.logger.debug(`Failed to Restore records for ${o.name}`),o.logger.error(a)}finally{o.initialized=!0}}}),this.set=function(){var a=O(function*(l,m){o.isInitialized();const T=hi(m);let X=o.messages.get(l);return typeof X>"u"&&(X={}),typeof X[T]<"u"||(X[T]=m,o.messages.set(l,X),yield o.persist()),T});return function(l,m){return a.apply(this,arguments)}}(),this.get=a=>{this.isInitialized();let l=this.messages.get(a);return typeof l>"u"&&(l={}),l},this.has=(a,l)=>(this.isInitialized(),typeof this.get(a)[hi(l)]<"u"),this.del=function(){var a=O(function*(l){o.isInitialized(),o.messages.delete(l),yield o.persist()});return function(l){return a.apply(this,arguments)}}(),this.logger=(0,B.generateChildLogger)(t,this.name),this.core=r}get context(){return(0,B.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}setRelayerMessages(t){var r=this;return O(function*(){yield r.core.storage.setItem(r.storageKey,Pc(t))})()}getRelayerMessages(){var t=this;return O(function*(){const r=yield t.core.storage.getItem(t.storageKey);return typeof r<"u"?Ac(r):void 0})()}persist(){var t=this;return O(function*(){yield t.setRelayerMessages(t.messages)})()}isInitialized(){if(!this.initialized){const{message:t}=Ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}class H0 extends f{constructor(t,r){var o;super(t,r),o=this,this.relayer=t,this.logger=r,this.events=new _e.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=1e4,this.publish=function(){var a=O(function*(l,m,T){o.logger.debug("Publishing Payload"),o.logger.trace({type:"method",method:"publish",params:{topic:l,message:m,opts:T}});try{const X=T?.ttl||b0,Q=Ia(T),ge=T?.prompt||!1,Oe=T?.tag||0,Xe={topic:l,message:m,opts:{ttl:X,relay:Q,prompt:ge,tag:Oe}},xt=hi(m);o.queue.set(xt,Xe);try{yield yield Qs(o.rpcPublish(l,m,X,Q,ge,Oe),o.publishTimeout),o.relayer.events.emit("relayer_publish",Xe)}catch{return o.logger.debug("Publishing Payload stalled"),void o.relayer.events.emit("relayer_connection_stalled")}o.onPublish(xt,Xe),o.logger.debug("Successfully Published Payload"),o.logger.trace({type:"method",method:"publish",params:{topic:l,message:m,opts:T}})}catch(X){throw o.logger.debug("Failed to Publish Payload"),o.logger.error(X),X}});return function(l,m,T){return a.apply(this,arguments)}}(),this.on=(a,l)=>{this.events.on(a,l)},this.once=(a,l)=>{this.events.once(a,l)},this.off=(a,l)=>{this.events.off(a,l)},this.removeListener=(a,l)=>{this.events.removeListener(a,l)},this.relayer=t,this.logger=(0,B.generateChildLogger)(r,this.name),this.registerEventListeners()}get context(){return(0,B.getLoggerContext)(this.logger)}rpcPublish(t,r,o,a,l,m){var T,X,Q,ge;const Oe={method:ks(a.protocol).publish,params:{topic:t,message:r,ttl:o,prompt:l,tag:m}};return Ar(null==(T=Oe.params)?void 0:T.prompt)&&(null==(X=Oe.params)||delete X.prompt),Ar(null==(Q=Oe.params)?void 0:Q.tag)&&(null==(ge=Oe.params)||delete ge.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:Oe}),this.relayer.request(Oe)}onPublish(t,r){this.queue.delete(t)}checkQueue(){var t=this;this.queue.forEach(function(){var r=O(function*(o){const{topic:a,message:l,opts:m}=o;yield t.publish(a,l,m)});return function(o){return r.apply(this,arguments)}}())}registerEventListeners(){this.relayer.core.heartbeat.on(ee.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()})}}class $0{constructor(){this.map=new Map,this.set=(t,r)=>{const o=this.get(t);this.exists(t,r)||this.map.set(t,[...o,r])},this.get=t=>this.map.get(t)||[],this.exists=(t,r)=>this.get(t).includes(r),this.delete=(t,r)=>{if(typeof r>"u")return void this.map.delete(t);if(!this.map.has(t))return;const o=this.get(t);if(!this.exists(t,r))return;const a=o.filter(l=>l!==r);a.length?this.map.set(t,a):this.map.delete(t)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var z0=Object.defineProperty,J0=Object.defineProperties,K0=Object.getOwnPropertyDescriptors,df=Object.getOwnPropertySymbols,V0=Object.prototype.hasOwnProperty,W0=Object.prototype.propertyIsEnumerable,pf=(u,t,r)=>t in u?z0(u,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[t]=r,hs=(u,t)=>{for(var r in t||(t={}))V0.call(t,r)&&pf(u,r,t[r]);if(df)for(var r of df(t))W0.call(t,r)&&pf(u,r,t[r]);return u},Fa=(u,t)=>J0(u,K0(t));class G0 extends b{constructor(t,r){var o;super(t,r),o=this,this.relayer=t,this.logger=r,this.subscriptions=new Map,this.topicMap=new $0,this.events=new _e.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Yn,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=O(function*(){o.initialized||(o.logger.trace("Initialized"),yield o.restart(),o.registerEventListeners(),o.onEnable(),o.clientId=yield o.relayer.core.crypto.getClientId())}),this.subscribe=function(){var a=O(function*(l,m){yield o.restartToComplete(),o.isInitialized(),o.logger.debug("Subscribing Topic"),o.logger.trace({type:"method",method:"subscribe",params:{topic:l,opts:m}});try{const T=Ia(m),X={topic:l,relay:T};o.pending.set(l,X);const Q=yield o.rpcSubscribe(l,T);return o.onSubscribe(Q,X),o.logger.debug("Successfully Subscribed Topic"),o.logger.trace({type:"method",method:"subscribe",params:{topic:l,opts:m}}),Q}catch(T){throw o.logger.debug("Failed to Subscribe Topic"),o.logger.error(T),T}});return function(l,m){return a.apply(this,arguments)}}(),this.unsubscribe=function(){var a=O(function*(l,m){yield o.restartToComplete(),o.isInitialized(),typeof m?.id<"u"?yield o.unsubscribeById(l,m.id,m):yield o.unsubscribeByTopic(l,m)});return function(l,m){return a.apply(this,arguments)}}(),this.isSubscribed=function(){var a=O(function*(l){return!!o.topics.includes(l)||(yield new Promise((m,T)=>{const X=new Z.Watch;X.start(o.pendingSubscriptionWatchLabel);const Q=setInterval(()=>{!o.pending.has(l)&&o.topics.includes(l)&&(clearInterval(Q),X.stop(o.pendingSubscriptionWatchLabel),m(!0)),X.elapsed(o.pendingSubscriptionWatchLabel)>=A0&&(clearInterval(Q),X.stop(o.pendingSubscriptionWatchLabel),T(!1))},o.pollingInterval)}))});return function(l){return a.apply(this,arguments)}}(),this.on=(a,l)=>{this.events.on(a,l)},this.once=(a,l)=>{this.events.once(a,l)},this.off=(a,l)=>{this.events.off(a,l)},this.removeListener=(a,l)=>{this.events.removeListener(a,l)},this.restart=O(function*(){o.restartInProgress=!0,yield o.restore(),yield o.reset(),o.restartInProgress=!1}),this.relayer=t,this.logger=(0,B.generateChildLogger)(r,this.name),this.clientId=""}get context(){return(0,B.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(t,r){let o=!1;try{o=this.getSubscription(t).topic===r}catch{}return o}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}unsubscribeByTopic(t,r){var o=this;return O(function*(){const a=o.topicMap.get(t);yield Promise.all(a.map(function(){var l=O(function*(m){return yield o.unsubscribeById(t,m,r)});return function(m){return l.apply(this,arguments)}}()))})()}unsubscribeById(t,r,o){var a=this;return O(function*(){a.logger.debug("Unsubscribing Topic"),a.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:r,opts:o}});try{const l=Ia(o);yield a.rpcUnsubscribe(t,r,l);const m=fr("USER_DISCONNECTED",`${a.name}, ${t}`);yield a.onUnsubscribe(t,r,m),a.logger.debug("Successfully Unsubscribed Topic"),a.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:r,opts:o}})}catch(l){throw a.logger.debug("Failed to Unsubscribe Topic"),a.logger.error(l),l}})()}rpcSubscribe(t,r){var o=this;return O(function*(){const a={method:ks(r.protocol).subscribe,params:{topic:t}};o.logger.debug("Outgoing Relay Payload"),o.logger.trace({type:"payload",direction:"outgoing",request:a});try{yield yield Qs(o.relayer.request(a),o.subscribeTimeout)}catch{o.logger.debug("Outgoing Relay Subscribe Payload stalled"),o.relayer.events.emit("relayer_connection_stalled")}return hi(t+o.clientId)})()}rpcBatchSubscribe(t){var r=this;return O(function*(){if(!t.length)return;const a={method:ks(t[0].relay.protocol).batchSubscribe,params:{topics:t.map(l=>l.topic)}};r.logger.debug("Outgoing Relay Payload"),r.logger.trace({type:"payload",direction:"outgoing",request:a});try{return yield yield Qs(r.relayer.request(a),r.subscribeTimeout)}catch{r.logger.debug("Outgoing Relay Payload stalled"),r.relayer.events.emit("relayer_connection_stalled")}})()}rpcUnsubscribe(t,r,o){const a={method:ks(o.protocol).unsubscribe,params:{topic:t,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:a}),this.relayer.request(a)}onSubscribe(t,r){this.setSubscription(t,Fa(hs({},r),{id:t})),this.pending.delete(r.topic)}onBatchSubscribe(t){t.length&&t.forEach(r=>{this.setSubscription(r.id,hs({},r)),this.pending.delete(r.topic)})}onUnsubscribe(t,r,o){var a=this;return O(function*(){a.events.removeAllListeners(r),a.hasSubscription(r,t)&&a.deleteSubscription(r,o),yield a.relayer.messages.del(t)})()}setRelayerSubscriptions(t){var r=this;return O(function*(){yield r.relayer.core.storage.setItem(r.storageKey,t)})()}getRelayerSubscriptions(){var t=this;return O(function*(){return yield t.relayer.core.storage.getItem(t.storageKey)})()}setSubscription(t,r){this.subscriptions.has(t)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:r}),this.addSubscription(t,r))}addSubscription(t,r){this.subscriptions.set(t,hs({},r)),this.topicMap.set(r.topic,t),this.events.emit(wn_created,r)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});const r=this.subscriptions.get(t);if(!r){const{message:o}=Ne("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(o)}return r}deleteSubscription(t,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:r});const o=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(o.topic,t),this.events.emit(wn_deleted,Fa(hs({},o),{reason:r}))}persist(){var t=this;return O(function*(){yield t.setRelayerSubscriptions(t.values),t.events.emit("subscription_sync")})()}reset(){var t=this;return O(function*(){if(t.cached.length){const r=Math.ceil(t.cached.length/t.batchSubscribeTopicsLimit);for(let o=0;o"u"||!r.length)return;if(t.subscriptions.size){const{message:o}=Ne("RESTORE_WILL_OVERRIDE",t.name);throw t.logger.error(o),t.logger.error(`${t.name}: ${JSON.stringify(t.values)}`),new Error(o)}t.cached=r,t.logger.debug(`Successfully Restored subscriptions for ${t.name}`),t.logger.trace({type:"method",method:"restore",subscriptions:t.values})}catch(r){t.logger.debug(`Failed to Restore subscriptions for ${t.name}`),t.logger.error(r)}})()}batchSubscribe(t){var r=this;return O(function*(){if(!t.length)return;const o=yield r.rpcBatchSubscribe(t);Li(o)&&r.onBatchSubscribe(o.map((a,l)=>Fa(hs({},t[l]),{id:a})))})()}onConnect(){var t=this;return O(function*(){t.restartInProgress||(yield t.restart(),t.onEnable())})()}onDisconnect(){this.onDisable()}checkPending(){var t=this;return O(function*(){if(t.relayer.transportExplicitlyClosed)return;const r=[];t.pending.forEach(o=>{r.push(o)}),yield t.batchSubscribe(r)})()}registerEventListeners(){var t=this;this.relayer.core.heartbeat.on(ee.HEARTBEAT_EVENTS.pulse,O(function*(){yield t.checkPending()})),this.relayer.on("relayer_connect",O(function*(){yield t.onConnect()})),this.relayer.on("relayer_disconnect",()=>{this.onDisconnect()}),this.events.on(wn_created,function(){var r=O(function*(o){const a=wn_created;t.logger.info(`Emitting ${a}`),t.logger.debug({type:"event",event:a,data:o}),yield t.persist()});return function(o){return r.apply(this,arguments)}}()),this.events.on(wn_deleted,function(){var r=O(function*(o){const a=wn_deleted;t.logger.info(`Emitting ${a}`),t.logger.debug({type:"event",event:a,data:o}),yield t.persist()});return function(o){return r.apply(this,arguments)}}())}isInitialized(){if(!this.initialized){const{message:t}=Ne("NOT_INITIALIZED",this.name);throw new Error(t)}}restartToComplete(){var t=this;return O(function*(){t.restartInProgress&&(yield new Promise(r=>{const o=setInterval(()=>{t.restartInProgress||(clearInterval(o),r())},t.pollingInterval)}))})()}}var Y0=Object.defineProperty,gf=Object.getOwnPropertySymbols,q0=Object.prototype.hasOwnProperty,X0=Object.prototype.propertyIsEnumerable,yf=(u,t,r)=>t in u?Y0(u,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[t]=r;class Q0 extends _{constructor(t){var r;super(t),r=this,this.protocol="wc",this.version=2,this.events=new _e.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=function(){var o=O(function*(a){r.logger.debug("Publishing Request Payload");try{return yield r.toEstablishConnection(),yield r.provider.request(a)}catch(l){throw r.logger.debug("Failed to Publish Request"),r.logger.error(l),l}});return function(a){return o.apply(this,arguments)}}(),this.core=t.core,this.logger=typeof t.logger<"u"&&"string"!=typeof t.logger?(0,B.generateChildLogger)(t.logger,this.name):(0,B.pino)((0,B.getDefaultLoggerOptions)({level:t.logger||"error"})),this.messages=new B0(this.logger,t.core),this.subscriber=new G0(this,this.logger),this.publisher=new H0(this,this.logger),this.relayUrl=t?.relayUrl||ff,this.projectId=t.projectId,this.provider={}}init(){var t=this;return O(function*(){t.logger.trace("Initialized"),yield t.createProvider(),yield Promise.all([t.messages.init(),t.transportOpen(),t.subscriber.init()]),t.registerEventListeners(),t.initialized=!0})()}get context(){return(0,B.getLoggerContext)(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}publish(t,r,o){var a=this;return O(function*(){a.isInitialized(),yield a.publisher.publish(t,r,o),yield a.recordMessageEvent({topic:t,message:r,publishedAt:Date.now()})})()}subscribe(t,r){var o=this;return O(function*(){o.isInitialized();let a="";return yield Promise.all([new Promise(l=>{o.subscriber.once(wn_created,m=>{m.topic===t&&l()})}),new Promise(function(){var l=O(function*(m){a=yield o.subscriber.subscribe(t,r),m()});return function(m){return l.apply(this,arguments)}}())]),a})()}unsubscribe(t,r){var o=this;return O(function*(){o.isInitialized(),yield o.subscriber.unsubscribe(t,r)})()}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}transportClose(){var t=this;return O(function*(){t.transportExplicitlyClosed=!0,t.connected&&(yield t.provider.disconnect(),t.events.emit("relayer_transport_closed"))})()}transportOpen(t){var r=this;return O(function*(){if(r.transportExplicitlyClosed=!1,!r.reconnecting){r.relayUrl=t||r.relayUrl,r.reconnecting=!0;try{yield Promise.all([new Promise(o=>{r.initialized||o(),r.subscriber.once("subscription_resubscribed",()=>{o()})}),yield Promise.race([new Promise(function(){var o=O(function*(a,l){yield Qs(r.provider.connect(),5e3,"socket stalled").catch(m=>l(m)).then(()=>a()).finally(()=>r.removeListener("relayer_transport_closed",r.rejectTransportOpen))});return function(a,l){return o.apply(this,arguments)}}()),new Promise(o=>r.once("relayer_transport_closed",r.rejectTransportOpen))])])}catch(o){if(r.logger.error(o),!r.isConnectionStalled(o.message))throw o;r.events.emit("relayer_transport_closed")}finally{r.reconnecting=!1}}})()}restartTransport(t){var r=this;return O(function*(){r.transportExplicitlyClosed||(r.relayUrl=t||r.relayUrl,yield Promise.all([new Promise(o=>{r.provider.once("disconnect",()=>{o()})}),r.transportClose()]),yield new Promise(o=>setTimeout(o,1e3)),yield r.createProvider(),yield r.transportOpen())})()}isConnectionStalled(t){return this.staleConnectionErrors.some(r=>t.includes(r))}rejectTransportOpen(){throw new Error("closeTransport called before connection was established")}createProvider(){var t=this;return O(function*(){const r=yield t.core.crypto.signJWT(t.relayUrl);t.provider=new Gn(new class Bp{constructor(t){if(this.url=t,this.events=new _e.EventEmitter,this.registering=!1,!(0,qe.isWsUrl)(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}open(t=this.url){var r=this;return O(function*(){yield r.register(t)})()}close(){var t=this;return O(function*(){return new Promise((r,o)=>{typeof t.socket>"u"?o(new Error("Connection already closed")):(t.socket.onclose=a=>{t.onClose(a),r()},t.socket.close())})})()}send(t,r){var o=this;return O(function*(){typeof o.socket>"u"&&(o.socket=yield o.register());try{o.socket.send(Ce(t))}catch(a){o.onError(t.id,a)}})()}register(t=this.url){if(!(0,qe.isWsUrl)(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((o,a)=>{this.events.once("register_error",l=>{this.resetMaxListeners(),a(l)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return a(new Error("WebSocket connection is missing or invalid"));o(this.socket)})})}return this.url=t,this.registering=!0,new Promise((r,o)=>{const a=(0,qe.isReactNative)()?void 0:{rejectUnauthorized:!(0,qe.isLocalhostUrl)(t)},l=new Mp(t,[],a);typeof window<"u"?l.onerror=m=>{o(this.emitError(m.error))}:l.on("error",m=>{o(this.emitError(m))}),l.onopen=()=>{this.onOpen(l),r(l)}})}onOpen(t){t.onmessage=r=>this.onPayload(r),t.onclose=r=>this.onClose(r),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const r="string"==typeof t.data?xe(t.data):t.data;this.events.emit("payload",r)}onError(t,r){const o=this.parseError(r),a=o.message||o.toString(),l=(0,qe.formatJsonRpcError)(t,a);this.events.emit("payload",l)}parseError(t,r=this.url){return(0,qe.parseConnectionError)(t,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(t){const r=this.parseError(new Error((null==t?void 0:t.message)||`WebSocket connection failed for URL: ${this.url}`));return this.events.emit("register_error",r),r}}(function Bd({protocol:u,version:t,relayUrl:r,sdkVersion:o,auth:a,projectId:l,useOnCloseEvent:m}){const T=r.split("?"),X=Md(u,t,o),ge=function Ud(u,t){let r=Ci.parse(u);return r=Oc(Oc({},r),t),Ci.stringify(r)}(T[1]||"",{auth:a,ua:X,projectId:l,useOnCloseEvent:m||void 0});return T[0]+"?"+ge}({sdkVersion:"2.7.0",protocol:t.protocol,version:t.version,relayUrl:t.relayUrl,projectId:t.projectId,auth:r,useOnCloseEvent:!0}))),t.registerProviderListeners()})()}recordMessageEvent(t){var r=this;return O(function*(){const{topic:o,message:a}=t;yield r.messages.set(o,a)})()}shouldIgnoreMessageEvent(t){var r=this;return O(function*(){const{topic:o,message:a}=t;return!(yield r.subscriber.isSubscribed(o))||r.messages.has(o,a)})()}onProviderPayload(t){var r=this;return O(function*(){if(r.logger.debug("Incoming Relay Payload"),r.logger.trace({type:"payload",direction:"incoming",payload:t}),(0,qe.isJsonRpcRequest)(t)){if(!t.method.endsWith("_subscription"))return;const o=t.params,{topic:a,message:l,publishedAt:m}=o.data,T={topic:a,message:l,publishedAt:m};r.logger.debug("Emitting Relayer Payload"),r.logger.trace(((u,t)=>{for(var r in t||(t={}))q0.call(t,r)&&yf(u,r,t[r]);if(gf)for(var r of gf(t))X0.call(t,r)&&yf(u,r,t[r]);return u})({type:"event",event:o.id},T)),r.events.emit(o.id,T),yield r.acknowledgePayload(t),yield r.onMessageEvent(T)}})()}onMessageEvent(t){var r=this;return O(function*(){(yield r.shouldIgnoreMessageEvent(t))||(r.events.emit("relayer_message",t),yield r.recordMessageEvent(t))})()}acknowledgePayload(t){var r=this;return O(function*(){const o=(0,qe.formatJsonRpcResult)(t.id,!0);yield r.provider.connection.send(o)})()}registerProviderListeners(){this.provider.on("payload",t=>this.onProviderPayload(t)),this.provider.on("connect",()=>{this.events.emit("relayer_connect")}),this.provider.on("disconnect",()=>{this.onProviderDisconnect()}),this.provider.on("error",t=>{this.logger.error(t),this.events.emit("relayer_error",t)})}registerEventListeners(){var t=this;this.events.on("relayer_connection_stalled",O(function*(){yield t.restartTransport()}))}onProviderDisconnect(){this.events.emit("relayer_disconnect"),this.attemptToReconnect()}attemptToReconnect(){var t=this;this.transportExplicitlyClosed||setTimeout(O(function*(){yield t.restartTransport()}),(0,Z.toMiliseconds)(S0))}isInitialized(){if(!this.initialized){const{message:t}=Ne("NOT_INITIALIZED",this.name);throw new Error(t)}}toEstablishConnection(){var t=this;return O(function*(){if(!t.connected){if(t.connecting)return yield new Promise(r=>{const o=setInterval(()=>{t.connected&&(clearInterval(o),r())},t.connectionStatusPollingInterval)});yield t.restartTransport()}})()}}var k0=Object.defineProperty,vf=Object.getOwnPropertySymbols,ey=Object.prototype.hasOwnProperty,ty=Object.prototype.propertyIsEnumerable,mf=(u,t,r)=>t in u?k0(u,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[t]=r,_f=(u,t)=>{for(var r in t||(t={}))ey.call(t,r)&&mf(u,r,t[r]);if(vf)for(var r of vf(t))ty.call(t,r)&&mf(u,r,t[r]);return u};class ro extends class v{constructor(t,r,o,a){this.core=t,this.logger=r,this.name=o}}{constructor(t,r,o,a=Yn,l){var m;super(t,r,o,a),m=this,this.core=t,this.logger=r,this.name=o,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=Yn,this.init=O(function*(){m.initialized||(m.logger.trace("Initialized"),yield m.restore(),m.cached.forEach(T=>{m.getKey&&null!==T&&!Ar(T)?m.map.set(m.getKey(T),T):function yp(u){var t;return null==(t=u?.proposer)?void 0:t.publicKey}(T)?m.map.set(T.id,T):function vp(u){return u?.topic}(T)&&m.map.set(T.topic,T)}),m.cached=[],m.initialized=!0)}),this.set=function(){var T=O(function*(X,Q){m.isInitialized(),m.map.has(X)?yield m.update(X,Q):(m.logger.debug("Setting value"),m.logger.trace({type:"method",method:"set",key:X,value:Q}),m.map.set(X,Q),yield m.persist())});return function(X,Q){return T.apply(this,arguments)}}(),this.get=T=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:T}),this.getData(T)),this.getAll=T=>(this.isInitialized(),T?this.values.filter(X=>Object.keys(T).every(Q=>zp()(X[Q],T[Q]))):this.values),this.update=function(){var T=O(function*(X,Q){m.isInitialized(),m.logger.debug("Updating value"),m.logger.trace({type:"method",method:"update",key:X,update:Q});const ge=_f(_f({},m.getData(X)),Q);m.map.set(X,ge),yield m.persist()});return function(X,Q){return T.apply(this,arguments)}}(),this.delete=function(){var T=O(function*(X,Q){m.isInitialized(),m.map.has(X)&&(m.logger.debug("Deleting value"),m.logger.trace({type:"method",method:"delete",key:X,reason:Q}),m.map.delete(X),yield m.persist())});return function(X,Q){return T.apply(this,arguments)}}(),this.logger=(0,B.generateChildLogger)(r,this.name),this.storagePrefix=a,this.getKey=l}get context(){return(0,B.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}setDataStore(t){var r=this;return O(function*(){yield r.core.storage.setItem(r.storageKey,t)})()}getDataStore(){var t=this;return O(function*(){return yield t.core.storage.getItem(t.storageKey)})()}getData(t){const r=this.map.get(t);if(!r){const{message:o}=Ne("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(o),new Error(o)}return r}persist(){var t=this;return O(function*(){yield t.setDataStore(t.values)})()}restore(){var t=this;return O(function*(){try{const r=yield t.getDataStore();if(typeof r>"u"||!r.length)return;if(t.map.size){const{message:o}=Ne("RESTORE_WILL_OVERRIDE",t.name);throw t.logger.error(o),new Error(o)}t.cached=r,t.logger.debug(`Successfully Restored value for ${t.name}`),t.logger.trace({type:"method",method:"restore",value:t.values})}catch(r){t.logger.debug(`Failed to Restore value for ${t.name}`),t.logger.error(r)}})()}isInitialized(){if(!this.initialized){const{message:t}=Ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}class ry{constructor(t,r){var o=this;this.core=t,this.logger=r,this.name="pairing",this.version="0.3",this.events=new(De()),this.initialized=!1,this.storagePrefix=Yn,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=O(function*(){o.initialized||(yield o.pairings.init(),yield o.cleanup(),o.registerRelayerEvents(),o.registerExpirerEvents(),o.initialized=!0,o.logger.trace("Initialized"))}),this.register=({methods:a})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...a])]},this.create=O(function*(){o.isInitialized();const a=Da(),l=yield o.core.crypto.setSymKey(a),m=pn(Z.FIVE_MINUTES),T={protocol:"irn"},X={topic:l,expiry:m,relay:T,active:!1},Q=function kd(u){return`${u.protocol}:${u.topic}@${u.version}?`+Ci.stringify(((u,t)=>{for(var r in t||(t={}))Gd.call(t,r)&&Uc(u,r,t[r]);if(Nc)for(var r of Nc(t))Yd.call(t,r)&&Uc(u,r,t[r]);return u})({symKey:u.symKey},function Qd(u,t="-"){const o={};return Object.keys(u).forEach(a=>{u[a]&&(o["relay"+t+a]=u[a])}),o}(u.relay)))}({protocol:o.core.protocol,version:o.core.version,topic:l,symKey:a,relay:T});return yield o.pairings.set(l,X),yield o.core.relayer.subscribe(l),o.core.expirer.set(l,m),{topic:l,uri:Q}}),this.pair=function(){var a=O(function*(l){o.isInitialized(),o.isValidPair(l);const{topic:m,symKey:T,relay:X}=function Zd(u){const t=u.indexOf(":"),r=-1!==u.indexOf("?")?u.indexOf("?"):void 0,o=u.substring(0,t),a=u.substring(t+1,r).split("@"),l=typeof r<"u"?u.substring(r):"",m=Ci.parse(l);return{protocol:o,topic:a[0],version:parseInt(a[1],10),symKey:m.symKey,relay:Xd(m)}}(l.uri);if(o.pairings.keys.includes(m))throw new Error(`Pairing already exists: ${m}`);if(o.core.crypto.hasKeys(m))throw new Error(`Keychain already exists: ${m}`);const Q=pn(Z.FIVE_MINUTES),ge={topic:m,relay:X,expiry:Q,active:!1};return yield o.pairings.set(m,ge),yield o.core.crypto.setSymKey(T,m),yield o.core.relayer.subscribe(m,{relay:X}),o.core.expirer.set(m,Q),l.activatePairing&&(yield o.activate({topic:m})),ge});return function(l){return a.apply(this,arguments)}}(),this.activate=function(){var a=O(function*({topic:l}){o.isInitialized();const m=pn(Z.THIRTY_DAYS);yield o.pairings.update(l,{active:!0,expiry:m}),o.core.expirer.set(l,m)});return function(l){return a.apply(this,arguments)}}(),this.ping=function(){var a=O(function*(l){o.isInitialized(),yield o.isValidPing(l);const{topic:m}=l;if(o.pairings.keys.includes(m)){const T=yield o.sendRequest(m,"wc_pairingPing",{}),{done:X,resolve:Q,reject:ge}=Ni();o.events.once(cr("pairing_ping",T),({error:Oe})=>{Oe?ge(Oe):Q()}),yield X()}});return function(l){return a.apply(this,arguments)}}(),this.updateExpiry=function(){var a=O(function*({topic:l,expiry:m}){o.isInitialized(),yield o.pairings.update(l,{expiry:m})});return function(l){return a.apply(this,arguments)}}(),this.updateMetadata=function(){var a=O(function*({topic:l,metadata:m}){o.isInitialized(),yield o.pairings.update(l,{peerMetadata:m})});return function(l){return a.apply(this,arguments)}}(),this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=function(){var a=O(function*(l){o.isInitialized(),yield o.isValidDisconnect(l);const{topic:m}=l;o.pairings.keys.includes(m)&&(yield o.sendRequest(m,"wc_pairingDelete",fr("USER_DISCONNECTED")),yield o.deletePairing(m))});return function(l){return a.apply(this,arguments)}}(),this.sendRequest=function(){var a=O(function*(l,m,T){const X=(0,qe.formatJsonRpcRequest)(m,T),Q=yield o.core.crypto.encode(l,X),ge=ls[m].req;return o.core.history.set(l,X),yield o.core.relayer.publish(l,Q,ge),X.id});return function(l,m,T){return a.apply(this,arguments)}}(),this.sendResult=function(){var a=O(function*(l,m,T){const X=(0,qe.formatJsonRpcResult)(l,T),Q=yield o.core.crypto.encode(m,X),ge=yield o.core.history.get(m,l),Oe=ls[ge.request.method].res;yield o.core.relayer.publish(m,Q,Oe),yield o.core.history.resolve(X)});return function(l,m,T){return a.apply(this,arguments)}}(),this.sendError=function(){var a=O(function*(l,m,T){const X=(0,qe.formatJsonRpcError)(l,T),Q=yield o.core.crypto.encode(m,X),ge=yield o.core.history.get(m,l),Oe=ls[ge.request.method]?ls[ge.request.method].res:ls.unregistered_method.res;yield o.core.relayer.publish(m,Q,Oe),yield o.core.history.resolve(X)});return function(l,m,T){return a.apply(this,arguments)}}(),this.deletePairing=function(){var a=O(function*(l,m){yield o.core.relayer.unsubscribe(l),yield Promise.all([o.pairings.delete(l,fr("USER_DISCONNECTED")),o.core.crypto.deleteSymKey(l),m?Promise.resolve():o.core.expirer.del(l)])});return function(l,m){return a.apply(this,arguments)}}(),this.cleanup=O(function*(){const a=o.pairings.getAll().filter(l=>Wn(l.expiry));yield Promise.all(a.map(l=>o.deletePairing(l.topic)))}),this.onRelayEventRequest=a=>{const{topic:l,payload:m}=a,T=m.method;if(this.pairings.keys.includes(l))switch(T){case"wc_pairingPing":return this.onPairingPingRequest(l,m);case"wc_pairingDelete":return this.onPairingDeleteRequest(l,m);default:return this.onUnknownRpcMethodRequest(l,m)}},this.onRelayEventResponse=function(){var a=O(function*(l){const{topic:m,payload:T}=l,X=(yield o.core.history.get(m,T.id)).request.method;if(o.pairings.keys.includes(m))return"wc_pairingPing"===X?o.onPairingPingResponse(m,T):o.onUnknownRpcMethodResponse(X)});return function(l){return a.apply(this,arguments)}}(),this.onPairingPingRequest=function(){var a=O(function*(l,m){const{id:T}=m;try{o.isValidPing({topic:l}),yield o.sendResult(T,l,!0),o.events.emit("pairing_ping",{id:T,topic:l})}catch(X){yield o.sendError(T,l,X),o.logger.error(X)}});return function(l,m){return a.apply(this,arguments)}}(),this.onPairingPingResponse=(a,l)=>{const{id:m}=l;setTimeout(()=>{(0,qe.isJsonRpcResult)(l)?this.events.emit(cr("pairing_ping",m),{}):(0,qe.isJsonRpcError)(l)&&this.events.emit(cr("pairing_ping",m),{error:l.error})},500)},this.onPairingDeleteRequest=function(){var a=O(function*(l,m){const{id:T}=m;try{o.isValidDisconnect({topic:l}),yield o.deletePairing(l),o.events.emit("pairing_delete",{id:T,topic:l})}catch(X){yield o.sendError(T,l,X),o.logger.error(X)}});return function(l,m){return a.apply(this,arguments)}}(),this.onUnknownRpcMethodRequest=function(){var a=O(function*(l,m){const{id:T,method:X}=m;try{if(o.registeredMethods.includes(X))return;const Q=fr("WC_METHOD_UNSUPPORTED",X);yield o.sendError(T,l,Q),o.logger.error(Q)}catch(Q){yield o.sendError(T,l,Q),o.logger.error(Q)}});return function(l,m){return a.apply(this,arguments)}}(),this.onUnknownRpcMethodResponse=a=>{this.registeredMethods.includes(a)||this.logger.error(fr("WC_METHOD_UNSUPPORTED",a))},this.isValidPair=a=>{if(!Lr(a)){const{message:l}=Ne("MISSING_OR_INVALID",`pair() params: ${a}`);throw new Error(l)}if(!function gp(u){if(vr(u,!1))try{return typeof new URL(u)<"u"}catch{return!1}return!1}(a.uri)){const{message:l}=Ne("MISSING_OR_INVALID",`pair() uri: ${a.uri}`);throw new Error(l)}},this.isValidPing=function(){var a=O(function*(l){if(!Lr(l)){const{message:T}=Ne("MISSING_OR_INVALID",`ping() params: ${l}`);throw new Error(T)}const{topic:m}=l;yield o.isValidPairingTopic(m)});return function(l){return a.apply(this,arguments)}}(),this.isValidDisconnect=function(){var a=O(function*(l){if(!Lr(l)){const{message:T}=Ne("MISSING_OR_INVALID",`disconnect() params: ${l}`);throw new Error(T)}const{topic:m}=l;yield o.isValidPairingTopic(m)});return function(l){return a.apply(this,arguments)}}(),this.isValidPairingTopic=function(){var a=O(function*(l){if(!vr(l,!1)){const{message:m}=Ne("MISSING_OR_INVALID",`pairing topic should be a string: ${l}`);throw new Error(m)}if(!o.pairings.keys.includes(l)){const{message:m}=Ne("NO_MATCHING_KEY",`pairing topic doesn't exist: ${l}`);throw new Error(m)}if(Wn(o.pairings.get(l).expiry)){yield o.deletePairing(l);const{message:m}=Ne("EXPIRED",`pairing topic: ${l}`);throw new Error(m)}});return function(l){return a.apply(this,arguments)}}(),this.core=t,this.logger=(0,B.generateChildLogger)(r,this.name),this.pairings=new ro(this.core,this.logger,this.name,this.storagePrefix)}get context(){return(0,B.getLoggerContext)(this.logger)}isInitialized(){if(!this.initialized){const{message:t}=Ne("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){var t=this;this.core.relayer.on("relayer_message",function(){var r=O(function*(o){const{topic:a,message:l}=o;if(t.ignoredPayloadTypes.includes(t.core.crypto.getPayloadType(l)))return;const m=yield t.core.crypto.decode(a,l);(0,qe.isJsonRpcRequest)(m)?(t.core.history.set(a,m),t.onRelayEventRequest({topic:a,payload:m})):(0,qe.isJsonRpcResponse)(m)&&(yield t.core.history.resolve(m),t.onRelayEventResponse({topic:a,payload:m}))});return function(o){return r.apply(this,arguments)}}())}registerExpirerEvents(){var t=this;this.core.expirer.on(Zr_expired,function(){var r=O(function*(o){const{topic:a}=Tc(o.target);a&&t.pairings.keys.includes(a)&&(yield t.deletePairing(a,!0),t.events.emit("pairing_expire",{topic:a}))});return function(o){return r.apply(this,arguments)}}())}}class ny extends U{constructor(t,r){var o;super(t,r),o=this,this.core=t,this.logger=r,this.records=new Map,this.events=new _e.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=Yn,this.init=O(function*(){o.initialized||(o.logger.trace("Initialized"),yield o.restore(),o.cached.forEach(a=>o.records.set(a.id,a)),o.cached=[],o.registerEventListeners(),o.initialized=!0)}),this.set=(a,l,m)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:a,request:l,chainId:m}),this.records.has(l.id))return;const T={id:l.id,topic:a,request:{method:l.method,params:l.params||null},chainId:m};this.records.set(T.id,T),this.events.emit("history_created",T)},this.resolve=function(){var a=O(function*(l){if(o.isInitialized(),o.logger.debug("Updating JSON-RPC response history record"),o.logger.trace({type:"method",method:"update",response:l}),!o.records.has(l.id))return;const m=yield o.getRecord(l.id);typeof m.response>"u"&&(m.response=(0,qe.isJsonRpcError)(l)?{error:l.error}:{result:l.result},o.records.set(m.id,m),o.events.emit("history_updated",m))});return function(l){return a.apply(this,arguments)}}(),this.get=function(){var a=O(function*(l,m){return o.isInitialized(),o.logger.debug("Getting record"),o.logger.trace({type:"method",method:"get",topic:l,id:m}),yield o.getRecord(m)});return function(l,m){return a.apply(this,arguments)}}(),this.delete=(a,l)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:l}),this.values.forEach(m=>{if(m.topic===a){if(typeof l<"u"&&m.id!==l)return;this.records.delete(m.id),this.events.emit("history_deleted",m)}})},this.exists=function(){var a=O(function*(l,m){return o.isInitialized(),!!o.records.has(m)&&(yield o.getRecord(m)).topic===l});return function(l,m){return a.apply(this,arguments)}}(),this.on=(a,l)=>{this.events.on(a,l)},this.once=(a,l)=>{this.events.once(a,l)},this.off=(a,l)=>{this.events.off(a,l)},this.removeListener=(a,l)=>{this.events.removeListener(a,l)},this.logger=(0,B.generateChildLogger)(r,this.name)}get context(){return(0,B.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const t=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const o={topic:r.topic,request:(0,qe.formatJsonRpcRequest)(r.request.method,r.request.params,r.id),chainId:r.chainId};return t.push(o)}),t}setJsonRpcRecords(t){var r=this;return O(function*(){yield r.core.storage.setItem(r.storageKey,t)})()}getJsonRpcRecords(){var t=this;return O(function*(){return yield t.core.storage.getItem(t.storageKey)})()}getRecord(t){this.isInitialized();const r=this.records.get(t);if(!r){const{message:o}=Ne("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(o)}return r}persist(){var t=this;return O(function*(){yield t.setJsonRpcRecords(t.values),t.events.emit("history_sync")})()}restore(){var t=this;return O(function*(){try{const r=yield t.getJsonRpcRecords();if(typeof r>"u"||!r.length)return;if(t.records.size){const{message:o}=Ne("RESTORE_WILL_OVERRIDE",t.name);throw t.logger.error(o),new Error(o)}t.cached=r,t.logger.debug(`Successfully Restored records for ${t.name}`),t.logger.trace({type:"method",method:"restore",records:t.values})}catch(r){t.logger.debug(`Failed to Restore records for ${t.name}`),t.logger.error(r)}})()}registerEventListeners(){this.events.on("history_created",t=>{const r="history_created";this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t}),this.persist()}),this.events.on("history_updated",t=>{const r="history_updated";this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t}),this.persist()}),this.events.on("history_deleted",t=>{const r="history_deleted";this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t}),this.persist()})}isInitialized(){if(!this.initialized){const{message:t}=Ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}class iy extends x{constructor(t,r){var o;super(t,r),o=this,this.core=t,this.logger=r,this.expirations=new Map,this.events=new _e.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=Yn,this.init=O(function*(){o.initialized||(o.logger.trace("Initialized"),yield o.restore(),o.cached.forEach(a=>o.expirations.set(a.target,a)),o.cached=[],o.registerEventListeners(),o.initialized=!0)}),this.has=a=>{try{const l=this.formatTarget(a);return typeof this.getExpiration(l)<"u"}catch{return!1}},this.set=(a,l)=>{this.isInitialized();const m=this.formatTarget(a),T={target:m,expiry:l};this.expirations.set(m,T),this.checkExpiry(m,T),this.events.emit("expirer_created",{target:m,expiration:T})},this.get=a=>{this.isInitialized();const l=this.formatTarget(a);return this.getExpiration(l)},this.del=a=>{if(this.isInitialized(),this.has(a)){const l=this.formatTarget(a),m=this.getExpiration(l);this.expirations.delete(l),this.events.emit("expirer_deleted",{target:l,expiration:m})}},this.on=(a,l)=>{this.events.on(a,l)},this.once=(a,l)=>{this.events.once(a,l)},this.off=(a,l)=>{this.events.off(a,l)},this.removeListener=(a,l)=>{this.events.removeListener(a,l)},this.logger=(0,B.generateChildLogger)(r,this.name)}get context(){return(0,B.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(t){if("string"==typeof t)return function Jd(u){return Cc("topic",u)}(t);if("number"==typeof t)return function Kd(u){return Cc("id",u)}(t);const{message:r}=Ne("UNKNOWN_TYPE","Target type: "+typeof t);throw new Error(r)}setExpirations(t){var r=this;return O(function*(){yield r.core.storage.setItem(r.storageKey,t)})()}getExpirations(){var t=this;return O(function*(){return yield t.core.storage.getItem(t.storageKey)})()}persist(){var t=this;return O(function*(){yield t.setExpirations(t.values),t.events.emit("expirer_sync")})()}restore(){var t=this;return O(function*(){try{const r=yield t.getExpirations();if(typeof r>"u"||!r.length)return;if(t.expirations.size){const{message:o}=Ne("RESTORE_WILL_OVERRIDE",t.name);throw t.logger.error(o),new Error(o)}t.cached=r,t.logger.debug(`Successfully Restored expirations for ${t.name}`),t.logger.trace({type:"method",method:"restore",expirations:t.values})}catch(r){t.logger.debug(`Failed to Restore expirations for ${t.name}`),t.logger.error(r)}})()}getExpiration(t){const r=this.expirations.get(t);if(!r){const{message:o}=Ne("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(o),new Error(o)}return r}checkExpiry(t,r){const{expiry:o}=r;(0,Z.toMiliseconds)(o)-Date.now()<=0&&this.expire(t,r)}expire(t,r){this.expirations.delete(t),this.events.emit(Zr_expired,{target:t,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((t,r)=>this.checkExpiry(r,t))}registerEventListeners(){this.core.heartbeat.on(ee.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on("expirer_created",t=>{const r="expirer_created";this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()}),this.events.on(Zr_expired,t=>{const r=Zr_expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()}),this.events.on("expirer_deleted",t=>{const r="expirer_deleted";this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()})}isInitialized(){if(!this.initialized){const{message:t}=Ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}class sy extends class N{constructor(t,r){this.projectId=t,this.logger=r}}{constructor(t,r){var o;super(t,r),o=this,this.projectId=t,this.logger=r,this.name=lf,this.initialized=!1,this.init=function(){var a=O(function*(l){!Oa()||!document||(o.verifyUrl=l?.verifyUrl||hf,yield o.createIframe())});return function(l){return a.apply(this,arguments)}}(),this.register=function(){var a=O(function*(l){var m;o.initialized||(yield o.init()),o.iframe&&(null==(m=o.iframe.contentWindow)||m.postMessage(l.attestationId,o.verifyUrl),o.logger.info(`postMessage sent: ${l.attestationId} ${o.verifyUrl}`))});return function(l){return a.apply(this,arguments)}}(),this.resolve=function(){var a=O(function*(l){var m;if(o.isDevEnv)return"";o.logger.info(`resolving attestation: ${l.attestationId}`);const T=o.startAbortTimer(Z.FIVE_SECONDS),X=yield fetch(`${o.verifyUrl}/attestation/${l.attestationId}`,{signal:o.abortController.signal});return clearTimeout(T),(null==(m=yield X.json())?void 0:m.origin)||""});return function(l){return a.apply(this,arguments)}}(),this.createIframe=O(function*(){try{const a=o.startAbortTimer(Z.FIVE_SECONDS);yield Promise.race([new Promise((l,m)=>{const T=document.createElement("iframe");T.setAttribute("id",lf),T.setAttribute("src",`${o.verifyUrl}/${o.projectId}`),T.style.display="none",T.addEventListener("load",()=>{o.initialized=!0,clearTimeout(a),l()}),T.addEventListener("error",X=>{m(X)}),document.body.append(T),o.iframe=T}),new Promise(l=>{o.abortController.signal.addEventListener("abort",()=>{l("iframe load timeout")})})])}catch(a){o.logger.error(`Verify iframe failed to load: ${o.verifyUrl}`),o.logger.error(a)}}),this.logger=(0,B.generateChildLogger)(r,this.name),this.verifyUrl=hf,this.abortController=new AbortController,this.isDevEnv=Sa()&&process.env.IS_VITEST}get context(){return(0,B.getLoggerContext)(this.logger)}startAbortTimer(t){return setTimeout(()=>this.abortController.abort(),pn(t))}}var oy=Object.defineProperty,bf=Object.getOwnPropertySymbols,ay=Object.prototype.hasOwnProperty,uy=Object.prototype.propertyIsEnumerable,Ef=(u,t,r)=>t in u?oy(u,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[t]=r,wf=(u,t)=>{for(var r in t||(t={}))ay.call(t,r)&&Ef(u,r,t[r]);if(bf)for(var r of bf(t))uy.call(t,r)&&Ef(u,r,t[r]);return u};class ja extends F{constructor(t){super(t),this.protocol="wc",this.version=2,this.name="core",this.events=new _e.EventEmitter,this.initialized=!1,this.on=(o,a)=>this.events.on(o,a),this.once=(o,a)=>this.events.once(o,a),this.off=(o,a)=>this.events.off(o,a),this.removeListener=(o,a)=>this.events.removeListener(o,a),this.projectId=t?.projectId,this.relayUrl=t?.relayUrl||ff;const r=typeof t?.logger<"u"&&"string"!=typeof t?.logger?t.logger:(0,B.pino)((0,B.getDefaultLoggerOptions)({level:t?.logger||"error"}));this.logger=(0,B.generateChildLogger)(r,this.name),this.heartbeat=new ee.HeartBeat,this.crypto=new M0(this,this.logger,t?.keychain),this.history=new ny(this,this.logger),this.expirer=new iy(this,this.logger),this.storage=null!=t&&t.storage?t.storage:new we.ZP(wf(wf({},d0),t?.storageOptions)),this.relayer=new Q0({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new ry(this,this.logger),this.verify=new sy(this.projectId||"",this.logger)}static init(t){return O(function*(){const r=new ja(t);return yield r.initialize(),r})()}get context(){return(0,B.getLoggerContext)(this.logger)}start(){var t=this;return O(function*(){t.initialized||(yield t.initialize())})()}initialize(){var t=this;return O(function*(){t.logger.trace("Initialized");try{yield t.crypto.init(),yield t.history.init(),yield t.expirer.init(),yield t.relayer.init(),yield t.heartbeat.init(),yield t.pairing.init(),t.initialized=!0,t.logger.info("Core Initialization Success")}catch(r){throw t.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,r),t.logger.error(r.message),r}})()}}const cy=ja,Ma="wc@2:client:",Of="Proposal expired",no=Z.SEVEN_DAYS,ds={wc_sessionPropose:{req:{ttl:Z.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Z.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Z.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Z.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Z.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Z.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Z.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Z.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Z.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Z.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Z.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Z.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Z.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Z.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Z.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Z.THIRTY_SECONDS,prompt:!1,tag:1115}}},Ha={min:Z.FIVE_MINUTES,max:Z.SEVEN_DAYS},py=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var gy=Object.defineProperty,yy=Object.defineProperties,vy=Object.getOwnPropertyDescriptors,If=Object.getOwnPropertySymbols,my=Object.prototype.hasOwnProperty,_y=Object.prototype.propertyIsEnumerable,Rf=(u,t,r)=>t in u?gy(u,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[t]=r,Qr=(u,t)=>{for(var r in t||(t={}))my.call(t,r)&&Rf(u,r,t[r]);if(If)for(var r of If(t))_y.call(t,r)&&Rf(u,r,t[r]);return u},$a=(u,t)=>yy(u,vy(t));class by extends class G{constructor(t){this.client=t}}{constructor(t){var r;super(t),r=this,this.name="engine",this.events=new(De()),this.initialized=!1,this.ignoredPayloadTypes=[1],this.init=O(function*(){r.initialized||(yield r.cleanup(),r.registerRelayerEvents(),r.registerExpirerEvents(),r.client.core.pairing.register({methods:Object.keys(ds)}),r.initialized=!0)}),this.connect=function(){var o=O(function*(a){r.isInitialized();const l=$a(Qr({},a),{requiredNamespaces:a.requiredNamespaces||{},optionalNamespaces:a.optionalNamespaces||{}});yield r.isValidConnect(l);const{pairingTopic:m,requiredNamespaces:T,optionalNamespaces:X,sessionProperties:Q,relays:ge}=l;let Xe,Oe=m,xt=!1;if(Oe&&(xt=r.client.core.pairing.pairings.get(Oe).active),!Oe||!xt){const{topic:vt,uri:Ut}=yield r.client.core.pairing.create();Oe=vt,Xe=Ut}const Be=yield r.client.core.crypto.generateKeyPair(),tt=Qr({requiredNamespaces:T,optionalNamespaces:X,relays:ge??[{protocol:"irn"}],proposer:{publicKey:Be,metadata:r.client.metadata}},Q&&{sessionProperties:Q}),{reject:Qe,resolve:Nt,done:dr}=Ni(Z.FIVE_MINUTES,Of);if(r.events.once(cr("session_connect"),function(){var vt=O(function*({error:Ut,session:Ot}){if(Ut)Qe(Ut);else if(Ot){Ot.self.publicKey=Be;const _r=$a(Qr({},Ot),{requiredNamespaces:Ot.requiredNamespaces,optionalNamespaces:Ot.optionalNamespaces});yield r.client.session.set(Ot.topic,_r),yield r.setExpiry(Ot.topic,Ot.expiry),Oe&&(yield r.client.core.pairing.updateMetadata({topic:Oe,metadata:Ot.peer.metadata})),Nt(_r)}});return function(Ut){return vt.apply(this,arguments)}}()),!Oe){const{message:vt}=Ne("NO_MATCHING_KEY",`connect() pairing topic: ${Oe}`);throw new Error(vt)}const Ct=yield r.sendRequest(Oe,"wc_sessionPropose",tt),Pt=pn(Z.FIVE_MINUTES);return yield r.setProposal(Ct,Qr({id:Ct,expiry:Pt},tt)),{uri:Xe,approval:dr}});return function(a){return o.apply(this,arguments)}}(),this.pair=function(){var o=O(function*(a){return r.isInitialized(),yield r.client.core.pairing.pair(a)});return function(a){return o.apply(this,arguments)}}(),this.approve=function(){var o=O(function*(a){r.isInitialized(),yield r.isValidApprove(a);const{id:l,relayProtocol:m,namespaces:T,sessionProperties:X}=a,Q=r.client.proposal.get(l);let{pairingTopic:ge,proposer:Oe,requiredNamespaces:Xe,optionalNamespaces:xt}=Q;ge=ge||"",pi(Xe)||(Xe=function fp(u,t){const r=eo(u,t);if(r)throw new Error(r.message);const o={};for(const[a,l]of Object.entries(u))o[a]={methods:l.methods,events:l.events,chains:l.accounts.map(m=>`${m.split(":")[0]}:${m.split(":")[1]}`)};return o}(T,"approve()"));const Be=yield r.client.core.crypto.generateKeyPair(),tt=Oe.publicKey,Qe=yield r.client.core.crypto.generateSharedKey(Be,tt);ge&&l&&(yield r.client.core.pairing.updateMetadata({topic:ge,metadata:Oe.metadata}),yield r.sendResult(l,ge,{relay:{protocol:m??"irn"},responderPublicKey:Be}),yield r.client.proposal.delete(l,fr("USER_DISCONNECTED")),yield r.client.core.pairing.activate({topic:ge}));const Nt=Qr({relay:{protocol:m??"irn"},namespaces:T,requiredNamespaces:Xe,optionalNamespaces:xt,pairingTopic:ge,controller:{publicKey:Be,metadata:r.client.metadata},expiry:pn(no)},X&&{sessionProperties:X});yield r.client.core.relayer.subscribe(Qe),yield r.sendRequest(Qe,"wc_sessionSettle",Nt);const dr=$a(Qr({},Nt),{topic:Qe,pairingTopic:ge,acknowledged:!1,self:Nt.controller,peer:{publicKey:Oe.publicKey,metadata:Oe.metadata},controller:Be});return yield r.client.session.set(Qe,dr),yield r.setExpiry(Qe,pn(no)),{topic:Qe,acknowledged:()=>new Promise(Ct=>Ct(r.client.session.get(Qe)))}});return function(a){return o.apply(this,arguments)}}(),this.reject=function(){var o=O(function*(a){r.isInitialized(),yield r.isValidReject(a);const{id:l,reason:m}=a,{pairingTopic:T}=r.client.proposal.get(l);T&&(yield r.sendError(l,T,m),yield r.client.proposal.delete(l,fr("USER_DISCONNECTED")))});return function(a){return o.apply(this,arguments)}}(),this.update=function(){var o=O(function*(a){r.isInitialized(),yield r.isValidUpdate(a);const{topic:l,namespaces:m}=a,T=yield r.sendRequest(l,"wc_sessionUpdate",{namespaces:m}),{done:X,resolve:Q,reject:ge}=Ni();return r.events.once(cr("session_update",T),({error:Oe})=>{Oe?ge(Oe):Q()}),yield r.client.session.update(l,{namespaces:m}),{acknowledged:X}});return function(a){return o.apply(this,arguments)}}(),this.extend=function(){var o=O(function*(a){r.isInitialized(),yield r.isValidExtend(a);const{topic:l}=a,m=yield r.sendRequest(l,"wc_sessionExtend",{}),{done:T,resolve:X,reject:Q}=Ni();return r.events.once(cr("session_extend",m),({error:ge})=>{ge?Q(ge):X()}),yield r.setExpiry(l,pn(no)),{acknowledged:T}});return function(a){return o.apply(this,arguments)}}(),this.request=function(){var o=O(function*(a){r.isInitialized(),yield r.isValidRequest(a);const{chainId:l,request:m,topic:T,expiry:X}=a,Q=yield r.sendRequest(T,"wc_sessionRequest",{request:m,chainId:l},X),{done:ge,resolve:Oe,reject:Xe}=Ni(X);return r.events.once(cr("session_request",Q),({error:xt,result:Be})=>{xt?Xe(xt):Oe(Be)}),r.client.events.emit("session_request_sent",{topic:T,request:m,chainId:l,id:Q}),yield ge()});return function(a){return o.apply(this,arguments)}}(),this.respond=function(){var o=O(function*(a){r.isInitialized(),yield r.isValidRespond(a);const{topic:l,response:m}=a,{id:T}=m;(0,qe.isJsonRpcResult)(m)?yield r.sendResult(T,l,m.result):(0,qe.isJsonRpcError)(m)&&(yield r.sendError(T,l,m.error)),r.deletePendingSessionRequest(a.response.id,{message:"fulfilled",code:0})});return function(a){return o.apply(this,arguments)}}(),this.ping=function(){var o=O(function*(a){r.isInitialized(),yield r.isValidPing(a);const{topic:l}=a;if(r.client.session.keys.includes(l)){const m=yield r.sendRequest(l,"wc_sessionPing",{}),{done:T,resolve:X,reject:Q}=Ni();r.events.once(cr("session_ping",m),({error:ge})=>{ge?Q(ge):X()}),yield T()}else r.client.core.pairing.pairings.keys.includes(l)&&(yield r.client.core.pairing.ping({topic:l}))});return function(a){return o.apply(this,arguments)}}(),this.emit=function(){var o=O(function*(a){r.isInitialized(),yield r.isValidEmit(a);const{topic:l,event:m,chainId:T}=a;yield r.sendRequest(l,"wc_sessionEvent",{event:m,chainId:T})});return function(a){return o.apply(this,arguments)}}(),this.disconnect=function(){var o=O(function*(a){r.isInitialized(),yield r.isValidDisconnect(a);const{topic:l}=a;r.client.session.keys.includes(l)?(yield r.sendRequest(l,"wc_sessionDelete",fr("USER_DISCONNECTED")),yield r.deleteSession(l)):yield r.client.core.pairing.disconnect({topic:l})});return function(a){return o.apply(this,arguments)}}(),this.find=o=>(this.isInitialized(),this.client.session.getAll().filter(a=>function dp(u,t){const{requiredNamespaces:r}=t,o=Object.keys(u.namespaces),a=Object.keys(r);let l=!0;return!!di(a,o)&&(o.forEach(m=>{const{accounts:T,methods:X,events:Q}=u.namespaces[m],ge=Ui(T),Oe=r[m];di(zr(m,Oe),ge)&&di(Oe.methods,X)&&di(Oe.events,Q)||(l=!1)}),l)}(a,o))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.deleteSession=function(){var o=O(function*(a,l){const{self:m}=r.client.session.get(a);yield r.client.core.relayer.unsubscribe(a),yield Promise.all([r.client.session.delete(a,fr("USER_DISCONNECTED")),r.client.core.crypto.deleteKeyPair(m.publicKey),r.client.core.crypto.deleteSymKey(a),l?Promise.resolve():r.client.core.expirer.del(a)])});return function(a,l){return o.apply(this,arguments)}}(),this.deleteProposal=function(){var o=O(function*(a,l){yield Promise.all([r.client.proposal.delete(a,fr("USER_DISCONNECTED")),l?Promise.resolve():r.client.core.expirer.del(a)])});return function(a,l){return o.apply(this,arguments)}}(),this.deletePendingSessionRequest=function(){var o=O(function*(a,l,m=!1){yield Promise.all([r.client.pendingRequest.delete(a,l),m?Promise.resolve():r.client.core.expirer.del(a)])});return function(a,l){return o.apply(this,arguments)}}(),this.setExpiry=function(){var o=O(function*(a,l){r.client.session.keys.includes(a)&&(yield r.client.session.update(a,{expiry:l})),r.client.core.expirer.set(a,l)});return function(a,l){return o.apply(this,arguments)}}(),this.setProposal=function(){var o=O(function*(a,l){yield r.client.proposal.set(a,l),r.client.core.expirer.set(a,l.expiry)});return function(a,l){return o.apply(this,arguments)}}(),this.setPendingSessionRequest=function(){var o=O(function*(a){const l=ds.wc_sessionRequest.req.ttl,{id:m,topic:T,params:X}=a;yield r.client.pendingRequest.set(m,{id:m,topic:T,params:X}),l&&r.client.core.expirer.set(m,pn(l))});return function(a){return o.apply(this,arguments)}}(),this.sendRequest=function(){var o=O(function*(a,l,m,T){const X=(0,qe.formatJsonRpcRequest)(l,m);if(Oa()&&py.includes(l)){const Oe=hi(JSON.stringify(X));yield r.client.core.verify.register({attestationId:Oe})}const Q=yield r.client.core.crypto.encode(a,X),ge=ds[l].req;return T&&(ge.ttl=T),r.client.core.history.set(a,X),r.client.core.relayer.publish(a,Q,ge),X.id});return function(a,l,m,T){return o.apply(this,arguments)}}(),this.sendResult=function(){var o=O(function*(a,l,m){const T=(0,qe.formatJsonRpcResult)(a,m),X=yield r.client.core.crypto.encode(l,T),Q=yield r.client.core.history.get(l,a);r.client.core.relayer.publish(l,X,ds[Q.request.method].res),yield r.client.core.history.resolve(T)});return function(a,l,m){return o.apply(this,arguments)}}(),this.sendError=function(){var o=O(function*(a,l,m){const T=(0,qe.formatJsonRpcError)(a,m),X=yield r.client.core.crypto.encode(l,T),Q=yield r.client.core.history.get(l,a);r.client.core.relayer.publish(l,X,ds[Q.request.method].res),yield r.client.core.history.resolve(T)});return function(a,l,m){return o.apply(this,arguments)}}(),this.cleanup=O(function*(){const o=[],a=[];r.client.session.getAll().forEach(l=>{Wn(l.expiry)&&o.push(l.topic)}),r.client.proposal.getAll().forEach(l=>{Wn(l.expiry)&&a.push(l.id)}),yield Promise.all([...o.map(l=>r.deleteSession(l)),...a.map(l=>r.deleteProposal(l))])}),this.onRelayEventRequest=o=>{const{topic:a,payload:l}=o,m=l.method;switch(m){case"wc_sessionPropose":return this.onSessionProposeRequest(a,l);case"wc_sessionSettle":return this.onSessionSettleRequest(a,l);case"wc_sessionUpdate":return this.onSessionUpdateRequest(a,l);case"wc_sessionExtend":return this.onSessionExtendRequest(a,l);case"wc_sessionPing":return this.onSessionPingRequest(a,l);case"wc_sessionDelete":return this.onSessionDeleteRequest(a,l);case"wc_sessionRequest":return this.onSessionRequest(a,l);case"wc_sessionEvent":return this.onSessionEventRequest(a,l);default:return this.client.logger.info(`Unsupported request method ${m}`)}},this.onRelayEventResponse=function(){var o=O(function*(a){const{topic:l,payload:m}=a,T=(yield r.client.core.history.get(l,m.id)).request.method;switch(T){case"wc_sessionPropose":return r.onSessionProposeResponse(l,m);case"wc_sessionSettle":return r.onSessionSettleResponse(l,m);case"wc_sessionUpdate":return r.onSessionUpdateResponse(l,m);case"wc_sessionExtend":return r.onSessionExtendResponse(l,m);case"wc_sessionPing":return r.onSessionPingResponse(l,m);case"wc_sessionRequest":return r.onSessionRequestResponse(l,m);default:return r.client.logger.info(`Unsupported response method ${T}`)}});return function(a){return o.apply(this,arguments)}}(),this.onSessionProposeRequest=function(){var o=O(function*(a,l){const{params:m,id:T}=l;try{r.isValidConnect(Qr({},l.params));const X=pn(Z.FIVE_MINUTES),Q=Qr({id:T,pairingTopic:a,expiry:X},m);yield r.setProposal(T,Q);const ge=hi(JSON.stringify(l)),Oe=yield r.getVerifyContext(ge,Q.proposer.metadata);r.client.events.emit("session_proposal",{id:T,params:Q,context:Oe})}catch(X){yield r.sendError(T,a,X),r.client.logger.error(X)}});return function(a,l){return o.apply(this,arguments)}}(),this.onSessionProposeResponse=function(){var o=O(function*(a,l){const{id:m}=l;if((0,qe.isJsonRpcResult)(l)){const{result:T}=l;r.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:T});const X=r.client.proposal.get(m);r.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:X});const Q=X.proposer.publicKey;r.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:Q});const ge=T.responderPublicKey;r.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:ge});const Oe=yield r.client.core.crypto.generateSharedKey(Q,ge);r.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:Oe});const Xe=yield r.client.core.relayer.subscribe(Oe);r.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:Xe}),yield r.client.core.pairing.activate({topic:a})}else(0,qe.isJsonRpcError)(l)&&(yield r.client.proposal.delete(m,fr("USER_DISCONNECTED")),r.events.emit(cr("session_connect"),{error:l.error}))});return function(a,l){return o.apply(this,arguments)}}(),this.onSessionSettleRequest=function(){var o=O(function*(a,l){const{id:m,params:T}=l;try{r.isValidSessionSettleRequest(T);const{relay:X,controller:Q,expiry:ge,namespaces:Oe,requiredNamespaces:Xe,optionalNamespaces:xt,sessionProperties:Be,pairingTopic:tt}=l.params,Qe=Qr({topic:a,relay:X,expiry:ge,namespaces:Oe,acknowledged:!0,pairingTopic:tt,requiredNamespaces:Xe,optionalNamespaces:xt,controller:Q.publicKey,self:{publicKey:"",metadata:r.client.metadata},peer:{publicKey:Q.publicKey,metadata:Q.metadata}},Be&&{sessionProperties:Be});yield r.sendResult(l.id,a,!0),r.events.emit(cr("session_connect"),{session:Qe})}catch(X){yield r.sendError(m,a,X),r.client.logger.error(X)}});return function(a,l){return o.apply(this,arguments)}}(),this.onSessionSettleResponse=function(){var o=O(function*(a,l){const{id:m}=l;(0,qe.isJsonRpcResult)(l)?(yield r.client.session.update(a,{acknowledged:!0}),r.events.emit(cr("session_approve",m),{})):(0,qe.isJsonRpcError)(l)&&(yield r.client.session.delete(a,fr("USER_DISCONNECTED")),r.events.emit(cr("session_approve",m),{error:l.error}))});return function(a,l){return o.apply(this,arguments)}}(),this.onSessionUpdateRequest=function(){var o=O(function*(a,l){const{params:m,id:T}=l;try{r.isValidUpdate(Qr({topic:a},m)),yield r.client.session.update(a,{namespaces:m.namespaces}),yield r.sendResult(T,a,!0),r.client.events.emit("session_update",{id:T,topic:a,params:m})}catch(X){yield r.sendError(T,a,X),r.client.logger.error(X)}});return function(a,l){return o.apply(this,arguments)}}(),this.onSessionUpdateResponse=(o,a)=>{const{id:l}=a;(0,qe.isJsonRpcResult)(a)?this.events.emit(cr("session_update",l),{}):(0,qe.isJsonRpcError)(a)&&this.events.emit(cr("session_update",l),{error:a.error})},this.onSessionExtendRequest=function(){var o=O(function*(a,l){const{id:m}=l;try{r.isValidExtend({topic:a}),yield r.setExpiry(a,pn(no)),yield r.sendResult(m,a,!0),r.client.events.emit("session_extend",{id:m,topic:a})}catch(T){yield r.sendError(m,a,T),r.client.logger.error(T)}});return function(a,l){return o.apply(this,arguments)}}(),this.onSessionExtendResponse=(o,a)=>{const{id:l}=a;(0,qe.isJsonRpcResult)(a)?this.events.emit(cr("session_extend",l),{}):(0,qe.isJsonRpcError)(a)&&this.events.emit(cr("session_extend",l),{error:a.error})},this.onSessionPingRequest=function(){var o=O(function*(a,l){const{id:m}=l;try{r.isValidPing({topic:a}),yield r.sendResult(m,a,!0),r.client.events.emit("session_ping",{id:m,topic:a})}catch(T){yield r.sendError(m,a,T),r.client.logger.error(T)}});return function(a,l){return o.apply(this,arguments)}}(),this.onSessionPingResponse=(o,a)=>{const{id:l}=a;setTimeout(()=>{(0,qe.isJsonRpcResult)(a)?this.events.emit(cr("session_ping",l),{}):(0,qe.isJsonRpcError)(a)&&this.events.emit(cr("session_ping",l),{error:a.error})},500)},this.onSessionDeleteRequest=function(){var o=O(function*(a,l){const{id:m}=l;try{r.isValidDisconnect({topic:a,reason:l.params}),yield Promise.all([new Promise(T=>{r.client.core.relayer.once("relayer_publish",O(function*(){T(yield r.deleteSession(a))}))}),r.sendResult(m,a,!0)]),r.client.events.emit("session_delete",{id:m,topic:a})}catch(T){yield r.sendError(m,a,T),r.client.logger.error(T)}});return function(a,l){return o.apply(this,arguments)}}(),this.onSessionRequest=function(){var o=O(function*(a,l){const{id:m,params:T}=l;try{r.isValidRequest(Qr({topic:a},T)),yield r.setPendingSessionRequest({id:m,topic:a,params:T});const X=hi(JSON.stringify(l)),Q=r.client.session.get(a),ge=yield r.getVerifyContext(X,Q.peer.metadata);r.client.events.emit("session_request",{id:m,topic:a,params:T,context:ge})}catch(X){yield r.sendError(m,a,X),r.client.logger.error(X)}});return function(a,l){return o.apply(this,arguments)}}(),this.onSessionRequestResponse=(o,a)=>{const{id:l}=a;(0,qe.isJsonRpcResult)(a)?this.events.emit(cr("session_request",l),{result:a.result}):(0,qe.isJsonRpcError)(a)&&this.events.emit(cr("session_request",l),{error:a.error})},this.onSessionEventRequest=function(){var o=O(function*(a,l){const{id:m,params:T}=l;try{r.isValidEmit(Qr({topic:a},T)),r.client.events.emit("session_event",{id:m,topic:a,params:T})}catch(X){yield r.sendError(m,a,X),r.client.logger.error(X)}});return function(a,l){return o.apply(this,arguments)}}(),this.isValidConnect=function(){var o=O(function*(a){if(!Lr(a)){const{message:ge}=Ne("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(a)}`);throw new Error(ge)}const{pairingTopic:l,requiredNamespaces:m,optionalNamespaces:T,sessionProperties:X,relays:Q}=a;if(Ar(l)||(yield r.isValidPairingTopic(l)),!function Sp(u,t){let r=!1;return t&&!u?r=!0:u&&Li(u)&&u.length&&u.forEach(o=>{r=Hc(o)}),r}(Q,!0)){const{message:ge}=Ne("MISSING_OR_INVALID",`connect() relays: ${Q}`);throw new Error(ge)}!Ar(m)&&0!==pi(m)&&r.validateNamespaces(m,"requiredNamespaces"),!Ar(T)&&0!==pi(T)&&r.validateNamespaces(T,"optionalNamespaces"),Ar(X)||r.validateSessionProps(X,"sessionProperties")});return function(a){return o.apply(this,arguments)}}(),this.validateNamespaces=(o,a)=>{const l=function xp(u,t,r){let o=null;if(u&&pi(u)){const a=Bc(u,t);a&&(o=a);const l=function bp(u,t){let r=null;return Object.entries(u).forEach(([o,a])=>{if(r)return;const l=function _p(u,t,r){let o=null;return Li(t)?t.forEach(a=>{o||(!Aa(a)||!a.includes(u))&&(o=fr("UNSUPPORTED_CHAINS",`${r}, chain ${a} should be a string and conform to "namespace:chainId" format`))}):o=fr("UNSUPPORTED_CHAINS",`${r}, chains ${t} should be an array of strings conforming to "namespace:chainId" format`),o}(o,zr(o,a),`${t} requiredNamespace`);l&&(r=l)}),r}(u,t);l&&(o=l)}else o=Ne("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return o}(o,"connect()",a);if(l)throw new Error(l.message)},this.isValidApprove=function(){var o=O(function*(a){if(!Lr(a))throw new Error(Ne("MISSING_OR_INVALID",`approve() params: ${a}`).message);const{id:l,namespaces:m,relayProtocol:T,sessionProperties:X}=a;yield r.isValidProposalId(l);const Q=r.client.proposal.get(l),ge=eo(m,"approve()");if(ge)throw new Error(ge.message);const Oe=Ca(Q.requiredNamespaces,m,"approve()");if(Oe)throw new Error(Oe.message);if(!vr(T,!0)){const{message:Xe}=Ne("MISSING_OR_INVALID",`approve() relayProtocol: ${T}`);throw new Error(Xe)}Ar(X)||r.validateSessionProps(X,"sessionProperties")});return function(a){return o.apply(this,arguments)}}(),this.isValidReject=function(){var o=O(function*(a){if(!Lr(a)){const{message:T}=Ne("MISSING_OR_INVALID",`reject() params: ${a}`);throw new Error(T)}const{id:l,reason:m}=a;if(yield r.isValidProposalId(l),!function Ip(u){return!!(u&&"object"==typeof u&&u.code&&Pa(u.code,!1)&&u.message&&vr(u.message,!1))}(m)){const{message:T}=Ne("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(m)}`);throw new Error(T)}});return function(a){return o.apply(this,arguments)}}(),this.isValidSessionSettleRequest=o=>{if(!Lr(o)){const{message:ge}=Ne("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${o}`);throw new Error(ge)}const{relay:a,controller:l,namespaces:m,expiry:T}=o;if(!Hc(a)){const{message:ge}=Ne("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(ge)}const X=function mp(u,t){let r=null;return vr(u?.publicKey,!1)||(r=Ne("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}(l,"onSessionSettleRequest()");if(X)throw new Error(X.message);const Q=eo(m,"onSessionSettleRequest()");if(Q)throw new Error(Q.message);if(Wn(T)){const{message:ge}=Ne("EXPIRED","onSessionSettleRequest()");throw new Error(ge)}},this.isValidUpdate=function(){var o=O(function*(a){if(!Lr(a)){const{message:ge}=Ne("MISSING_OR_INVALID",`update() params: ${a}`);throw new Error(ge)}const{topic:l,namespaces:m}=a;yield r.isValidSessionTopic(l);const T=r.client.session.get(l),X=eo(m,"update()");if(X)throw new Error(X.message);const Q=Ca(T.requiredNamespaces,m,"update()");if(Q)throw new Error(Q.message)});return function(a){return o.apply(this,arguments)}}(),this.isValidExtend=function(){var o=O(function*(a){if(!Lr(a)){const{message:m}=Ne("MISSING_OR_INVALID",`extend() params: ${a}`);throw new Error(m)}const{topic:l}=a;yield r.isValidSessionTopic(l)});return function(a){return o.apply(this,arguments)}}(),this.isValidRequest=function(){var o=O(function*(a){if(!Lr(a)){const{message:ge}=Ne("MISSING_OR_INVALID",`request() params: ${a}`);throw new Error(ge)}const{topic:l,request:m,chainId:T,expiry:X}=a;yield r.isValidSessionTopic(l);const{namespaces:Q}=r.client.session.get(l);if(!$c(Q,T)){const{message:ge}=Ne("MISSING_OR_INVALID",`request() chainId: ${T}`);throw new Error(ge)}if(!function Rp(u){return!(Ar(u)||!vr(u.method,!1))}(m)){const{message:ge}=Ne("MISSING_OR_INVALID",`request() ${JSON.stringify(m)}`);throw new Error(ge)}if(!function Cp(u,t,r){return!!vr(r,!1)&&function up(u,t){const r=[];return Object.values(u).forEach(o=>{Ui(o.accounts).includes(t)&&r.push(...o.methods)}),r}(u,t).includes(r)}(Q,T,m.method)){const{message:ge}=Ne("MISSING_OR_INVALID",`request() method: ${m.method}`);throw new Error(ge)}if(X&&!function Lp(u,t){return Pa(u,!1)&&u<=t.max&&u>=t.min}(X,Ha)){const{message:ge}=Ne("MISSING_OR_INVALID",`request() expiry: ${X}. Expiry must be a number (in seconds) between ${Ha.min} and ${Ha.max}`);throw new Error(ge)}});return function(a){return o.apply(this,arguments)}}(),this.isValidRespond=function(){var o=O(function*(a){if(!Lr(a)){const{message:T}=Ne("MISSING_OR_INVALID",`respond() params: ${a}`);throw new Error(T)}const{topic:l,response:m}=a;if(yield r.isValidSessionTopic(l),!function Pp(u){return!(Ar(u)||Ar(u.result)&&Ar(u.error)||!Pa(u.id,!1)||!vr(u.jsonrpc,!1))}(m)){const{message:T}=Ne("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(m)}`);throw new Error(T)}});return function(a){return o.apply(this,arguments)}}(),this.isValidPing=function(){var o=O(function*(a){if(!Lr(a)){const{message:m}=Ne("MISSING_OR_INVALID",`ping() params: ${a}`);throw new Error(m)}const{topic:l}=a;yield r.isValidSessionOrPairingTopic(l)});return function(a){return o.apply(this,arguments)}}(),this.isValidEmit=function(){var o=O(function*(a){if(!Lr(a)){const{message:Q}=Ne("MISSING_OR_INVALID",`emit() params: ${a}`);throw new Error(Q)}const{topic:l,event:m,chainId:T}=a;yield r.isValidSessionTopic(l);const{namespaces:X}=r.client.session.get(l);if(!$c(X,T)){const{message:Q}=Ne("MISSING_OR_INVALID",`emit() chainId: ${T}`);throw new Error(Q)}if(!function Ap(u){return!(Ar(u)||!vr(u.name,!1))}(m)){const{message:Q}=Ne("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(m)}`);throw new Error(Q)}if(!function Tp(u,t,r){return!!vr(r,!1)&&function cp(u,t){const r=[];return Object.values(u).forEach(o=>{Ui(o.accounts).includes(t)&&r.push(...o.events)}),r}(u,t).includes(r)}(X,T,m.name)){const{message:Q}=Ne("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(m)}`);throw new Error(Q)}});return function(a){return o.apply(this,arguments)}}(),this.isValidDisconnect=function(){var o=O(function*(a){if(!Lr(a)){const{message:m}=Ne("MISSING_OR_INVALID",`disconnect() params: ${a}`);throw new Error(m)}const{topic:l}=a;yield r.isValidSessionOrPairingTopic(l)});return function(a){return o.apply(this,arguments)}}(),this.getVerifyContext=function(){var o=O(function*(a,l){const m={verified:{verifyUrl:l.verifyUrl||"",validation:"UNKNOWN",origin:l.url||""}};try{const T=yield r.client.core.verify.resolve({attestationId:a,verifyUrl:l.verifyUrl});m.verified.origin=T,m.verified.validation=T===l.url?"VALID":"INVALID"}catch(T){r.client.logger.error(T)}return r.client.logger.info(`Verify context: ${JSON.stringify(m)}`),m});return function(a,l){return o.apply(this,arguments)}}(),this.validateSessionProps=(o,a)=>{Object.values(o).forEach(l=>{if(!vr(l,!1)){const{message:m}=Ne("MISSING_OR_INVALID",`${a} must be in Record format. Received: ${JSON.stringify(l)}`);throw new Error(m)}})}}isInitialized(){if(!this.initialized){const{message:t}=Ne("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){var t=this;this.client.core.relayer.on("relayer_message",function(){var r=O(function*(o){const{topic:a,message:l}=o;if(t.ignoredPayloadTypes.includes(t.client.core.crypto.getPayloadType(l)))return;const m=yield t.client.core.crypto.decode(a,l);(0,qe.isJsonRpcRequest)(m)?(t.client.core.history.set(a,m),t.onRelayEventRequest({topic:a,payload:m})):(0,qe.isJsonRpcResponse)(m)&&(yield t.client.core.history.resolve(m),t.onRelayEventResponse({topic:a,payload:m}))});return function(o){return r.apply(this,arguments)}}())}registerExpirerEvents(){var t=this;this.client.core.expirer.on(Zr_expired,function(){var r=O(function*(o){const{topic:a,id:l}=Tc(o.target);if(l&&t.client.pendingRequest.keys.includes(l))return yield t.deletePendingSessionRequest(l,Ne("EXPIRED"),!0);a?t.client.session.keys.includes(a)&&(yield t.deleteSession(a,!0),t.client.events.emit("session_expire",{topic:a})):l&&(yield t.deleteProposal(l,!0),t.client.events.emit("proposal_expire",{id:l}))});return function(o){return r.apply(this,arguments)}}())}isValidPairingTopic(t){if(!vr(t,!1)){const{message:r}=Ne("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:r}=Ne("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(r)}if(Wn(this.client.core.pairing.pairings.get(t).expiry)){const{message:r}=Ne("EXPIRED",`pairing topic: ${t}`);throw new Error(r)}}isValidSessionTopic(t){var r=this;return O(function*(){if(!vr(t,!1)){const{message:o}=Ne("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw new Error(o)}if(!r.client.session.keys.includes(t)){const{message:o}=Ne("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw new Error(o)}if(Wn(r.client.session.get(t).expiry)){yield r.deleteSession(t);const{message:o}=Ne("EXPIRED",`session topic: ${t}`);throw new Error(o)}})()}isValidSessionOrPairingTopic(t){var r=this;return O(function*(){if(r.client.session.keys.includes(t))yield r.isValidSessionTopic(t);else{if(!r.client.core.pairing.pairings.keys.includes(t)){if(vr(t,!1)){const{message:o}=Ne("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw new Error(o)}{const{message:o}=Ne("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw new Error(o)}}r.isValidPairingTopic(t)}})()}isValidProposalId(t){var r=this;return O(function*(){if(!function Op(u){return"number"==typeof u}(t)){const{message:o}=Ne("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw new Error(o)}if(!r.client.proposal.keys.includes(t)){const{message:o}=Ne("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw new Error(o)}if(Wn(r.client.proposal.get(t).expiry)){yield r.deleteProposal(t);const{message:o}=Ne("EXPIRED",`proposal id: ${t}`);throw new Error(o)}})()}}class Ey extends ro{constructor(t,r){super(t,r,"proposal",Ma),this.core=t,this.logger=r}}class wy extends ro{constructor(t,r){super(t,r,"session",Ma),this.core=t,this.logger=r}}class Dy extends ro{constructor(t,r){super(t,r,"request",Ma,o=>o.id),this.core=t,this.logger=r}}class za extends class W{constructor(t){this.opts=t,this.protocol="wc",this.version=2}}{constructor(t){var r;super(t),r=this,this.protocol="wc",this.version=2,this.name="client",this.events=new _e.EventEmitter,this.on=(a,l)=>this.events.on(a,l),this.once=(a,l)=>this.events.once(a,l),this.off=(a,l)=>this.events.off(a,l),this.removeListener=(a,l)=>this.events.removeListener(a,l),this.removeAllListeners=a=>this.events.removeAllListeners(a),this.connect=function(){var a=O(function*(l){try{return yield r.engine.connect(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.pair=function(){var a=O(function*(l){try{return yield r.engine.pair(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.approve=function(){var a=O(function*(l){try{return yield r.engine.approve(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.reject=function(){var a=O(function*(l){try{return yield r.engine.reject(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.update=function(){var a=O(function*(l){try{return yield r.engine.update(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.extend=function(){var a=O(function*(l){try{return yield r.engine.extend(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.request=function(){var a=O(function*(l){try{return yield r.engine.request(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.respond=function(){var a=O(function*(l){try{return yield r.engine.respond(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.ping=function(){var a=O(function*(l){try{return yield r.engine.ping(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.emit=function(){var a=O(function*(l){try{return yield r.engine.emit(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.disconnect=function(){var a=O(function*(l){try{return yield r.engine.disconnect(l)}catch(m){throw r.logger.error(m.message),m}});return function(l){return a.apply(this,arguments)}}(),this.find=a=>{try{return this.engine.find(a)}catch(l){throw this.logger.error(l.message),l}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(a){throw this.logger.error(a.message),a}},this.name=t?.name||"client",this.metadata=t?.metadata||function Ld(){return(0,ma.D)()||{name:"",description:"",url:"",icons:[""]}}();const o=typeof t?.logger<"u"&&"string"!=typeof t?.logger?t.logger:(0,B.pino)((0,B.getDefaultLoggerOptions)({level:t?.logger||"error"}));this.core=t?.core||new cy(t),this.logger=(0,B.generateChildLogger)(o,this.name),this.session=new wy(this.core,this.logger),this.proposal=new Ey(this.core,this.logger),this.pendingRequest=new Dy(this.core,this.logger),this.engine=new by(this)}static init(t){return O(function*(){const r=new za(t);return yield r.initialize(),r})()}get context(){return(0,B.getLoggerContext)(this.logger)}get pairing(){return this.core.pairing.pairings}initialize(){var t=this;return O(function*(){t.logger.trace("Initialized");try{yield t.core.start(),yield t.session.init(),yield t.proposal.init(),yield t.pendingRequest.init(),yield t.engine.init(),t.core.verify.init({verifyUrl:t.metadata.verifyUrl}),t.logger.info("SignClient Initialization Success")}catch(r){throw t.logger.info("SignClient Initialization Failure"),t.logger.error(r.message),r}})()}}var xy=D(5928),Pf=D.n(xy);const Af={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class Tf{constructor(t){if(this.url=t,this.events=new _e.EventEmitter,this.isAvailable=!1,this.registering=!1,!(0,qe.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,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}open(t=this.url){var r=this;return O(function*(){yield r.register(t)})()}close(){var t=this;return O(function*(){if(!t.isAvailable)throw new Error("Connection already closed");t.onClose()})()}send(t,r){var o=this;return O(function*(){o.isAvailable||(yield o.register());try{const a=Ce(t),m=yield(yield Pf()(o.url,Object.assign(Object.assign({},Af),{body:a}))).json();o.onPayload({data:m})}catch(a){o.onError(t.id,a)}})()}register(t=this.url){var r=this;return O(function*(){if(!(0,qe.isHttpUrl)(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);if(r.registering){const o=r.events.getMaxListeners();return(r.events.listenerCount("register_error")>=o||r.events.listenerCount("open")>=o)&&r.events.setMaxListeners(o+1),new Promise((a,l)=>{r.events.once("register_error",m=>{r.resetMaxListeners(),l(m)}),r.events.once("open",()=>{if(r.resetMaxListeners(),typeof r.isAvailable>"u")return l(new Error("HTTP connection is missing or invalid"));a()})})}r.url=t,r.registering=!0;try{const o=Ce({id:1,jsonrpc:"2.0",method:"test",params:[]});yield Pf()(t,Object.assign(Object.assign({},Af),{body:o})),r.onOpen()}catch(o){const a=r.parseError(o);throw r.events.emit("register_error",a),r.onClose(),a}})()}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(typeof t.data>"u")return;const r="string"==typeof t.data?xe(t.data):t.data;this.events.emit("payload",r)}onError(t,r){const o=this.parseError(r),a=o.message||o.toString(),l=(0,qe.formatJsonRpcError)(t,a);this.events.emit("payload",l)}parseError(t,r=this.url){return(0,qe.parseConnectionError)(t,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}const Fi=Tf,Uf="wc@2:universal_provider:";var u,t,ps=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ja={exports:{}};u=Ja,t=Ja.exports,function(){var r,m="Expected a function",X="__lodash_hash_undefined__",ge="__lodash_placeholder__",yi=1/0,Zn=9007199254740991,xn=4294967295,hv=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],ji="[object Arguments]",ao="[object Array]",gs="[object Boolean]",ys="[object Date]",uo="[object Error]",co="[object Function]",$f="[object GeneratorFunction]",gn="[object Map]",vs="[object Number]",Un="[object Object]",zf="[object Promise]",ms="[object RegExp]",yn="[object Set]",_s="[object String]",fo="[object Symbol]",bs="[object WeakMap]",Es="[object ArrayBuffer]",Mi="[object DataView]",Ga="[object Float32Array]",Ya="[object Float64Array]",qa="[object Int8Array]",Xa="[object Int16Array]",Za="[object Int32Array]",Qa="[object Uint8Array]",ka="[object Uint8ClampedArray]",eu="[object Uint16Array]",tu="[object Uint32Array]",_v=/\b__p \+= '';/g,bv=/\b(__p \+=) '' \+/g,Ev=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Jf=/&(?:amp|lt|gt|quot|#39);/g,Kf=/[&<>"']/g,wv=RegExp(Jf.source),Dv=RegExp(Kf.source),xv=/<%-([\s\S]+?)%>/g,Sv=/<%([\s\S]+?)%>/g,Vf=/<%=([\s\S]+?)%>/g,Ov=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Iv=/^\w*$/,Rv=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ru=/[\\^$.*+?()[\]{}|]/g,Pv=RegExp(ru.source),nu=/^\s+/,Av=/\s/,Cv=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tv=/\{\n\/\* \[wrapped with (.+)\] \*/,Nv=/,? & /,Uv=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Lv=/[()=,{}\[\]\/\s]/,Fv=/\\(\\)?/g,jv=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Wf=/\w*$/,Mv=/^[-+]0x[0-9a-f]+$/i,Bv=/^0b[01]+$/i,Hv=/^\[object .+?Constructor\]$/,$v=/^0o[0-7]+$/i,zv=/^(?:0|[1-9]\d*)$/,Jv=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lo=/($^)/,Kv=/['\n\r\u2028\u2029\\]/g,ho="\\ud800-\\udfff",Gf="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Yf="\\u2700-\\u27bf",qf="a-z\\xdf-\\xf6\\xf8-\\xff",Xf="A-Z\\xc0-\\xd6\\xd8-\\xde",Zf="\\ufe0e\\ufe0f",Qf="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Qv="["+ho+"]",kf="["+Qf+"]",po="["+Gf+"]",el="\\d+",kv="["+Yf+"]",tl="["+qf+"]",rl="[^"+ho+Qf+el+Yf+qf+Xf+"]",su="\\ud83c[\\udffb-\\udfff]",nl="[^"+ho+"]",ou="(?:\\ud83c[\\udde6-\\uddff]){2}",au="[\\ud800-\\udbff][\\udc00-\\udfff]",Bi="["+Xf+"]",sl="(?:"+tl+"|"+rl+")",t1="(?:"+Bi+"|"+rl+")",ol="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",al="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",ul="(?:"+po+"|"+su+")?",cl="["+Zf+"]?",fl=cl+ul+"(?:\\u200d(?:"+[nl,ou,au].join("|")+")"+cl+ul+")*",s1="(?:"+[kv,ou,au].join("|")+")"+fl,o1="(?:"+[nl+po+"?",po,ou,au,Qv].join("|")+")",a1=RegExp("['\u2019]","g"),u1=RegExp(po,"g"),uu=RegExp(su+"(?="+su+")|"+o1+fl,"g"),c1=RegExp([Bi+"?"+tl+"+"+ol+"(?="+[kf,Bi,"$"].join("|")+")",t1+"+"+al+"(?="+[kf,Bi+sl,"$"].join("|")+")",Bi+"?"+sl+"+"+ol,Bi+"+"+al,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",el,s1].join("|"),"g"),f1=RegExp("[\\u200d"+ho+Gf+Zf+"]"),l1=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,h1=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],d1=-1,Bt={};Bt[Ga]=Bt[Ya]=Bt[qa]=Bt[Xa]=Bt[Za]=Bt[Qa]=Bt[ka]=Bt[eu]=Bt[tu]=!0,Bt[ji]=Bt[ao]=Bt[Es]=Bt[gs]=Bt[Mi]=Bt[ys]=Bt[uo]=Bt[co]=Bt[gn]=Bt[vs]=Bt[Un]=Bt[ms]=Bt[yn]=Bt[_s]=Bt[bs]=!1;var jt={};jt[ji]=jt[ao]=jt[Es]=jt[Mi]=jt[gs]=jt[ys]=jt[Ga]=jt[Ya]=jt[qa]=jt[Xa]=jt[Za]=jt[gn]=jt[vs]=jt[Un]=jt[ms]=jt[yn]=jt[_s]=jt[fo]=jt[Qa]=jt[ka]=jt[eu]=jt[tu]=!0,jt[uo]=jt[co]=jt[bs]=!1;var v1={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},m1=parseFloat,_1=parseInt,ll="object"==typeof ps&&ps&&ps.Object===Object&&ps,b1="object"==typeof self&&self&&self.Object===Object&&self,xr=ll||b1||Function("return this")(),cu=t&&!t.nodeType&&t,vi=cu&&u&&!u.nodeType&&u,hl=vi&&vi.exports===cu,fu=hl&&ll.process,en=function(){try{return vi&&vi.require&&vi.require("util").types||fu&&fu.binding&&fu.binding("util")}catch{}}(),dl=en&&en.isArrayBuffer,pl=en&&en.isDate,gl=en&&en.isMap,yl=en&&en.isRegExp,vl=en&&en.isSet,ml=en&&en.isTypedArray;function Jr(ae,me,ye){switch(ye.length){case 0:return ae.call(me);case 1:return ae.call(me,ye[0]);case 2:return ae.call(me,ye[0],ye[1]);case 3:return ae.call(me,ye[0],ye[1],ye[2])}return ae.apply(me,ye)}function E1(ae,me,ye,Le){for(var ke=-1,It=null==ae?0:ae.length;++ke-1}function lu(ae,me,ye){for(var Le=-1,ke=null==ae?0:ae.length;++Le-1;);return ye}function Ol(ae,me){for(var ye=ae.length;ye--&&Hi(me,ae[ye],0)>-1;);return ye}function A1(ae,me){for(var ye=ae.length,Le=0;ye--;)ae[ye]===me&&++Le;return Le}var C1=gu({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),T1=gu({"&":"&","<":"<",">":">",'"':""","'":"'"});function N1(ae){return"\\"+v1[ae]}function $i(ae){return f1.test(ae)}function _u(ae){var me=-1,ye=Array(ae.size);return ae.forEach(function(Le,ke){ye[++me]=[ke,Le]}),ye}function Il(ae,me){return function(ye){return ae(me(ye))}}function ei(ae,me){for(var ye=-1,Le=ae.length,ke=0,It=[];++ye",""":'"',"'":"'"}),Ji=function ae(me){var e,ye=(me=null==me?xr:Ji.defaults(xr.Object(),me,Ji.pick(xr,h1))).Array,Le=me.Date,ke=me.Error,It=me.Function,pr=me.Math,Lt=me.Object,bu=me.RegExp,V1=me.String,rn=me.TypeError,mo=ye.prototype,Ki=Lt.prototype,_o=me["__core-js_shared__"],bo=It.prototype.toString,At=Ki.hasOwnProperty,G1=0,Pl=(e=/[^.]+$/.exec(_o&&_o.keys&&_o.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"",Eo=Ki.toString,Y1=bo.call(Lt),q1=xr._,X1=bu("^"+bo.call(At).replace(ru,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wo=hl?me.Buffer:r,ti=me.Symbol,Do=me.Uint8Array,Al=wo?wo.allocUnsafe:r,xo=Il(Lt.getPrototypeOf,Lt),Cl=Lt.create,Tl=Ki.propertyIsEnumerable,So=mo.splice,Nl=ti?ti.isConcatSpreadable:r,Ds=ti?ti.iterator:r,mi=ti?ti.toStringTag:r,Oo=function(){try{var e=Di(Lt,"defineProperty");return e({},"",{}),e}catch{}}(),Z1=me.clearTimeout!==xr.clearTimeout&&me.clearTimeout,Q1=Le&&Le.now!==xr.Date.now&&Le.now,k1=me.setTimeout!==xr.setTimeout&&me.setTimeout,Io=pr.ceil,Ro=pr.floor,Eu=Lt.getOwnPropertySymbols,em=wo?wo.isBuffer:r,Ul=me.isFinite,tm=mo.join,rm=Il(Lt.keys,Lt),gr=pr.max,Ir=pr.min,nm=Le.now,im=me.parseInt,Ll=pr.random,sm=mo.reverse,wu=Di(me,"DataView"),xs=Di(me,"Map"),Du=Di(me,"Promise"),Vi=Di(me,"Set"),Ss=Di(me,"WeakMap"),Os=Di(Lt,"create"),Po=Ss&&new Ss,Wi={},om=xi(wu),am=xi(xs),um=xi(Du),cm=xi(Vi),fm=xi(Ss),Ao=ti?ti.prototype:r,Is=Ao?Ao.valueOf:r,Fl=Ao?Ao.toString:r;function R(e){if(qt(e)&&!et(e)&&!(e instanceof pt)){if(e instanceof nn)return e;if(At.call(e,"__wrapped__"))return jh(e)}return new nn(e)}var Gi=function(){function e(){}return function(n){if(!Vt(n))return{};if(Cl)return Cl(n);e.prototype=n;var s=new e;return e.prototype=r,s}}();function Co(){}function nn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=r}function pt(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=xn,this.__views__=[]}function _i(e){var n=-1,s=null==e?0:e.length;for(this.clear();++n=n?e:n)),e}function sn(e,n,s,d,w,A){var K,q=1&n,fe=2&n,be=4&n;if(s&&(K=w?s(e,d,w,A):s(e)),K!==r)return K;if(!Vt(e))return e;var Ee=et(e);if(Ee){if(K=function I_(e){var n=e.length,s=new e.constructor(n);return n&&"string"==typeof e[0]&&At.call(e,"index")&&(s.index=e.index,s.input=e.input),s}(e),!q)return Fr(e,K)}else{var Ie=Rr(e),Te=Ie==co||Ie==$f;if(oi(e))return ch(e,q);if(Ie==Un||Ie==ji||Te&&!w){if(K=fe||Te?{}:Rh(e),!q)return fe?function y_(e,n){return On(e,Oh(e),n)}(e,function Bm(e,n){return e&&On(n,Mr(n),e)}(K,e)):function g_(e,n){return On(e,Yu(e),n)}(e,Bl(K,e))}else{if(!jt[Ie])return w?e:{};K=function R_(e,n,s){var d=e.constructor;switch(n){case Es:return $u(e);case gs:case ys:return new d(+e);case Mi:return function l_(e,n){var s=n?$u(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}(e,s);case Ga:case Ya:case qa:case Xa:case Za:case Qa:case ka:case eu:case tu:return fh(e,s);case gn:return new d;case vs:case _s:return new d(e);case ms:return function h_(e){var n=new e.constructor(e.source,Wf.exec(e));return n.lastIndex=e.lastIndex,n}(e);case yn:return new d;case fo:return function d_(e){return Is?Lt(Is.call(e)):{}}(e)}}(e,Ie,q)}}A||(A=new mn);var Me=A.get(e);if(Me)return Me;A.set(e,K),nd(e)?e.forEach(function(Ve){K.add(sn(Ve,n,s,Ve,e,A))}):td(e)&&e.forEach(function(Ve,ht){K.set(ht,sn(Ve,n,s,ht,e,A))});var st=Ee?r:(be?fe?Vu:Ku:fe?Mr:br)(e);return tn(st||e,function(Ve,ht){st&&(Ve=e[ht=Ve]),Rs(K,ht,sn(Ve,n,s,ht,e,A))}),K}function Hl(e,n,s){var d=s.length;if(null==e)return!d;for(e=Lt(e);d--;){var w=s[d],K=e[w];if(K===r&&!(w in e)||!(0,n[w])(K))return!1}return!0}function $l(e,n,s){if("function"!=typeof e)throw new rn(m);return Ls(function(){e.apply(r,s)},n)}function Ps(e,n,s,d){var w=-1,A=go,K=!0,q=e.length,fe=[],be=n.length;if(!q)return fe;s&&(n=Jt(n,Kr(s))),d?(A=lu,K=!1):n.length>=200&&(A=ws,K=!1,n=new bi(n));e:for(;++w-1},Ln.prototype.set=function Dm(e,n){var s=this.__data__,d=To(s,e);return d<0?(++this.size,s.push([e,n])):s[d][1]=n,this},Fn.prototype.clear=function xm(){this.size=0,this.__data__={hash:new _i,map:new(xs||Ln),string:new _i}},Fn.prototype.delete=function Sm(e){var n=Ko(this,e).delete(e);return this.size-=n?1:0,n},Fn.prototype.get=function Om(e){return Ko(this,e).get(e)},Fn.prototype.has=function Im(e){return Ko(this,e).has(e)},Fn.prototype.set=function Rm(e,n){var s=Ko(this,e),d=s.size;return s.set(e,n),this.size+=s.size==d?0:1,this},bi.prototype.add=bi.prototype.push=function Pm(e){return this.__data__.set(e,X),this},bi.prototype.has=function Am(e){return this.__data__.has(e)},mn.prototype.clear=function Cm(){this.__data__=new Ln,this.size=0},mn.prototype.delete=function Tm(e){var n=this.__data__,s=n.delete(e);return this.size=n.size,s},mn.prototype.get=function Nm(e){return this.__data__.get(e)},mn.prototype.has=function Um(e){return this.__data__.has(e)},mn.prototype.set=function Lm(e,n){var s=this.__data__;if(s instanceof Ln){var d=s.__data__;if(!xs||d.length<199)return d.push([e,n]),this.size=++s.size,this;s=this.__data__=new Fn(d)}return s.set(e,n),this.size=s.size,this};var ri=ph(Sn),zl=ph(Iu,!0);function $m(e,n){var s=!0;return ri(e,function(d,w,A){return s=!!n(d,w,A)}),s}function No(e,n,s){for(var d=-1,w=e.length;++d0&&s(q)?n>1?Sr(q,n-1,s,d,w):kn(w,q):d||(w[w.length]=q)}return w}var Ou=gh(),Kl=gh(!0);function Sn(e,n){return e&&Ou(e,n,br)}function Iu(e,n){return e&&Kl(e,n,br)}function Uo(e,n){return Qn(n,function(s){return $n(e[s])})}function wi(e,n){for(var s=0,d=(n=ii(n,e)).length;null!=e&&sn}function Jm(e,n){return null!=e&&At.call(e,n)}function Km(e,n){return null!=e&&n in Lt(e)}function Pu(e,n,s){for(var d=s?lu:go,w=e[0].length,A=e.length,K=A,q=ye(A),fe=1/0,be=[];K--;){var Ee=e[K];K&&n&&(Ee=Jt(Ee,Kr(n))),fe=Ir(Ee.length,fe),q[K]=!s&&(n||w>=120&&Ee.length>=120)?new bi(K&&Ee):r}Ee=e[0];var Ie=-1,Te=q[0];e:for(;++Ie=q?fe:fe*("desc"==s[d]?-1:1)}return e.index-n.index}(A,K,s)})}function eh(e,n,s){for(var d=-1,w=n.length,A={};++d-1;)q!==e&&So.call(q,fe,1),So.call(e,fe,1);return e}function th(e,n){for(var s=e?n.length:0,d=s-1;s--;){var w=n[s];if(s==d||w!==A){var A=w;Hn(w)?So.call(e,w,1):ju(e,w)}}return e}function Uu(e,n){return e+Ro(Ll()*(n-e+1))}function Lu(e,n){var s="";if(!e||n<1||n>Zn)return s;do{n%2&&(s+=e),(n=Ro(n/2))&&(e+=e)}while(n);return s}function at(e,n){return Qu(Ch(e,n,Br),e+"")}function s_(e){return Ml(Qi(e))}function o_(e,n){var s=Qi(e);return Vo(s,Ei(n,0,s.length))}function Ts(e,n,s,d){if(!Vt(e))return e;for(var w=-1,A=(n=ii(n,e)).length,K=A-1,q=e;null!=q&&++ww?0:w+n),(s=s>w?w:s)<0&&(s+=w),w=n>s?0:s-n>>>0,n>>>=0;for(var A=ye(w);++d>>1,K=e[A];null!==K&&!Wr(K)&&(s?K<=n:K=200){var be=n?null:b_(e);if(be)return vo(be);K=!1,w=ws,fe=new bi}else fe=n?[]:q;e:for(;++d=d?e:on(e,n,s)}var uh=Z1||function(e){return xr.clearTimeout(e)};function ch(e,n){if(n)return e.slice();var s=e.length,d=Al?Al(s):new e.constructor(s);return e.copy(d),d}function $u(e){var n=new e.constructor(e.byteLength);return new Do(n).set(new Do(e)),n}function fh(e,n){var s=n?$u(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function lh(e,n){if(e!==n){var s=e!==r,d=null===e,w=e==e,A=Wr(e),K=n!==r,q=null===n,fe=n==n,be=Wr(n);if(!q&&!be&&!A&&e>n||A&&K&&fe&&!q&&!be||d&&K&&fe||!s&&fe||!w)return 1;if(!d&&!A&&!be&&e1?s[w-1]:r,K=w>2?s[2]:r;for(A=e.length>3&&"function"==typeof A?(w--,A):r,K&&Tr(s[0],s[1],K)&&(A=w<3?r:A,w=1),n=Lt(n);++d-1?w[A?n[K]:K]:r}}function mh(e){return Bn(function(n){var s=n.length,d=s,w=nn.prototype.thru;for(e&&n.reverse();d--;){var A=n[d];if("function"!=typeof A)throw new rn(m);if(w&&!K&&"wrapper"==Jo(A))var K=new nn([],!0)}for(d=K?d:s;++d1&&mt.reverse(),Ee&&feq))return!1;var be=A.get(e),Ee=A.get(n);if(be&&Ee)return be==n&&Ee==e;var Ie=-1,Te=!0,Me=2&s?new bi:r;for(A.set(e,n),A.set(n,e);++Ie-1&&e%1==0&&e1?"& ":"")+n[d],n=n.join(s>2?", ":" "),e.replace(Cv,"{\n/* [wrapped with "+n+"] */\n")}(d,function B_(e,n){return tn(hv,function(s){var d="_."+s[0];n&s[1]&&!go(e,d)&&e.push(d)}),e.sort()}(function O_(e){var n=e.match(Tv);return n?n[1].split(Nv):[]}(d),s)))}function Lh(e){var n=0,s=0;return function(){var d=nm(),w=16-(d-s);if(s=d,w>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(r,arguments)}}function Vo(e,n){var s=-1,d=e.length,w=d-1;for(n=n===r?d:n;++s1?e[n-1]:r;return s="function"==typeof s?(e.pop(),s):r,Jh(e,s)});function Kh(e){var n=R(e);return n.__chain__=!0,n}function Wo(e,n){return n(e)}var zb=Bn(function(e){var n=e.length,s=n?e[0]:0,d=this.__wrapped__,w=function(A){return Su(A,e)};return!(n>1||this.__actions__.length)&&d instanceof pt&&Hn(s)?((d=d.slice(s,+s+(n?1:0))).__actions__.push({func:Wo,args:[w],thisArg:r}),new nn(d,this.__chain__).thru(function(A){return n&&!A.length&&A.push(r),A})):this.thru(w)}),Xb=Mo(function(e,n,s){At.call(e,s)?++e[s]:jn(e,s,1)}),kb=vh(Mh),eE=vh(Bh);function Vh(e,n){return(et(e)?tn:ri)(e,Je(n,3))}function Wh(e,n){return(et(e)?w1:zl)(e,Je(n,3))}var iE=Mo(function(e,n,s){At.call(e,s)?e[s].push(n):jn(e,s,[n])}),oE=at(function(e,n,s){var d=-1,w="function"==typeof n,A=jr(e)?ye(e.length):[];return ri(e,function(K){A[++d]=w?Jr(n,K,s):As(K,n,s)}),A}),aE=Mo(function(e,n,s){jn(e,s,n)});function Go(e,n){return(et(e)?Jt:ql)(e,Je(n,3))}var cE=Mo(function(e,n,s){e[s?0:1].push(n)},function(){return[[],[]]}),mE=at(function(e,n){if(null==e)return[];var s=n.length;return s>1&&Tr(e,n[0],n[1])?n=[]:s>2&&Tr(n[0],n[1],n[2])&&(n=[n[0]]),kl(e,Sr(n,1),[])}),Yo=Q1||function(){return xr.Date.now()};function Gh(e,n,s){return n=s?r:n,Mn(e,128,r,r,r,r,n=e&&null==n?e.length:n)}function Yh(e,n){var s;if("function"!=typeof n)throw new rn(m);return e=nt(e),function(){return--e>0&&(s=n.apply(this,arguments)),e<=1&&(n=r),s}}var tc=at(function(e,n,s){var d=1;if(s.length){var w=ei(s,Xi(tc));d|=32}return Mn(e,d,n,s,w)}),qh=at(function(e,n,s){var d=3;if(s.length){var w=ei(s,Xi(qh));d|=32}return Mn(n,d,e,s,w)});function Qh(e,n,s){var d,w,A,K,q,fe,be=0,Ee=!1,Ie=!1,Te=!0;if("function"!=typeof e)throw new rn(m);function Me(nr){var bn=d,Jn=w;return d=w=r,be=nr,K=e.apply(Jn,bn)}function Ke(nr){return be=nr,q=Ls(ht,n),Ee?Me(nr):K}function Ve(nr){var bn=nr-fe;return fe===r||bn>=n||bn<0||Ie&&nr-be>=A}function ht(){var nr=Yo();if(Ve(nr))return mt(nr);q=Ls(ht,function st(nr){var vd=n-(nr-fe);return Ie?Ir(vd,A-(nr-be)):vd}(nr))}function mt(nr){return q=r,Te&&d?Me(nr):(d=w=r,K)}function Yr(){var nr=Yo(),bn=Ve(nr);if(d=arguments,w=this,fe=nr,bn){if(q===r)return Ke(fe);if(Ie)return uh(q),q=Ls(ht,n),Me(fe)}return q===r&&(q=Ls(ht,n)),K}return n=un(n)||0,Vt(s)&&(Ee=!!s.leading,A=(Ie="maxWait"in s)?gr(un(s.maxWait)||0,n):A,Te="trailing"in s?!!s.trailing:Te),Yr.cancel=function Gr(){q!==r&&uh(q),be=0,d=fe=w=q=r},Yr.flush=function Nr(){return q===r?K:mt(Yo())},Yr}var bE=at(function(e,n){return $l(e,1,n)}),EE=at(function(e,n,s){return $l(e,un(n)||0,s)});function qo(e,n){if("function"!=typeof e||null!=n&&"function"!=typeof n)throw new rn(m);var s=function(){var d=arguments,w=n?n.apply(this,d):d[0],A=s.cache;if(A.has(w))return A.get(w);var K=e.apply(this,d);return s.cache=A.set(w,K)||A,K};return s.cache=new(qo.Cache||Fn),s}function Xo(e){if("function"!=typeof e)throw new rn(m);return function(){var n=arguments;switch(n.length){case 0:return!e.call(this);case 1:return!e.call(this,n[0]);case 2:return!e.call(this,n[0],n[1]);case 3:return!e.call(this,n[0],n[1],n[2])}return!e.apply(this,n)}}qo.Cache=Fn;var xE=f_(function(e,n){var s=(n=1==n.length&&et(n[0])?Jt(n[0],Kr(Je())):Jt(Sr(n,1),Kr(Je()))).length;return at(function(d){for(var w=-1,A=Ir(d.length,s);++w=n}),Si=Wl(function(){return arguments}())?Wl:function(e){return qt(e)&&At.call(e,"callee")&&!Tl.call(e,"callee")},et=ye.isArray,BE=dl?Kr(dl):function Gm(e){return qt(e)&&Cr(e)==Es};function jr(e){return null!=e&&Zo(e.length)&&!$n(e)}function rr(e){return qt(e)&&jr(e)}var oi=em||dc,$E=pl?Kr(pl):function Ym(e){return qt(e)&&Cr(e)==ys};function nc(e){if(!qt(e))return!1;var n=Cr(e);return n==uo||"[object DOMException]"==n||"string"==typeof e.message&&"string"==typeof e.name&&!Fs(e)}function $n(e){if(!Vt(e))return!1;var n=Cr(e);return n==co||n==$f||"[object AsyncFunction]"==n||"[object Proxy]"==n}function ed(e){return"number"==typeof e&&e==nt(e)}function Zo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Zn}function Vt(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)}function qt(e){return null!=e&&"object"==typeof e}var td=gl?Kr(gl):function Xm(e){return qt(e)&&Rr(e)==gn};function rd(e){return"number"==typeof e||qt(e)&&Cr(e)==vs}function Fs(e){if(!qt(e)||Cr(e)!=Un)return!1;var n=xo(e);if(null===n)return!0;var s=At.call(n,"constructor")&&n.constructor;return"function"==typeof s&&s instanceof s&&bo.call(s)==Y1}var ic=yl?Kr(yl):function Zm(e){return qt(e)&&Cr(e)==ms},nd=vl?Kr(vl):function Qm(e){return qt(e)&&Rr(e)==yn};function Qo(e){return"string"==typeof e||!et(e)&&qt(e)&&Cr(e)==_s}function Wr(e){return"symbol"==typeof e||qt(e)&&Cr(e)==fo}var Zi=ml?Kr(ml):function km(e){return qt(e)&&Zo(e.length)&&!!Bt[Cr(e)]},nw=zo(Tu),iw=zo(function(e,n){return e<=n});function id(e){if(!e)return[];if(jr(e))return Qo(e)?vn(e):Fr(e);if(Ds&&e[Ds])return function F1(ae){for(var me,ye=[];!(me=ae.next()).done;)ye.push(me.value);return ye}(e[Ds]());var n=Rr(e);return(n==gn?_u:n==yn?vo:Qi)(e)}function zn(e){return e?(e=un(e))===yi||e===-yi?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function nt(e){var n=zn(e),s=n%1;return n==n?s?n-s:n:0}function sd(e){return e?Ei(nt(e),0,xn):0}function un(e){if("number"==typeof e)return e;if(Wr(e))return NaN;if(Vt(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=Vt(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=xl(e);var s=Bv.test(e);return s||$v.test(e)?_1(e.slice(2),s?2:8):Mv.test(e)?NaN:+e}function od(e){return On(e,Mr(e))}function Rt(e){return null==e?"":Vr(e)}var ow=Yi(function(e,n){if(Us(n)||jr(n))On(n,br(n),e);else for(var s in n)At.call(n,s)&&Rs(e,s,n[s])}),ad=Yi(function(e,n){On(n,Mr(n),e)}),ko=Yi(function(e,n,s,d){On(n,Mr(n),e,d)}),aw=Yi(function(e,n,s,d){On(n,br(n),e,d)}),uw=Bn(Su),fw=at(function(e,n){e=Lt(e);var s=-1,d=n.length,w=d>2?n[2]:r;for(w&&Tr(n[0],n[1],w)&&(d=1);++s1),A}),On(e,Vu(e),s),d&&(s=sn(s,7,E_));for(var w=n.length;w--;)ju(s,n[w]);return s}),Pw=Bn(function(e,n){return null==e?{}:function r_(e,n){return eh(e,n,function(s,d){return oc(e,d)})}(e,n)});function cd(e,n){if(null==e)return{};var s=Jt(Vu(e),function(d){return[d]});return n=Je(n),eh(e,s,function(d,w){return n(d,w[0])})}var fd=wh(br),ld=wh(Mr);function Qi(e){return null==e?[]:mu(e,br(e))}var $w=qi(function(e,n,s){return n=n.toLowerCase(),e+(s?hd(n):n)});function hd(e){return ac(Rt(e).toLowerCase())}function dd(e){return(e=Rt(e))&&e.replace(Jv,C1).replace(u1,"")}var Vw=qi(function(e,n,s){return e+(s?"-":"")+n.toLowerCase()}),Ww=qi(function(e,n,s){return e+(s?" ":"")+n.toLowerCase()}),Gw=yh("toLowerCase"),e3=qi(function(e,n,s){return e+(s?"_":"")+n.toLowerCase()}),r3=qi(function(e,n,s){return e+(s?" ":"")+ac(n)}),h3=qi(function(e,n,s){return e+(s?" ":"")+n.toUpperCase()}),ac=yh("toUpperCase");function pd(e,n,s){return e=Rt(e),(n=s?r:n)===r?function L1(ae){return l1.test(ae)}(e)?function J1(ae){return ae.match(c1)||[]}(e):function O1(ae){return ae.match(Uv)||[]}(e):e.match(n)||[]}var gd=at(function(e,n){try{return Jr(e,r,n)}catch(s){return nc(s)?s:new ke(s)}}),d3=Bn(function(e,n){return tn(n,function(s){s=In(s),jn(e,s,tc(e[s],e))}),e});function uc(e){return function(){return e}}var v3=mh(),m3=mh(!0);function Br(e){return e}function cc(e){return Yl("function"==typeof e?e:sn(e,1))}var E3=at(function(e,n){return function(s){return As(s,e,n)}}),w3=at(function(e,n){return function(s){return As(e,s,n)}});function fc(e,n,s){var d=br(n),w=Uo(n,d);null==s&&(!Vt(n)||!w.length&&d.length)&&(s=n,n=e,e=this,w=Uo(n,br(n)));var A=!(Vt(s)&&"chain"in s&&!s.chain),K=$n(e);return tn(w,function(q){var fe=n[q];e[q]=fe,K&&(e.prototype[q]=function(){var be=this.__chain__;if(A||be){var Ee=e(this.__wrapped__),Ie=Ee.__actions__=Fr(this.__actions__);return Ie.push({func:fe,args:arguments,thisArg:e}),Ee.__chain__=be,Ee}return fe.apply(e,kn([this.value()],arguments))})}),e}function lc(){}var S3=zu(Jt),O3=zu(_l),I3=zu(du);function yd(e){return qu(e)?pu(In(e)):function n_(e){return function(n){return wi(n,e)}}(e)}var P3=bh(),A3=bh(!0);function hc(){return[]}function dc(){return!1}var j3=Ho(function(e,n){return e+n},0),M3=Ju("ceil"),B3=Ho(function(e,n){return e/n},1),H3=Ju("floor"),G3=Ho(function(e,n){return e*n},1),Y3=Ju("round"),q3=Ho(function(e,n){return e-n},0);return R.after=function _E(e,n){if("function"!=typeof n)throw new rn(m);return e=nt(e),function(){if(--e<1)return n.apply(this,arguments)}},R.ary=Gh,R.assign=ow,R.assignIn=ad,R.assignInWith=ko,R.assignWith=aw,R.at=uw,R.before=Yh,R.bind=tc,R.bindAll=d3,R.bindKey=qh,R.castArray=function CE(){if(!arguments.length)return[];var e=arguments[0];return et(e)?e:[e]},R.chain=Kh,R.chunk=function H_(e,n,s){n=(s?Tr(e,n,s):n===r)?1:gr(nt(n),0);var d=null==e?0:e.length;if(!d||n<1)return[];for(var w=0,A=0,K=ye(Io(d/n));ww?0:w+s),(d=d===r||d>w?w:nt(d))<0&&(d+=w),d=s>d?0:sd(d);s>>0)?(e=Rt(e))&&("string"==typeof n||null!=n&&!ic(n))&&!(n=Vr(n))&&$i(e)?si(vn(e),0,s):e.split(n,s):[]},R.spread=function IE(e,n){if("function"!=typeof e)throw new rn(m);return n=null==n?0:gr(nt(n),0),at(function(s){var d=s[n],w=si(s,0,n);return d&&kn(w,d),Jr(e,this,w)})},R.tail=function wb(e){var n=null==e?0:e.length;return n?on(e,1,n):[]},R.take=function Db(e,n,s){return e&&e.length?on(e,0,(n=s||n===r?1:nt(n))<0?0:n):[]},R.takeRight=function xb(e,n,s){var d=null==e?0:e.length;return d?on(e,(n=d-(n=s||n===r?1:nt(n)))<0?0:n,d):[]},R.takeRightWhile=function Sb(e,n){return e&&e.length?jo(e,Je(n,3),!1,!0):[]},R.takeWhile=function Ob(e,n){return e&&e.length?jo(e,Je(n,3)):[]},R.tap=function $b(e,n){return n(e),e},R.throttle=function RE(e,n,s){var d=!0,w=!0;if("function"!=typeof e)throw new rn(m);return Vt(s)&&(d="leading"in s?!!s.leading:d,w="trailing"in s?!!s.trailing:w),Qh(e,n,{leading:d,maxWait:n,trailing:w})},R.thru=Wo,R.toArray=id,R.toPairs=fd,R.toPairsIn=ld,R.toPath=function L3(e){return et(e)?Jt(e,In):Wr(e)?[e]:Fr(Fh(Rt(e)))},R.toPlainObject=od,R.transform=function Nw(e,n,s){var d=et(e),w=d||oi(e)||Zi(e);if(n=Je(n,4),null==s){var A=e&&e.constructor;s=w?d?new A:[]:Vt(e)&&$n(A)?Gi(xo(e)):{}}return(w?tn:Sn)(e,function(K,q,fe){return n(s,K,q,fe)}),s},R.unary=function PE(e){return Gh(e,1)},R.union=Ib,R.unionBy=Rb,R.unionWith=Pb,R.uniq=function Ab(e){return e&&e.length?ni(e):[]},R.uniqBy=function Cb(e,n){return e&&e.length?ni(e,Je(n,2)):[]},R.uniqWith=function Tb(e,n){return n="function"==typeof n?n:r,e&&e.length?ni(e,r,n):[]},R.unset=function Uw(e,n){return null==e||ju(e,n)},R.unzip=ec,R.unzipWith=Jh,R.update=function Lw(e,n,s){return null==e?e:sh(e,n,Hu(s))},R.updateWith=function Fw(e,n,s,d){return d="function"==typeof d?d:r,null==e?e:sh(e,n,Hu(s),d)},R.values=Qi,R.valuesIn=function jw(e){return null==e?[]:mu(e,Mr(e))},R.without=Nb,R.words=pd,R.wrap=function AE(e,n){return rc(Hu(n),e)},R.xor=Ub,R.xorBy=Lb,R.xorWith=Fb,R.zip=jb,R.zipObject=function Mb(e,n){return ah(e||[],n||[],Rs)},R.zipObjectDeep=function Bb(e,n){return ah(e||[],n||[],Ts)},R.zipWith=Hb,R.entries=fd,R.entriesIn=ld,R.extend=ad,R.extendWith=ko,fc(R,R),R.add=j3,R.attempt=gd,R.camelCase=$w,R.capitalize=hd,R.ceil=M3,R.clamp=function Mw(e,n,s){return s===r&&(s=n,n=r),s!==r&&(s=(s=un(s))==s?s:0),n!==r&&(n=(n=un(n))==n?n:0),Ei(un(e),n,s)},R.clone=function TE(e){return sn(e,4)},R.cloneDeep=function UE(e){return sn(e,5)},R.cloneDeepWith=function LE(e,n){return sn(e,5,n="function"==typeof n?n:r)},R.cloneWith=function NE(e,n){return sn(e,4,n="function"==typeof n?n:r)},R.conformsTo=function FE(e,n){return null==n||Hl(e,n,br(n))},R.deburr=dd,R.defaultTo=function y3(e,n){return null==e||e!=e?n:e},R.divide=B3,R.endsWith=function zw(e,n,s){e=Rt(e),n=Vr(n);var d=e.length,w=s=s===r?d:Ei(nt(s),0,d);return(s-=n.length)>=0&&e.slice(s,w)==n},R.eq=_n,R.escape=function Jw(e){return(e=Rt(e))&&Dv.test(e)?e.replace(Kf,T1):e},R.escapeRegExp=function Kw(e){return(e=Rt(e))&&Pv.test(e)?e.replace(ru,"\\$&"):e},R.every=function Zb(e,n,s){var d=et(e)?_l:$m;return s&&Tr(e,n,s)&&(n=r),d(e,Je(n,3))},R.find=kb,R.findIndex=Mh,R.findKey=function hw(e,n){return bl(e,Je(n,3),Sn)},R.findLast=eE,R.findLastIndex=Bh,R.findLastKey=function dw(e,n){return bl(e,Je(n,3),Iu)},R.floor=H3,R.forEach=Vh,R.forEachRight=Wh,R.forIn=function pw(e,n){return null==e?e:Ou(e,Je(n,3),Mr)},R.forInRight=function gw(e,n){return null==e?e:Kl(e,Je(n,3),Mr)},R.forOwn=function yw(e,n){return e&&Sn(e,Je(n,3))},R.forOwnRight=function vw(e,n){return e&&Iu(e,Je(n,3))},R.get=sc,R.gt=jE,R.gte=ME,R.has=function bw(e,n){return null!=e&&Ih(e,n,Jm)},R.hasIn=oc,R.head=$h,R.identity=Br,R.includes=function sE(e,n,s,d){e=jr(e)?e:Qi(e),s=s&&!d?nt(s):0;var w=e.length;return s<0&&(s=gr(w+s,0)),Qo(e)?s<=w&&e.indexOf(n,s)>-1:!!w&&Hi(e,n,s)>-1},R.indexOf=function eb(e,n,s){var d=null==e?0:e.length;if(!d)return-1;var w=null==s?0:nt(s);return w<0&&(w=gr(d+w,0)),Hi(e,n,w)},R.inRange=function Bw(e,n,s){return n=zn(n),s===r?(s=n,n=0):s=zn(s),function Vm(e,n,s){return e>=Ir(n,s)&&e=-Zn&&e<=Zn},R.isSet=nd,R.isString=Qo,R.isSymbol=Wr,R.isTypedArray=Zi,R.isUndefined=function ew(e){return e===r},R.isWeakMap=function tw(e){return qt(e)&&Rr(e)==bs},R.isWeakSet=function rw(e){return qt(e)&&"[object WeakSet]"==Cr(e)},R.join=function sb(e,n){return null==e?"":tm.call(e,n)},R.kebabCase=Vw,R.last=an,R.lastIndexOf=function ob(e,n,s){var d=null==e?0:e.length;if(!d)return-1;var w=d;return s!==r&&(w=(w=nt(s))<0?gr(d+w,0):Ir(w,d-1)),n==n?function B1(ae,me,ye){for(var Le=ye+1;Le--;)if(ae[Le]===me)return Le;return Le}(e,n,w):yo(e,El,w,!0)},R.lowerCase=Ww,R.lowerFirst=Gw,R.lt=nw,R.lte=iw,R.max=function $3(e){return e&&e.length?No(e,Br,Ru):r},R.maxBy=function z3(e,n){return e&&e.length?No(e,Je(n,2),Ru):r},R.mean=function J3(e){return wl(e,Br)},R.meanBy=function K3(e,n){return wl(e,Je(n,2))},R.min=function V3(e){return e&&e.length?No(e,Br,Tu):r},R.minBy=function W3(e,n){return e&&e.length?No(e,Je(n,2),Tu):r},R.stubArray=hc,R.stubFalse=dc,R.stubObject=function C3(){return{}},R.stubString=function T3(){return""},R.stubTrue=function N3(){return!0},R.multiply=G3,R.nth=function ab(e,n){return e&&e.length?Ql(e,nt(n)):r},R.noConflict=function D3(){return xr._===this&&(xr._=q1),this},R.noop=lc,R.now=Yo,R.pad=function Yw(e,n,s){e=Rt(e);var d=(n=nt(n))?zi(e):0;if(!n||d>=n)return e;var w=(n-d)/2;return $o(Ro(w),s)+e+$o(Io(w),s)},R.padEnd=function qw(e,n,s){e=Rt(e);var d=(n=nt(n))?zi(e):0;return n&&dn){var d=e;e=n,n=d}if(s||e%1||n%1){var w=Ll();return Ir(e+w*(n-e+m1("1e-"+((w+"").length-1))),n)}return Uu(e,n)},R.reduce=function fE(e,n,s){var d=et(e)?hu:Dl,w=arguments.length<3;return d(e,Je(n,4),s,w,ri)},R.reduceRight=function lE(e,n,s){var d=et(e)?D1:Dl,w=arguments.length<3;return d(e,Je(n,4),s,w,zl)},R.repeat=function Qw(e,n,s){return n=(s?Tr(e,n,s):n===r)?1:nt(n),Lu(Rt(e),n)},R.replace=function kw(){var e=arguments,n=Rt(e[0]);return e.length<3?n:n.replace(e[1],e[2])},R.result=function Aw(e,n,s){var d=-1,w=(n=ii(n,e)).length;for(w||(w=1,e=r);++dZn)return[];var s=xn,d=Ir(e,xn);n=Je(n),e-=xn;for(var w=vu(d,n);++s=A)return e;var q=s-zi(d);if(q<1)return d;var fe=K?si(K,0,q).join(""):e.slice(0,q);if(w===r)return fe+d;if(K&&(q+=fe.length-q),ic(w)){if(e.slice(q).search(w)){var be,Ee=fe;for(w.global||(w=bu(w.source,Rt(Wf.exec(w))+"g")),w.lastIndex=0;be=w.exec(Ee);)var Ie=be.index;fe=fe.slice(0,Ie===r?q:Ie)}}else if(e.indexOf(Vr(w),q)!=q){var Te=fe.lastIndexOf(w);Te>-1&&(fe=fe.slice(0,Te))}return fe+d},R.unescape=function l3(e){return(e=Rt(e))&&wv.test(e)?e.replace(Jf,H1):e},R.uniqueId=function F3(e){var n=++G1;return Rt(e)+n},R.upperCase=h3,R.upperFirst=ac,R.each=Vh,R.eachRight=Wh,R.first=$h,fc(R,function(){var e={};return Sn(R,function(n,s){At.call(R.prototype,s)||(e[s]=n)}),e}(),{chain:!1}),R.VERSION="4.17.21",tn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){R[e].placeholder=R}),tn(["drop","take"],function(e,n){pt.prototype[e]=function(s){s=s===r?1:gr(nt(s),0);var d=this.__filtered__&&!n?new pt(this):this.clone();return d.__filtered__?d.__takeCount__=Ir(s,d.__takeCount__):d.__views__.push({size:Ir(s,xn),type:e+(d.__dir__<0?"Right":"")}),d},pt.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),tn(["filter","map","takeWhile"],function(e,n){var s=n+1,d=1==s||3==s;pt.prototype[e]=function(w){var A=this.clone();return A.__iteratees__.push({iteratee:Je(w,3),type:s}),A.__filtered__=A.__filtered__||d,A}}),tn(["head","last"],function(e,n){var s="take"+(n?"Right":"");pt.prototype[e]=function(){return this[s](1).value()[0]}}),tn(["initial","tail"],function(e,n){var s="drop"+(n?"":"Right");pt.prototype[e]=function(){return this.__filtered__?new pt(this):this[s](1)}}),pt.prototype.compact=function(){return this.filter(Br)},pt.prototype.find=function(e){return this.filter(e).head()},pt.prototype.findLast=function(e){return this.reverse().find(e)},pt.prototype.invokeMap=at(function(e,n){return"function"==typeof e?new pt(this):this.map(function(s){return As(s,e,n)})}),pt.prototype.reject=function(e){return this.filter(Xo(Je(e)))},pt.prototype.slice=function(e,n){e=nt(e);var s=this;return s.__filtered__&&(e>0||n<0)?new pt(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),n!==r&&(s=(n=nt(n))<0?s.dropRight(-n):s.take(n-e)),s)},pt.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},pt.prototype.toArray=function(){return this.take(xn)},Sn(pt.prototype,function(e,n){var s=/^(?:filter|find|map|reject)|While$/.test(n),d=/^(?:head|last)$/.test(n),w=R[d?"take"+("last"==n?"Right":""):n],A=d||/^find/.test(n);w&&(R.prototype[n]=function(){var K=this.__wrapped__,q=d?[1]:arguments,fe=K instanceof pt,be=q[0],Ee=fe||et(K),Ie=function(ht){var mt=w.apply(R,kn([ht],q));return d&&Te?mt[0]:mt};Ee&&s&&"function"==typeof be&&1!=be.length&&(fe=Ee=!1);var Te=this.__chain__,Me=!!this.__actions__.length,Ke=A&&!Te,st=fe&&!Me;if(!A&&Ee){K=st?K:new pt(this);var Ve=e.apply(K,q);return Ve.__actions__.push({func:Wo,args:[Ie],thisArg:r}),new nn(Ve,Te)}return Ke&&st?e.apply(this,q):(Ve=this.thru(Ie),Ke?d?Ve.value()[0]:Ve.value():Ve)})}),tn(["pop","push","shift","sort","splice","unshift"],function(e){var n=mo[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",d=/^(?:pop|shift)$/.test(e);R.prototype[e]=function(){var w=arguments;if(d&&!this.__chain__){var A=this.value();return n.apply(et(A)?A:[],w)}return this[s](function(K){return n.apply(et(K)?K:[],w)})}}),Sn(pt.prototype,function(e,n){var s=R[n];if(s){var d=s.name+"";At.call(Wi,d)||(Wi[d]=[]),Wi[d].push({name:n,func:s})}}),Wi[Bo(r,2).name]=[{name:"wrapper",func:r}],pt.prototype.clone=function lm(){var e=new pt(this.__wrapped__);return e.__actions__=Fr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Fr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Fr(this.__views__),e},pt.prototype.reverse=function hm(){if(this.__filtered__){var e=new pt(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},pt.prototype.value=function dm(){var e=this.__wrapped__.value(),n=this.__dir__,s=et(e),d=n<0,w=s?e.length:0,A=function S_(e,n,s){for(var d=-1,w=s.length;++d=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},R.prototype.plant=function Gb(e){for(var n,s=this;s instanceof Co;){var d=jh(s);d.__index__=0,d.__values__=r,n?w.__wrapped__=d:n=d;var w=d;s=s.__wrapped__}return w.__wrapped__=e,n},R.prototype.reverse=function Yb(){var e=this.__wrapped__;if(e instanceof pt){var n=e;return this.__actions__.length&&(n=new pt(this)),(n=n.reverse()).__actions__.push({func:Wo,args:[ku],thisArg:r}),new nn(n,this.__chain__)}return this.thru(ku)},R.prototype.toJSON=R.prototype.valueOf=R.prototype.value=function qb(){return oh(this.__wrapped__,this.__actions__)},R.prototype.first=R.prototype.head,Ds&&(R.prototype[Ds]=function Wb(){return this}),R}();vi?((vi.exports=Ji)._=Ji,cu._=Ji):xr._=Ji}.call(ps);var Py=Object.defineProperty,Ay=Object.defineProperties,Cy=Object.getOwnPropertyDescriptors,Lf=Object.getOwnPropertySymbols,Ty=Object.prototype.hasOwnProperty,Ny=Object.prototype.propertyIsEnumerable,Ff=(u,t,r)=>t in u?Py(u,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[t]=r,io=(u,t)=>{for(var r in t||(t={}))Ty.call(t,r)&&Ff(u,r,t[r]);if(Lf)for(var r of Lf(t))Ny.call(t,r)&&Ff(u,r,t[r]);return u},Uy=(u,t)=>Ay(u,Cy(t));function kr(u,t,r){let o;const a=Ka(u);return t.rpcMap&&(o=t.rpcMap[a]),o||(o=`https://rpc.walletconnect.com/v1?chainId=eip155:${a}&projectId=${r}`),o}function Ka(u){return u.includes("eip155")?Number(u.split(":")[1]):Number(u)}function jf(u){var t,r,o,a;const l={};if(!pi(u))return l;for(const[m,T]of Object.entries(u)){const X=Ra(m)?[m]:T.chains,Q=T.methods||[],ge=T.events||[],Oe=T.rpcMap||{},Xe=us(m);l[Xe]=Uy(io(io({},l[Xe]),T),{chains:En(X,null==(t=l[Xe])?void 0:t.chains),methods:En(Q,null==(r=l[Xe])?void 0:r.methods),events:En(ge,null==(o=l[Xe])?void 0:o.events),rpcMap:io(io({},Oe),null==(a=l[Xe])?void 0:a.rpcMap)})}return l}const gi=(u,t)=>{const r=o=>{o.request!==t.request||o.topic!==t.topic||(u.events.removeListener("session_request_sent",r),function By(u){if(typeof window<"u")try{const t=window.localStorage.getItem("WALLETCONNECT_DEEPLINK_CHOICE");if(t){const o=JSON.parse(t)?.href;if("string"==typeof o){o.endsWith("/")&&o.slice(0,-1);const a=`${o}/wc?requestId=${u.id}&sessionTopic=${u.topic}`;window.open(a,"_self","noreferrer noopener")}}}catch(t){console.error(t)}}(t))};u.on("session_request_sent",r)};class Hy{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=t.events,this.client=t.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?(gi(this.client,t),this.client.request(t)):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(this.chainId=t,!this.httpProviders[t]){const o=r||kr(`${this.name}:${t}`,this.namespace);if(!o)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,o)}this.events.emit("default_chain_changed",`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t&&t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var o;t[r]=this.createHttpProvider(r,null==(o=this.namespace.rpcMap)?void 0:o[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const o=this.createHttpProvider(t,r);o&&(this.httpProviders[t]=o)}createHttpProvider(t,r){const o=r||kr(t,this.namespace);return typeof o>"u"?void 0:new Gn(new Fi(o))}}class $y{constructor(t){this.name="eip155",this.namespace=t.namespace,this.client=t.client,this.events=t.events,this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}request(t){var r=this;return O(function*(){var o;switch(t.request.method){case"eth_requestAccounts":case"eth_accounts":return r.getAccounts();case"wallet_switchEthereumChain":return r.handleSwitchChain(t.request.params?null==(o=t.request.params[0])?void 0:o.chainId:"0x0"),null;case"eth_chainId":return parseInt(r.getDefaultChain())}return r.namespace.methods.includes(t.request.method)?(gi(r.client,t),yield r.client.request(t)):r.getHttpProvider().request(t.request)})()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,r){const o=Ka(t);if(!this.httpProviders[o]){const a=r||kr(`${this.name}:${o}`,this.namespace,this.client.core.projectId);if(!a)throw new Error(`No RPC url provided for chainId: ${o}`);this.setHttpProvider(o,a)}this.chainId=o,this.events.emit("default_chain_changed",`${this.name}:${o}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,r){const o=r||kr(`${this.name}:${t}`,this.namespace,this.client.core.projectId);return typeof o>"u"?void 0:new Gn(new Tf(o))}setHttpProvider(t,r){const o=this.createHttpProvider(t,r);o&&(this.httpProviders[t]=o)}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var o;const a=Ka(r);t[a]=this.createHttpProvider(a,null==(o=this.namespace.rpcMap)?void 0:o[r])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}handleSwitchChain(t){const r=parseInt(t,16);(function Ly(u,t){if(!t.includes(u))throw new Error(`Chain '${u}' not approved. Please use one of the following: ${t.toString()}`)})(`${this.name}:${r}`,this.namespace.chains),this.setDefaultChain(`${r}`)}}class zy{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=t.events,this.client=t.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?(gi(this.client,t),this.client.request(t)):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(!this.httpProviders[t]){const o=r||kr(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!o)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,o)}this.chainId=t,this.events.emit("default_chain_changed",`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var o;t[r]=this.createHttpProvider(r,null==(o=this.namespace.rpcMap)?void 0:o[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const o=this.createHttpProvider(t,r);o&&(this.httpProviders[t]=o)}createHttpProvider(t,r){const o=r||kr(t,this.namespace,this.client.core.projectId);return typeof o>"u"?void 0:new Gn(new Fi(o))}}class Jy{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=t.events,this.client=t.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?(gi(this.client,t),this.client.request(t)):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(this.chainId=t,!this.httpProviders[t]){const o=r||kr(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!o)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,o)}this.events.emit("default_chain_changed",`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var o;t[r]=this.createHttpProvider(r,null==(o=this.namespace.rpcMap)?void 0:o[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const o=this.createHttpProvider(t,r);o&&(this.httpProviders[t]=o)}createHttpProvider(t,r){const o=r||kr(t,this.namespace,this.client.core.projectId);return typeof o>"u"?void 0:new Gn(new Fi(o))}}class Ky{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=t.events,this.client=t.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?(gi(this.client,t),this.client.request(t)):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(this.chainId=t,!this.httpProviders[t]){const o=r||this.getCardanoRPCUrl(t);if(!o)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,o)}this.events.emit("default_chain_changed",`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{const o=this.getCardanoRPCUrl(r);t[r]=this.createHttpProvider(r,o)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}getCardanoRPCUrl(t){const r=this.namespace.rpcMap;if(r)return r[t]}setHttpProvider(t,r){const o=this.createHttpProvider(t,r);o&&(this.httpProviders[t]=o)}createHttpProvider(t,r){const o=r||this.getCardanoRPCUrl(t);return typeof o>"u"?void 0:new Gn(new Fi(o))}}class Vy{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=t.events,this.client=t.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?(gi(this.client,t),this.client.request(t)):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(!this.httpProviders[t]){const o=r||kr(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!o)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,o)}this.chainId=t,this.events.emit("default_chain_changed",`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var o;t[r]=this.createHttpProvider(r,null==(o=this.namespace.rpcMap)?void 0:o[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const o=this.createHttpProvider(t,r);o&&(this.httpProviders[t]=o)}createHttpProvider(t,r){const o=r||kr(t,this.namespace,this.client.core.projectId);return typeof o>"u"?void 0:new Gn(new Fi(o))}}class Wy{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=t.events,this.client=t.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?(gi(this.client,t),this.client.request(t)):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(!this.httpProviders[t]){const o=r||kr(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!o)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,o)}this.chainId=t,this.events.emit("default_chain_changed",`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var o;t[r]=this.createHttpProvider(r,null==(o=this.namespace.rpcMap)?void 0:o[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const o=this.createHttpProvider(t,r);o&&(this.httpProviders[t]=o)}createHttpProvider(t,r){const o=r||kr(t,this.namespace,this.client.core.projectId);return typeof o>"u"?void 0:new Gn(new Fi(o))}}var Gy=Object.defineProperty,Yy=Object.defineProperties,qy=Object.getOwnPropertyDescriptors,Mf=Object.getOwnPropertySymbols,Xy=Object.prototype.hasOwnProperty,Zy=Object.prototype.propertyIsEnumerable,Bf=(u,t,r)=>t in u?Gy(u,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[t]=r,so=(u,t)=>{for(var r in t||(t={}))Xy.call(t,r)&&Bf(u,r,t[r]);if(Mf)for(var r of Mf(t))Zy.call(t,r)&&Bf(u,r,t[r]);return u},Va=(u,t)=>Yy(u,qy(t));class Wa{constructor(t){this.events=new(De()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.providerOpts=t,this.logger=typeof t?.logger<"u"&&"string"!=typeof t?.logger?t.logger:(0,B.pino)((0,B.getDefaultLoggerOptions)({level:t?.logger||"error"}))}static init(t){return O(function*(){const r=new Wa(t);return yield r.initialize(),r})()}request(t,r){var o=this;return O(function*(){const[a,l]=o.validateChain(r);if(!o.session)throw new Error("Please call connect() before request()");return yield o.getProvider(a).request({request:so({},t),chainId:`${a}:${l}`,topic:o.session.topic})})()}sendAsync(t,r,o){this.request(t,o).then(a=>r(null,a)).catch(a=>r(a,void 0))}enable(){var t=this;return O(function*(){if(!t.client)throw new Error("Sign Client not initialized");return t.session||(yield t.connect({namespaces:t.namespaces,optionalNamespaces:t.optionalNamespaces,sessionProperties:t.sessionProperties})),yield t.requestAccounts()})()}disconnect(){var t=this;return O(function*(){var r;if(!t.session)throw new Error("Please call connect() before enable()");yield t.client.disconnect({topic:null==(r=t.session)?void 0:r.topic,reason:fr("USER_DISCONNECTED")}),yield t.cleanup()})()}connect(t){var r=this;return O(function*(){if(!r.client)throw new Error("Sign Client not initialized");if(r.setNamespaces(t),yield r.cleanupPendingPairings(),!t.skipPairing)return yield r.pair(t.pairingTopic)})()}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}removeListener(t,r){this.events.removeListener(t,r)}off(t,r){this.events.off(t,r)}get isWalletConnect(){return!0}pair(t){var r=this;return O(function*(){r.shouldAbortPairingAttempt=!1;let o=0;do{if(r.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(o>=r.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:a,approval:l}=yield r.client.connect({pairingTopic:t,requiredNamespaces:r.namespaces,optionalNamespaces:r.optionalNamespaces,sessionProperties:r.sessionProperties});a&&(r.uri=a,r.events.emit("display_uri",a)),yield l().then(m=>{r.session=m}).catch(m=>{if(m.message!==Of)throw m;o++})}while(!r.session);return r.onConnect(),r.session})()}setDefaultChain(t,r){try{const[o,a]=this.validateChain(t);this.getProvider(o).setDefaultChain(a,r)}catch(o){if(!/Please call connect/.test(o.message))throw o}}cleanupPendingPairings(t={}){var r=this;return O(function*(){r.logger.info("Cleaning up inactive pairings...");const o=r.client.pairing.getAll();if(Li(o)){for(const a of o)t.deletePairings?r.client.core.expirer.set(a.topic,0):yield r.client.core.relayer.subscriber.unsubscribe(a.topic);r.logger.info(`Inactive pairings cleared: ${o.length}`)}})()}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}checkStorage(){var t=this;return O(function*(){t.namespaces=(yield t.getFromStore("namespaces"))||{},t.optionalNamespaces=(yield t.getFromStore("optionalNamespaces"))||{},t.client.session.length&&(t.session=t.client.session.get(t.client.session.keys[t.client.session.keys.length-1]),t.createProviders())})()}initialize(){var t=this;return O(function*(){t.logger.trace("Initialized"),yield t.createClient(),yield t.checkStorage(),t.registerEventListeners()})()}createClient(){var t=this;return O(function*(){t.client=t.providerOpts.client||(yield za.init({logger:t.providerOpts.logger||"error",relayUrl:t.providerOpts.relayUrl||"wss://relay.walletconnect.com",projectId:t.providerOpts.projectId,metadata:t.providerOpts.metadata,storageOptions:t.providerOpts.storageOptions,name:t.providerOpts.name})),t.logger.trace("SignClient Initialized")})()}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");[...new Set(Object.keys(this.session.namespaces).map(t=>us(t)))].forEach(t=>{if(!this.session)return;const r=function jy(u,t){const r=Object.keys(t.namespaces).filter(a=>a.includes(u));if(!r.length)return[];const o=[];return r.forEach(a=>{o.push(...t.namespaces[a].accounts)}),o}(t,this.session),o=function Fy(u){return u.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}(r),a=function My(u,t={}){const r=jf(u),o=jf(t);return Ja.exports.merge(r,o)}(this.namespaces,this.optionalNamespaces),l=Va(so({},a[t]),{accounts:r,chains:o});switch(t){case"eip155":this.rpcProviders[t]=new $y({client:this.client,namespace:l,events:this.events});break;case"solana":this.rpcProviders[t]=new zy({client:this.client,namespace:l,events:this.events});break;case"cosmos":this.rpcProviders[t]=new Jy({client:this.client,namespace:l,events:this.events});break;case"polkadot":this.rpcProviders[t]=new Hy({client:this.client,namespace:l,events:this.events});break;case"cip34":this.rpcProviders[t]=new Ky({client:this.client,namespace:l,events:this.events});break;case"elrond":this.rpcProviders[t]=new Vy({client:this.client,namespace:l,events:this.events});break;case"multiversx":this.rpcProviders[t]=new Wy({client:this.client,namespace:l,events:this.events})}})}registerEventListeners(){var t=this;if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",r=>{this.events.emit("session_ping",r)}),this.client.on("session_event",r=>{const{params:o}=r,{event:a}=o;"accountsChanged"===a.name?this.events.emit("accountsChanged",a.data):"chainChanged"===a.name?this.onChainChanged(o.chainId):this.events.emit(a.name,a.data),this.events.emit("session_event",r)}),this.client.on("session_update",({topic:r,params:o})=>{var a;const{namespaces:l}=o,m=null==(a=this.client)?void 0:a.session.get(r);this.session=Va(so({},m),{namespaces:l}),this.onSessionUpdate(),this.events.emit("session_update",{topic:r,params:o})}),this.client.on("session_delete",function(){var r=O(function*(o){yield t.cleanup(),t.events.emit("session_delete",o),t.events.emit("disconnect",Va(so({},fr("USER_DISCONNECTED")),{data:o.topic}))});return function(o){return r.apply(this,arguments)}}()),this.on("default_chain_changed",r=>{this.onChainChanged(r,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var r;this.getProvider(t).updateNamespace(null==(r=this.session)?void 0:r.namespaces[t])})}setNamespaces(t){const{namespaces:r,optionalNamespaces:o,sessionProperties:a}=t;if(!r||!Object.keys(r).length)throw new Error("Namespaces must be not empty");this.namespaces=r,this.optionalNamespaces=o,this.sessionProperties=a,this.persist("namespaces",r),this.persist("optionalNamespaces",o)}validateChain(t){const[r,o]=t?.split(":")||["",""];if(r&&!Object.keys(this.namespaces).map(m=>us(m)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&o)return[r,o];const a=us(Object.keys(this.namespaces)[0]);return[a,this.rpcProviders[a].getDefaultChain()]}requestAccounts(){var t=this;return O(function*(){const[r]=t.validateChain();return yield t.getProvider(r).requestAccounts()})()}onChainChanged(t,r=!1){var o;const[a,l]=this.validateChain(t);r||this.getProvider(a).setDefaultChain(l),(null!=(o=this.namespaces[a])?o:this.namespaces[`${a}:${l}`]).defaultChain=l,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",l)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}cleanup(){var t=this;return O(function*(){t.session=void 0,yield t.cleanupPendingPairings({deletePairings:!0})})()}persist(t,r){this.client.core.storage.setItem(`${Uf}/${t}`,r)}getFromStore(t){var r=this;return O(function*(){return yield r.client.core.storage.getItem(`${Uf}/${t}`)})()}}var ev={1:"https://ethereum.publicnode.com",5:"https://eth-goerli.g.alchemy.com/v2/yVhq9zPJorAWsw-F87fEabSUl7cCU6z4",11155111:"https://sepolia.infura.io/v3/9f79b2f9274344af90b8d4e244b580ef",137:"https://polygon-rpc.com/",80001:"https://polygon-mumbai.g.alchemy.com/v2/rVI6pOV4irVsrw20cJxc1fxK_1cSeiY0",56:"https://bsc-dataseed.binance.org/",97:"https://data-seed-prebsc-1-s1.binance.org:8545",43114:"https://api.avax.network/ext/bc/C/rpc",43113:"https://api.avax-test.network/ext/bc/C/rpc",250:"https://rpc.fantom.network/",25:"https://evm-cronos.crypto.org",338:"https://evm-t3.cronos.org",42161:"https://arb1.arbitrum.io/rpc",421613:"https://arb-goerli.g.alchemy.com/v2/nFrflomLgsQQL5NWjGileAVqIGGxZWce",10:"https://mainnet.optimism.io"},tv=["eip155:1","eip155:137","eip155:250","eip155:25","eip155:42161","eip155:10"],rv=function(){return function(u,t,r,o){return new(r||(r=Promise))(function(l,m){function T(ge){try{Q(o.next(ge))}catch(Oe){m(Oe)}}function X(ge){try{Q(o.throw(ge))}catch(Oe){m(Oe)}}function Q(ge){ge.done?l(ge.value):function a(l){return l instanceof r?l:new r(function(m){m(l)})}(ge.value).then(T,X)}Q((o=o.apply(u,t||[])).next())})}(void 0,void 0,void 0,function(){return function(u,t){var o,a,l,m,r={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return m={next:T(0),throw:T(1),return:T(2)},"function"==typeof Symbol&&(m[Symbol.iterator]=function(){return this}),m;function T(Q){return function(ge){return function X(Q){if(o)throw new TypeError("Generator is already executing.");for(;m&&(m=0,Q[0]&&(r=0)),r;)try{if(o=1,a&&(l=2&Q[0]?a.return:Q[0]?a.throw||((l=a.return)&&l.call(a),0):a.next)&&!(l=l.call(a,Q[1])).done)return l;switch(a=0,l&&(Q=[2&Q[0],l.value]),Q[0]){case 0:case 1:l=Q;break;case 4:return r.label++,{value:Q[1],done:!1};case 5:r.label++,a=Q[1],Q=[0];continue;case 7:Q=r.ops.pop(),r.trys.pop();continue;default:if(!(l=(l=r.trys).length>0&&l[l.length-1])&&(6===Q[0]||2===Q[0])){r=0;continue}if(3===Q[0]&&(!l||Q[1]>l[0]&&Q[1]{"use strict";Object.defineProperty(g,"__esModule",{value:!0});var I=D(17686);function te(P,N,E){return void 0===N&&(N=new Uint8Array(2)),void 0===E&&(E=0),N[E+0]=P>>>8,N[E+1]=P>>>0,N}function H(P,N,E){return void 0===N&&(N=new Uint8Array(2)),void 0===E&&(E=0),N[E+0]=P>>>0,N[E+1]=P>>>8,N}function M(P,N){return void 0===N&&(N=0),P[N]<<24|P[N+1]<<16|P[N+2]<<8|P[N+3]}function C(P,N){return void 0===N&&(N=0),(P[N]<<24|P[N+1]<<16|P[N+2]<<8|P[N+3])>>>0}function L(P,N){return void 0===N&&(N=0),P[N+3]<<24|P[N+2]<<16|P[N+1]<<8|P[N]}function ce(P,N){return void 0===N&&(N=0),(P[N+3]<<24|P[N+2]<<16|P[N+1]<<8|P[N])>>>0}function de(P,N,E){return void 0===N&&(N=new Uint8Array(4)),void 0===E&&(E=0),N[E+0]=P>>>24,N[E+1]=P>>>16,N[E+2]=P>>>8,N[E+3]=P>>>0,N}function ue(P,N,E){return void 0===N&&(N=new Uint8Array(4)),void 0===E&&(E=0),N[E+0]=P>>>0,N[E+1]=P>>>8,N[E+2]=P>>>16,N[E+3]=P>>>24,N}function ee(P,N,E){return void 0===N&&(N=new Uint8Array(8)),void 0===E&&(E=0),de(P/4294967296>>>0,N,E),de(P>>>0,N,E+4),N}function B(P,N,E){return void 0===N&&(N=new Uint8Array(8)),void 0===E&&(E=0),ue(P>>>0,N,E),ue(P/4294967296>>>0,N,E+4),N}g.readInt16BE=function re(P,N){return void 0===N&&(N=0),(P[N+0]<<8|P[N+1])<<16>>16},g.readUint16BE=function ne(P,N){return void 0===N&&(N=0),(P[N+0]<<8|P[N+1])>>>0},g.readInt16LE=function k(P,N){return void 0===N&&(N=0),(P[N+1]<<8|P[N])<<16>>16},g.readUint16LE=function $(P,N){return void 0===N&&(N=0),(P[N+1]<<8|P[N])>>>0},g.writeUint16BE=te,g.writeInt16BE=te,g.writeUint16LE=H,g.writeInt16LE=H,g.readInt32BE=M,g.readUint32BE=C,g.readInt32LE=L,g.readUint32LE=ce,g.writeUint32BE=de,g.writeInt32BE=de,g.writeUint32LE=ue,g.writeInt32LE=ue,g.readInt64BE=function O(P,N){void 0===N&&(N=0);var E=M(P,N),W=M(P,N+4);return 4294967296*E+W-4294967296*(W>>31)},g.readUint64BE=function _e(P,N){return void 0===N&&(N=0),4294967296*C(P,N)+C(P,N+4)},g.readInt64LE=function De(P,N){void 0===N&&(N=0);var E=L(P,N);return 4294967296*L(P,N+4)+E-4294967296*(E>>31)},g.readUint64LE=function we(P,N){void 0===N&&(N=0);var E=ce(P,N);return 4294967296*ce(P,N+4)+E},g.writeUint64BE=ee,g.writeInt64BE=ee,g.writeUint64LE=B,g.writeInt64LE=B,g.readUintBE=function J(P,N,E){if(void 0===E&&(E=0),P%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(P/8>N.length-E)throw new Error("readUintBE: array is too short for the given bitLength");for(var W=0,le=1,G=P/8+E-1;G>=E;G--)W+=N[G]*le,le*=256;return W},g.readUintLE=function F(P,N,E){if(void 0===E&&(E=0),P%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(P/8>N.length-E)throw new Error("readUintLE: array is too short for the given bitLength");for(var W=0,le=1,G=E;G=W;G--)E[G]=N/le&255,le*=256;return E},g.writeUintLE=function U(P,N,E,W){if(void 0===E&&(E=new Uint8Array(P/8)),void 0===W&&(W=0),P%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!I.isSafeInteger(N))throw new Error("writeUintLE value must be an integer");for(var le=1,G=W;G{"use strict";Object.defineProperty(g,"__esModule",{value:!0});var I=D(32222),re=D(11512);function k(M,C,L){for(var ce=1634760805,de=857760878,ue=2036477234,O=1797285236,_e=L[3]<<24|L[2]<<16|L[1]<<8|L[0],De=L[7]<<24|L[6]<<16|L[5]<<8|L[4],we=L[11]<<24|L[10]<<16|L[9]<<8|L[8],ee=L[15]<<24|L[14]<<16|L[13]<<8|L[12],B=L[19]<<24|L[18]<<16|L[17]<<8|L[16],J=L[23]<<24|L[22]<<16|L[21]<<8|L[20],F=L[27]<<24|L[26]<<16|L[25]<<8|L[24],V=L[31]<<24|L[30]<<16|L[29]<<8|L[28],U=C[3]<<24|C[2]<<16|C[1]<<8|C[0],h=C[7]<<24|C[6]<<16|C[5]<<8|C[4],f=C[11]<<24|C[10]<<16|C[9]<<8|C[8],_=C[15]<<24|C[14]<<16|C[13]<<8|C[12],v=ce,S=de,b=ue,p=O,x=_e,P=De,N=we,E=ee,W=B,le=J,G=F,Re=V,ve=U,xe=h,Ce=f,Fe=_,je=0;je<20;je+=2)x=(x^=W=W+(ve=(ve^=v=v+x|0)>>>16|ve<<16)|0)>>>20|x<<12,P=(P^=le=le+(xe=(xe^=S=S+P|0)>>>16|xe<<16)|0)>>>20|P<<12,N=(N^=G=G+(Ce=(Ce^=b=b+N|0)>>>16|Ce<<16)|0)>>>20|N<<12,E=(E^=Re=Re+(Fe=(Fe^=p=p+E|0)>>>16|Fe<<16)|0)>>>20|E<<12,N=(N^=G=G+(Ce=(Ce^=b=b+N|0)>>>24|Ce<<8)|0)>>>25|N<<7,E=(E^=Re=Re+(Fe=(Fe^=p=p+E|0)>>>24|Fe<<8)|0)>>>25|E<<7,P=(P^=le=le+(xe=(xe^=S=S+P|0)>>>24|xe<<8)|0)>>>25|P<<7,x=(x^=W=W+(ve=(ve^=v=v+x|0)>>>24|ve<<8)|0)>>>25|x<<7,P=(P^=G=G+(Fe=(Fe^=v=v+P|0)>>>16|Fe<<16)|0)>>>20|P<<12,N=(N^=Re=Re+(ve=(ve^=S=S+N|0)>>>16|ve<<16)|0)>>>20|N<<12,E=(E^=W=W+(xe=(xe^=b=b+E|0)>>>16|xe<<16)|0)>>>20|E<<12,x=(x^=le=le+(Ce=(Ce^=p=p+x|0)>>>16|Ce<<16)|0)>>>20|x<<12,E=(E^=W=W+(xe=(xe^=b=b+E|0)>>>24|xe<<8)|0)>>>25|E<<7,x=(x^=le=le+(Ce=(Ce^=p=p+x|0)>>>24|Ce<<8)|0)>>>25|x<<7,N=(N^=Re=Re+(ve=(ve^=S=S+N|0)>>>24|ve<<8)|0)>>>25|N<<7,P=(P^=G=G+(Fe=(Fe^=v=v+P|0)>>>24|Fe<<8)|0)>>>25|P<<7;I.writeUint32LE(v+ce|0,M,0),I.writeUint32LE(S+de|0,M,4),I.writeUint32LE(b+ue|0,M,8),I.writeUint32LE(p+O|0,M,12),I.writeUint32LE(x+_e|0,M,16),I.writeUint32LE(P+De|0,M,20),I.writeUint32LE(N+we|0,M,24),I.writeUint32LE(E+ee|0,M,28),I.writeUint32LE(W+B|0,M,32),I.writeUint32LE(le+J|0,M,36),I.writeUint32LE(G+F|0,M,40),I.writeUint32LE(Re+V|0,M,44),I.writeUint32LE(ve+U|0,M,48),I.writeUint32LE(xe+h|0,M,52),I.writeUint32LE(Ce+f|0,M,56),I.writeUint32LE(Fe+_|0,M,60)}function $(M,C,L,ce,de){if(void 0===de&&(de=0),32!==M.length)throw new Error("ChaCha: key size must be 32 bytes");if(ce.length>>=8,C++;if(ce>0)throw new Error("ChaCha: counter overflow")}g.streamXOR=$,g.stream=function te(M,C,L,ce){return void 0===ce&&(ce=0),re.wipe(L),$(M,C,L,L,ce)}},31118:(Pe,g,D)=>{"use strict";var re=D(24553),ne=D(83905),k=D(11512),$=D(32222),te=D(93386);g.Cv=32,g.WH=12,g.pg=16;var H=new Uint8Array(16),M=function(){function C(L){if(this.nonceLength=g.WH,this.tagLength=g.pg,L.length!==g.Cv)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(L)}return C.prototype.seal=function(L,ce,de,ue){if(L.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var O=new Uint8Array(16);O.set(L,O.length-L.length);var _e=new Uint8Array(32);re.stream(this._key,O,_e,4);var we,De=ce.length+this.tagLength;if(ue){if(ue.length!==De)throw new Error("ChaCha20Poly1305: incorrect destination length");we=ue}else we=new Uint8Array(De);return re.streamXOR(this._key,O,ce,we,4),this._authenticate(we.subarray(we.length-this.tagLength,we.length),_e,we.subarray(0,we.length-this.tagLength),de),k.wipe(O),we},C.prototype.open=function(L,ce,de,ue){if(L.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(ce.length0&&O.update(H.subarray(ue.length%16))),O.update(de),de.length%16>0&&O.update(H.subarray(de.length%16));var _e=new Uint8Array(8);ue&&$.writeUint64LE(ue.length,_e),O.update(_e),$.writeUint64LE(de.length,_e),O.update(_e);for(var De=O.digest(),we=0;we{"use strict";function re(k,$){if(k.length!==$.length)return 0;for(var te=0,H=0;H>>8}Object.defineProperty(g,"__esModule",{value:!0}),g.select=function D(k,$,te){return~(k-1)&$|k-1&te},g.lessOrEqual=function I(k,$){return(0|k)-(0|$)-1>>>31&1},g.compare=re,g.equal=function ne(k,$){return 0!==k.length&&0!==$.length&&0!==re(k,$)}},52877:(Pe,g,D)=>{"use strict";g.Xx=g._w=g.aP=g.KS=g.jQ=void 0;D(7841);const ne=D(85198);D(11512);function $(Z){const he=new Float64Array(16);if(Z)for(let se=0;se>16&1),se[ze-1]&=65535;se[15]=y[15]-32767-(se[14]>>16&1);const Ae=se[15]>>16&1;se[14]&=65535,De(y,se,1-Ae)}for(let Y=0;Y<16;Y++)Z[2*Y]=255&y[Y],Z[2*Y+1]=y[Y]>>8}function J(Z){const he=new Uint8Array(32);return we(he,Z),1&he[0]}function V(Z,he,se){for(let y=0;y<16;y++)Z[y]=he[y]+se[y]}function U(Z,he,se){for(let y=0;y<16;y++)Z[y]=he[y]-se[y]}function h(Z,he,se){let y,Y,Ae=0,ze=0,ot=0,wt=0,ct=0,_t=0,Ht=0,Xt=0,gt=0,ft=0,it=0,ut=0,rt=0,Ge=0,He=0,We=0,Ye=0,lt=0,dt=0,bt=0,Et=0,yt=0,Dt=0,St=0,qr=0,Er=0,cn=0,Rn=0,Kn=0,Pn=0,fn=0,Wt=se[0],Gt=se[1],Yt=se[2],$t=se[3],ir=se[4],Zt=se[5],Qt=se[6],sr=se[7],or=se[8],kt=se[9],Kt=se[10],Ft=se[11],er=se[12],lr=se[13],ar=se[14],ur=se[15];y=he[0],Ae+=y*Wt,ze+=y*Gt,ot+=y*Yt,wt+=y*$t,ct+=y*ir,_t+=y*Zt,Ht+=y*Qt,Xt+=y*sr,gt+=y*or,ft+=y*kt,it+=y*Kt,ut+=y*Ft,rt+=y*er,Ge+=y*lr,He+=y*ar,We+=y*ur,y=he[1],ze+=y*Wt,ot+=y*Gt,wt+=y*Yt,ct+=y*$t,_t+=y*ir,Ht+=y*Zt,Xt+=y*Qt,gt+=y*sr,ft+=y*or,it+=y*kt,ut+=y*Kt,rt+=y*Ft,Ge+=y*er,He+=y*lr,We+=y*ar,Ye+=y*ur,y=he[2],ot+=y*Wt,wt+=y*Gt,ct+=y*Yt,_t+=y*$t,Ht+=y*ir,Xt+=y*Zt,gt+=y*Qt,ft+=y*sr,it+=y*or,ut+=y*kt,rt+=y*Kt,Ge+=y*Ft,He+=y*er,We+=y*lr,Ye+=y*ar,lt+=y*ur,y=he[3],wt+=y*Wt,ct+=y*Gt,_t+=y*Yt,Ht+=y*$t,Xt+=y*ir,gt+=y*Zt,ft+=y*Qt,it+=y*sr,ut+=y*or,rt+=y*kt,Ge+=y*Kt,He+=y*Ft,We+=y*er,Ye+=y*lr,lt+=y*ar,dt+=y*ur,y=he[4],ct+=y*Wt,_t+=y*Gt,Ht+=y*Yt,Xt+=y*$t,gt+=y*ir,ft+=y*Zt,it+=y*Qt,ut+=y*sr,rt+=y*or,Ge+=y*kt,He+=y*Kt,We+=y*Ft,Ye+=y*er,lt+=y*lr,dt+=y*ar,bt+=y*ur,y=he[5],_t+=y*Wt,Ht+=y*Gt,Xt+=y*Yt,gt+=y*$t,ft+=y*ir,it+=y*Zt,ut+=y*Qt,rt+=y*sr,Ge+=y*or,He+=y*kt,We+=y*Kt,Ye+=y*Ft,lt+=y*er,dt+=y*lr,bt+=y*ar,Et+=y*ur,y=he[6],Ht+=y*Wt,Xt+=y*Gt,gt+=y*Yt,ft+=y*$t,it+=y*ir,ut+=y*Zt,rt+=y*Qt,Ge+=y*sr,He+=y*or,We+=y*kt,Ye+=y*Kt,lt+=y*Ft,dt+=y*er,bt+=y*lr,Et+=y*ar,yt+=y*ur,y=he[7],Xt+=y*Wt,gt+=y*Gt,ft+=y*Yt,it+=y*$t,ut+=y*ir,rt+=y*Zt,Ge+=y*Qt,He+=y*sr,We+=y*or,Ye+=y*kt,lt+=y*Kt,dt+=y*Ft,bt+=y*er,Et+=y*lr,yt+=y*ar,Dt+=y*ur,y=he[8],gt+=y*Wt,ft+=y*Gt,it+=y*Yt,ut+=y*$t,rt+=y*ir,Ge+=y*Zt,He+=y*Qt,We+=y*sr,Ye+=y*or,lt+=y*kt,dt+=y*Kt,bt+=y*Ft,Et+=y*er,yt+=y*lr,Dt+=y*ar,St+=y*ur,y=he[9],ft+=y*Wt,it+=y*Gt,ut+=y*Yt,rt+=y*$t,Ge+=y*ir,He+=y*Zt,We+=y*Qt,Ye+=y*sr,lt+=y*or,dt+=y*kt,bt+=y*Kt,Et+=y*Ft,yt+=y*er,Dt+=y*lr,St+=y*ar,qr+=y*ur,y=he[10],it+=y*Wt,ut+=y*Gt,rt+=y*Yt,Ge+=y*$t,He+=y*ir,We+=y*Zt,Ye+=y*Qt,lt+=y*sr,dt+=y*or,bt+=y*kt,Et+=y*Kt,yt+=y*Ft,Dt+=y*er,St+=y*lr,qr+=y*ar,Er+=y*ur,y=he[11],ut+=y*Wt,rt+=y*Gt,Ge+=y*Yt,He+=y*$t,We+=y*ir,Ye+=y*Zt,lt+=y*Qt,dt+=y*sr,bt+=y*or,Et+=y*kt,yt+=y*Kt,Dt+=y*Ft,St+=y*er,qr+=y*lr,Er+=y*ar,cn+=y*ur,y=he[12],rt+=y*Wt,Ge+=y*Gt,He+=y*Yt,We+=y*$t,Ye+=y*ir,lt+=y*Zt,dt+=y*Qt,bt+=y*sr,Et+=y*or,yt+=y*kt,Dt+=y*Kt,St+=y*Ft,qr+=y*er,Er+=y*lr,cn+=y*ar,Rn+=y*ur,y=he[13],Ge+=y*Wt,He+=y*Gt,We+=y*Yt,Ye+=y*$t,lt+=y*ir,dt+=y*Zt,bt+=y*Qt,Et+=y*sr,yt+=y*or,Dt+=y*kt,St+=y*Kt,qr+=y*Ft,Er+=y*er,cn+=y*lr,Rn+=y*ar,Kn+=y*ur,y=he[14],He+=y*Wt,We+=y*Gt,Ye+=y*Yt,lt+=y*$t,dt+=y*ir,bt+=y*Zt,Et+=y*Qt,yt+=y*sr,Dt+=y*or,St+=y*kt,qr+=y*Kt,Er+=y*Ft,cn+=y*er,Rn+=y*lr,Kn+=y*ar,Pn+=y*ur,y=he[15],We+=y*Wt,Ye+=y*Gt,lt+=y*Yt,dt+=y*$t,bt+=y*ir,Et+=y*Zt,yt+=y*Qt,Dt+=y*sr,St+=y*or,qr+=y*kt,Er+=y*Kt,cn+=y*Ft,Rn+=y*er,Kn+=y*lr,Pn+=y*ar,fn+=y*ur,Ae+=38*Ye,ze+=38*lt,ot+=38*dt,wt+=38*bt,ct+=38*Et,_t+=38*yt,Ht+=38*Dt,Xt+=38*St,gt+=38*qr,ft+=38*Er,it+=38*cn,ut+=38*Rn,rt+=38*Kn,Ge+=38*Pn,He+=38*fn,Y=1,y=Ae+Y+65535,Y=Math.floor(y/65536),Ae=y-65536*Y,y=ze+Y+65535,Y=Math.floor(y/65536),ze=y-65536*Y,y=ot+Y+65535,Y=Math.floor(y/65536),ot=y-65536*Y,y=wt+Y+65535,Y=Math.floor(y/65536),wt=y-65536*Y,y=ct+Y+65535,Y=Math.floor(y/65536),ct=y-65536*Y,y=_t+Y+65535,Y=Math.floor(y/65536),_t=y-65536*Y,y=Ht+Y+65535,Y=Math.floor(y/65536),Ht=y-65536*Y,y=Xt+Y+65535,Y=Math.floor(y/65536),Xt=y-65536*Y,y=gt+Y+65535,Y=Math.floor(y/65536),gt=y-65536*Y,y=ft+Y+65535,Y=Math.floor(y/65536),ft=y-65536*Y,y=it+Y+65535,Y=Math.floor(y/65536),it=y-65536*Y,y=ut+Y+65535,Y=Math.floor(y/65536),ut=y-65536*Y,y=rt+Y+65535,Y=Math.floor(y/65536),rt=y-65536*Y,y=Ge+Y+65535,Y=Math.floor(y/65536),Ge=y-65536*Y,y=He+Y+65535,Y=Math.floor(y/65536),He=y-65536*Y,y=We+Y+65535,Y=Math.floor(y/65536),We=y-65536*Y,Ae+=Y-1+37*(Y-1),Y=1,y=Ae+Y+65535,Y=Math.floor(y/65536),Ae=y-65536*Y,y=ze+Y+65535,Y=Math.floor(y/65536),ze=y-65536*Y,y=ot+Y+65535,Y=Math.floor(y/65536),ot=y-65536*Y,y=wt+Y+65535,Y=Math.floor(y/65536),wt=y-65536*Y,y=ct+Y+65535,Y=Math.floor(y/65536),ct=y-65536*Y,y=_t+Y+65535,Y=Math.floor(y/65536),_t=y-65536*Y,y=Ht+Y+65535,Y=Math.floor(y/65536),Ht=y-65536*Y,y=Xt+Y+65535,Y=Math.floor(y/65536),Xt=y-65536*Y,y=gt+Y+65535,Y=Math.floor(y/65536),gt=y-65536*Y,y=ft+Y+65535,Y=Math.floor(y/65536),ft=y-65536*Y,y=it+Y+65535,Y=Math.floor(y/65536),it=y-65536*Y,y=ut+Y+65535,Y=Math.floor(y/65536),ut=y-65536*Y,y=rt+Y+65535,Y=Math.floor(y/65536),rt=y-65536*Y,y=Ge+Y+65535,Y=Math.floor(y/65536),Ge=y-65536*Y,y=He+Y+65535,Y=Math.floor(y/65536),He=y-65536*Y,y=We+Y+65535,Y=Math.floor(y/65536),We=y-65536*Y,Ae+=Y-1+37*(Y-1),Z[0]=Ae,Z[1]=ze,Z[2]=ot,Z[3]=wt,Z[4]=ct,Z[5]=_t,Z[6]=Ht,Z[7]=Xt,Z[8]=gt,Z[9]=ft,Z[10]=it,Z[11]=ut,Z[12]=rt,Z[13]=Ge,Z[14]=He,Z[15]=We}function f(Z,he){h(Z,he,he)}function S(Z,he){const se=$(),y=$(),Y=$(),Ae=$(),ze=$(),ot=$(),wt=$(),ct=$(),_t=$();U(se,Z[1],Z[0]),U(_t,he[1],he[0]),h(se,se,_t),V(y,Z[0],Z[1]),V(_t,he[0],he[1]),h(y,y,_t),h(Y,Z[3],he[3]),h(Y,Y,L),h(Ae,Z[2],he[2]),V(Ae,Ae,Ae),U(ze,y,se),U(ot,Ae,Y),V(wt,Ae,Y),V(ct,y,se),h(Z[0],ze,ot),h(Z[1],ct,wt),h(Z[2],wt,ot),h(Z[3],ze,ct)}function b(Z,he,se){for(let y=0;y<4;y++)De(Z[y],he[y],se)}function p(Z,he){const se=$(),y=$(),Y=$();(function _(Z,he){const se=$();let y;for(y=0;y<16;y++)se[y]=he[y];for(y=253;y>=0;y--)f(se,se),2!==y&&4!==y&&h(se,se,he);for(y=0;y<16;y++)Z[y]=se[y]})(Y,he[2]),h(se,he[0],Y),h(y,he[1],Y),we(Z,y),Z[31]^=J(se)<<7}function P(Z,he){const se=[$(),$(),$(),$()];O(se[0],ce),O(se[1],de),O(se[2],M),h(se[3],ce,de),function x(Z,he,se){O(Z[0],H),O(Z[1],M),O(Z[2],M),O(Z[3],H);for(let y=255;y>=0;--y){const Y=se[y/8|0]>>(7&y)&1;b(Z,he,Y),S(he,Z),S(Z,Z),b(Z,he,Y)}}(Z,se,he)}g._w=function N(Z){if(Z.length!==g.aP)throw new Error(`ed25519: seed must be ${g.aP} bytes`);const he=(0,ne.hash)(Z);he[0]&=248,he[31]&=127,he[31]|=64;const se=new Uint8Array(32),y=[$(),$(),$(),$()];P(y,he),p(se,y);const Y=new Uint8Array(64);return Y.set(Z),Y.set(se,32),{publicKey:se,secretKey:Y}};const le=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function G(Z,he){let se,y,Y,Ae;for(y=63;y>=32;--y){for(se=0,Y=y-32,Ae=y-12;Y>4)*le[Y],se=he[Y]>>8,he[Y]&=255;for(Y=0;Y<32;Y++)he[Y]-=se*le[Y];for(y=0;y<32;y++)he[y+1]+=he[y]>>8,Z[y]=255&he[y]}function Re(Z){const he=new Float64Array(64);for(let se=0;se<64;se++)he[se]=Z[se];for(let se=0;se<64;se++)Z[se]=0;G(Z,he)}g.Xx=function ve(Z,he){const se=new Float64Array(64),y=[$(),$(),$(),$()],Y=(0,ne.hash)(Z.subarray(0,32));Y[0]&=248,Y[31]&=127,Y[31]|=64;const Ae=new Uint8Array(64);Ae.set(Y.subarray(32),32);const ze=new ne.SHA512;ze.update(Ae.subarray(32)),ze.update(he);const ot=ze.digest();ze.clean(),Re(ot),P(y,ot),p(Ae,y),ze.reset(),ze.update(Ae.subarray(0,32)),ze.update(Z.subarray(32)),ze.update(he);const wt=ze.digest();Re(wt);for(let ct=0;ct<32;ct++)se[ct]=ot[ct];for(let ct=0;ct<32;ct++)for(let _t=0;_t<32;_t++)se[ct+_t]+=wt[ct]*Y[_t];return G(Ae.subarray(32),se),Ae}},51845:(Pe,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.isSerializableHash=function D(I){return typeof I.saveState<"u"&&typeof I.restoreState<"u"&&typeof I.cleanSavedState<"u"}},82584:(Pe,g,D)=>{"use strict";var re=D(99171),ne=D(11512),k=function(){function $(te,H,M,C){void 0===M&&(M=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=te,this._info=C;var L=re.hmac(this._hash,M,H);this._hmac=new re.HMAC(te,L),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return $.prototype._fillBuffer=function(){this._counter[0]++;var te=this._counter[0];if(0===te)throw new Error("hkdf: cannot expand more");this._hmac.reset(),te>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},$.prototype.expand=function(te){for(var H=new Uint8Array(te),M=0;M{"use strict";Object.defineProperty(g,"__esModule",{value:!0});var I=D(51845),re=D(93386),ne=D(11512),k=function(){function te(H,M){this._finished=!1,this._inner=new H,this._outer=new H,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var C=new Uint8Array(this.blockSize);M.length>this.blockSize?this._inner.update(M).finish(C).clean():C.set(M);for(var L=0;L{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.mul=Math.imul||function D(te,H){var C=65535&te,ce=65535&H;return C*ce+((te>>>16&65535)*ce+C*(H>>>16&65535)<<16>>>0)|0},g.add=function I(te,H){return te+H|0},g.sub=function re(te,H){return te-H|0},g.rotl=function ne(te,H){return te<>>32-H},g.rotr=function k(te,H){return te<<32-H|te>>>H},g.isInteger=Number.isInteger||function $(te){return"number"==typeof te&&isFinite(te)&&Math.floor(te)===te},g.MAX_SAFE_INTEGER=9007199254740991,g.isSafeInteger=function(te){return g.isInteger(te)&&te>=-g.MAX_SAFE_INTEGER&&te<=g.MAX_SAFE_INTEGER}},83905:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});var I=D(93386),re=D(11512);g.DIGEST_LENGTH=16;var ne=function(){function te(H){this.digestLength=g.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var M=H[0]|H[1]<<8;this._r[0]=8191&M;var C=H[2]|H[3]<<8;this._r[1]=8191&(M>>>13|C<<3);var L=H[4]|H[5]<<8;this._r[2]=7939&(C>>>10|L<<6);var ce=H[6]|H[7]<<8;this._r[3]=8191&(L>>>7|ce<<9);var de=H[8]|H[9]<<8;this._r[4]=255&(ce>>>4|de<<12),this._r[5]=de>>>1&8190;var ue=H[10]|H[11]<<8;this._r[6]=8191&(de>>>14|ue<<2);var O=H[12]|H[13]<<8;this._r[7]=8065&(ue>>>11|O<<5);var _e=H[14]|H[15]<<8;this._r[8]=8191&(O>>>8|_e<<8),this._r[9]=_e>>>5&127,this._pad[0]=H[16]|H[17]<<8,this._pad[1]=H[18]|H[19]<<8,this._pad[2]=H[20]|H[21]<<8,this._pad[3]=H[22]|H[23]<<8,this._pad[4]=H[24]|H[25]<<8,this._pad[5]=H[26]|H[27]<<8,this._pad[6]=H[28]|H[29]<<8,this._pad[7]=H[30]|H[31]<<8}return te.prototype._blocks=function(H,M,C){for(var L=this._fin?0:2048,ce=this._h[0],de=this._h[1],ue=this._h[2],O=this._h[3],_e=this._h[4],De=this._h[5],we=this._h[6],ee=this._h[7],B=this._h[8],J=this._h[9],F=this._r[0],V=this._r[1],U=this._r[2],h=this._r[3],f=this._r[4],_=this._r[5],v=this._r[6],S=this._r[7],b=this._r[8],p=this._r[9];C>=16;){var x=H[M+0]|H[M+1]<<8,P=H[M+2]|H[M+3]<<8,N=H[M+4]|H[M+5]<<8,E=H[M+6]|H[M+7]<<8,W=H[M+8]|H[M+9]<<8,le=H[M+10]|H[M+11]<<8,G=H[M+12]|H[M+13]<<8,Re=H[M+14]|H[M+15]<<8,ve=0,xe=ve;xe+=(ce+=8191&x)*F,xe+=(de+=8191&(x>>>13|P<<3))*(5*p),xe+=(ue+=8191&(P>>>10|N<<6))*(5*b),xe+=(O+=8191&(N>>>7|E<<9))*(5*S),ve=(xe+=(_e+=8191&(E>>>4|W<<12))*(5*v))>>>13,xe&=8191,xe+=(De+=W>>>1&8191)*(5*_),xe+=(we+=8191&(W>>>14|le<<2))*(5*f),xe+=(ee+=8191&(le>>>11|G<<5))*(5*h),xe+=(B+=8191&(G>>>8|Re<<8))*(5*U);var Ce=ve+=(xe+=(J+=Re>>>5|L)*(5*V))>>>13;Ce+=ce*V,Ce+=de*F,Ce+=ue*(5*p),Ce+=O*(5*b),ve=(Ce+=_e*(5*S))>>>13,Ce&=8191,Ce+=De*(5*v),Ce+=we*(5*_),Ce+=ee*(5*f),Ce+=B*(5*h),ve+=(Ce+=J*(5*U))>>>13,Ce&=8191;var Fe=ve;Fe+=ce*U,Fe+=de*V,Fe+=ue*F,Fe+=O*(5*p),ve=(Fe+=_e*(5*b))>>>13,Fe&=8191,Fe+=De*(5*S),Fe+=we*(5*v),Fe+=ee*(5*_),Fe+=B*(5*f);var je=ve+=(Fe+=J*(5*h))>>>13;je+=ce*h,je+=de*U,je+=ue*V,je+=O*F,ve=(je+=_e*(5*p))>>>13,je&=8191,je+=De*(5*b),je+=we*(5*S),je+=ee*(5*v),je+=B*(5*_);var Z=ve+=(je+=J*(5*f))>>>13;Z+=ce*f,Z+=de*h,Z+=ue*U,Z+=O*V,ve=(Z+=_e*F)>>>13,Z&=8191,Z+=De*(5*p),Z+=we*(5*b),Z+=ee*(5*S),Z+=B*(5*v);var he=ve+=(Z+=J*(5*_))>>>13;he+=ce*_,he+=de*f,he+=ue*h,he+=O*U,ve=(he+=_e*V)>>>13,he&=8191,he+=De*F,he+=we*(5*p),he+=ee*(5*b),he+=B*(5*S);var se=ve+=(he+=J*(5*v))>>>13;se+=ce*v,se+=de*_,se+=ue*f,se+=O*h,ve=(se+=_e*U)>>>13,se&=8191,se+=De*V,se+=we*F,se+=ee*(5*p),se+=B*(5*b);var y=ve+=(se+=J*(5*S))>>>13;y+=ce*S,y+=de*v,y+=ue*_,y+=O*f,ve=(y+=_e*h)>>>13,y&=8191,y+=De*U,y+=we*V,y+=ee*F,y+=B*(5*p);var Y=ve+=(y+=J*(5*b))>>>13;Y+=ce*b,Y+=de*S,Y+=ue*v,Y+=O*_,ve=(Y+=_e*f)>>>13,Y&=8191,Y+=De*h,Y+=we*U,Y+=ee*V,Y+=B*F;var Ae=ve+=(Y+=J*(5*p))>>>13;Ae+=ce*p,Ae+=de*b,Ae+=ue*S,Ae+=O*v,ve=(Ae+=_e*_)>>>13,Ae&=8191,Ae+=De*f,Ae+=we*h,Ae+=ee*U,Ae+=B*V,ce=xe=8191&(ve=(ve=((ve+=(Ae+=J*F)>>>13)<<2)+ve|0)+(xe&=8191)|0),de=Ce+=ve>>>=13,ue=Fe&=8191,O=je&=8191,_e=Z&=8191,De=he&=8191,we=se&=8191,ee=y&=8191,B=Y&=8191,J=Ae&=8191,M+=16,C-=16}this._h[0]=ce,this._h[1]=de,this._h[2]=ue,this._h[3]=O,this._h[4]=_e,this._h[5]=De,this._h[6]=we,this._h[7]=ee,this._h[8]=B,this._h[9]=J},te.prototype.finish=function(H,M){void 0===M&&(M=0);var L,ce,de,ue,C=new Uint16Array(10);if(this._leftover){for(ue=this._leftover,this._buffer[ue++]=1;ue<16;ue++)this._buffer[ue]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(L=this._h[1]>>>13,this._h[1]&=8191,ue=2;ue<10;ue++)this._h[ue]+=L,L=this._h[ue]>>>13,this._h[ue]&=8191;for(this._h[0]+=5*L,L=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=L,L=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=L,C[0]=this._h[0]+5,L=C[0]>>>13,C[0]&=8191,ue=1;ue<10;ue++)C[ue]=this._h[ue]+L,L=C[ue]>>>13,C[ue]&=8191;for(C[9]-=8192,ce=(1^L)-1,ue=0;ue<10;ue++)C[ue]&=ce;for(ce=~ce,ue=0;ue<10;ue++)this._h[ue]=this._h[ue]&ce|C[ue];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),this._h[0]=65535&(de=this._h[0]+this._pad[0]),ue=1;ue<8;ue++)this._h[ue]=65535&(de=(this._h[ue]+this._pad[ue]|0)+(de>>>16)|0);return H[M+0]=this._h[0]>>>0,H[M+1]=this._h[0]>>>8,H[M+2]=this._h[1]>>>0,H[M+3]=this._h[1]>>>8,H[M+4]=this._h[2]>>>0,H[M+5]=this._h[2]>>>8,H[M+6]=this._h[3]>>>0,H[M+7]=this._h[3]>>>8,H[M+8]=this._h[4]>>>0,H[M+9]=this._h[4]>>>8,H[M+10]=this._h[5]>>>0,H[M+11]=this._h[5]>>>8,H[M+12]=this._h[6]>>>0,H[M+13]=this._h[6]>>>8,H[M+14]=this._h[7]>>>0,H[M+15]=this._h[7]>>>8,this._finished=!0,this},te.prototype.update=function(H){var L,M=0,C=H.length;if(this._leftover){(L=16-this._leftover)>C&&(L=C);for(var ce=0;ce=16&&(this._blocks(H,M,L=C-C%16),M+=L,C-=L),C){for(ce=0;ce{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.randomStringForEntropy=g.randomString=g.randomUint32=g.randomBytes=g.defaultRandomSource=void 0;const I=D(14894),re=D(32222),ne=D(11512);function k(C,L=g.defaultRandomSource){return L.randomBytes(C)}g.defaultRandomSource=new I.SystemRandomSource,g.randomBytes=k,g.randomUint32=function $(C=g.defaultRandomSource){const L=k(4,C),ce=(0,re.readUint32LE)(L);return(0,ne.wipe)(L),ce};const te="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function H(C,L=te,ce=g.defaultRandomSource){if(L.length<2)throw new Error("randomString charset is too short");if(L.length>256)throw new Error("randomString charset is too long");let de="";const ue=L.length,O=256-256%ue;for(;C>0;){const _e=k(Math.ceil(256*C/O),ce);for(let De=0;De<_e.length&&C>0;De++){const we=_e[De];we{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.BrowserRandomSource=void 0,g.BrowserRandomSource=class I{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const ne=typeof self<"u"?self.crypto||self.msCrypto:null;ne&&void 0!==ne.getRandomValues&&(this._crypto=ne,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(ne){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const k=new Uint8Array(ne);for(let $=0;${"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.NodeRandomSource=void 0;const I=D(11512);g.NodeRandomSource=class re{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const k=D(19726);k&&k.randomBytes&&(this._crypto=k,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(k){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let $=this._crypto.randomBytes(k);if($.length!==k)throw new Error("NodeRandomSource: got fewer bytes than requested");const te=new Uint8Array(k);for(let H=0;H{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.SystemRandomSource=void 0;const I=D(33607),re=D(73022);g.SystemRandomSource=class ne{constructor(){return this.isAvailable=!1,this.name="",this._source=new I.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new re.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes($){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes($)}}},59373:(Pe,g,D)=>{"use strict";var re=D(32222),ne=D(11512);g.k=32,g.cn=64;var k=function(){function M(){this.digestLength=g.k,this.blockSize=g.cn,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return M.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},M.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},M.prototype.clean=function(){ne.wipe(this._buffer),ne.wipe(this._temp),this.reset()},M.prototype.update=function(C,L){if(void 0===L&&(L=C.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var ce=0;if(this._bytesHashed+=L,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=C[ce++],L--;this._bufferLength===this.blockSize&&(te(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(L>=this.blockSize&&(ce=te(this._temp,this._state,C,ce,L),L%=this.blockSize);L>0;)this._buffer[this._bufferLength++]=C[ce++],L--;return this},M.prototype.finish=function(C){if(!this._finished){var L=this._bytesHashed,ce=this._bufferLength,de=L/536870912|0,ue=L<<3,O=L%64<56?64:128;this._buffer[ce]=128;for(var _e=ce+1;_e0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},M.prototype.restoreState=function(C){return this._state.set(C.state),this._bufferLength=C.bufferLength,C.buffer&&this._buffer.set(C.buffer),this._bytesHashed=C.bytesHashed,this._finished=!1,this},M.prototype.cleanSavedState=function(C){ne.wipe(C.state),C.buffer&&ne.wipe(C.buffer),C.bufferLength=0,C.bytesHashed=0},M}();g.mE=k;var $=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function te(M,C,L,ce,de){for(;de>=64;){for(var ue=C[0],O=C[1],_e=C[2],De=C[3],we=C[4],ee=C[5],B=C[6],J=C[7],F=0;F<16;F++)M[F]=re.readUint32BE(L,ce+4*F);for(F=16;F<64;F++){var U=M[F-2];M[F]=((h=(U>>>17|U<<15)^(U>>>19|U<<13)^U>>>10)+M[F-7]|0)+((f=((U=M[F-15])>>>7|U<<25)^(U>>>18|U<<14)^U>>>3)+M[F-16]|0)}for(F=0;F<64;F++){var h=(((we>>>6|we<<26)^(we>>>11|we<<21)^(we>>>25|we<<7))+(we&ee^~we&B)|0)+(J+($[F]+M[F]|0)|0)|0,f=((ue>>>2|ue<<30)^(ue>>>13|ue<<19)^(ue>>>22|ue<<10))+(ue&O^ue&_e^O&_e)|0;J=B,B=ee,ee=we,we=De+h|0,De=_e,_e=O,O=ue,ue=h+f|0}C[0]+=ue,C[1]+=O,C[2]+=_e,C[3]+=De,C[4]+=we,C[5]+=ee,C[6]+=B,C[7]+=J,ce+=64,de-=64}return ce}g.vp=function H(M){var C=new k;C.update(M);var L=C.digest();return C.clean(),L}},85198:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});var I=D(32222),re=D(11512);g.DIGEST_LENGTH=64,g.BLOCK_SIZE=128;var ne=function(){function H(){this.digestLength=g.DIGEST_LENGTH,this.blockSize=g.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return H.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},H.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},H.prototype.clean=function(){re.wipe(this._buffer),re.wipe(this._tempHi),re.wipe(this._tempLo),this.reset()},H.prototype.update=function(M,C){if(void 0===C&&(C=M.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var L=0;if(this._bytesHashed+=C,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=M[L++],C--;this._bufferLength===this.blockSize&&($(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(C>=this.blockSize&&(L=$(this._tempHi,this._tempLo,this._stateHi,this._stateLo,M,L,C),C%=this.blockSize);C>0;)this._buffer[this._bufferLength++]=M[L++],C--;return this},H.prototype.finish=function(M){if(!this._finished){var C=this._bytesHashed,L=this._bufferLength,ce=C/536870912|0,de=C<<3,ue=C%128<112?128:256;this._buffer[L]=128;for(var O=L+1;O0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},H.prototype.restoreState=function(M){return this._stateHi.set(M.stateHi),this._stateLo.set(M.stateLo),this._bufferLength=M.bufferLength,M.buffer&&this._buffer.set(M.buffer),this._bytesHashed=M.bytesHashed,this._finished=!1,this},H.prototype.cleanSavedState=function(M){re.wipe(M.stateHi),re.wipe(M.stateLo),M.buffer&&re.wipe(M.buffer),M.bufferLength=0,M.bytesHashed=0},H}();g.SHA512=ne;var k=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function $(H,M,C,L,ce,de,ue){for(var p,x,P,N,E,W,le,G,O=C[0],_e=C[1],De=C[2],we=C[3],ee=C[4],B=C[5],J=C[6],F=C[7],V=L[0],U=L[1],h=L[2],f=L[3],_=L[4],v=L[5],S=L[6],b=L[7];ue>=128;){for(var Re=0;Re<16;Re++)H[Re]=I.readUint32BE(ce,ve=8*Re+de),M[Re]=I.readUint32BE(ce,ve+4);for(Re=0;Re<80;Re++){var y,Ht,Ce=_e,Fe=De,je=we,Z=ee,he=B,se=J,Ae=U,ze=h,ot=f,wt=_,ct=v,_t=S;if(E=65535&(x=b),W=x>>>16,le=65535&(p=F),G=p>>>16,E+=65535&(x=(_>>>14|ee<<18)^(_>>>18|ee<<14)^(ee>>>9|_<<23)),W+=x>>>16,le+=65535&(p=(ee>>>14|_<<18)^(ee>>>18|_<<14)^(_>>>9|ee<<23)),G+=p>>>16,E+=65535&(x=_&v^~_&S),W+=x>>>16,le+=65535&(p=ee&B^~ee&J),G+=p>>>16,E+=65535&(x=k[2*Re+1]),W+=x>>>16,le+=65535&(p=k[2*Re]),G+=p>>>16,W+=(x=M[Re%16])>>>16,le+=65535&(p=H[Re%16]),G+=p>>>16,le+=(W+=(E+=65535&x)>>>16)>>>16,E=65535&(x=N=65535&E|W<<16),W=x>>>16,le=65535&(p=P=65535&le|(G+=le>>>16)<<16),G=p>>>16,E+=65535&(x=(V>>>28|O<<4)^(O>>>2|V<<30)^(O>>>7|V<<25)),W+=x>>>16,le+=65535&(p=(O>>>28|V<<4)^(V>>>2|O<<30)^(V>>>7|O<<25)),G+=p>>>16,W+=(x=V&U^V&h^U&h)>>>16,le+=65535&(p=O&_e^O&De^_e&De),G+=p>>>16,y=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,Ht=65535&E|W<<16,E=65535&(x=ot),W=x>>>16,le=65535&(p=je),G=p>>>16,W+=(x=N)>>>16,le+=65535&(p=P),G+=p>>>16,_e=O,De=Ce,we=Fe,ee=je=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,B=Z,J=he,F=se,O=y,U=V,h=Ae,f=ze,_=ot=65535&E|W<<16,v=wt,S=ct,b=_t,V=Ht,Re%16==15)for(var ve=0;ve<16;ve++)E=65535&(x=M[ve]),W=x>>>16,le=65535&(p=H[ve]),G=p>>>16,E+=65535&(x=M[(ve+9)%16]),W+=x>>>16,le+=65535&(p=H[(ve+9)%16]),G+=p>>>16,E+=65535&(x=((N=M[(ve+1)%16])>>>1|(P=H[(ve+1)%16])<<31)^(N>>>8|P<<24)^(N>>>7|P<<25)),W+=x>>>16,le+=65535&(p=(P>>>1|N<<31)^(P>>>8|N<<24)^P>>>7),G+=p>>>16,W+=(x=((N=M[(ve+14)%16])>>>19|(P=H[(ve+14)%16])<<13)^(P>>>29|N<<3)^(N>>>6|P<<26))>>>16,le+=65535&(p=(P>>>19|N<<13)^(N>>>29|P<<3)^P>>>6),G+=p>>>16,H[ve]=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,M[ve]=65535&E|W<<16}E=65535&(x=V),W=x>>>16,le=65535&(p=O),G=p>>>16,W+=(x=L[0])>>>16,le+=65535&(p=C[0]),G+=p>>>16,C[0]=O=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,L[0]=V=65535&E|W<<16,E=65535&(x=U),W=x>>>16,le=65535&(p=_e),G=p>>>16,W+=(x=L[1])>>>16,le+=65535&(p=C[1]),G+=p>>>16,C[1]=_e=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,L[1]=U=65535&E|W<<16,E=65535&(x=h),W=x>>>16,le=65535&(p=De),G=p>>>16,W+=(x=L[2])>>>16,le+=65535&(p=C[2]),G+=p>>>16,C[2]=De=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,L[2]=h=65535&E|W<<16,E=65535&(x=f),W=x>>>16,le=65535&(p=we),G=p>>>16,W+=(x=L[3])>>>16,le+=65535&(p=C[3]),G+=p>>>16,C[3]=we=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,L[3]=f=65535&E|W<<16,E=65535&(x=_),W=x>>>16,le=65535&(p=ee),G=p>>>16,W+=(x=L[4])>>>16,le+=65535&(p=C[4]),G+=p>>>16,C[4]=ee=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,L[4]=_=65535&E|W<<16,E=65535&(x=v),W=x>>>16,le=65535&(p=B),G=p>>>16,W+=(x=L[5])>>>16,le+=65535&(p=C[5]),G+=p>>>16,C[5]=B=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,L[5]=v=65535&E|W<<16,E=65535&(x=S),W=x>>>16,le=65535&(p=J),G=p>>>16,W+=(x=L[6])>>>16,le+=65535&(p=C[6]),G+=p>>>16,C[6]=J=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,L[6]=S=65535&E|W<<16,E=65535&(x=b),W=x>>>16,le=65535&(p=F),G=p>>>16,W+=(x=L[7])>>>16,le+=65535&(p=C[7]),G+=p>>>16,C[7]=F=65535&(le+=(W+=(E+=65535&x)>>>16)>>>16)|(G+=le>>>16)<<16,L[7]=b=65535&E|W<<16,de+=128,ue-=128}return de}g.hash=function te(H){var M=new ne;M.update(H);var C=M.digest();return M.clean(),C}},11512:(Pe,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.wipe=function D(I){for(var re=0;re{"use strict";g.gi=g.Au=g.KS=g.kz=void 0;const re=D(7841),ne=D(11512);function k(F){const V=new Float64Array(16);if(F)for(let U=0;U=0;--E){const W=U[E>>>3]>>>(7&E)&1;M(f,_,W),M(v,S,W),ce(b,f,v),de(f,f,v),ce(v,_,S),de(_,_,S),O(S,b),O(p,f),ue(f,v,f),ue(v,_,b),ce(b,f,v),de(f,f,v),O(_,f),de(v,S,p),ue(f,v,te),ce(f,f,S),ue(v,v,f),ue(f,S,p),ue(S,_,h),O(_,b),M(f,_,W),M(v,S,W)}for(let E=0;E<16;E++)h[E+16]=f[E],h[E+32]=v[E],h[E+48]=_[E],h[E+64]=S[E];const x=h.subarray(32),P=h.subarray(16);(function _e(F,V){const U=k();for(let h=0;h<16;h++)U[h]=V[h];for(let h=253;h>=0;h--)O(U,U),2!==h&&4!==h&&ue(U,U,V);for(let h=0;h<16;h++)F[h]=U[h]})(x,x),ue(P,P,x);const N=new Uint8Array(32);return function C(F,V){const U=k(),h=k();for(let f=0;f<16;f++)h[f]=V[f];H(h),H(h),H(h);for(let f=0;f<2;f++){U[0]=h[0]-65517;for(let v=1;v<15;v++)U[v]=h[v]-65535-(U[v-1]>>16&1),U[v-1]&=65535;U[15]=h[15]-32767-(U[14]>>16&1);const _=U[15]>>16&1;U[14]&=65535,M(h,U,1-_)}for(let f=0;f<16;f++)F[2*f]=255&h[f],F[2*f+1]=h[f]>>8}(N,P),N}function we(F){return De(F,$)}g.Au=function B(F){const V=(0,re.randomBytes)(32,F),U=function ee(F){if(F.length!==g.KS)throw new Error(`x25519: seed must be ${g.KS} bytes`);const V=new Uint8Array(F);return{publicKey:we(V),secretKey:V}}(V);return(0,ne.wipe)(V),U},g.gi=function J(F,V,U=!1){if(F.length!==g.kz)throw new Error("X25519: incorrect secret key length");if(V.length!==g.kz)throw new Error("X25519: incorrect public key length");const h=De(F,V);if(U){let f=0;for(let _=0;_{"use strict";function D(){return(null==global?void 0:global.crypto)||(null==global?void 0:global.msCrypto)||{}}function I(){const ne=D();return ne.subtle||ne.webkitSubtle}Object.defineProperty(g,"__esModule",{value:!0}),g.isBrowserCryptoAvailable=g.getSubtleCrypto=g.getBrowerCrypto=void 0,g.getBrowerCrypto=D,g.getSubtleCrypto=I,g.isBrowserCryptoAvailable=function re(){return!!D()&&!!I()}},26e3:(Pe,g)=>{"use strict";function D(){return typeof document>"u"&&typeof navigator<"u"&&"ReactNative"===navigator.product}function I(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Object.defineProperty(g,"__esModule",{value:!0}),g.isBrowser=g.isNode=g.isReactNative=void 0,g.isReactNative=D,g.isNode=I,g.isBrowser=function re(){return!D()&&!I()}},43841:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});const I=D(69763);I.__exportStar(D(38573),g),I.__exportStar(D(26e3),g)},43795:(Pe,g,D)=>{"use strict";D.d(g,{q:()=>I});class I{}},39282:(Pe,g,D)=>{"use strict";D.r(g),D.d(g,{IEvents:()=>I.q});var I=D(43795)},6602:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.HEARTBEAT_EVENTS=g.HEARTBEAT_INTERVAL=void 0;const I=D(40145);g.HEARTBEAT_INTERVAL=I.FIVE_SECONDS,g.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"}},40073:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),D(99940).__exportStar(D(6602),g)},81382:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.HeartBeat=void 0;const I=D(99940),re=D(2272),ne=D(40145),k=D(77522),$=D(40073);class te extends k.IHeartBeat{constructor(M){super(M),this.events=new re.EventEmitter,this.interval=$.HEARTBEAT_INTERVAL,this.interval=(null==M?void 0:M.interval)||$.HEARTBEAT_INTERVAL}static init(M){return I.__awaiter(this,void 0,void 0,function*(){const C=new te(M);return yield C.init(),C})}init(){return I.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(M,C){this.events.on(M,C)}once(M,C){this.events.once(M,C)}off(M,C){this.events.off(M,C)}removeListener(M,C){this.events.removeListener(M,C)}initialize(){return I.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),ne.toMiliseconds(this.interval))})}pulse(){this.events.emit($.HEARTBEAT_EVENTS.pulse)}}g.HeartBeat=te},40851:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});const I=D(99940);I.__exportStar(D(81382),g),I.__exportStar(D(77522),g),I.__exportStar(D(40073),g)},31849:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.IHeartBeat=void 0;const I=D(39282);g.IHeartBeat=class re extends I.IEvents{constructor(k){super()}}},77522:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),D(99940).__exportStar(D(31849),g)},85666:(Pe,g,D)=>{"use strict";D.d(g,{IJsonRpcProvider:()=>ne.x0});var I=D(24530);D.o(I,"IJsonRpcProvider")&&D.d(g,{IJsonRpcProvider:function(){return I.IJsonRpcProvider}}),D.o(I,"isHttpUrl")&&D.d(g,{isHttpUrl:function(){return I.isHttpUrl}}),D.o(I,"isJsonRpcError")&&D.d(g,{isJsonRpcError:function(){return I.isJsonRpcError}}),D.o(I,"isJsonRpcRequest")&&D.d(g,{isJsonRpcRequest:function(){return I.isJsonRpcRequest}}),D.o(I,"isJsonRpcResponse")&&D.d(g,{isJsonRpcResponse:function(){return I.isJsonRpcResponse}}),D.o(I,"isJsonRpcResult")&&D.d(g,{isJsonRpcResult:function(){return I.isJsonRpcResult}}),D.o(I,"isLocalhostUrl")&&D.d(g,{isLocalhostUrl:function(){return I.isLocalhostUrl}}),D.o(I,"isReactNative")&&D.d(g,{isReactNative:function(){return I.isReactNative}}),D.o(I,"isWsUrl")&&D.d(g,{isWsUrl:function(){return I.isWsUrl}});var ne=D(15466),k=D(14980);D.o(k,"isHttpUrl")&&D.d(g,{isHttpUrl:function(){return k.isHttpUrl}}),D.o(k,"isJsonRpcError")&&D.d(g,{isJsonRpcError:function(){return k.isJsonRpcError}}),D.o(k,"isJsonRpcRequest")&&D.d(g,{isJsonRpcRequest:function(){return k.isJsonRpcRequest}}),D.o(k,"isJsonRpcResponse")&&D.d(g,{isJsonRpcResponse:function(){return k.isJsonRpcResponse}}),D.o(k,"isJsonRpcResult")&&D.d(g,{isJsonRpcResult:function(){return k.isJsonRpcResult}}),D.o(k,"isLocalhostUrl")&&D.d(g,{isLocalhostUrl:function(){return k.isLocalhostUrl}}),D.o(k,"isReactNative")&&D.d(g,{isReactNative:function(){return k.isReactNative}}),D.o(k,"isWsUrl")&&D.d(g,{isWsUrl:function(){return k.isWsUrl}})},24530:()=>{},15466:(Pe,g,D)=>{"use strict";D.d(g,{x0:()=>k});class k extends class ne extends class I{}{constructor(){super()}}{constructor(te){super()}}},14980:()=>{},90680:(Pe,g,D)=>{"use strict";D.d(g,{CA:()=>te,JV:()=>L,O4:()=>$,dQ:()=>H,xK:()=>C});const $="INTERNAL_ERROR",te="SERVER_ERROR",H=[-32700,-32600,-32601,-32602,-32603],C={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"},[$]:{code:-32603,message:"Internal error"},[te]:{code:-32e3,message:"Server error"}},L=te},20429:(Pe,g,D)=>{"use strict";var I=D(43841);D.o(I,"IJsonRpcProvider")&&D.d(g,{IJsonRpcProvider:function(){return I.IJsonRpcProvider}}),D.o(I,"formatJsonRpcError")&&D.d(g,{formatJsonRpcError:function(){return I.formatJsonRpcError}}),D.o(I,"formatJsonRpcRequest")&&D.d(g,{formatJsonRpcRequest:function(){return I.formatJsonRpcRequest}}),D.o(I,"formatJsonRpcResult")&&D.d(g,{formatJsonRpcResult:function(){return I.formatJsonRpcResult}}),D.o(I,"getBigIntRpcId")&&D.d(g,{getBigIntRpcId:function(){return I.getBigIntRpcId}}),D.o(I,"isHttpUrl")&&D.d(g,{isHttpUrl:function(){return I.isHttpUrl}}),D.o(I,"isJsonRpcError")&&D.d(g,{isJsonRpcError:function(){return I.isJsonRpcError}}),D.o(I,"isJsonRpcRequest")&&D.d(g,{isJsonRpcRequest:function(){return I.isJsonRpcRequest}}),D.o(I,"isJsonRpcResponse")&&D.d(g,{isJsonRpcResponse:function(){return I.isJsonRpcResponse}}),D.o(I,"isJsonRpcResult")&&D.d(g,{isJsonRpcResult:function(){return I.isJsonRpcResult}}),D.o(I,"isLocalhostUrl")&&D.d(g,{isLocalhostUrl:function(){return I.isLocalhostUrl}}),D.o(I,"isReactNative")&&D.d(g,{isReactNative:function(){return I.isReactNative}}),D.o(I,"isWsUrl")&&D.d(g,{isWsUrl:function(){return I.isWsUrl}})},49286:(Pe,g,D)=>{"use strict";D.d(g,{CX:()=>M,L2:()=>te,by:()=>$,i5:()=>ne});var I=D(90680);function ne(C){return I.dQ.includes(C)}function $(C){return Object.keys(I.xK).includes(C)?I.xK[C]:I.xK[I.JV]}function te(C){return Object.values(I.xK).find(ce=>ce.code===C)||I.xK[I.JV]}function M(C,L,ce){return C.message.includes("getaddrinfo ENOTFOUND")||C.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${ce} RPC url at ${L}`):C}},76212:(Pe,g,D)=>{"use strict";D.d(g,{CS:()=>k,RI:()=>H,sT:()=>$,tm:()=>te});var I=D(49286),re=D(90680);function ne(C=3){return Date.now()*Math.pow(10,C)+Math.floor(Math.random()*Math.pow(10,C))}function k(C=6){return BigInt(ne(C))}function $(C,L,ce){return{id:ce||ne(),jsonrpc:"2.0",method:C,params:L}}function te(C,L){return{id:C,jsonrpc:"2.0",result:L}}function H(C,L,ce){return{id:C,jsonrpc:"2.0",error:M(L,ce)}}function M(C,L){return typeof C>"u"?(0,I.by)(re.O4):("string"==typeof C&&(C=Object.assign(Object.assign({},(0,I.by)(re.CA)),{message:C})),typeof L<"u"&&(C.data=L),(0,I.i5)(C.code)&&(C=(0,I.L2)(C.code)),C)}},80663:(Pe,g,D)=>{"use strict";D.d(g,{formatJsonRpcError:()=>k.RI,formatJsonRpcRequest:()=>k.sT,formatJsonRpcResult:()=>k.tm,getBigIntRpcId:()=>k.CS,isHttpUrl:()=>te.jK,isJsonRpcError:()=>H.jg,isJsonRpcRequest:()=>H.DW,isJsonRpcResponse:()=>H.u,isJsonRpcResult:()=>H.k4,isLocalhostUrl:()=>te.JF,isWsUrl:()=>te.UZ,parseConnectionError:()=>re.CX}),D(90680);var re=D(49286),ne=D(20429);D.o(ne,"IJsonRpcProvider")&&D.d(g,{IJsonRpcProvider:function(){return ne.IJsonRpcProvider}}),D.o(ne,"formatJsonRpcError")&&D.d(g,{formatJsonRpcError:function(){return ne.formatJsonRpcError}}),D.o(ne,"formatJsonRpcRequest")&&D.d(g,{formatJsonRpcRequest:function(){return ne.formatJsonRpcRequest}}),D.o(ne,"formatJsonRpcResult")&&D.d(g,{formatJsonRpcResult:function(){return ne.formatJsonRpcResult}}),D.o(ne,"getBigIntRpcId")&&D.d(g,{getBigIntRpcId:function(){return ne.getBigIntRpcId}}),D.o(ne,"isHttpUrl")&&D.d(g,{isHttpUrl:function(){return ne.isHttpUrl}}),D.o(ne,"isJsonRpcError")&&D.d(g,{isJsonRpcError:function(){return ne.isJsonRpcError}}),D.o(ne,"isJsonRpcRequest")&&D.d(g,{isJsonRpcRequest:function(){return ne.isJsonRpcRequest}}),D.o(ne,"isJsonRpcResponse")&&D.d(g,{isJsonRpcResponse:function(){return ne.isJsonRpcResponse}}),D.o(ne,"isJsonRpcResult")&&D.d(g,{isJsonRpcResult:function(){return ne.isJsonRpcResult}}),D.o(ne,"isLocalhostUrl")&&D.d(g,{isLocalhostUrl:function(){return ne.isLocalhostUrl}}),D.o(ne,"isReactNative")&&D.d(g,{isReactNative:function(){return ne.isReactNative}}),D.o(ne,"isWsUrl")&&D.d(g,{isWsUrl:function(){return ne.isWsUrl}});var k=D(76212),$=D(85713);D.o($,"IJsonRpcProvider")&&D.d(g,{IJsonRpcProvider:function(){return $.IJsonRpcProvider}}),D.o($,"isHttpUrl")&&D.d(g,{isHttpUrl:function(){return $.isHttpUrl}}),D.o($,"isJsonRpcError")&&D.d(g,{isJsonRpcError:function(){return $.isJsonRpcError}}),D.o($,"isJsonRpcRequest")&&D.d(g,{isJsonRpcRequest:function(){return $.isJsonRpcRequest}}),D.o($,"isJsonRpcResponse")&&D.d(g,{isJsonRpcResponse:function(){return $.isJsonRpcResponse}}),D.o($,"isJsonRpcResult")&&D.d(g,{isJsonRpcResult:function(){return $.isJsonRpcResult}}),D.o($,"isLocalhostUrl")&&D.d(g,{isLocalhostUrl:function(){return $.isLocalhostUrl}}),D.o($,"isReactNative")&&D.d(g,{isReactNative:function(){return $.isReactNative}}),D.o($,"isWsUrl")&&D.d(g,{isWsUrl:function(){return $.isWsUrl}});var te=D(81230),H=D(74019)},85713:(Pe,g,D)=>{"use strict";D.d(g,{IJsonRpcProvider:()=>I.IJsonRpcProvider});var I=D(85666);D.o(I,"isHttpUrl")&&D.d(g,{isHttpUrl:function(){return I.isHttpUrl}}),D.o(I,"isJsonRpcError")&&D.d(g,{isJsonRpcError:function(){return I.isJsonRpcError}}),D.o(I,"isJsonRpcRequest")&&D.d(g,{isJsonRpcRequest:function(){return I.isJsonRpcRequest}}),D.o(I,"isJsonRpcResponse")&&D.d(g,{isJsonRpcResponse:function(){return I.isJsonRpcResponse}}),D.o(I,"isJsonRpcResult")&&D.d(g,{isJsonRpcResult:function(){return I.isJsonRpcResult}}),D.o(I,"isLocalhostUrl")&&D.d(g,{isLocalhostUrl:function(){return I.isLocalhostUrl}}),D.o(I,"isReactNative")&&D.d(g,{isReactNative:function(){return I.isReactNative}}),D.o(I,"isWsUrl")&&D.d(g,{isWsUrl:function(){return I.isWsUrl}})},81230:(Pe,g,D)=>{"use strict";function k(M,C){const L=function ne(M){const C=M.match(new RegExp(/^\w+:/,"gi"));if(C&&C.length)return C[0]}(M);return!(typeof L>"u")&&new RegExp(C).test(L)}function $(M){return k(M,"^https?:")}function te(M){return k(M,"^wss?:")}function H(M){return new RegExp("wss?://localhost(:d{2,5})?").test(M)}D.d(g,{JF:()=>H,UZ:()=>te,jK:()=>$})},74019:(Pe,g,D)=>{"use strict";function I(H){return"object"==typeof H&&"id"in H&&"jsonrpc"in H&&"2.0"===H.jsonrpc}function re(H){return I(H)&&"method"in H}function ne(H){return I(H)&&(k(H)||$(H))}function k(H){return"result"in H}function $(H){return"error"in H}D.d(g,{DW:()=>re,jg:()=>$,k4:()=>k,u:()=>ne})},83169:(Pe,g,D)=>{"use strict";const re=D(92818),ne=D(53439),k=re.__importDefault(D(271)),$=D(86586);g.ZP=class te{constructor(){this.localStorage=k.default}getKeys(){return re.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return re.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map($.parseEntry)})}getItem(M){return re.__awaiter(this,void 0,void 0,function*(){const C=this.localStorage.getItem(M);if(null!==C)return ne.safeJsonParse(C)})}setItem(M,C){return re.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(M,ne.safeJsonStringify(C))})}removeItem(M){return re.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(M)})}}},271:Pe=>{"use strict";!function(){let g;function D(){}g=D,g.prototype.getItem=function(I){return this.hasOwnProperty(I)?String(this[I]):null},g.prototype.setItem=function(I,re){this[I]=String(re)},g.prototype.removeItem=function(I){delete this[I]},g.prototype.clear=function(){const I=this;Object.keys(I).forEach(function(re){I[re]=void 0,delete I[re]})},g.prototype.key=function(I){return I=I||0,Object.keys(this)[I]},g.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),Pe.exports=typeof global<"u"&&global.localStorage?global.localStorage:typeof window<"u"&&window.localStorage?window.localStorage:new D}()},86586:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});const I=D(92818);I.__exportStar(D(68684),g),I.__exportStar(D(2043),g)},68684:(Pe,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.IKeyValueStorage=void 0,g.IKeyValueStorage=class D{}},2043:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.parseEntry=void 0;const I=D(53439);g.parseEntry=function re(ne){var k;return[ne[0],I.safeJsonParse(null!==(k=ne[1])&&void 0!==k?k:"")]}},20191:(Pe,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.PINO_CUSTOM_CONTEXT_KEY=g.PINO_LOGGER_DEFAULTS=void 0,g.PINO_LOGGER_DEFAULTS={level:"info"},g.PINO_CUSTOM_CONTEXT_KEY="custom_context"},71268:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.pino=void 0;const I=D(20263),re=I.__importDefault(D(37386));Object.defineProperty(g,"pino",{enumerable:!0,get:function(){return re.default}}),I.__exportStar(D(20191),g),I.__exportStar(D(59164),g)},59164:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.generateChildLogger=g.formatChildLoggerContext=g.getLoggerContext=g.setBrowserLoggerContext=g.getBrowserLoggerContext=g.getDefaultLoggerOptions=void 0;const I=D(20191);function ne(M,C=I.PINO_CUSTOM_CONTEXT_KEY){return M[C]||""}function k(M,C,L=I.PINO_CUSTOM_CONTEXT_KEY){return M[L]=C,M}function $(M,C=I.PINO_CUSTOM_CONTEXT_KEY){let L="";return L=typeof M.bindings>"u"?ne(M,C):M.bindings().context||"",L}function te(M,C,L=I.PINO_CUSTOM_CONTEXT_KEY){const ce=$(M,L);return ce.trim()?`${ce}/${C}`:C}g.getDefaultLoggerOptions=function re(M){return Object.assign(Object.assign({},M),{level:(null==M?void 0:M.level)||I.PINO_LOGGER_DEFAULTS.level})},g.getBrowserLoggerContext=ne,g.setBrowserLoggerContext=k,g.getLoggerContext=$,g.formatChildLoggerContext=te,g.generateChildLogger=function H(M,C,L=I.PINO_CUSTOM_CONTEXT_KEY){const ce=te(M,C,L);return k(M.child({context:ce}),ce,L)}},43025:()=>{},84143:()=>{},21833:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});const I=D(58092);I.__exportStar(D(77892),g),I.__exportStar(D(72562),g)},77892:(Pe,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.ONE_THOUSAND=g.ONE_HUNDRED=void 0,g.ONE_HUNDRED=100,g.ONE_THOUSAND=1e3},72562:(Pe,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.ONE_YEAR=g.FOUR_WEEKS=g.THREE_WEEKS=g.TWO_WEEKS=g.ONE_WEEK=g.THIRTY_DAYS=g.SEVEN_DAYS=g.FIVE_DAYS=g.THREE_DAYS=g.ONE_DAY=g.TWENTY_FOUR_HOURS=g.TWELVE_HOURS=g.SIX_HOURS=g.THREE_HOURS=g.ONE_HOUR=g.SIXTY_MINUTES=g.THIRTY_MINUTES=g.TEN_MINUTES=g.FIVE_MINUTES=g.ONE_MINUTE=g.SIXTY_SECONDS=g.THIRTY_SECONDS=g.TEN_SECONDS=g.FIVE_SECONDS=g.ONE_SECOND=void 0,g.ONE_SECOND=1,g.FIVE_SECONDS=5,g.TEN_SECONDS=10,g.THIRTY_SECONDS=30,g.SIXTY_SECONDS=60,g.ONE_MINUTE=g.SIXTY_SECONDS,g.FIVE_MINUTES=5*g.ONE_MINUTE,g.TEN_MINUTES=10*g.ONE_MINUTE,g.THIRTY_MINUTES=30*g.ONE_MINUTE,g.SIXTY_MINUTES=60*g.ONE_MINUTE,g.ONE_HOUR=g.SIXTY_MINUTES,g.THREE_HOURS=3*g.ONE_HOUR,g.SIX_HOURS=6*g.ONE_HOUR,g.TWELVE_HOURS=12*g.ONE_HOUR,g.TWENTY_FOUR_HOURS=24*g.ONE_HOUR,g.ONE_DAY=g.TWENTY_FOUR_HOURS,g.THREE_DAYS=3*g.ONE_DAY,g.FIVE_DAYS=5*g.ONE_DAY,g.SEVEN_DAYS=7*g.ONE_DAY,g.THIRTY_DAYS=30*g.ONE_DAY,g.ONE_WEEK=g.SEVEN_DAYS,g.TWO_WEEKS=2*g.ONE_WEEK,g.THREE_WEEKS=3*g.ONE_WEEK,g.FOUR_WEEKS=4*g.ONE_WEEK,g.ONE_YEAR=365*g.ONE_DAY},40145:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});const I=D(58092);I.__exportStar(D(94256),g),I.__exportStar(D(59794),g),I.__exportStar(D(16834),g),I.__exportStar(D(21833),g)},16834:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),D(58092).__exportStar(D(45412),g)},45412:(Pe,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.IWatch=void 0,g.IWatch=class D{}},24500:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.fromMiliseconds=g.toMiliseconds=void 0;const I=D(21833);g.toMiliseconds=function re(k){return k*I.ONE_THOUSAND},g.fromMiliseconds=function ne(k){return Math.floor(k/I.ONE_THOUSAND)}},23337:(Pe,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.delay=void 0,g.delay=function D(I){return new Promise(re=>{setTimeout(()=>{re(!0)},I)})}},94256:(Pe,g,D)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});const I=D(58092);I.__exportStar(D(23337),g),I.__exportStar(D(24500),g)},59794:(Pe,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Watch=void 0;class D{constructor(){this.timestamps=new Map}start(re){if(this.timestamps.has(re))throw new Error(`Watch already started for label: ${re}`);this.timestamps.set(re,{started:Date.now()})}stop(re){const ne=this.get(re);if(typeof ne.elapsed<"u")throw new Error(`Watch already stopped for label: ${re}`);const k=Date.now()-ne.started;this.timestamps.set(re,{started:ne.started,elapsed:k})}get(re){const ne=this.timestamps.get(re);if(typeof ne>"u")throw new Error(`No timestamp found for label: ${re}`);return ne}elapsed(re){const ne=this.get(re);return ne.elapsed||Date.now()-ne.started}}g.Watch=D,g.default=D},6179:(Pe,g)=>{"use strict";function D(de){let ue;return typeof window<"u"&&typeof window[de]<"u"&&(ue=window[de]),ue}function I(de){const ue=D(de);if(!ue)throw new Error(`${de} is not defined in Window`);return ue}Object.defineProperty(g,"__esModule",{value:!0}),g.getLocalStorage=g.getLocalStorageOrThrow=g.getCrypto=g.getCryptoOrThrow=g.getLocation=g.getLocationOrThrow=g.getNavigator=g.getNavigatorOrThrow=g.getDocument=g.getDocumentOrThrow=g.getFromWindowOrThrow=g.getFromWindow=void 0,g.getFromWindow=D,g.getFromWindowOrThrow=I,g.getDocumentOrThrow=function re(){return I("document")},g.getDocument=function ne(){return D("document")},g.getNavigatorOrThrow=function k(){return I("navigator")},g.getNavigator=function $(){return D("navigator")},g.getLocationOrThrow=function te(){return I("location")},g.getLocation=function H(){return D("location")},g.getCryptoOrThrow=function M(){return I("crypto")},g.getCrypto=function C(){return D("crypto")},g.getLocalStorageOrThrow=function L(){return I("localStorage")},g.getLocalStorage=function ce(){return D("localStorage")}},98064:(Pe,g,D)=>{"use strict";g.D=void 0;const re=D(6179);g.D=function ne(){let k,$;try{k=re.getDocumentOrThrow(),$=re.getLocationOrThrow()}catch{return null}function H(..._e){const De=k.getElementsByTagName("meta");for(let we=0;weee.getAttribute(J)).filter(J=>!!J&&_e.includes(J));if(B.length&&B){const J=ee.getAttribute("content");if(J)return J}}return""}const L=function M(){let _e=H("name","og:site_name","og:title","twitter:title");return _e||(_e=k.title),_e}();return{description:function C(){return H("description","og:description","twitter:description","keywords")}(),url:$.origin,icons:function te(){const _e=k.getElementsByTagName("link"),De=[];for(let we=0;we<_e.length;we++){const ee=_e[we],B=ee.getAttribute("rel");if(B&&B.toLowerCase().indexOf("icon")>-1){const J=ee.getAttribute("href");if(J)if(-1===J.toLowerCase().indexOf("https:")&&-1===J.toLowerCase().indexOf("http:")&&0!==J.indexOf("//")){let F=$.protocol+"//"+$.host;if(0===J.indexOf("/"))F+=J;else{const V=$.pathname.split("/");V.pop(),F+=V.join("/")+"/"+J}De.push(F)}else 0===J.indexOf("//")?De.push($.protocol+J):De.push(J)}}return De}(),name:L}}},5928:function(Pe,g){var ne,D=typeof self<"u"?self:this,I=function(){function ne(){this.fetch=!1,this.DOMException=D.DOMException}return ne.prototype=D,new ne}();ne=I,function($){var te_searchParams="URLSearchParams"in ne,te_iterable="Symbol"in ne&&"iterator"in Symbol,te_blob="FileReader"in ne&&"Blob"in ne&&function(){try{return new Blob,!0}catch{return!1}}(),te_formData="FormData"in ne,te_arrayBuffer="ArrayBuffer"in ne;if(te_arrayBuffer)var M=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],C=ArrayBuffer.isView||function(b){return b&&M.indexOf(Object.prototype.toString.call(b))>-1};function L(b){if("string"!=typeof b&&(b=String(b)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(b))throw new TypeError("Invalid character in header field name");return b.toLowerCase()}function ce(b){return"string"!=typeof b&&(b=String(b)),b}function de(b){var p={next:function(){var x=b.shift();return{done:void 0===x,value:x}}};return te_iterable&&(p[Symbol.iterator]=function(){return p}),p}function ue(b){this.map={},b instanceof ue?b.forEach(function(p,x){this.append(x,p)},this):Array.isArray(b)?b.forEach(function(p){this.append(p[0],p[1])},this):b&&Object.getOwnPropertyNames(b).forEach(function(p){this.append(p,b[p])},this)}function O(b){if(b.bodyUsed)return Promise.reject(new TypeError("Already read"));b.bodyUsed=!0}function _e(b){return new Promise(function(p,x){b.onload=function(){p(b.result)},b.onerror=function(){x(b.error)}})}function De(b){var p=new FileReader,x=_e(p);return p.readAsArrayBuffer(b),x}function B(b){if(b.slice)return b.slice(0);var p=new Uint8Array(b.byteLength);return p.set(new Uint8Array(b)),p.buffer}function J(){return this.bodyUsed=!1,this._initBody=function(b){this._bodyInit=b,b?"string"==typeof b?this._bodyText=b:te_blob&&Blob.prototype.isPrototypeOf(b)?this._bodyBlob=b:te_formData&&FormData.prototype.isPrototypeOf(b)?this._bodyFormData=b:te_searchParams&&URLSearchParams.prototype.isPrototypeOf(b)?this._bodyText=b.toString():te_arrayBuffer&&te_blob&&function H(b){return b&&DataView.prototype.isPrototypeOf(b)}(b)?(this._bodyArrayBuffer=B(b.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):te_arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(b)||C(b))?this._bodyArrayBuffer=B(b):this._bodyText=b=Object.prototype.toString.call(b):this._bodyText="",this.headers.get("content-type")||("string"==typeof b?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):te_searchParams&&URLSearchParams.prototype.isPrototypeOf(b)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},te_blob&&(this.blob=function(){var b=O(this);if(b)return b;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?O(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(De)}),this.text=function(){var b=O(this);if(b)return b;if(this._bodyBlob)return function we(b){var p=new FileReader,x=_e(p);return p.readAsText(b),x}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function ee(b){for(var p=new Uint8Array(b),x=new Array(p.length),P=0;P-1?p:b}(p.method||this.method||"GET"),this.mode=p.mode||this.mode||null,this.signal=p.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x)}function h(b){var p=new FormData;return b.trim().split("&").forEach(function(x){if(x){var P=x.split("="),N=P.shift().replace(/\+/g," "),E=P.join("=").replace(/\+/g," ");p.append(decodeURIComponent(N),decodeURIComponent(E))}}),p}function f(b){var p=new ue;return b.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(P){var N=P.split(":"),E=N.shift().trim();if(E){var W=N.join(":").trim();p.append(E,W)}}),p}function _(b,p){p||(p={}),this.type="default",this.status=void 0===p.status?200:p.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in p?p.statusText:"OK",this.headers=new ue(p.headers),this.url=p.url||"",this._initBody(b)}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})},J.call(U.prototype),J.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new ue(this.headers),url:this.url})},_.error=function(){var b=new _(null,{status:0,statusText:""});return b.type="error",b};var v=[301,302,303,307,308];_.redirect=function(b,p){if(-1===v.indexOf(p))throw new RangeError("Invalid status code");return new _(null,{status:p,headers:{location:b}})},$.DOMException=ne.DOMException;try{new $.DOMException}catch{$.DOMException=function(p,x){this.message=p,this.name=x;var P=Error(p);this.stack=P.stack},$.DOMException.prototype=Object.create(Error.prototype),$.DOMException.prototype.constructor=$.DOMException}function S(b,p){return new Promise(function(x,P){var N=new U(b,p);if(N.signal&&N.signal.aborted)return P(new $.DOMException("Aborted","AbortError"));var E=new XMLHttpRequest;function W(){E.abort()}E.onload=function(){var le={status:E.status,statusText:E.statusText,headers:f(E.getAllResponseHeaders()||"")};le.url="responseURL"in E?E.responseURL:le.headers.get("X-Request-URL"),x(new _("response"in E?E.response:E.responseText,le))},E.onerror=function(){P(new TypeError("Network request failed"))},E.ontimeout=function(){P(new TypeError("Network request failed"))},E.onabort=function(){P(new $.DOMException("Aborted","AbortError"))},E.open(N.method,N.url,!0),"include"===N.credentials?E.withCredentials=!0:"omit"===N.credentials&&(E.withCredentials=!1),"responseType"in E&&te_blob&&(E.responseType="blob"),N.headers.forEach(function(le,G){E.setRequestHeader(G,le)}),N.signal&&(N.signal.addEventListener("abort",W),E.onreadystatechange=function(){4===E.readyState&&N.signal.removeEventListener("abort",W)}),E.send(typeof N._bodyInit>"u"?null:N._bodyInit)})}S.polyfill=!0,ne.fetch||(ne.fetch=S,ne.Headers=ue,ne.Request=U,ne.Response=_),$.Headers=ue,$.Request=U,$.Response=_,$.fetch=S,Object.defineProperty($,"__esModule",{value:!0})}({}),I.fetch.ponyfill=!0,delete I.fetch.polyfill;var re=I;(g=re.fetch).default=re.fetch,g.fetch=re.fetch,g.Headers=re.Headers,g.Request=re.Request,g.Response=re.Response,Pe.exports=g},80318:Pe=>{"use strict";var g="%[a-f0-9]{2}",D=new RegExp("("+g+")|([^%]+?)","gi"),I=new RegExp("("+g+")+","gi");function re($,te){try{return[decodeURIComponent($.join(""))]}catch{}if(1===$.length)return $;var H=$.slice(0,te=te||1),M=$.slice(te);return Array.prototype.concat.call([],re(H),re(M))}function ne($){try{return decodeURIComponent($)}catch{for(var te=$.match(D)||[],H=1;H{"use strict";var I,g="object"==typeof Reflect?Reflect:null,D=g&&"function"==typeof g.apply?g.apply:function(J,F,V){return Function.prototype.apply.call(J,F,V)};I=g&&"function"==typeof g.ownKeys?g.ownKeys:Object.getOwnPropertySymbols?function(J){return Object.getOwnPropertyNames(J).concat(Object.getOwnPropertySymbols(J))}:function(J){return Object.getOwnPropertyNames(J)};var ne=Number.isNaN||function(J){return J!=J};function k(){k.init.call(this)}Pe.exports=k,Pe.exports.once=function De(B,J){return new Promise(function(F,V){function U(f){B.removeListener(J,h),V(f)}function h(){"function"==typeof B.removeListener&&B.removeListener("error",U),F([].slice.call(arguments))}ee(B,J,h,{once:!0}),"error"!==J&&function we(B,J,F){"function"==typeof B.on&&ee(B,"error",J,F)}(B,U,{once:!0})})},k.EventEmitter=k,k.prototype._events=void 0,k.prototype._eventsCount=0,k.prototype._maxListeners=void 0;var $=10;function te(B){if("function"!=typeof B)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}function H(B){return void 0===B._maxListeners?k.defaultMaxListeners:B._maxListeners}function M(B,J,F,V){var U,h,f;if(te(F),void 0===(h=B._events)?(h=B._events=Object.create(null),B._eventsCount=0):(void 0!==h.newListener&&(B.emit("newListener",J,F.listener?F.listener:F),h=B._events),f=h[J]),void 0===f)f=h[J]=F,++B._eventsCount;else if("function"==typeof f?f=h[J]=V?[F,f]:[f,F]:V?f.unshift(F):f.push(F),(U=H(B))>0&&f.length>U&&!f.warned){f.warned=!0;var _=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(J)+" listeners added. Use emitter.setMaxListeners() to increase limit");_.name="MaxListenersExceededWarning",_.emitter=B,_.type=J,_.count=f.length,function re(B){console&&console.warn&&console.warn(B)}(_)}return B}function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function L(B,J,F){var V={fired:!1,wrapFn:void 0,target:B,type:J,listener:F},U=C.bind(V);return U.listener=F,V.wrapFn=U,U}function ce(B,J,F){var V=B._events;if(void 0===V)return[];var U=V[J];return void 0===U?[]:"function"==typeof U?F?[U.listener||U]:[U]:F?function _e(B){for(var J=new Array(B.length),F=0;F0&&(f=F[0]),f instanceof Error)throw f;var _=new Error("Unhandled error."+(f?" ("+f.message+")":""));throw _.context=f,_}var v=h[J];if(void 0===v)return!1;if("function"==typeof v)D(v,this,F);else{var S=v.length,b=ue(v,S);for(V=0;V=0;f--)if(V[f]===F||V[f].listener===F){_=V[f].listener,h=f;break}if(h<0)return this;0===h?V.shift():function O(B,J){for(;J+1=0;U--)this.removeListener(J,F[U]);return this},k.prototype.listeners=function(J){return ce(this,J,!0)},k.prototype.rawListeners=function(J){return ce(this,J,!1)},k.listenerCount=function(B,J){return"function"==typeof B.listenerCount?B.listenerCount(J):de.call(B,J)},k.prototype.listenerCount=de,k.prototype.eventNames=function(){return this._eventsCount>0?I(this._events):[]}},25633:Pe=>{"use strict";Pe.exports=function(g,D){for(var I={},re=Object.keys(g),ne=Array.isArray(D),k=0;k{Pe=D.nmd(Pe);var re="__lodash_hash_undefined__",$=9007199254740991,te="[object Arguments]",H="[object Array]",C="[object Boolean]",L="[object Date]",ce="[object Error]",de="[object Function]",O="[object Map]",_e="[object Number]",we="[object Object]",ee="[object Promise]",J="[object RegExp]",F="[object Set]",V="[object String]",f="[object WeakMap]",_="[object ArrayBuffer]",v="[object DataView]",Re=/^\[object .+?Constructor\]$/,ve=/^(?:0|[1-9]\d*)$/,xe={};xe["[object Float32Array]"]=xe["[object Float64Array]"]=xe["[object Int8Array]"]=xe["[object Int16Array]"]=xe["[object Int32Array]"]=xe["[object Uint8Array]"]=xe["[object Uint8ClampedArray]"]=xe["[object Uint16Array]"]=xe["[object Uint32Array]"]=!0,xe[te]=xe[H]=xe[_]=xe[C]=xe[v]=xe[L]=xe[ce]=xe[de]=xe[O]=xe[_e]=xe[we]=xe[J]=xe[F]=xe[V]=xe[f]=!1;var Ce="object"==typeof global&&global&&global.Object===Object&&global,Fe="object"==typeof self&&self&&self.Object===Object&&self,je=Ce||Fe||Function("return this")(),Z=g&&!g.nodeType&&g,he=Z&&Pe&&!Pe.nodeType&&Pe,se=he&&he.exports===Z,y=se&&Ce.process,Y=function(){try{return y&&y.binding&&y.binding("util")}catch{}}(),Ae=Y&&Y.isTypedArray;function wt(j,oe){for(var Se=-1,Ue=null==j?0:j.length;++Setr))return!1;var Mt=Ze.get(j);if(Mt&&Ze.get(oe))return Mt==oe;var Ur=-1,Xr=!0,yr=2&Se?new ai:void 0;for(Ze.set(j,oe),Ze.set(oe,j);++Ur-1},ln.prototype.set=function sa(j,oe){var Se=this.__data__,Ue=es(Se,j);return Ue<0?(++this.size,Se.push([j,oe])):Se[Ue][1]=oe,this},An.prototype.clear=function oa(){this.size=0,this.__data__={hash:new Ft,map:new(fn||ln),string:new Ft}},An.prototype.delete=function pc(j){var oe=ci(this,j).delete(j);return this.size-=oe?1:0,oe},An.prototype.get=function js(j){return ci(this,j).get(j)},An.prototype.has=function gc(j){return ci(this,j).has(j)},An.prototype.set=function yc(j,oe){var Se=ci(this,j),Ue=Se.size;return Se.set(j,oe),this.size+=Se.size==Ue?0:1,this},ai.prototype.add=ai.prototype.push=function Ms(j){return this.__data__.set(j,re),this},ai.prototype.has=function ki(j){return this.__data__.has(j)},Cn.prototype.clear=function Bs(){this.__data__=new ln,this.size=0},Cn.prototype.delete=function wr(j){var oe=this.__data__,Se=oe.delete(j);return this.size=oe.size,Se},Cn.prototype.get=function Or(j){return this.__data__.get(j)},Cn.prototype.has=function Oi(j){return this.__data__.has(j)},Cn.prototype.set=function Ii(j,oe){var Se=this.__data__;if(Se instanceof ln){var Ue=Se.__data__;if(!fn||Ue.length<199)return Ue.push([j,oe]),this.size=++Se.size,this;Se=this.__data__=new An(Ue)}return Se.set(j,oe),this.size=Se.size,this};var Js=cn?function(j){return null==j?[]:(j=Object(j),function ze(j,oe){for(var Se=-1,Ue=null==j?0:j.length,Tt=0,Ze=[];++Se-1&&j%1==0&&j-1&&j%1==0&&j<=$}function Ys(j){var oe=typeof j;return null!=j&&("object"==oe||"function"==oe)}function fi(j){return null!=j&&"object"==typeof j}var qs=Ae?function _t(j){return function(oe){return j(oe)}}(Ae):function zs(j){return fi(j)&&is(j.length)&&!!xe[ui(j)]};function Ai(j){return function Ws(j){return null!=j&&is(j.length)&&!va(j)}(j)?function Hs(j,oe){var Se=Pi(j),Ue=!Se&&Vs(j),Tt=!Se&&!Ue&&ns(j),Ze=!Se&&!Ue&&!Tt&&qs(j),zt=Se||Ue||Tt||Ze,tr=zt?function ct(j,oe){for(var Se=-1,Ue=Array(j);++Se{"use strict";const I=D(71141),re=D(80318),ne=D(71675),k=D(25633),te=Symbol("encodeFragmentIdentifier");function C(ee){if("string"!=typeof ee||1!==ee.length)throw new TypeError("arrayFormatSeparator must be single character string")}function L(ee,B){return B.encode?B.strict?I(ee):encodeURIComponent(ee):ee}function ce(ee,B){return B.decode?re(ee):ee}function de(ee){return Array.isArray(ee)?ee.sort():"object"==typeof ee?de(Object.keys(ee)).sort((B,J)=>Number(B)-Number(J)).map(B=>ee[B]):ee}function ue(ee){const B=ee.indexOf("#");return-1!==B&&(ee=ee.slice(0,B)),ee}function _e(ee){const B=(ee=ue(ee)).indexOf("?");return-1===B?"":ee.slice(B+1)}function De(ee,B){return B.parseNumbers&&!Number.isNaN(Number(ee))&&"string"==typeof ee&&""!==ee.trim()?ee=Number(ee):B.parseBooleans&&null!==ee&&("true"===ee.toLowerCase()||"false"===ee.toLowerCase())&&(ee="true"===ee.toLowerCase()),ee}function we(ee,B){C((B=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},B)).arrayFormatSeparator);const J=function M(ee){let B;switch(ee.arrayFormat){case"index":return(J,F,V)=>{B=/\[(\d*)\]$/.exec(J),J=J.replace(/\[\d*\]$/,""),B?(void 0===V[J]&&(V[J]={}),V[J][B[1]]=F):V[J]=F};case"bracket":return(J,F,V)=>{B=/(\[\])$/.exec(J),V[J=J.replace(/\[\]$/,"")]=B?void 0!==V[J]?[].concat(V[J],F):[F]:F};case"colon-list-separator":return(J,F,V)=>{B=/(:list)$/.exec(J),V[J=J.replace(/:list$/,"")]=B?void 0!==V[J]?[].concat(V[J],F):[F]:F};case"comma":case"separator":return(J,F,V)=>{const U="string"==typeof F&&F.includes(ee.arrayFormatSeparator),h="string"==typeof F&&!U&&ce(F,ee).includes(ee.arrayFormatSeparator);F=h?ce(F,ee):F;const f=U||h?F.split(ee.arrayFormatSeparator).map(_=>ce(_,ee)):null===F?F:ce(F,ee);V[J]=f};case"bracket-separator":return(J,F,V)=>{const U=/(\[\])$/.test(J);if(J=J.replace(/\[\]$/,""),!U)return void(V[J]=F&&ce(F,ee));const h=null===F?[]:F.split(ee.arrayFormatSeparator).map(f=>ce(f,ee));V[J]=void 0!==V[J]?[].concat(V[J],h):h};default:return(J,F,V)=>{V[J]=void 0!==V[J]?[].concat(V[J],F):F}}}(B),F=Object.create(null);if("string"!=typeof ee||!(ee=ee.trim().replace(/^[?#&]/,"")))return F;for(const V of ee.split("&")){if(""===V)continue;let[U,h]=ne(B.decode?V.replace(/\+/g," "):V,"=");h=void 0===h?null:["comma","separator","bracket-separator"].includes(B.arrayFormat)?h:ce(h,B),J(ce(U,B),h,F)}for(const V of Object.keys(F)){const U=F[V];if("object"==typeof U&&null!==U)for(const h of Object.keys(U))U[h]=De(U[h],B);else F[V]=De(U,B)}return!1===B.sort?F:(!0===B.sort?Object.keys(F).sort():Object.keys(F).sort(B.sort)).reduce((V,U)=>{const h=F[U];return V[U]=Boolean(h)&&"object"==typeof h&&!Array.isArray(h)?de(h):h,V},Object.create(null))}g.extract=_e,g.parse=we,g.stringify=(ee,B)=>{if(!ee)return"";C((B=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},B)).arrayFormatSeparator);const J=h=>B.skipNull&&(ee=>null==ee)(ee[h])||B.skipEmptyString&&""===ee[h],F=function H(ee){switch(ee.arrayFormat){case"index":return B=>(J,F)=>{const V=J.length;return void 0===F||ee.skipNull&&null===F||ee.skipEmptyString&&""===F?J:null===F?[...J,[L(B,ee),"[",V,"]"].join("")]:[...J,[L(B,ee),"[",L(V,ee),"]=",L(F,ee)].join("")]};case"bracket":return B=>(J,F)=>void 0===F||ee.skipNull&&null===F||ee.skipEmptyString&&""===F?J:null===F?[...J,[L(B,ee),"[]"].join("")]:[...J,[L(B,ee),"[]=",L(F,ee)].join("")];case"colon-list-separator":return B=>(J,F)=>void 0===F||ee.skipNull&&null===F||ee.skipEmptyString&&""===F?J:null===F?[...J,[L(B,ee),":list="].join("")]:[...J,[L(B,ee),":list=",L(F,ee)].join("")];case"comma":case"separator":case"bracket-separator":{const B="bracket-separator"===ee.arrayFormat?"[]=":"=";return J=>(F,V)=>void 0===V||ee.skipNull&&null===V||ee.skipEmptyString&&""===V?F:(V=null===V?"":V,0===F.length?[[L(J,ee),B,L(V,ee)].join("")]:[[F,L(V,ee)].join(ee.arrayFormatSeparator)])}default:return B=>(J,F)=>void 0===F||ee.skipNull&&null===F||ee.skipEmptyString&&""===F?J:null===F?[...J,L(B,ee)]:[...J,[L(B,ee),"=",L(F,ee)].join("")]}}(B),V={};for(const h of Object.keys(ee))J(h)||(V[h]=ee[h]);const U=Object.keys(V);return!1!==B.sort&&U.sort(B.sort),U.map(h=>{const f=ee[h];return void 0===f?"":null===f?L(h,B):Array.isArray(f)?0===f.length&&"bracket-separator"===B.arrayFormat?L(h,B)+"[]":f.reduce(F(h),[]).join("&"):L(h,B)+"="+L(f,B)}).filter(h=>h.length>0).join("&")},g.parseUrl=(ee,B)=>{B=Object.assign({decode:!0},B);const[J,F]=ne(ee,"#");return Object.assign({url:J.split("?")[0]||"",query:we(_e(ee),B)},B&&B.parseFragmentIdentifier&&F?{fragmentIdentifier:ce(F,B)}:{})},g.stringifyUrl=(ee,B)=>{B=Object.assign({encode:!0,strict:!0,[te]:!0},B);const J=ue(ee.url).split("?")[0]||"",F=g.extract(ee.url),V=g.parse(F,{sort:!1}),U=Object.assign(V,ee.query);let h=g.stringify(U,B);h&&(h=`?${h}`);let f=function O(ee){let B="";const J=ee.indexOf("#");return-1!==J&&(B=ee.slice(J)),B}(ee.url);return ee.fragmentIdentifier&&(f=`#${B[te]?L(ee.fragmentIdentifier,B):ee.fragmentIdentifier}`),`${J}${h}${f}`},g.pick=(ee,B,J)=>{J=Object.assign({parseFragmentIdentifier:!0,[te]:!1},J);const{url:F,query:V,fragmentIdentifier:U}=g.parseUrl(ee,J);return g.stringifyUrl({url:F,query:k(V,B),fragmentIdentifier:U},J)},g.exclude=(ee,B,J)=>{const F=Array.isArray(B)?V=>!B.includes(V):(V,U)=>!B(V,U);return g.pick(ee,F,J)}},51958:Pe=>{"use strict";function g(I){try{return JSON.stringify(I)}catch{return'"[Circular]"'}}Pe.exports=function D(I,re,ne){var k=ne&&ne.stringify||g;if("object"==typeof I&&null!==I){var te=re.length+1;if(1===te)return I;var H=new Array(te);H[0]=k(I);for(var M=1;M-1?de:0,I.charCodeAt(O+1)){case 100:case 102:if(ce>=C||null==re[ce])break;de=C||null==re[ce])break;de=C||void 0===re[ce])break;de",de=O+2,O++;break}L+=k(re[ce]),de=O+2,O++;break;case 115:if(ce>=C)break;de{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.safeJsonParse=function D(re){if("string"!=typeof re)throw new Error("Cannot safe json parse value of type "+typeof re);try{return JSON.parse(re)}catch{return re}},g.safeJsonStringify=function I(re){return"string"==typeof re?re:JSON.stringify(re,(ne,k)=>typeof k>"u"?null:k)}},71675:Pe=>{"use strict";Pe.exports=(g,D)=>{if("string"!=typeof g||"string"!=typeof D)throw new TypeError("Expected the arguments to be of type `string`");if(""===D)return[g];const I=g.indexOf(D);return-1===I?[g]:[g.slice(0,I),g.slice(I+D.length)]}},71141:Pe=>{"use strict";Pe.exports=g=>encodeURIComponent(g).replace(/[!'()*]/g,D=>`%${D.charCodeAt(0).toString(16).toUpperCase()}`)},82791:Pe=>{"use strict";Pe.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},69763:(Pe,g,D)=>{"use strict";D.r(g),D.d(g,{__assign:()=>ne,__asyncDelegator:()=>ee,__asyncGenerator:()=>we,__asyncValues:()=>B,__await:()=>De,__awaiter:()=>M,__classPrivateFieldGet:()=>U,__classPrivateFieldSet:()=>h,__createBinding:()=>L,__decorate:()=>$,__exportStar:()=>ce,__extends:()=>re,__generator:()=>C,__importDefault:()=>V,__importStar:()=>F,__makeTemplateObject:()=>J,__metadata:()=>H,__param:()=>te,__read:()=>ue,__rest:()=>k,__spread:()=>O,__spreadArrays:()=>_e,__values:()=>de});var I=function(f,_){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var b in S)S.hasOwnProperty(b)&&(v[b]=S[b])})(f,_)};function re(f,_){function v(){this.constructor=f}I(f,_),f.prototype=null===_?Object.create(_):(v.prototype=_.prototype,new v)}var ne=function(){return ne=Object.assign||function(_){for(var v,S=1,b=arguments.length;S=0;P--)(x=f[P])&&(p=(b<3?x(p):b>3?x(_,v,p):x(_,v))||p);return b>3&&p&&Object.defineProperty(_,v,p),p}function te(f,_){return function(v,S){_(v,S,f)}}function H(f,_){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(f,_)}function M(f,_,v,S){return new(v||(v=Promise))(function(p,x){function P(W){try{E(S.next(W))}catch(le){x(le)}}function N(W){try{E(S.throw(W))}catch(le){x(le)}}function E(W){W.done?p(W.value):function b(p){return p instanceof v?p:new v(function(x){x(p)})}(W.value).then(P,N)}E((S=S.apply(f,_||[])).next())})}function C(f,_){var S,b,p,x,v={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return x={next:P(0),throw:P(1),return:P(2)},"function"==typeof Symbol&&(x[Symbol.iterator]=function(){return this}),x;function P(E){return function(W){return function N(E){if(S)throw new TypeError("Generator is already executing.");for(;v;)try{if(S=1,b&&(p=2&E[0]?b.return:E[0]?b.throw||((p=b.return)&&p.call(b),0):b.next)&&!(p=p.call(b,E[1])).done)return p;switch(b=0,p&&(E=[2&E[0],p.value]),E[0]){case 0:case 1:p=E;break;case 4:return v.label++,{value:E[1],done:!1};case 5:v.label++,b=E[1],E=[0];continue;case 7:E=v.ops.pop(),v.trys.pop();continue;default:if(!(p=(p=v.trys).length>0&&p[p.length-1])&&(6===E[0]||2===E[0])){v=0;continue}if(3===E[0]&&(!p||E[1]>p[0]&&E[1]=f.length&&(f=void 0),{value:f&&f[S++],done:!f}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}function ue(f,_){var v="function"==typeof Symbol&&f[Symbol.iterator];if(!v)return f;var b,x,S=v.call(f),p=[];try{for(;(void 0===_||_-- >0)&&!(b=S.next()).done;)p.push(b.value)}catch(P){x={error:P}}finally{try{b&&!b.done&&(v=S.return)&&v.call(S)}finally{if(x)throw x.error}}return p}function O(){for(var f=[],_=0;_1||P(G,Re)})})}function P(G,Re){try{!function N(G){G.value instanceof De?Promise.resolve(G.value.v).then(E,W):le(p[0][2],G)}(S[G](Re))}catch(ve){le(p[0][3],ve)}}function E(G){P("next",G)}function W(G){P("throw",G)}function le(G,Re){G(Re),p.shift(),p.length&&P(p[0][0],p[0][1])}}function ee(f){var _,v;return _={},S("next"),S("throw",function(b){throw b}),S("return"),_[Symbol.iterator]=function(){return this},_;function S(b,p){_[b]=f[b]?function(x){return(v=!v)?{value:De(f[b](x)),done:"return"===b}:p?p(x):x}:p}}function B(f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var v,_=f[Symbol.asyncIterator];return _?_.call(f):(f=de(f),v={},S("next"),S("throw"),S("return"),v[Symbol.asyncIterator]=function(){return this},v);function S(p){v[p]=f[p]&&function(x){return new Promise(function(P,N){!function b(p,x,P,N){Promise.resolve(N).then(function(E){p({value:E,done:P})},x)}(P,N,(x=f[p](x)).done,x.value)})}}}function J(f,_){return Object.defineProperty?Object.defineProperty(f,"raw",{value:_}):f.raw=_,f}function F(f){if(f&&f.__esModule)return f;var _={};if(null!=f)for(var v in f)Object.hasOwnProperty.call(f,v)&&(_[v]=f[v]);return _.default=f,_}function V(f){return f&&f.__esModule?f:{default:f}}function U(f,_){if(!_.has(f))throw new TypeError("attempted to get private field on non-instance");return _.get(f)}function h(f,_,v){if(!_.has(f))throw new TypeError("attempted to set private field on non-instance");return _.set(f,v),v}},99940:(Pe,g,D)=>{"use strict";D.r(g),D.d(g,{__assign:()=>ne,__asyncDelegator:()=>ee,__asyncGenerator:()=>we,__asyncValues:()=>B,__await:()=>De,__awaiter:()=>M,__classPrivateFieldGet:()=>U,__classPrivateFieldSet:()=>h,__createBinding:()=>L,__decorate:()=>$,__exportStar:()=>ce,__extends:()=>re,__generator:()=>C,__importDefault:()=>V,__importStar:()=>F,__makeTemplateObject:()=>J,__metadata:()=>H,__param:()=>te,__read:()=>ue,__rest:()=>k,__spread:()=>O,__spreadArrays:()=>_e,__values:()=>de});var I=function(f,_){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var b in S)S.hasOwnProperty(b)&&(v[b]=S[b])})(f,_)};function re(f,_){function v(){this.constructor=f}I(f,_),f.prototype=null===_?Object.create(_):(v.prototype=_.prototype,new v)}var ne=function(){return ne=Object.assign||function(_){for(var v,S=1,b=arguments.length;S=0;P--)(x=f[P])&&(p=(b<3?x(p):b>3?x(_,v,p):x(_,v))||p);return b>3&&p&&Object.defineProperty(_,v,p),p}function te(f,_){return function(v,S){_(v,S,f)}}function H(f,_){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(f,_)}function M(f,_,v,S){return new(v||(v=Promise))(function(p,x){function P(W){try{E(S.next(W))}catch(le){x(le)}}function N(W){try{E(S.throw(W))}catch(le){x(le)}}function E(W){W.done?p(W.value):function b(p){return p instanceof v?p:new v(function(x){x(p)})}(W.value).then(P,N)}E((S=S.apply(f,_||[])).next())})}function C(f,_){var S,b,p,x,v={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return x={next:P(0),throw:P(1),return:P(2)},"function"==typeof Symbol&&(x[Symbol.iterator]=function(){return this}),x;function P(E){return function(W){return function N(E){if(S)throw new TypeError("Generator is already executing.");for(;v;)try{if(S=1,b&&(p=2&E[0]?b.return:E[0]?b.throw||((p=b.return)&&p.call(b),0):b.next)&&!(p=p.call(b,E[1])).done)return p;switch(b=0,p&&(E=[2&E[0],p.value]),E[0]){case 0:case 1:p=E;break;case 4:return v.label++,{value:E[1],done:!1};case 5:v.label++,b=E[1],E=[0];continue;case 7:E=v.ops.pop(),v.trys.pop();continue;default:if(!(p=(p=v.trys).length>0&&p[p.length-1])&&(6===E[0]||2===E[0])){v=0;continue}if(3===E[0]&&(!p||E[1]>p[0]&&E[1]=f.length&&(f=void 0),{value:f&&f[S++],done:!f}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}function ue(f,_){var v="function"==typeof Symbol&&f[Symbol.iterator];if(!v)return f;var b,x,S=v.call(f),p=[];try{for(;(void 0===_||_-- >0)&&!(b=S.next()).done;)p.push(b.value)}catch(P){x={error:P}}finally{try{b&&!b.done&&(v=S.return)&&v.call(S)}finally{if(x)throw x.error}}return p}function O(){for(var f=[],_=0;_1||P(G,Re)})})}function P(G,Re){try{!function N(G){G.value instanceof De?Promise.resolve(G.value.v).then(E,W):le(p[0][2],G)}(S[G](Re))}catch(ve){le(p[0][3],ve)}}function E(G){P("next",G)}function W(G){P("throw",G)}function le(G,Re){G(Re),p.shift(),p.length&&P(p[0][0],p[0][1])}}function ee(f){var _,v;return _={},S("next"),S("throw",function(b){throw b}),S("return"),_[Symbol.iterator]=function(){return this},_;function S(b,p){_[b]=f[b]?function(x){return(v=!v)?{value:De(f[b](x)),done:"return"===b}:p?p(x):x}:p}}function B(f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var v,_=f[Symbol.asyncIterator];return _?_.call(f):(f=de(f),v={},S("next"),S("throw"),S("return"),v[Symbol.asyncIterator]=function(){return this},v);function S(p){v[p]=f[p]&&function(x){return new Promise(function(P,N){!function b(p,x,P,N){Promise.resolve(N).then(function(E){p({value:E,done:P})},x)}(P,N,(x=f[p](x)).done,x.value)})}}}function J(f,_){return Object.defineProperty?Object.defineProperty(f,"raw",{value:_}):f.raw=_,f}function F(f){if(f&&f.__esModule)return f;var _={};if(null!=f)for(var v in f)Object.hasOwnProperty.call(f,v)&&(_[v]=f[v]);return _.default=f,_}function V(f){return f&&f.__esModule?f:{default:f}}function U(f,_){if(!_.has(f))throw new TypeError("attempted to get private field on non-instance");return _.get(f)}function h(f,_,v){if(!_.has(f))throw new TypeError("attempted to set private field on non-instance");return _.set(f,v),v}},92818:(Pe,g,D)=>{"use strict";D.r(g),D.d(g,{__assign:()=>ne,__asyncDelegator:()=>ee,__asyncGenerator:()=>we,__asyncValues:()=>B,__await:()=>De,__awaiter:()=>M,__classPrivateFieldGet:()=>U,__classPrivateFieldSet:()=>h,__createBinding:()=>L,__decorate:()=>$,__exportStar:()=>ce,__extends:()=>re,__generator:()=>C,__importDefault:()=>V,__importStar:()=>F,__makeTemplateObject:()=>J,__metadata:()=>H,__param:()=>te,__read:()=>ue,__rest:()=>k,__spread:()=>O,__spreadArrays:()=>_e,__values:()=>de});var I=function(f,_){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var b in S)S.hasOwnProperty(b)&&(v[b]=S[b])})(f,_)};function re(f,_){function v(){this.constructor=f}I(f,_),f.prototype=null===_?Object.create(_):(v.prototype=_.prototype,new v)}var ne=function(){return ne=Object.assign||function(_){for(var v,S=1,b=arguments.length;S=0;P--)(x=f[P])&&(p=(b<3?x(p):b>3?x(_,v,p):x(_,v))||p);return b>3&&p&&Object.defineProperty(_,v,p),p}function te(f,_){return function(v,S){_(v,S,f)}}function H(f,_){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(f,_)}function M(f,_,v,S){return new(v||(v=Promise))(function(p,x){function P(W){try{E(S.next(W))}catch(le){x(le)}}function N(W){try{E(S.throw(W))}catch(le){x(le)}}function E(W){W.done?p(W.value):function b(p){return p instanceof v?p:new v(function(x){x(p)})}(W.value).then(P,N)}E((S=S.apply(f,_||[])).next())})}function C(f,_){var S,b,p,x,v={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return x={next:P(0),throw:P(1),return:P(2)},"function"==typeof Symbol&&(x[Symbol.iterator]=function(){return this}),x;function P(E){return function(W){return function N(E){if(S)throw new TypeError("Generator is already executing.");for(;v;)try{if(S=1,b&&(p=2&E[0]?b.return:E[0]?b.throw||((p=b.return)&&p.call(b),0):b.next)&&!(p=p.call(b,E[1])).done)return p;switch(b=0,p&&(E=[2&E[0],p.value]),E[0]){case 0:case 1:p=E;break;case 4:return v.label++,{value:E[1],done:!1};case 5:v.label++,b=E[1],E=[0];continue;case 7:E=v.ops.pop(),v.trys.pop();continue;default:if(!(p=(p=v.trys).length>0&&p[p.length-1])&&(6===E[0]||2===E[0])){v=0;continue}if(3===E[0]&&(!p||E[1]>p[0]&&E[1]=f.length&&(f=void 0),{value:f&&f[S++],done:!f}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}function ue(f,_){var v="function"==typeof Symbol&&f[Symbol.iterator];if(!v)return f;var b,x,S=v.call(f),p=[];try{for(;(void 0===_||_-- >0)&&!(b=S.next()).done;)p.push(b.value)}catch(P){x={error:P}}finally{try{b&&!b.done&&(v=S.return)&&v.call(S)}finally{if(x)throw x.error}}return p}function O(){for(var f=[],_=0;_1||P(G,Re)})})}function P(G,Re){try{!function N(G){G.value instanceof De?Promise.resolve(G.value.v).then(E,W):le(p[0][2],G)}(S[G](Re))}catch(ve){le(p[0][3],ve)}}function E(G){P("next",G)}function W(G){P("throw",G)}function le(G,Re){G(Re),p.shift(),p.length&&P(p[0][0],p[0][1])}}function ee(f){var _,v;return _={},S("next"),S("throw",function(b){throw b}),S("return"),_[Symbol.iterator]=function(){return this},_;function S(b,p){_[b]=f[b]?function(x){return(v=!v)?{value:De(f[b](x)),done:"return"===b}:p?p(x):x}:p}}function B(f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var v,_=f[Symbol.asyncIterator];return _?_.call(f):(f=de(f),v={},S("next"),S("throw"),S("return"),v[Symbol.asyncIterator]=function(){return this},v);function S(p){v[p]=f[p]&&function(x){return new Promise(function(P,N){!function b(p,x,P,N){Promise.resolve(N).then(function(E){p({value:E,done:P})},x)}(P,N,(x=f[p](x)).done,x.value)})}}}function J(f,_){return Object.defineProperty?Object.defineProperty(f,"raw",{value:_}):f.raw=_,f}function F(f){if(f&&f.__esModule)return f;var _={};if(null!=f)for(var v in f)Object.hasOwnProperty.call(f,v)&&(_[v]=f[v]);return _.default=f,_}function V(f){return f&&f.__esModule?f:{default:f}}function U(f,_){if(!_.has(f))throw new TypeError("attempted to get private field on non-instance");return _.get(f)}function h(f,_,v){if(!_.has(f))throw new TypeError("attempted to set private field on non-instance");return _.set(f,v),v}},20263:(Pe,g,D)=>{"use strict";D.r(g),D.d(g,{__assign:()=>ne,__asyncDelegator:()=>ee,__asyncGenerator:()=>we,__asyncValues:()=>B,__await:()=>De,__awaiter:()=>M,__classPrivateFieldGet:()=>U,__classPrivateFieldSet:()=>h,__createBinding:()=>L,__decorate:()=>$,__exportStar:()=>ce,__extends:()=>re,__generator:()=>C,__importDefault:()=>V,__importStar:()=>F,__makeTemplateObject:()=>J,__metadata:()=>H,__param:()=>te,__read:()=>ue,__rest:()=>k,__spread:()=>O,__spreadArrays:()=>_e,__values:()=>de});var I=function(f,_){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var b in S)S.hasOwnProperty(b)&&(v[b]=S[b])})(f,_)};function re(f,_){function v(){this.constructor=f}I(f,_),f.prototype=null===_?Object.create(_):(v.prototype=_.prototype,new v)}var ne=function(){return ne=Object.assign||function(_){for(var v,S=1,b=arguments.length;S=0;P--)(x=f[P])&&(p=(b<3?x(p):b>3?x(_,v,p):x(_,v))||p);return b>3&&p&&Object.defineProperty(_,v,p),p}function te(f,_){return function(v,S){_(v,S,f)}}function H(f,_){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(f,_)}function M(f,_,v,S){return new(v||(v=Promise))(function(p,x){function P(W){try{E(S.next(W))}catch(le){x(le)}}function N(W){try{E(S.throw(W))}catch(le){x(le)}}function E(W){W.done?p(W.value):function b(p){return p instanceof v?p:new v(function(x){x(p)})}(W.value).then(P,N)}E((S=S.apply(f,_||[])).next())})}function C(f,_){var S,b,p,x,v={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return x={next:P(0),throw:P(1),return:P(2)},"function"==typeof Symbol&&(x[Symbol.iterator]=function(){return this}),x;function P(E){return function(W){return function N(E){if(S)throw new TypeError("Generator is already executing.");for(;v;)try{if(S=1,b&&(p=2&E[0]?b.return:E[0]?b.throw||((p=b.return)&&p.call(b),0):b.next)&&!(p=p.call(b,E[1])).done)return p;switch(b=0,p&&(E=[2&E[0],p.value]),E[0]){case 0:case 1:p=E;break;case 4:return v.label++,{value:E[1],done:!1};case 5:v.label++,b=E[1],E=[0];continue;case 7:E=v.ops.pop(),v.trys.pop();continue;default:if(!(p=(p=v.trys).length>0&&p[p.length-1])&&(6===E[0]||2===E[0])){v=0;continue}if(3===E[0]&&(!p||E[1]>p[0]&&E[1]=f.length&&(f=void 0),{value:f&&f[S++],done:!f}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}function ue(f,_){var v="function"==typeof Symbol&&f[Symbol.iterator];if(!v)return f;var b,x,S=v.call(f),p=[];try{for(;(void 0===_||_-- >0)&&!(b=S.next()).done;)p.push(b.value)}catch(P){x={error:P}}finally{try{b&&!b.done&&(v=S.return)&&v.call(S)}finally{if(x)throw x.error}}return p}function O(){for(var f=[],_=0;_1||P(G,Re)})})}function P(G,Re){try{!function N(G){G.value instanceof De?Promise.resolve(G.value.v).then(E,W):le(p[0][2],G)}(S[G](Re))}catch(ve){le(p[0][3],ve)}}function E(G){P("next",G)}function W(G){P("throw",G)}function le(G,Re){G(Re),p.shift(),p.length&&P(p[0][0],p[0][1])}}function ee(f){var _,v;return _={},S("next"),S("throw",function(b){throw b}),S("return"),_[Symbol.iterator]=function(){return this},_;function S(b,p){_[b]=f[b]?function(x){return(v=!v)?{value:De(f[b](x)),done:"return"===b}:p?p(x):x}:p}}function B(f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var v,_=f[Symbol.asyncIterator];return _?_.call(f):(f=de(f),v={},S("next"),S("throw"),S("return"),v[Symbol.asyncIterator]=function(){return this},v);function S(p){v[p]=f[p]&&function(x){return new Promise(function(P,N){!function b(p,x,P,N){Promise.resolve(N).then(function(E){p({value:E,done:P})},x)}(P,N,(x=f[p](x)).done,x.value)})}}}function J(f,_){return Object.defineProperty?Object.defineProperty(f,"raw",{value:_}):f.raw=_,f}function F(f){if(f&&f.__esModule)return f;var _={};if(null!=f)for(var v in f)Object.hasOwnProperty.call(f,v)&&(_[v]=f[v]);return _.default=f,_}function V(f){return f&&f.__esModule?f:{default:f}}function U(f,_){if(!_.has(f))throw new TypeError("attempted to get private field on non-instance");return _.get(f)}function h(f,_,v){if(!_.has(f))throw new TypeError("attempted to set private field on non-instance");return _.set(f,v),v}},58092:(Pe,g,D)=>{"use strict";D.r(g),D.d(g,{__assign:()=>ne,__asyncDelegator:()=>ee,__asyncGenerator:()=>we,__asyncValues:()=>B,__await:()=>De,__awaiter:()=>M,__classPrivateFieldGet:()=>U,__classPrivateFieldSet:()=>h,__createBinding:()=>L,__decorate:()=>$,__exportStar:()=>ce,__extends:()=>re,__generator:()=>C,__importDefault:()=>V,__importStar:()=>F,__makeTemplateObject:()=>J,__metadata:()=>H,__param:()=>te,__read:()=>ue,__rest:()=>k,__spread:()=>O,__spreadArrays:()=>_e,__values:()=>de});var I=function(f,_){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var b in S)S.hasOwnProperty(b)&&(v[b]=S[b])})(f,_)};function re(f,_){function v(){this.constructor=f}I(f,_),f.prototype=null===_?Object.create(_):(v.prototype=_.prototype,new v)}var ne=function(){return ne=Object.assign||function(_){for(var v,S=1,b=arguments.length;S=0;P--)(x=f[P])&&(p=(b<3?x(p):b>3?x(_,v,p):x(_,v))||p);return b>3&&p&&Object.defineProperty(_,v,p),p}function te(f,_){return function(v,S){_(v,S,f)}}function H(f,_){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(f,_)}function M(f,_,v,S){return new(v||(v=Promise))(function(p,x){function P(W){try{E(S.next(W))}catch(le){x(le)}}function N(W){try{E(S.throw(W))}catch(le){x(le)}}function E(W){W.done?p(W.value):function b(p){return p instanceof v?p:new v(function(x){x(p)})}(W.value).then(P,N)}E((S=S.apply(f,_||[])).next())})}function C(f,_){var S,b,p,x,v={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return x={next:P(0),throw:P(1),return:P(2)},"function"==typeof Symbol&&(x[Symbol.iterator]=function(){return this}),x;function P(E){return function(W){return function N(E){if(S)throw new TypeError("Generator is already executing.");for(;v;)try{if(S=1,b&&(p=2&E[0]?b.return:E[0]?b.throw||((p=b.return)&&p.call(b),0):b.next)&&!(p=p.call(b,E[1])).done)return p;switch(b=0,p&&(E=[2&E[0],p.value]),E[0]){case 0:case 1:p=E;break;case 4:return v.label++,{value:E[1],done:!1};case 5:v.label++,b=E[1],E=[0];continue;case 7:E=v.ops.pop(),v.trys.pop();continue;default:if(!(p=(p=v.trys).length>0&&p[p.length-1])&&(6===E[0]||2===E[0])){v=0;continue}if(3===E[0]&&(!p||E[1]>p[0]&&E[1]=f.length&&(f=void 0),{value:f&&f[S++],done:!f}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}function ue(f,_){var v="function"==typeof Symbol&&f[Symbol.iterator];if(!v)return f;var b,x,S=v.call(f),p=[];try{for(;(void 0===_||_-- >0)&&!(b=S.next()).done;)p.push(b.value)}catch(P){x={error:P}}finally{try{b&&!b.done&&(v=S.return)&&v.call(S)}finally{if(x)throw x.error}}return p}function O(){for(var f=[],_=0;_1||P(G,Re)})})}function P(G,Re){try{!function N(G){G.value instanceof De?Promise.resolve(G.value.v).then(E,W):le(p[0][2],G)}(S[G](Re))}catch(ve){le(p[0][3],ve)}}function E(G){P("next",G)}function W(G){P("throw",G)}function le(G,Re){G(Re),p.shift(),p.length&&P(p[0][0],p[0][1])}}function ee(f){var _,v;return _={},S("next"),S("throw",function(b){throw b}),S("return"),_[Symbol.iterator]=function(){return this},_;function S(b,p){_[b]=f[b]?function(x){return(v=!v)?{value:De(f[b](x)),done:"return"===b}:p?p(x):x}:p}}function B(f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var v,_=f[Symbol.asyncIterator];return _?_.call(f):(f=de(f),v={},S("next"),S("throw"),S("return"),v[Symbol.asyncIterator]=function(){return this},v);function S(p){v[p]=f[p]&&function(x){return new Promise(function(P,N){!function b(p,x,P,N){Promise.resolve(N).then(function(E){p({value:E,done:P})},x)}(P,N,(x=f[p](x)).done,x.value)})}}}function J(f,_){return Object.defineProperty?Object.defineProperty(f,"raw",{value:_}):f.raw=_,f}function F(f){if(f&&f.__esModule)return f;var _={};if(null!=f)for(var v in f)Object.hasOwnProperty.call(f,v)&&(_[v]=f[v]);return _.default=f,_}function V(f){return f&&f.__esModule?f:{default:f}}function U(f,_){if(!_.has(f))throw new TypeError("attempted to get private field on non-instance");return _.get(f)}function h(f,_,v){if(!_.has(f))throw new TypeError("attempted to set private field on non-instance");return _.set(f,v),v}},37386:(Pe,g,D)=>{"use strict";const I=D(51958);Pe.exports=$;const re=function V(){function U(h){return typeof h<"u"&&h}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return U(self)||U(window)||U(this)||{}}}().console||{},ne={mapHttpRequest:_e,mapHttpResponse:_e,wrapRequestSerializer:De,wrapResponseSerializer:De,wrapErrorSerializer:De,req:_e,res:_e,err:function ue(U){const h={type:U.constructor.name,msg:U.message,stack:U.stack};for(const f in U)void 0===h[f]&&(h[f]=U[f]);return h}};function $(U){(U=U||{}).browser=U.browser||{};const h=U.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");const f=U.browser.write||re;U.browser.write&&(U.browser.asObject=!0);const _=U.serializers||{},v=function k(U,h){return Array.isArray(U)?U.filter(function(_){return"!stdSerializers.err"!==_}):!0===U&&Object.keys(h)}(U.browser.serialize,_);let S=U.browser.serialize;Array.isArray(U.browser.serialize)&&U.browser.serialize.indexOf("!stdSerializers.err")>-1&&(S=!1),"function"==typeof f&&(f.error=f.fatal=f.warn=f.info=f.debug=f.trace=f),!1===U.enabled&&(U.level="silent");const p=U.level||"info",x=Object.create(f);x.log||(x.log=we),Object.defineProperty(x,"levelVal",{get:function N(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(x,"level",{get:function E(){return this._level},set:function W(G){if("silent"!==G&&!this.levels.values[G])throw Error("unknown level "+G);this._level=G,te(P,x,"error","log"),te(P,x,"fatal","error"),te(P,x,"warn","error"),te(P,x,"info","log"),te(P,x,"debug","log"),te(P,x,"trace","log")}});const P={transmit:h,serialize:v,asObject:U.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:O(U)};return x.levels=$.levels,x.level=p,x.setMaxListeners=x.getMaxListeners=x.emit=x.addListener=x.on=x.prependListener=x.once=x.prependOnceListener=x.removeListener=x.removeAllListeners=x.listeners=x.listenerCount=x.eventNames=x.write=x.flush=we,x.serializers=_,x._serialize=v,x._stdErrSerialize=S,x.child=function le(G,Re){if(!G)throw new Error("missing bindings for child Pino");Re=Re||{},v&&G.serializers&&(Re.serializers=G.serializers);const ve=Re.serializers;if(v&&ve){var xe=Object.assign({},_,ve),Ce=!0===U.browser.serialize?Object.keys(xe):v;delete G.serializers,C([G],Ce,xe,this._stdErrSerialize)}function Fe(je){this._childLevel=1+(0|je._childLevel),this.error=L(je,G,"error"),this.fatal=L(je,G,"fatal"),this.warn=L(je,G,"warn"),this.info=L(je,G,"info"),this.debug=L(je,G,"debug"),this.trace=L(je,G,"trace"),xe&&(this.serializers=xe,this._serialize=Ce),h&&(this._logEvent=de([].concat(je._logEvent.bindings,G)))}return Fe.prototype=this,new Fe(this)},h&&(x._logEvent=de()),x}function te(U,h,f,_){const v=Object.getPrototypeOf(h);h[f]=h.levelVal>h.levels.values[f]?we:v[f]?v[f]:re[f]||re[_]||we,function H(U,h,f){!U.transmit&&h[f]===we||(h[f]=function(_){return function(){const S=U.timestamp(),b=new Array(arguments.length),p=Object.getPrototypeOf&&Object.getPrototypeOf(this)===re?re:this;for(var x=0;x-1&&S in f&&(U[v][S]=f[S](U[v][S]))}function L(U,h,f){return function(){const _=new Array(1+arguments.length);_[0]=h;for(var v=1;v<_.length;v++)_[v]=arguments[v-1];return U[f].apply(this,_)}}function ce(U,h,f){const _=h.send,v=h.ts,S=h.methodLevel,b=h.methodValue,p=h.val,x=U._logEvent.bindings;C(f,U._serialize||Object.keys(U.serializers),U.serializers,void 0===U._stdErrSerialize||U._stdErrSerialize),U._logEvent.ts=v,U._logEvent.messages=f.filter(function(P){return-1===x.indexOf(P)}),U._logEvent.level.label=S,U._logEvent.level.value=b,_(S,U._logEvent,p),U._logEvent=de(x)}function de(U){return{ts:0,messages:[],bindings:U||[],level:{label:"",value:0}}}function O(U){return"function"==typeof U.timestamp?U.timestamp:!1===U.timestamp?ee:B}function _e(){return{}}function De(U){return U}function we(){}function ee(){return!1}function B(){return Date.now()}$.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},$.stdSerializers=ne,$.stdTimeFunctions=Object.assign({},{nullTime:ee,epochTime:B,unixTime:function J(){return Math.round(Date.now()/1e3)},isoTime:function F(){return new Date(Date.now()).toISOString()}})}}]); \ No newline at end of file diff --git a/angular-bare-bones-demo/dist/235.c021a217ad7b926f.js b/angular-bare-bones-demo/dist/235.c021a217ad7b926f.js deleted file mode 100644 index 4b4d4f8bf..000000000 --- a/angular-bare-bones-demo/dist/235.c021a217ad7b926f.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkAngular_bare_bones_demo=self.webpackChunkAngular_bare_bones_demo||[]).push([[235],{18983:function(Ki,er){!function(B){"use strict";function tn(t){if(Array.isArray(t))return t}function ar(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r=0;--Y){var D=this.tryEntries[Y],ut=D.completion;if("root"===D.tryLoc)return U("end");if(D.tryLoc<=this.prev){var it=o.call(D,"catchLoc"),yt=o.call(D,"finallyLoc");if(it&&yt){if(this.prev=0;--U){var Y=this.tryEntries[U];if(Y.tryLoc<=this.prev&&o.call(Y,"finallyLoc")&&this.prev=0;--A){var U=this.tryEntries[A];if(U.finallyLoc===_)return this.complete(U.completion,U.afterLoc),At(U),m}},catch:function(_){for(var A=this.tryEntries.length-1;A>=0;--A){var U=this.tryEntries[A];if(U.tryLoc===_){var Y=U.completion;if("throw"===Y.type){var D=Y.arg;At(U)}return D}}throw new Error("illegal catch attempt")},delegateYield:function(_,A,U){return this.delegate={iterator:_t(_),resultName:A,nextLoc:U},"next"===this.method&&(this.arg=void 0),m}},e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(Xa);var $a,or=Xa.exports(),h=or;try{regeneratorRuntime=or}catch{"object"===(typeof globalThis>"u"?"undefined":z(globalThis))?globalThis.regeneratorRuntime=or:Function("r","regeneratorRuntime = r")(or)}function Qa(t){if(typeof Symbol<"u"&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Fn(t){return tn(t)||Qa(t)||yn(t)||Va()}function q(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function to(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,e)}return r}function O(t){for(var n=1;n=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(c){throw c},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return u=c.done,c},e:function(c){i=!0,o=c},f:function(){try{u||null==r.return||r.return()}finally{if(i)throw o}}}}var Hi="function"==typeof queueMicrotask?queueMicrotask:function(t){return($a||($a=Promise.resolve())).then(t).catch(function(n){return setTimeout(function(){throw n},0)})},Wi=function(){var t,n=[];return{deliver:function(r){return x(h.mark(function e(){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:n.push(r),t&&(t(n.shift()),t=void 0);case 2:case"end":return a.stop()}},e)}))()},receive:function(){return new Promise(function(r){var e=n.shift();if(e)return r(e);t=r})}}},Nr="INIT",cn="SUBSCRIBE",nn="UNSUBSCRIBE",Br="UPDATED",no="SNAPSHOT",$="object"===(typeof self>"u"?"undefined":z(self))&&self.self===self&&self||"object"===(typeof global>"u"?"undefined":z(global))&&global.global===global&&global||"object"===(typeof window>"u"?"undefined":z(window))&&window.window===window&&window;$.FCL_REGISTRY=$.FCL_REGISTRY??{};var zt,Ji=0,dt=function(t,n,r){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise(function(a,o){var u=e.expectReply||!1,i=null!=e.timeout?e.timeout:5e3;u&&i&&setTimeout(function(){return o(new Error("Timeout: ".concat(i,"ms passed without a response.")))},i);var c={to:t,from:e.from,tag:n,data:r,timeout:i,reply:a,reject:o};try{$.FCL_REGISTRY[t]&&$.FCL_REGISTRY[t].mailbox.deliver(c),u||a(!0)}catch(l){console.error("FCL.Actor -- Could Not Deliver Message",c,$.FCL_REGISTRY[t],l)}})},Xi=function(t){delete $.FCL_REGISTRY[t]},Zi=function(){var n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n=x(h.mark(function r(e){var a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if("function"!=typeof t.INIT){o.next=3;break}return o.next=3,t.INIT(e);case 3:return o.next=6,e.receive();case 6:if(a=o.sent,o.prev=7,"EXIT"!==a.tag){o.next=13;break}if("function"!=typeof t.TERMINATE){o.next=12;break}return o.next=12,t.TERMINATE(e,a,a.data||{});case 12:return o.abrupt("break",25);case 13:return o.next=15,t[a.tag](e,a,a.data||{});case 15:o.next=20;break;case 17:o.prev=17,o.t0=o.catch(7),console.error("".concat(e.self()," Error"),a,o.t0);case 20:return o.prev=20,o.abrupt("continue",3);case 23:o.next=3;break;case 25:case"end":return o.stop()}},r,null,[[7,17,20,23]])})),function(r){return n.apply(this,arguments)}},rn=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null==n&&(n=++Ji),null!=$.FCL_REGISTRY[n])return n;$.FCL_REGISTRY[n]={addr:n,mailbox:Wi(),subs:new Set,kvs:{},error:null};var r={self:function(){return n},receive:function(){return $.FCL_REGISTRY[n].mailbox.receive()},send:function(e,a,o){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u.from=n,dt(e,a,o,u)},sendSelf:function(e,a,o){$.FCL_REGISTRY[n]&&dt(n,e,a,o)},broadcast:function(e,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o.from=n;var u,i=bt($.FCL_REGISTRY[n].subs);try{for(i.s();!(u=i.n()).done;)dt(u.value,e,a,o)}catch(l){i.e(l)}finally{i.f()}},subscribe:function(e){return null!=e&&$.FCL_REGISTRY[n].subs.add(e)},unsubscribe:function(e){return null!=e&&$.FCL_REGISTRY[n].subs.delete(e)},subscriberCount:function(){return $.FCL_REGISTRY[n].subs.size},hasSubs:function(){return!!$.FCL_REGISTRY[n].subs.size},put:function(e,a){null!=e&&($.FCL_REGISTRY[n].kvs[e]=a)},get:function(e,a){return $.FCL_REGISTRY[n].kvs[e]??a},delete:function(e){delete $.FCL_REGISTRY[n].kvs[e]},update:function(e,a){null!=e&&($.FCL_REGISTRY[n].kvs[e]=a($.FCL_REGISTRY[n].kvs[e]))},keys:function(){return Object.keys($.FCL_REGISTRY[n].kvs)},all:function(){return $.FCL_REGISTRY[n].kvs},where:function(e){return Object.keys($.FCL_REGISTRY[n].kvs).reduce(function(a,o){return e.test(o)?O(O({},a),{},q({},o,$.FCL_REGISTRY[n].kvs[o])):a},{})},merge:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(e).forEach(function(a){return $.FCL_REGISTRY[n].kvs[a]=e[a]})},fatalError:function(e){$.FCL_REGISTRY[n].error=e;var a,o=bt($.FCL_REGISTRY[n].subs);try{for(o.s();!(a=o.n()).done;)dt(a.value,Br)}catch(i){o.e(i)}finally{o.f()}}};return"object"===z(t)&&(t=Zi(t)),Hi(x(h.mark(function e(){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t(r);case 2:Xi(n);case 3:case"end":return a.stop()}},e)}))),n};function ur(t,n,r){n(t);var o,e="@EXIT",a=rn((o=x(h.mark(function u(i){var c,l;return h.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:i.send(t,cn);case 1:return d.next=4,i.receive();case 4:if(l=$.FCL_REGISTRY[t].error,(c=d.sent).tag!==e){d.next=9;break}return i.send(t,nn),d.abrupt("return");case 9:if(!l){d.next=13;break}return r(null,l),i.send(t,nn),d.abrupt("return");case 13:r(c.data,null),d.next=1;break;case 16:case"end":return d.stop()}},u)})),function(u){return o.apply(this,arguments)}));return function(){return dt(a,e)}}function ro(t,n){return n(t),dt(t,no,null,{expectReply:!0,timeout:0})}var Yt="config",eo="PUT_CONFIG",ao="GET_CONFIG",oo="GET_ALL_CONFIG",uo="UPDATE_CONFIG",so="DELETE_CONFIG",io="CLEAR_CONFIG",co="WHERE_CONFIG",jn="CONFIG/UPDATED",fo=function(t){return t},lo=(q(zt={},eo,function(t,n,r){var e=r.key,a=r.value;if(null==e)throw new Error("Missing 'key' for config/put.");t.put(e,a),t.broadcast(jn,O({},t.all()))}),q(zt,ao,function(t,n,r){var e=r.key,a=r.fallback;if(null==e)throw new Error("Missing 'key' for config/get");n.reply(t.get(e,a))}),q(zt,oo,function(t,n){n.reply(O({},t.all()))}),q(zt,uo,function(t,n,r){var e=r.key,a=r.fn;if(null==e)throw new Error("Missing 'key' for config/update");t.update(e,a||fo),t.broadcast(jn,O({},t.all()))}),q(zt,so,function(t,n,r){var e=r.key;if(null==e)throw new Error("Missing 'key' for config/delete");t.delete(e),t.broadcast(jn,O({},t.all()))}),q(zt,io,function(t,n){for(var r=0,e=Object.keys(t.all());r1?i[1]:void 0,(n=i.length>0&&void 0!==i[0]?i[0]:[]).length){c.next=4;break}return c.abrupt("return",r);case 4:return e=Fn(n),a=e[0],o=e.slice(1),c.next=7,Ur(a);case 7:if(null!=(u=c.sent)){c.next=10;break}return c.abrupt("return",Fr(o,r));case 10:return c.abrupt("return",u);case 11:case"end":return c.stop()}},t)})),jr.apply(this,arguments)}function sr(){return dt(Yt,oo,null,{expectReply:!0,timeout:10})}function po(t){return dt(Yt,uo,{key:t,fn:arguments.length>1&&void 0!==arguments[1]?arguments[1]:fo}),j()}function ho(t){return dt(Yt,so,{key:t}),j()}function go(t){return dt(Yt,co,{pattern:t},{expectReply:!0,timeout:10})}function mo(t){return ur(Yt,function(){return rn(lo,Yt)},t)}function vo(t){return dt(Yt,io).then(j(t))}function j(t){return null!=t&&"object"===z(t)&&Object.keys(t).map(function(n){return Lr(n,t[n])}),{put:Lr,get:Ur,all:sr,first:Fr,update:po,delete:ho,where:go,subscribe:mo,overload:yo}}rn(lo,Yt),j.put=Lr,j.get=Ur,j.all=sr,j.first=Fr,j.update=po,j.delete=ho,j.where=go,j.subscribe=mo,j.overload=yo;var $i=function(t){return t};function yo(){var r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$i;return new Promise((r=x(h.mark(function e(a,o){var u,i;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,sr();case 2:return u=c.sent,c.prev=3,j(t),c.t0=n,c.next=8,sr();case 8:return c.t1=c.sent,c.next=11,(0,c.t0)(c.t1);case 11:return i=c.sent,c.next=14,vo(u);case 14:a(i),c.next=22;break;case 17:return c.prev=17,c.t2=c.catch(3),c.next=21,vo(u);case 21:o(c.t2);case 22:case"end":return c.stop()}},e,null,[[3,17]])})),function(e,a){return r.apply(this,arguments)}))}var bo,wo,Qi={can:!(typeof window>"u"),get:(wo=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",JSON.parse(sessionStorage.getItem(n)));case 1:case"end":return r.stop()}},t)})),function(t){return wo.apply(this,arguments)}),put:(bo=x(h.mark(function t(n,r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",sessionStorage.setItem(n,JSON.stringify(r)));case 1:case"end":return e.stop()}},t)})),function(t,n){return bo.apply(this,arguments)})};function xo(t){return ko.apply(this,arguments)}function ko(){return(ko=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=Object,r.t1=Object,r.next=4,j().where(n);case 4:return r.t2=r.sent,r.t3=r.t1.entries.call(r.t1,r.t2).map(function(e){var a=Lt(e,2),u=a[1];return[a[0].replace(n,""),u]}),r.abrupt("return",r.t0.fromEntries.call(r.t0,r.t3));case 7:case"end":return r.stop()}},t)}))).apply(this,arguments)}j({"discovery.wallet.method.default":"IFRAME/RPC","fcl.storage.default":Qi});var Ut="1.3.2";function C(t,n){if(!t){var r,e=new Error("INVARIANT ".concat(n));e.stack=e.stack.split("\n").filter(function(i){return!/at invariant/.test(i)}).join("\n");for(var a=arguments.length,o=new Array(a>2?a-2:0),u=2;u"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function nc(t,n){if(n&&("object"===z(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return Mr(t)}function Yr(t){var n=Io();return function(){var r,e=Gn(t);if(n){var a=Gn(this).constructor;r=Reflect.construct(e,arguments,a)}else r=e.apply(this,arguments);return nc(this,r)}}wt.deprecate=function(t){var n=t.pkg,r=t.subject,e=t.transition,a=t.level,o=void 0===a?St.warn:a,u=t.message,i=void 0===u?"":u,c=t.callback,l=void 0===c?null:c,d=function(){return wt({title:"".concat(n?n+" ":"","Deprecation Notice"),message:"\n ".concat(r?"".concat((g=r,g.charAt(0).toUpperCase()+g.slice(1))," is deprecated and will cease to work in future releases").concat(n?" of "+n:"","."):"").concat(i?"\n"+i:"").concat(e?"\nYou can learn more (including a guide on common transition paths) here: ".concat(e):"","\n ").trim(),level:o});var g};return"function"==typeof l?x(h.mark(function g(){var v=arguments;return h.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,d();case 2:return m.next=4,l.apply(void 0,v);case 4:return m.abrupt("return",m.sent);case 5:case"end":return m.stop()}},g)})):d()};for(var X={},rc={byteLength:function(t){var n=So(t),e=n[1];return 3*(n[0]+e)/4-e},toByteArray:function(t){var n,r,g,e=So(t),a=e[0],o=e[1],u=new ec(3*(a+(g=o))/4-g),i=0,c=o>0?a-4:a;for(r=0;r>16&255,u[i++]=n>>8&255,u[i++]=255&n;return 2===o&&(n=Ct[t.charCodeAt(r)]<<2|Ct[t.charCodeAt(r+1)]>>4,u[i++]=255&n),1===o&&(n=Ct[t.charCodeAt(r)]<<10|Ct[t.charCodeAt(r+1)]<<4|Ct[t.charCodeAt(r+2)]>>2,u[i++]=n>>8&255,u[i++]=255&n),u},fromByteArray:function(t){for(var n,r=t.length,e=r%3,a=[],o=16383,u=0,i=r-e;ui?i:u+o));return 1===e?a.push(qt[(n=t[r-1])>>2]+qt[n<<4&63]+"=="):2===e&&a.push(qt[(n=(t[r-2]<<8)+t[r-1])>>10]+qt[n>>4&63]+qt[n<<2&63]+"="),a.join("")}},qt=[],Ct=[],ec=typeof Uint8Array<"u"?Uint8Array:Array,qr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bn=0,ac=qr.length;bn0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=n),[r,r===n?0:4-r%4]}function oc(t,n,r){for(var a,o=[],u=n;u>18&63]+qt[a>>12&63]+qt[a>>6&63]+qt[63&a]);return o.join("")}Ct["-".charCodeAt(0)]=62,Ct["_".charCodeAt(0)]=63;var Kr={};function fn(t){if(Array.isArray(t)){for(var n=[],r=0;r>1,d=-7,g=r?a-1:0,v=r?-1:1,m=t[n+g];for(g+=v,o=m&(1<<-d)-1,m>>=-d,d+=i;d>0;o=256*o+t[n+g],g+=v,d-=8);for(u=o&(1<<-d)-1,o>>=-d,d+=e;d>0;u=256*u+t[n+g],g+=v,d-=8);if(0===o)o=1-l;else{if(o===c)return u?NaN:1/0*(m?-1:1);u+=Math.pow(2,e),o-=l}return(m?-1:1)*u*Math.pow(2,o-e)},Kr.write=function(t,n,r,e,a,o){var u,i,c,l=8*o-a-1,d=(1<>1,v=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,m=e?0:o-1,b=e?1:-1,E=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(i=isNaN(n)?1:0,u=d):(u=Math.floor(Math.log(n)/Math.LN2),n*(c=Math.pow(2,-u))<1&&(u--,c*=2),(n+=u+g>=1?v/c:v*Math.pow(2,1-g))*c>=2&&(u++,c/=2),u+g>=d?(i=0,u=d):u+g>=1?(i=(n*c-1)*Math.pow(2,a),u+=g):(i=n*Math.pow(2,g-1)*Math.pow(2,a),u=0));a>=8;t[r+m]=255&i,m+=b,i/=256,a-=8);for(u=u<0;t[r+m]=255&u,m+=b,u/=256,l-=8);t[r+m-b]|=128*E},function(t){var n=rc,r=Kr,e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(s){return+s!=s&&(s=0),u.alloc(+s)},t.INSPECT_MAX_BYTES=50;var a=2147483647;function o(s){if(s>a)throw new RangeError('The value "'+s+'" is invalid for option "size"');var f=new Uint8Array(s);return Object.setPrototypeOf(f,u.prototype),f}function u(s,f,p){if("number"==typeof s){if("string"==typeof f)throw new TypeError('The "string" argument must be of type string. Received type number');return l(s)}return i(s,f,p)}function i(s,f,p){if("string"==typeof s)return function(w,P){if("string"==typeof P&&""!==P||(P="utf8"),!u.isEncoding(P))throw new TypeError("Unknown encoding: "+P);var M=0|m(w,P),tt=o(M),rt=tt.write(w,P);return rt!==M&&(tt=tt.slice(0,rt)),tt}(s,f);if(ArrayBuffer.isView(s))return function(w){if(Vt(w,Uint8Array)){var P=new Uint8Array(w);return g(P.buffer,P.byteOffset,P.byteLength)}return d(w)}(s);if(null==s)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+z(s));if(Vt(s,ArrayBuffer)||s&&Vt(s.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Vt(s,SharedArrayBuffer)||s&&Vt(s.buffer,SharedArrayBuffer)))return g(s,f,p);if("number"==typeof s)throw new TypeError('The "value" argument must not be of type number. Received type number');var y=s.valueOf&&s.valueOf();if(null!=y&&y!==s)return u.from(y,f,p);var k=function(w){if(u.isBuffer(w)){var P=0|v(w.length),M=o(P);return 0===M.length||w.copy(M,0,0,P),M}return void 0!==w.length?"number"!=typeof w.length||Ha(w.length)?o(0):d(w):"Buffer"===w.type&&Array.isArray(w.data)?d(w.data):void 0}(s);if(k)return k;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof s[Symbol.toPrimitive])return u.from(s[Symbol.toPrimitive]("string"),f,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+z(s))}function c(s){if("number"!=typeof s)throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function l(s){return c(s),o(s<0?0:0|v(s))}function d(s){for(var f=s.length<0?0:0|v(s.length),p=o(f),y=0;y=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|s}function m(s,f){if(u.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||Vt(s,ArrayBuffer))return s.byteLength;if("string"!=typeof s)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+z(s));var p=s.length,y=arguments.length>2&&!0===arguments[2];if(!y&&0===p)return 0;for(var k=!1;;)switch(f){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return Qt(s).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*p;case"hex":return p>>>1;case"base64":return qi(s).length;default:if(k)return y?-1:Qt(s).length;f=(""+f).toLowerCase(),k=!0}}function b(s,f,p){var y=!1;if((void 0===f||f<0)&&(f=0),f>this.length||((void 0===p||p>this.length)&&(p=this.length),p<=0)||(p>>>=0)<=(f>>>=0))return"";for(s||(s="utf8");;)switch(s){case"hex":return Nt(this,f,p);case"utf8":case"utf-8":return It(this,f,p);case"ascii":return Rt(this,f,p);case"latin1":case"binary":return _t(this,f,p);case"base64":return lt(this,f,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,f,p);default:if(y)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),y=!0}}function E(s,f,p){var y=s[f];s[f]=s[p],s[p]=y}function S(s,f,p,y,k){if(0===s.length)return-1;if("string"==typeof p?(y=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),Ha(p=+p)&&(p=k?0:s.length-1),p<0&&(p=s.length+p),p>=s.length){if(k)return-1;p=s.length-1}else if(p<0){if(!k)return-1;p=0}if("string"==typeof f&&(f=u.from(f,y)),u.isBuffer(f))return 0===f.length?-1:N(s,f,p,y,k);if("number"==typeof f)return f&=255,"function"==typeof Uint8Array.prototype.indexOf?k?Uint8Array.prototype.indexOf.call(s,f,p):Uint8Array.prototype.lastIndexOf.call(s,f,p):N(s,[f],p,y,k);throw new TypeError("val must be string, number or Buffer")}function N(s,f,p,y,k){var w,P=1,M=s.length,tt=f.length;if(void 0!==y&&("ucs2"===(y=String(y).toLowerCase())||"ucs-2"===y||"utf16le"===y||"utf-16le"===y)){if(s.length<2||f.length<2)return-1;P=2,M/=2,tt/=2,p/=2}function rt(nr,rr){return 1===P?nr[rr]:nr.readUInt16BE(rr*P)}if(k){var nt=-1;for(w=p;wM&&(p=M-tt),w=p;w>=0;w--){for(var Bt=!0,sn=0;snk&&(y=k):y=k;var w,P=f.length;for(y>P/2&&(y=P/2),w=0;w>8,rt.push(P%256),rt.push(M);return rt}(f,s.length-p),s,p,y)}function lt(s,f,p){return n.fromByteArray(0===f&&p===s.length?s:s.slice(f,p))}function It(s,f,p){p=Math.min(s.length,p);for(var y=[],k=f;k239?4:w>223?3:w>191?2:1;if(k+M<=p){var tt=void 0,rt=void 0,nt=void 0,Bt=void 0;switch(M){case 1:w<128&&(P=w);break;case 2:128==(192&(tt=s[k+1]))&&(Bt=(31&w)<<6|63&tt)>127&&(P=Bt);break;case 3:rt=s[k+2],128==(192&(tt=s[k+1]))&&128==(192&rt)&&(Bt=(15&w)<<12|(63&tt)<<6|63&rt)>2047&&(Bt<55296||Bt>57343)&&(P=Bt);break;case 4:rt=s[k+2],nt=s[k+3],128==(192&(tt=s[k+1]))&&128==(192&rt)&&128==(192&nt)&&(Bt=(15&w)<<18|(63&tt)<<12|(63&rt)<<6|63&nt)>65535&&Bt<1114112&&(P=Bt)}}null===P?(P=65533,M=1):P>65535&&(y.push((P-=65536)>>>10&1023|55296),P=56320|1023&P),y.push(P),k+=M}return function(sn){var nr=sn.length;if(nr<=At)return String.fromCharCode.apply(String,sn);for(var rr="",Wa=0;Wa"u"||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(s,f,p){return i(s,f,p)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(s,f,p){return k=f,w=p,c(y=s),y<=0?o(y):void 0!==k?"string"==typeof w?o(y).fill(k,w):o(y).fill(k):o(y);var y,k,w},u.allocUnsafe=function(s){return l(s)},u.allocUnsafeSlow=function(s){return l(s)},u.isBuffer=function(s){return null!=s&&!0===s._isBuffer&&s!==u.prototype},u.compare=function(s,f){if(Vt(s,Uint8Array)&&(s=u.from(s,s.offset,s.byteLength)),Vt(f,Uint8Array)&&(f=u.from(f,f.offset,f.byteLength)),!u.isBuffer(s)||!u.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(s===f)return 0;for(var p=s.length,y=f.length,k=0,w=Math.min(p,y);ky.length?(u.isBuffer(w)||(w=u.from(w)),w.copy(y,k)):Uint8Array.prototype.set.call(y,w,k);else{if(!u.isBuffer(w))throw new TypeError('"list" argument must be an Array of Buffers');w.copy(y,k)}k+=w.length}return y},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var s=this.length;if(s%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var f=0;ff&&(s+=" ... "),""},e&&(u.prototype[e]=u.prototype.inspect),u.prototype.compare=function(s,f,p,y,k){if(Vt(s,Uint8Array)&&(s=u.from(s,s.offset,s.byteLength)),!u.isBuffer(s))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+z(s));if(void 0===f&&(f=0),void 0===p&&(p=s?s.length:0),void 0===y&&(y=0),void 0===k&&(k=this.length),f<0||p>s.length||y<0||k>this.length)throw new RangeError("out of range index");if(y>=k&&f>=p)return 0;if(y>=k)return-1;if(f>=p)return 1;if(this===s)return 0;for(var w=(k>>>=0)-(y>>>=0),P=(p>>>=0)-(f>>>=0),M=Math.min(w,P),tt=this.slice(y,k),rt=s.slice(f,p),nt=0;nt>>=0,isFinite(p)?(p>>>=0,void 0===y&&(y="utf8")):(y=p,p=void 0)}var k=this.length-f;if((void 0===p||p>k)&&(p=k),s.length>0&&(p<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");y||(y="utf8");for(var w=!1;;)switch(y){case"hex":return T(this,s,f,p);case"utf8":case"utf-8":return R(this,s,f,p);case"ascii":case"latin1":case"binary":return L(this,s,f,p);case"base64":return I(this,s,f,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,s,f,p);default:if(w)throw new TypeError("Unknown encoding: "+y);y=(""+y).toLowerCase(),w=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var At=4096;function Rt(s,f,p){var y="";p=Math.min(s.length,p);for(var k=f;ky)&&(p=y);for(var k="",w=f;wp)throw new RangeError("Trying to access beyond buffer length")}function U(s,f,p,y,k,w){if(!u.isBuffer(s))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>k||fs.length)throw new RangeError("Index out of range")}function Y(s,f,p,y,k){Tt(f,y,k,s,p,7);var w=Number(f&BigInt(4294967295));s[p++]=w,s[p++]=w>>=8,s[p++]=w>>=8,s[p++]=w>>=8;var P=Number(f>>BigInt(32)&BigInt(4294967295));return s[p++]=P,s[p++]=P>>=8,s[p++]=P>>=8,s[p++]=P>>=8,p}function D(s,f,p,y,k){Tt(f,y,k,s,p,7);var w=Number(f&BigInt(4294967295));s[p+7]=w,s[p+6]=w>>=8,s[p+5]=w>>=8,s[p+4]=w>>=8;var P=Number(f>>BigInt(32)&BigInt(4294967295));return s[p+3]=P,s[p+2]=P>>=8,s[p+1]=P>>=8,s[p]=P>>=8,p+8}function ut(s,f,p,y,k,w){if(p+y>s.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function it(s,f,p,y,k){return f=+f,p>>>=0,k||ut(s,0,p,4),r.write(s,f,p,y,23,4),p+4}function yt(s,f,p,y,k){return f=+f,p>>>=0,k||ut(s,0,p,8),r.write(s,f,p,y,52,8),p+8}u.prototype.slice=function(s,f){var p=this.length;(s=~~s)<0?(s+=p)<0&&(s=0):s>p&&(s=p),(f=void 0===f?p:~~f)<0?(f+=p)<0&&(f=0):f>p&&(f=p),f>>=0,f>>>=0,p||A(s,f,this.length);for(var y=this[s],k=1,w=0;++w>>=0,f>>>=0,p||A(s,f,this.length);for(var y=this[s+--f],k=1;f>0&&(k*=256);)y+=this[s+--f]*k;return y},u.prototype.readUint8=u.prototype.readUInt8=function(s,f){return s>>>=0,f||A(s,1,this.length),this[s]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(s,f){return s>>>=0,f||A(s,2,this.length),this[s]|this[s+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(s,f){return s>>>=0,f||A(s,2,this.length),this[s]<<8|this[s+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(s,f){return s>>>=0,f||A(s,4,this.length),(this[s]|this[s+1]<<8|this[s+2]<<16)+16777216*this[s+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(s,f){return s>>>=0,f||A(s,4,this.length),16777216*this[s]+(this[s+1]<<16|this[s+2]<<8|this[s+3])},u.prototype.readBigUInt64LE=un(function(s){$t(s>>>=0,"offset");var f=this[s],p=this[s+7];void 0!==f&&void 0!==p||on(s,this.length-8);var y=f+this[++s]*Math.pow(2,8)+this[++s]*Math.pow(2,16)+this[++s]*Math.pow(2,24),k=this[++s]+this[++s]*Math.pow(2,8)+this[++s]*Math.pow(2,16)+p*Math.pow(2,24);return BigInt(y)+(BigInt(k)<>>=0,"offset");var f=this[s],p=this[s+7];void 0!==f&&void 0!==p||on(s,this.length-8);var y=f*Math.pow(2,24)+this[++s]*Math.pow(2,16)+this[++s]*Math.pow(2,8)+this[++s],k=this[++s]*Math.pow(2,24)+this[++s]*Math.pow(2,16)+this[++s]*Math.pow(2,8)+p;return(BigInt(y)<>>=0,f>>>=0,p||A(s,f,this.length);for(var y=this[s],k=1,w=0;++w=(k*=128)&&(y-=Math.pow(2,8*f)),y},u.prototype.readIntBE=function(s,f,p){s>>>=0,f>>>=0,p||A(s,f,this.length);for(var y=f,k=1,w=this[s+--y];y>0&&(k*=256);)w+=this[s+--y]*k;return w>=(k*=128)&&(w-=Math.pow(2,8*f)),w},u.prototype.readInt8=function(s,f){return s>>>=0,f||A(s,1,this.length),128&this[s]?-1*(255-this[s]+1):this[s]},u.prototype.readInt16LE=function(s,f){s>>>=0,f||A(s,2,this.length);var p=this[s]|this[s+1]<<8;return 32768&p?4294901760|p:p},u.prototype.readInt16BE=function(s,f){s>>>=0,f||A(s,2,this.length);var p=this[s+1]|this[s]<<8;return 32768&p?4294901760|p:p},u.prototype.readInt32LE=function(s,f){return s>>>=0,f||A(s,4,this.length),this[s]|this[s+1]<<8|this[s+2]<<16|this[s+3]<<24},u.prototype.readInt32BE=function(s,f){return s>>>=0,f||A(s,4,this.length),this[s]<<24|this[s+1]<<16|this[s+2]<<8|this[s+3]},u.prototype.readBigInt64LE=un(function(s){$t(s>>>=0,"offset");var f=this[s],p=this[s+7];void 0!==f&&void 0!==p||on(s,this.length-8);var y=this[s+4]+this[s+5]*Math.pow(2,8)+this[s+6]*Math.pow(2,16)+(p<<24);return(BigInt(y)<>>=0,"offset");var f=this[s],p=this[s+7];void 0!==f&&void 0!==p||on(s,this.length-8);var y=(f<<24)+this[++s]*Math.pow(2,16)+this[++s]*Math.pow(2,8)+this[++s];return(BigInt(y)<>>=0,f||A(s,4,this.length),r.read(this,s,!0,23,4)},u.prototype.readFloatBE=function(s,f){return s>>>=0,f||A(s,4,this.length),r.read(this,s,!1,23,4)},u.prototype.readDoubleLE=function(s,f){return s>>>=0,f||A(s,8,this.length),r.read(this,s,!0,52,8)},u.prototype.readDoubleBE=function(s,f){return s>>>=0,f||A(s,8,this.length),r.read(this,s,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(s,f,p,y){s=+s,f>>>=0,p>>>=0,y||U(this,s,f,p,Math.pow(2,8*p)-1,0);var k=1,w=0;for(this[f]=255&s;++w>>=0,p>>>=0,y||U(this,s,f,p,Math.pow(2,8*p)-1,0);var k=p-1,w=1;for(this[f+k]=255&s;--k>=0&&(w*=256);)this[f+k]=s/w&255;return f+p},u.prototype.writeUint8=u.prototype.writeUInt8=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,1,255,0),this[f]=255&s,f+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,2,65535,0),this[f]=255&s,this[f+1]=s>>>8,f+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,2,65535,0),this[f]=s>>>8,this[f+1]=255&s,f+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,4,4294967295,0),this[f+3]=s>>>24,this[f+2]=s>>>16,this[f+1]=s>>>8,this[f]=255&s,f+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,4,4294967295,0),this[f]=s>>>24,this[f+1]=s>>>16,this[f+2]=s>>>8,this[f+3]=255&s,f+4},u.prototype.writeBigUInt64LE=un(function(s){return Y(this,s,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=un(function(s){return D(this,s,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(s,f,p,y){if(s=+s,f>>>=0,!y){var k=Math.pow(2,8*p-1);U(this,s,f,p,k-1,-k)}var w=0,P=1,M=0;for(this[f]=255&s;++w>0)-M&255;return f+p},u.prototype.writeIntBE=function(s,f,p,y){if(s=+s,f>>>=0,!y){var k=Math.pow(2,8*p-1);U(this,s,f,p,k-1,-k)}var w=p-1,P=1,M=0;for(this[f+w]=255&s;--w>=0&&(P*=256);)s<0&&0===M&&0!==this[f+w+1]&&(M=1),this[f+w]=(s/P>>0)-M&255;return f+p},u.prototype.writeInt8=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,1,127,-128),s<0&&(s=255+s+1),this[f]=255&s,f+1},u.prototype.writeInt16LE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,2,32767,-32768),this[f]=255&s,this[f+1]=s>>>8,f+2},u.prototype.writeInt16BE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,2,32767,-32768),this[f]=s>>>8,this[f+1]=255&s,f+2},u.prototype.writeInt32LE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,4,2147483647,-2147483648),this[f]=255&s,this[f+1]=s>>>8,this[f+2]=s>>>16,this[f+3]=s>>>24,f+4},u.prototype.writeInt32BE=function(s,f,p){return s=+s,f>>>=0,p||U(this,s,f,4,2147483647,-2147483648),s<0&&(s=4294967295+s+1),this[f]=s>>>24,this[f+1]=s>>>16,this[f+2]=s>>>8,this[f+3]=255&s,f+4},u.prototype.writeBigInt64LE=un(function(s){return Y(this,s,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=un(function(s){return D(this,s,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(s,f,p){return it(this,s,f,!0,p)},u.prototype.writeFloatBE=function(s,f,p){return it(this,s,f,!1,p)},u.prototype.writeDoubleLE=function(s,f,p){return yt(this,s,f,!0,p)},u.prototype.writeDoubleBE=function(s,f,p){return yt(this,s,f,!1,p)},u.prototype.copy=function(s,f,p,y){if(!u.isBuffer(s))throw new TypeError("argument should be a Buffer");if(p||(p=0),y||0===y||(y=this.length),f>=s.length&&(f=s.length),f||(f=0),y>0&&y=this.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("sourceEnd out of bounds");y>this.length&&(y=this.length),s.length-f>>=0,p=void 0===p?this.length:p>>>0,s||(s=0),"number"==typeof s)for(w=f;w=y+4;p-=3)f="_".concat(s.slice(p-3,p)).concat(f);return"".concat(s.slice(0,p)).concat(f)}function Tt(s,f,p,y,k,w){if(s>p||s3?0===f||f===BigInt(0)?">= 0".concat(M," and < 2").concat(M," ** ").concat(8*(w+1)).concat(M):">= -(2".concat(M," ** ").concat(8*(w+1)-1).concat(M,") and < 2 ** ")+"".concat(8*(w+1)-1).concat(M):">= ".concat(f).concat(M," and <= ").concat(p).concat(M),new pt.ERR_OUT_OF_RANGE("value",P,s)}var tt,rt,nt;tt=y,nt=w,$t(rt=k,"offset"),void 0!==tt[rt]&&void 0!==tt[rt+nt]||on(rt,tt.length-(nt+1))}function $t(s,f){if("number"!=typeof s)throw new pt.ERR_INVALID_ARG_TYPE(f,"number",s)}function on(s,f,p){throw Math.floor(s)!==s?($t(s,p),new pt.ERR_OUT_OF_RANGE(p||"offset","an integer",s)):f<0?new pt.ERR_BUFFER_OUT_OF_BOUNDS:new pt.ERR_OUT_OF_RANGE(p||"offset",">= ".concat(p?1:0," and <= ").concat(f),s)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(s){return s?"".concat(s," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(s,f){return'The "'.concat(s,'" argument must be of type number. Received type ').concat(z(f))},TypeError),F("ERR_OUT_OF_RANGE",function(s,f,p){var y='The value of "'.concat(s,'" is out of range.'),k=p;return Number.isInteger(p)&&Math.abs(p)>Math.pow(2,32)?k=kt(String(p)):"bigint"==typeof p&&(k=String(p),(p>Math.pow(BigInt(2),BigInt(32))||p<-Math.pow(BigInt(2),BigInt(32)))&&(k=kt(k)),k+="n"),y+" It must be ".concat(f,". Received ").concat(k)},RangeError);var tr=/[^+/0-9A-Za-z-_]/g;function Qt(s,f){var p;f=f||1/0;for(var y=s.length,k=null,w=[],P=0;P55295&&p<57344){if(!k){if(p>56319){(f-=3)>-1&&w.push(239,191,189);continue}if(P+1===y){(f-=3)>-1&&w.push(239,191,189);continue}k=p;continue}if(p<56320){(f-=3)>-1&&w.push(239,191,189),k=p;continue}p=65536+(k-55296<<10|p-56320)}else k&&(f-=3)>-1&&w.push(239,191,189);if(k=null,p<128){if((f-=1)<0)break;w.push(p)}else if(p<2048){if((f-=2)<0)break;w.push(p>>6|192,63&p|128)}else if(p<65536){if((f-=3)<0)break;w.push(p>>12|224,p>>6&63|128,63&p|128)}else{if(!(p<1114112))throw new Error("Invalid code point");if((f-=4)<0)break;w.push(p>>18|240,p>>12&63|128,p>>6&63|128,63&p|128)}}return w}function qi(s){return n.toByteArray(function(f){if((f=(f=f.split("=")[0]).trim().replace(tr,"")).length<2)return"";for(;f.length%4!=0;)f+="=";return f}(s))}function Pr(s,f,p,y){var k;for(k=0;k=f.length||k>=s.length);++k)f[k+p]=s[k];return k}function Vt(s,f){return s instanceof f||null!=s&&null!=s.constructor&&null!=s.constructor.name&&s.constructor.name===f.name}function Ha(s){return s!=s}var fp=function(){for(var s="0123456789abcdef",f=new Array(256),p=0;p<16;++p)for(var y=16*p,k=0;k<16;++k)f[y+k]=s[p]+s[k];return f}();function un(s){return typeof BigInt>"u"?lp:s}function lp(){throw new Error("BigInt not supported")}}(X);var Vr={exports:{}};!function(t,n){var r=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=n=r.fetch,r.fetch&&(n.default=r.fetch.bind(r)),n.Headers=r.Headers,n.Request=r.Request,n.Response=r.Response}(Vr,Vr.exports);var _o=Vr.exports;function Z(t){return null==t?null:t.replace(/^0x/,"").replace(/^Fx/,"")}function at(t){return null==t?null:"0x"+Z(t)}var Jr=function(t){zr(r,t);var n=Yr(r);function r(e){var a,o=e.error,u=e.hostname,i=e.path,c=e.method,l=e.requestBody,d=e.responseBody,g=e.responseStatusText,v=e.statusCode;Dr(this,r);var m="\n HTTP Request Error: An error occurred when interacting with the Access API.\n ".concat(o?"error=".concat(o):"","\n ").concat(u?"hostname=".concat(u):"","\n ").concat(i?"path=".concat(i):"","\n ").concat(c?"method=".concat(c):"","\n ").concat(l?"requestBody=".concat(l):"","\n ").concat(d?"responseBody=".concat(d):"","\n ").concat(g?"responseStatusText=".concat(g):"","\n ").concat(v?"statusCode=".concat(v):"","\n ");return(a=n.call(this,m)).name="HTTP Request Error",a.statusCode=v,a.errorMessage=o,a}return Gr(r)}(ir(Error));function gt(t){return Xr.apply(this,arguments)}function Xr(){return Xr=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d,g,v,m,b;return h.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return b=function(){return b=x(h.mark(function S(){var N,R=arguments;return h.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return N=R.length>0&&void 0!==R[0]?R[0]:0,L.prev=1,L.next=4,v();case 4:case 14:return L.abrupt("return",L.sent);case 8:if(L.prev=8,L.t0=L.catch(1),![408,429,500,502,503,504].includes(L.t0.statusCode)){L.next=17;break}return L.next=14,new Promise(function(I,W){N1&&void 0!==a[1]?a[1]:{},C((e=a.length>2&&void 0!==a[2]?a[2]:{}).node,"SDK Send Execute Script Error: opts.node must be defined."),C(r.response,"SDK Send Execute Script Error: context.response must be defined."),C(r.Buffer,"SDK Send Execute Script Error: context.Buffer must be defined."),o.next=7,n;case 7:if(!(n=o.sent).block.id){o.next=14;break}return o.next=11,sc(n,r,e);case 11:case 17:case 22:return o.abrupt("return",o.sent);case 14:if(!n.block.height){o.next=20;break}return o.next=17,ic(n,r,e);case 20:return o.next=22,cc(n,r,e);case 23:case"end":return o.stop()}},t)})),ne.apply(this,arguments)}var lc={SHA2_256:1,SHA2_384:2,SHA3_256:3,SHA3_384:4,KMAC128_BLS_BLS12_381:5},pc={ECDSA_P256:1,ECDSA_secp256k1:2,BLS_BLS12_381:3};function dc(t,n,r){return To.apply(this,arguments)}function To(){return(To=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/accounts/".concat(n.account.addr,"?block_height=").concat(n.block.height,"&expand=contracts,keys"),method:"GET",body:null});case 3:return u.abrupt("return",Oo(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function hc(t,n,r){return Co.apply(this,arguments)}function Co(){return(Co=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/accounts/".concat(n.account.addr,"?block_height=sealed&expand=contracts,keys"),method:"GET",body:null});case 3:return u.abrupt("return",Oo(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function Oo(t,n,r){var e,a,o=n.response();return o.tag=t.tag,o.account={address:r.address,balance:Number(r.balance),code:"",contracts:function(u){var i={};if(!u)return i;for(var c=0,l=Object.keys(u);c1&&void 0!==a[1]?a[1]:{},C((e=a.length>2&&void 0!==a[2]?a[2]:{}).node,"SDK Send Get Account Error: opts.node must be defined."),C(r.response,"SDK Send Get Account Error: context.response must be defined."),C(r.Buffer,"SDK Send Get Account Error: context.Buffer must be defined."),o.next=7,n;case 7:if(null===(n=o.sent).block.height){o.next=14;break}return o.next=11,dc(n,r,e);case 11:case 16:return o.abrupt("return",o.sent);case 14:return o.next=16,hc(n,r,e);case 17:case"end":return o.stop()}},t)})),re.apply(this,arguments)}function mc(t,n,r){return Po.apply(this,arguments)}function Po(){return(Po=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/blocks/".concat(n.block.id),method:"GET",body:null});case 3:return u.abrupt("return",ee(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function vc(t,n,r){return No.apply(this,arguments)}function No(){return(No=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/blocks?height=".concat(n.block.height),method:"GET",body:null});case 3:return u.abrupt("return",ee(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function yc(t,n,r){return Bo.apply(this,arguments)}function Bo(){return(Bo=x(h.mark(function t(n,r,e){var a,o,u;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return o=e.httpRequest||gt,u=null!==(a=n.block)&&void 0!==a&&a.isSealed?"sealed":"finalized",c.next=4,o({hostname:e.node,path:"/v1/blocks?height=".concat(u),method:"GET",body:null});case 4:return c.abrupt("return",ee(n,r,c.sent));case 6:case"end":return c.stop()}},t)}))).apply(this,arguments)}function ee(t,n,r){var e=r.length?r[0]:null,a=n.response();return a.tag=t.tag,a.blockHeader={id:e.header.id,parentId:e.header.parent_id,height:Number(e.header.height),timestamp:e.header.timestamp},a}function bc(t){return ae.apply(this,arguments)}function ae(){return ae=x(h.mark(function t(n){var r,e,o,u=arguments;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},C((e=u.length>2&&void 0!==u[2]?u[2]:{}).node,"SDK Send Get Block Header Error: opts.node must be defined."),C(r.response,"SDK Send Get Block Header Error: context.response must be defined."),i.next=6,n;case 6:if(o=null!==(n=i.sent).block.height,null===n.block.id){i.next=15;break}return i.next=12,mc(n,r,e);case 12:case 18:case 23:return i.abrupt("return",i.sent);case 15:if(!o){i.next=21;break}return i.next=18,vc(n,r,e);case 21:return i.next=23,yc(n,r,e);case 24:case"end":return i.stop()}},t)})),ae.apply(this,arguments)}function wc(t,n,r){return Lo.apply(this,arguments)}function Lo(){return(Lo=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/blocks/".concat(n.block.id,"?expand=payload"),method:"GET",body:null});case 3:return u.abrupt("return",oe(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function xc(t,n,r){return Uo.apply(this,arguments)}function Uo(){return(Uo=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/blocks?height=".concat(n.block.height,"&expand=payload"),method:"GET",body:null});case 3:return u.abrupt("return",oe(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function kc(t,n,r){return Fo.apply(this,arguments)}function Fo(){return(Fo=x(h.mark(function t(n,r,e){var a,o,u;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return o=e.httpRequest||gt,u=null!==(a=n.block)&&void 0!==a&&a.isSealed?"sealed":"final",c.next=4,o({hostname:e.node,path:"/v1/blocks?height=".concat(u,"&expand=payload"),method:"GET",body:null});case 4:return c.abrupt("return",oe(n,r,c.sent));case 6:case"end":return c.stop()}},t)}))).apply(this,arguments)}function oe(t,n,r){var e=r.length?r[0]:null,a=n.response();return a.tag=t.tag,a.block={id:e.header.id,parentId:e.header.parent_id,height:Number(e.header.height),timestamp:e.header.timestamp,collectionGuarantees:e.payload.collection_guarantees.map(function(o){return{collectionId:o.collection_id,signerIds:o.signer_ids}}),blockSeals:e.payload.block_seals.map(function(o){return{blockId:o.block_id,executionReceiptId:o.result_id}})},a}function Ec(t){return ue.apply(this,arguments)}function ue(){return ue=x(h.mark(function t(n){var r,e,o,u=arguments;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},C((e=u.length>2&&void 0!==u[2]?u[2]:{}).node,"SDK Send Get Block Error: opts.node must be defined."),C(r.response,"SDK Send Get Block Error: context.response must be defined."),i.next=6,n;case 6:if(o=null!==(n=i.sent).block.height,null===n.block.id){i.next=15;break}return i.next=12,wc(n,r,e);case 12:case 18:case 23:return i.abrupt("return",i.sent);case 15:if(!o){i.next=21;break}return i.next=18,xc(n,r,e);case 21:return i.next=23,kc(n,r,e);case 24:case"end":return i.stop()}},t)})),ue.apply(this,arguments)}function Ic(t){return se.apply(this,arguments)}function se(){return se=x(h.mark(function t(n){var r,e,a,o,u,i=arguments;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},C((e=i.length>2&&void 0!==i[2]?i[2]:{}).node,"SDK Send Get Collection Error: opts.node must be defined."),C(r.response,"SDK Send Get Collection Error: context.response must be defined."),a=e.httpRequest||gt,c.next=7,a({hostname:e.node,path:"/v1/collections/".concat(n.collection.id,"?expand=transactions"),method:"GET",body:null});case 7:return o=c.sent,(u=r.response()).tag=n.tag,u.collection={id:o.id,transactionIds:o.transactions.map(function(l){return l.id})},c.abrupt("return",u);case 12:case"end":return c.stop()}},t)})),se.apply(this,arguments)}function Sc(t,n,r){return jo.apply(this,arguments)}function jo(){return(jo=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/events?type=".concat(n.events.eventType,"&start_height=").concat(n.events.start,"&end_height=").concat(n.events.end),method:"GET",body:null});case 3:return u.abrupt("return",Go(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function Ac(t,n,r){return Do.apply(this,arguments)}function Do(){return(Do=x(h.mark(function t(n,r,e){var a;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=e.httpRequest||gt,u.next=3,a({hostname:e.node,path:"/v1/events?type=".concat(n.events.eventType,"&block_ids=").concat(n.events.blockIds.join(",")),method:"GET",body:null});case 3:return u.abrupt("return",Go(n,r,u.sent));case 5:case"end":return u.stop()}},t)}))).apply(this,arguments)}function Go(t,n,r){var e=n.response();return e.tag=t.tag,e.events=[],r.forEach(function(a){return a.events?a.events.forEach(function(o){return e.events.push({blockId:a.block_id,blockHeight:Number(a.block_height),blockTimestamp:a.block_timestamp,type:o.type,transactionId:o.transaction_id,transactionIndex:Number(o.transaction_index),eventIndex:Number(o.event_index),payload:JSON.parse(n.Buffer.from(o.payload,"base64").toString())})}):null}),e}function Rc(t){return ie.apply(this,arguments)}function ie(){return ie=x(h.mark(function t(n){var r,e,a,o,u=arguments;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},C((e=u.length>2&&void 0!==u[2]?u[2]:{}).node,"SDK Send Get Events Error: opts.node must be defined."),C(r.response,"SDK Send Get Events Error: context.response must be defined."),C(r.Buffer,"SDK Send Get Events Error: context.Buffer must be defined."),i.next=7,n;case 7:if(a=null!==(n=i.sent).events.start,o=Array.isArray(n.events.blockIds)&&n.events.blockIds.length>0,C(a||o,"SendGetEventsError: Unable to determine which get events request to send. Either a block height range, or block IDs must be specified."),!a){i.next=17;break}return i.next=14,Sc(n,r,e);case 14:case 19:return i.abrupt("return",i.sent);case 17:return i.next=19,Ac(n,r,e);case 20:case"end":return i.stop()}},t)})),ie.apply(this,arguments)}function _c(t){return ce.apply(this,arguments)}function ce(){return ce=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d=arguments;return h.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return r=d.length>1&&void 0!==d[1]?d[1]:{},C((e=d.length>2&&void 0!==d[2]?d[2]:{}).node,"SDK Send Get Transaction Error: opts.node must be defined."),C(r.response,"SDK Send Get Transaction Error: context.response must be defined."),C(r.Buffer,"SDK Send Get Transaction Error: context.Buffer must be defined."),a=e.httpRequest||gt,g.next=8,n;case 8:return n=g.sent,g.next=11,a({hostname:e.node,path:"/v1/transactions/".concat(n.transaction.id),method:"GET",body:null});case 11:return o=g.sent,u=function(v){return{address:v.address,keyId:Number(v.key_id),sequenceNumber:Number(v.sequence_number)}},i=function(v){return{address:v.address,keyId:Number(v.key_index),signature:v.signature}},c=function(v){return JSON.parse(r.Buffer.from(v,"base64").toString())},(l=r.response()).tag=n.tag,l.transaction={script:r.Buffer.from(o.script,"base64").toString(),args:K(o.arguments.map(c)),referenceBlockId:o.reference_block_id,gasLimit:Number(o.gas_limit),payer:o.payer,proposalKey:o.proposal_key?u(o.proposal_key):o.proposal_key,authorizers:o.authorizers,payloadSignatures:K(o.payload_signatures.map(i)),envelopeSignatures:K(o.envelope_signatures.map(i))},g.abrupt("return",l);case 19:case"end":return g.stop()}},t)})),ce.apply(this,arguments)}var Tc={UNKNOWN:0,PENDING:1,FINALIZED:2,EXECUTED:3,SEALED:4,EXPIRED:5};function Cc(t){return fe.apply(this,arguments)}function fe(){return fe=x(h.mark(function t(n){var r,e,a,o,u,i=arguments;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},C((e=i.length>2&&void 0!==i[2]?i[2]:{}).node,"SDK Send Get Transaction Status Error: opts.node must be defined."),C(r.response,"SDK Send Get Transaction Status Error: context.response must be defined."),C(r.Buffer,"SDK Send Get Transaction Status Error: context.Buffer must be defined."),a=e.httpRequest||gt,c.next=8,n;case 8:return n=c.sent,c.next=11,a({hostname:e.node,path:"/v1/transaction_results/".concat(n.transaction.id),method:"GET",body:null});case 11:return o=c.sent,(u=r.response()).tag=n.tag,u.transactionStatus={blockId:o.block_id,status:Tc[o.status.toUpperCase()]||"",statusString:o.status.toUpperCase(),statusCode:o.status_code,errorMessage:o.error_message,events:o.events.map(function(l){return{type:l.type,transactionId:l.transaction_id,transactionIndex:Number(l.transaction_index),eventIndex:Number(l.event_index),payload:JSON.parse(r.Buffer.from(l.payload,"base64").toString())}})},c.abrupt("return",u);case 16:case"end":return c.stop()}},t)})),fe.apply(this,arguments)}function Oc(t){return le.apply(this,arguments)}function le(){return le=x(h.mark(function t(n){var r,e,a,o,u=arguments;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},C((e=u.length>2&&void 0!==u[2]?u[2]:{}).node,"SDK Send Ping Error: opts.node must be defined."),C(r.response,"SDK Send Ping Error: context.response must be defined."),a=e.httpRequest||gt,i.next=7,a({hostname:e.node,path:"/v1/blocks?height=sealed",method:"GET",body:null});case 7:return(o=r.response()).tag=n.tag,i.abrupt("return",o);case 10:case"end":return i.stop()}},t)})),le.apply(this,arguments)}var Pc=function(t){return"".concat(withPrefix(t.addr),"-").concat(t.keyId)};function Nc(t){return pe.apply(this,arguments)}function pe(){return pe=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d,g,v,m,b,E,S,N,T=arguments;return h.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return r=T.length>1&&void 0!==T[1]?T[1]:{},C((e=T.length>2&&void 0!==T[2]?T[2]:{}).node,"SDK Send Transaction Error: opts.node must be defined."),C(r.response,"SDK Send Transaction Error: context.response must be defined."),C(r.Buffer,"SDK Send Transaction Error: context.Buffer must be defined."),a=e.httpRequest||gt,R.next=8,n;case 8:n=R.sent,o=[],u=0,i=Object.values(n.accounts);case 11:if(!(u1&&void 0!==o[1]?o[1]:{},C((a=o.length>2&&void 0!==o[2]?o[2]:{}).node,'SDK Send Error: Either opts.node or "accessNode.api" in config must be defined.'),C(e.ix,"SDK Send Error: context.ix must be defined."),u.next=6,r;case 6:r=u.sent,u.t0=!0,u.next=u.t0===e.ix.isTransaction(r)?10:u.t0===e.ix.isGetTransactionStatus(r)?11:u.t0===e.ix.isGetTransaction(r)?12:u.t0===e.ix.isScript(r)?13:u.t0===e.ix.isGetAccount(r)?14:u.t0===e.ix.isGetEvents(r)?15:u.t0===e.ix.isGetBlock(r)?16:u.t0===e.ix.isGetBlockHeader(r)?17:u.t0===e.ix.isGetCollection(r)?18:u.t0===e.ix.isPing(r)?19:20;break;case 10:return u.abrupt("return",a.sendTransaction?a.sendTransaction(r,e,a):Nc(r,e,a));case 11:return u.abrupt("return",a.sendGetTransactionStatus?a.sendGetTransactionStatus(r,e,a):Cc(r,e,a));case 12:return u.abrupt("return",a.sendGetTransaction?a.sendGetTransaction(r,e,a):_c(r,e,a));case 13:return u.abrupt("return",a.sendExecuteScript?a.sendExecuteScript(r,e,a):fc(r,e,a));case 14:return u.abrupt("return",a.sendGetAccount?a.sendGetAccount(r,e,a):gc(r,e,a));case 15:return u.abrupt("return",a.sendGetEvents?a.sendGetEvents(r,e,a):Rc(r,e,a));case 16:return u.abrupt("return",a.sendGetBlock?a.sendGetBlock(r,e,a):Ec(r,e,a));case 17:return u.abrupt("return",a.sendGetBlockHeader?a.sendGetBlockHeader(r,e,a):bc(r,e,a));case 18:return u.abrupt("return",a.sendGetCollection?a.sendGetCollection(r,e,a):Ic(r,e,a));case 19:return u.abrupt("return",a.sendPing?a.sendPing(r,e,a):Oc(r,e,a));case 20:return u.abrupt("return",r);case 21:case"end":return u.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),he={},Mo={},zo={},Yo={},ge=function(t,n){return function(r,e){var a=2*e,o=2*n;r[a]=t[o],r[a+1]=t[o+1]}};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=ge)&&n.__esModule?n:{default:n};t.default=function(a){for(var o=a.A,u=a.C,i=0;i<25;i+=5){for(var c=0;c<5;c++)(0,r.default)(o,i+c)(u,c);for(var l=0;l<5;l++){var d=2*(i+l),g=(l+1)%5*2,v=(l+2)%5*2;o[d]^=~u[g]&u[v],o[d+1]^=~u[g+1]&u[v+1]}}}}(Yo);var qo={},Ko={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=new Uint32Array([0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424]);t.default=n})(Ko),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=Ko)&&n.__esModule?n:{default:n};t.default=function(a){var o=a.A,u=2*a.roundIndex;o[0]^=r.default[u],o[1]^=r.default[u+1]}}(qo);var Ho={},Wo={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[10,7,11,17,18,3,5,16,8,21,24,4,15,23,19,13,12,2,20,14,22,9,6,1]}(Wo);var Vo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[1,3,6,10,15,21,28,36,45,55,2,14,27,41,56,8,25,43,62,18,39,61,20,44]})(Vo),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(Wo),r=a(Vo),e=a(ge);function a(u){return u&&u.__esModule?u:{default:u}}t.default=function(u){var i=u.A,c=u.C,l=u.W;(0,e.default)(i,1)(l,0);for(var d=0,g=0,v=0,m=32,b=0;b<24;b++){var E=n.default[b],S=r.default[b];(0,e.default)(i,E)(c,0),l[v=S<32?0:1]=(d=l[0])<>>(m=32-S),l[(v+1)%2]=g<>>m,(0,e.default)(l,0)(i,E),(0,e.default)(c,0)(l,0)}}}(Ho);var Jo={};function Xo(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!t.length&&!n.length||!t.length)return r;if(!n.length)return[].concat(K(r),[t[0]]);var e=Fn(t),a=e[0],o=e.slice(1),u=Fn(n),i=u[0],c=u.slice(1);return void 0!==a&&r.push(a),void 0!==i&&r.push(i),Xo(o,c,r)}function Zo(t){return function(n){return"function"==typeof n?(wt.deprecate({pkg:"FCL/SDK",subject:"Interopolation of functions into template literals",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0001-deprecate-params"}),Zo(t)(n(t))):String(n)}}function cr(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),e=1;e=0||(d[c]=u[c]);return d}(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=ge)&&n.__esModule?n:{default:n};t.default=function(a){for(var o=a.A,u=a.C,i=a.D,c=a.W,l=0,d=0,g=0;g<5;g++){var v=2*g,m=2*(g+5),b=2*(g+10),E=2*(g+15),S=2*(g+20);u[v]=o[v]^o[m]^o[b]^o[E]^o[S],u[v+1]=o[v+1]^o[m+1]^o[b+1]^o[E+1]^o[S+1]}for(var N=0;N<5;N++){(0,r.default)(u,(N+1)%5)(c,0),c[0]=(l=c[0])<<1|(d=c[1])>>>31,c[1]=d<<1|l>>>31,i[2*N]=u[(N+4)%5*2]^c[0],i[2*N+1]=u[(N+4)%5*2+1]^c[1];for(var T=0;T<25;T+=5)o[2*(T+N)]^=i[2*N],o[2*(T+N)+1]^=i[2*N+1]}}})(Jo),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(Yo),r=o(qo),e=o(Ho),a=o(Jo);function o(i){return i&&i.__esModule?i:{default:i}}t.default=function(){var i=new Uint32Array(10),c=new Uint32Array(10),l=new Uint32Array(2);return function(d){for(var g=0;g<24;g++)(0,a.default)({A:d,C:i,D:c,W:l}),(0,e.default)({A:d,C:i,W:l}),(0,n.default)({A:d,C:i}),(0,r.default)({A:d,roundIndex:g});i.fill(0),c.fill(0),l.fill(0)}}}(zo),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=X,e=(n=zo)&&n.__esModule?n:{default:n},a=function(i,c){for(var l=0;l>>8,c[l+2]=i[d+1]>>>16,c[l+3]=i[d+1]>>>24,c[l+4]=i[d],c[l+5]=i[d]>>>8,c[l+6]=i[d]>>>16,c[l+7]=i[d]>>>24}return c};t.default=function(i){var c=this,l=i.capacity,d=i.padding,g=(0,e.default)(),v=l/8,m=200-l/4,b=0,E=new Uint32Array(50),S=r.Buffer.allocUnsafe(m);return this.absorb=function(N){for(var T=0;T=m&&(a(S,E),g(E),b=0);return c},this.squeeze=function(){var N=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},T={buffer:N.buffer||r.Buffer.allocUnsafe(v),padding:N.padding||d,queue:r.Buffer.allocUnsafe(S.length),state:new Uint32Array(E.length)};S.copy(T.queue);for(var R=0;R0&&void 0!==arguments[0]?arguments[0]:v;if(!this||this.constructor!==b)return new b(S);if(g&&!g.includes(S))throw new Error("Unsupported hash length");var N=new e.default({capacity:S});return this.update=function(T){var R=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";if(r.Buffer.isBuffer(T))return N.absorb(T),E;if("string"==typeof T)return E.update(r.Buffer.from(T,R));throw new TypeError("Not a string or buffer")},this.digest=function(){var T=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"binary",R="string"==typeof T?{format:T}:T,L=N.squeeze({buffer:R.buffer,padding:R.padding||m});return R.format&&"binary"!==R.format?L.toString(R.format):L},this.reset=function(){return N.reset(),E},this}},o=a({allowedSizes:[224,256,384,512],defaultSize:512,padding:1});t.Keccak=o;var u=a({allowedSizes:[224,256,384,512],defaultSize:512,padding:6});t.SHA3=u;var i=a({allowedSizes:[128,256],defaultSize:256,padding:31});t.SHAKE=i;var c=o;t.SHA3Hash=c,u.SHA3Hash=c,t.default=u}(he);var fr="UNKNOWN",me="SCRIPT",ve="TRANSACTION",ye="GET_TRANSACTION_STATUS",be="GET_ACCOUNT",we="GET_EVENTS",xe="PING",ke="GET_TRANSACTION",Ee="GET_BLOCK",Ie="GET_BLOCK_HEADER",Se="GET_COLLECTION",Re="ACCOUNT",_e="ARGUMENT",Te="authorizer",Ce="payer",Qo="proposer",Lc='{\n "kind":"'.concat(Re,'",\n "tempId":null,\n "addr":null,\n "keyId":null,\n "sequenceNum":null,\n "signature":null,\n "signingFunction":null,\n "resolve":null,\n "role": {\n "proposer":false,\n "authorizer":false,\n "payer":false,\n "param":false\n }\n}'),Uc='{\n "kind":"'.concat(_e,'",\n "tempId":null,\n "value":null,\n "asArgument":null,\n "xform":null,\n "resolve": null,\n "resolveArgument": null\n}'),tu='{\n "tag":"'.concat(fr,'",\n "assigns":{},\n "status":"').concat("OK",'",\n "reason":null,\n "accounts":{},\n "params":{},\n "arguments":{},\n "message": {\n "cadence":null,\n "refBlock":null,\n "computeLimit":null,\n "proposer":null,\n "payer":null,\n "authorizations":[],\n "params":[],\n "arguments":[]\n },\n "proposer":null,\n "authorizations":[],\n "payer":[],\n "events": {\n "eventType":null,\n "start":null,\n "end":null,\n "blockIds":[]\n },\n "transaction": {\n "id":null\n },\n "block": {\n "id":null,\n "height":null,\n "isSealed":null\n },\n "account": {\n "addr":null\n },\n "collection": {\n "id":null\n }\n}'),nu=new Set(Object.keys(JSON.parse(tu))),pr=function(){return JSON.parse(tu)},ru="abcdefghijklmnopqrstuvwxyz0123456789".split(""),Fc=function(){return ru[~~(Math.random()*ru.length)]},Oe=function(){return Array.from({length:10},Fc).join("")},eu=function(t){return"number"==typeof t},au=function(t){return Array.isArray(t)},ou=function(t){return null!==t&&"object"===z(t)},Pe=function(t){return null==t},wn=function(t){return"function"==typeof t},uu=function(t){if(!ou(t)||Pe(t)||eu(t))return!1;var n,r=bt(nu);try{for(r.s();!(n=r.n()).done;)if(!t.hasOwnProperty(n.value))return!1}catch(a){r.e(a)}finally{r.f()}return!0},ht=function(t){return t.status="OK",t},Ne=function(t,n){return t.status="BAD",t.reason=n,t},Ft=function(t){return function(n){return n.tag=t,ht(n)}},su=function(t){return null==t.keyId?t:(C(!isNaN(parseInt(t.keyId)),"account.keyId must be an integer"),O(O({},t),{},{keyId:parseInt(t.keyId)}))},dr=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){C("function"==typeof t||"object"===z(t),"prepAccount must be passed an authorization function or an account object"),C(null!=n.role,"Account must have a role");var e=JSON.parse(Lc),a=n.role,o=Oe();t.authorization&&wn(t.authorization)&&(t={resolve:t.authorization}),!t.authorization&&wn(t)&&(t={resolve:t});var u=t.resolve;return u&&(t.resolve=function(i){for(var c=arguments.length,l=new Array(c>1?c-1:0),d=1;d1&&void 0!==c[1]?c[1]:[],l.prev=1,l.t0=Hc,l.next=5,r;case 5:if(l.t1=l.sent,r=(0,l.t0)(l.t1),!Ue(r)){l.next=9;break}throw new Error("Interaction Error: ".concat(r.reason));case 9:if(e.length){l.next=11;break}return l.abrupt("return",r);case 11:return a=Fn(e),o=a[0],u=a.slice(1),l.next=14,o;case 14:if(!wn(i=l.sent)){l.next=17;break}return l.abrupt("return",gr(i(r),u));case 17:if(!Pe(i)&&i){l.next=19;break}return l.abrupt("return",gr(r,u));case 19:if(!uu(i)){l.next=21;break}return l.abrupt("return",gr(i,u));case 21:throw new Error("Invalid Interaction Composition");case 24:throw l.prev=24,l.t2=l.catch(1),l.t2;case 27:case"end":return l.stop()}},n,null,[[1,24]])}));return function(n){return t.apply(this,arguments)}}(),st=function t(){for(var n=arguments.length,r=new Array(n),e=0;e1&&void 0!==arguments[1]?arguments[1]:Wc;return function(r){return r.assigns[t]=n(r.assigns[t],r),ht(r)}},Fe=Object.freeze({__proto__:null,UNKNOWN:fr,SCRIPT:me,TRANSACTION:ve,GET_TRANSACTION_STATUS:ye,GET_ACCOUNT:be,GET_EVENTS:we,PING:xe,GET_TRANSACTION:ke,GET_BLOCK:Ee,GET_BLOCK_HEADER:Ie,GET_COLLECTION:Se,BAD:"BAD",OK:"OK",ACCOUNT:Re,PARAM:"PARAM",ARGUMENT:_e,AUTHORIZER:Te,PAYER:Ce,PROPOSER:Qo,interaction:pr,uuid:Oe,isNumber:eu,isArray:au,isObj:ou,isNull:Pe,isFn:wn,isInteraction:uu,Ok:ht,Bad:Ne,prepAccount:dr,makeArgument:iu,makeUnknown:jc,makeScript:cu,makeTransaction:fu,makeGetTransactionStatus:lu,makeGetTransaction:pu,makeGetAccount:du,makeGetEvents:hr,makePing:hu,makeGetBlock:gu,makeGetBlockHeader:mu,makeGetCollection:vu,isUnknown:Dc,isScript:Be,isTransaction:en,isGetTransactionStatus:Gc,isGetTransaction:Mc,isGetAccount:Le,isGetEvents:zc,isPing:Yc,isGetBlock:yu,isGetBlockHeader:qc,isGetCollection:Kc,isOk:bu,isBad:Ue,why:wu,isAccount:function(t){return t.kind===Re},isParam:function(t){return"PARAM"===t.kind},isArgument:function(t){return t.kind===_e},pipe:st,get:mr,put:vr,update:xu,destroy:function(t){return function(n){return delete n.assigns[t],ht(n)}}});function yr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return st(pr(),t)}var je=function(){return JSON.parse('{\n "tag":null,\n "transaction":null,\n "transactionStatus":null,\n "transactionId":null,\n "encodedData":null,\n "events":null,\n "account":null,\n "block":null,\n "blockHeader":null,\n "latestBlock":null,\n "collection":null\n}')};function Mn(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return st([gu,function(n){return n.block.isSealed=t,ht(n)}])}function xn(t){return st([du,function(n){return n.account.addr=Z(t),ht(n)}])}var Vc=function(){wt.deprecate({pkg:"@onflow/decode",subject:"Operating upon data of the latestBlock field of the response object",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/decode/WARNINGS.md#0001-Deprecating-latestBlock-field"})},ot=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r);case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Jc=function(){var t=x(h.mark(function n(){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",null);case 1:case"end":return r.stop()}},n)}));return function(){return t.apply(this,arguments)}}(),Xc=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.staticType);case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Zc=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{domain:r.domain,identifier:r.identifier});case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),$c=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{path:r.path,address:r.address,borrowType:r.borrowType});case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Qc=function(){var t=x(h.mark(function n(r,e,a){return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!r){o.next=6;break}return o.next=3,kn(r,e,a);case 3:o.t0=o.sent,o.next=7;break;case 6:o.t0=null;case 7:return o.abrupt("return",o.t0);case 8:case"end":return o.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}(),tf=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{address:r.address,type:r.type});case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),nf=function(){var t=x(h.mark(function n(r,e,a){return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Promise.all(r.map(function(u){return new Promise((i=x(h.mark(function c(l){return h.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.t0=l,d.next=3,kn(u,e,[].concat(K(a),[u.type]));case 3:return d.t1=d.sent,d.abrupt("return",(0,d.t0)(d.t1));case 5:case"end":return d.stop()}},c)})),function(c){return i.apply(this,arguments)}));var i}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}(),rf=function(){var t=x(h.mark(function n(r,e,a){return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,r.reduce(function(){var u=x(h.mark(function i(c,l){return h.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,c;case 2:return c=d.sent,d.next=5,kn(l.key,e,[].concat(K(a),[l.key]));case 5:return d.t0=d.sent,d.next=8,kn(l.value,e,[].concat(K(a),[l.key]));case 8:return c[d.t0]=d.sent,d.abrupt("return",c);case 10:case"end":return d.stop()}},i)}));return function(i,c){return u.apply(this,arguments)}}(),Promise.resolve({}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}(),br=function(){var t=x(h.mark(function n(r,e,a){var o,u;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.fields.reduce(function(){var c=x(h.mark(function l(d,g){return h.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,d;case 2:return d=v.sent,v.next=5,kn(g.value,e,[].concat(K(a),[g.name]));case 5:return d[g.name]=v.sent,v.abrupt("return",d);case 7:case"end":return v.stop()}},l)}));return function(l,d){return c.apply(this,arguments)}}(),Promise.resolve({}));case 2:if(o=i.sent,!(u=r.id&&Eu(e,r.id))){i.next=10;break}return i.next=7,u(o);case 7:i.t0=i.sent,i.next=11;break;case 10:i.t0=o;case 11:return i.abrupt("return",i.t0);case 12:case"end":return i.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}(),ku={UInt:ot,Int:ot,UInt8:ot,Int8:ot,UInt16:ot,Int16:ot,UInt32:ot,Int32:ot,UInt64:ot,Int64:ot,UInt128:ot,Int128:ot,UInt256:ot,Int256:ot,Word8:ot,Word16:ot,Word32:ot,Word64:ot,UFix64:ot,Fix64:ot,String:ot,Character:ot,Bool:ot,Address:ot,Void:Jc,Optional:Qc,Reference:tf,Array:nf,Dictionary:rf,Event:br,Resource:br,Struct:br,Enum:br,Type:Xc,Path:Zc,Capability:$c},Eu=function(t,n){var r=Object.keys(t).find(function(e){return/^\/.*\/$/.test(e)?new RegExp(e.substring(1,e.length-1)).test(n):e===n});return n&&r&&t[r]},kn=function(){var t=x(h.mark(function n(r,e,a){var o;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(o=Eu(e,r.type)){u.next=3;break}throw new Error("Undefined Decoder Error: ".concat(r.type,"@").concat(a.join(".")));case 3:return u.next=5,o(r.value,e,a);case 5:return u.abrupt("return",u.sent);case 6:case"end":return u.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}(),De=function(){var t=x(h.mark(function n(r){var e,a,o,u,i=arguments;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return e=i.length>1&&void 0!==i[1]?i[1]:{},a=i.length>2&&void 0!==i[2]?i[2]:[],o=Object.keys(ku).filter(function(l){return!Object.keys(e).find(function(d){return new RegExp(d).test(l)})}).reduce(function(l,d){return l[d]=ku[d],l},e),u=O(O({},o),e),c.abrupt("return",kn(r,u,a));case 5:case"end":return c.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Jt=function(){var t=x(h.mark(function n(r){var e,a=arguments;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(e=a.length>1&&void 0!==a[1]?a[1]:{},!r.encodedData){o.next=5;break}return o.abrupt("return",De(r.encodedData,e));case 5:if(!r.transactionStatus){o.next=16;break}return o.t0=O,o.t1=O({},r.transactionStatus),o.t2={},o.next=11,Promise.all(r.transactionStatus.events.map(function(){var u=x(h.mark(function i(c){return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.t0=c.type,l.t1=c.transactionId,l.t2=c.transactionIndex,l.t3=c.eventIndex,l.next=6,De(c.payload,e);case 6:return l.t4=l.sent,l.abrupt("return",{type:l.t0,transactionId:l.t1,transactionIndex:l.t2,eventIndex:l.t3,data:l.t4});case 8:case"end":return l.stop()}},i)}));return function(i){return u.apply(this,arguments)}}()));case 11:return o.t3=o.sent,o.t4={events:o.t3},o.abrupt("return",(0,o.t0)(o.t1,o.t2,o.t4));case 16:if(!r.transaction){o.next=20;break}return o.abrupt("return",r.transaction);case 20:if(!r.events){o.next=26;break}return o.next=23,Promise.all(r.events.map(function(){var u=x(h.mark(function i(c){return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.t0=c.blockId,l.t1=c.blockHeight,l.t2=c.blockTimestamp,l.t3=c.type,l.t4=c.transactionId,l.t5=c.transactionIndex,l.t6=c.eventIndex,l.next=9,De(c.payload,e);case 9:return l.t7=l.sent,l.abrupt("return",{blockId:l.t0,blockHeight:l.t1,blockTimestamp:l.t2,type:l.t3,transactionId:l.t4,transactionIndex:l.t5,eventIndex:l.t6,data:l.t7});case 11:case"end":return l.stop()}},i)}));return function(i){return u.apply(this,arguments)}}()));case 23:return o.abrupt("return",o.sent);case 26:if(!r.account){o.next=30;break}return o.abrupt("return",r.account);case 30:if(!r.block){o.next=34;break}return o.abrupt("return",r.block);case 34:if(!r.blockHeader){o.next=38;break}return o.abrupt("return",r.blockHeader);case 38:if(!r.latestBlock){o.next=43;break}return Vc(),o.abrupt("return",r.latestBlock);case 43:if(!r.transactionId){o.next=47;break}return o.abrupt("return",r.transactionId);case 47:if(!r.collection){o.next=49;break}return o.abrupt("return",r.collection);case 49:return o.abrupt("return",null);case 50:case"end":return o.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Iu=function(t){return"function"==typeof t},Su=function(t){return"string"==typeof t};function Au(){return(Au=x(h.mark(function t(n){var r;return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!en(n)&&!Be(n)){e.next=11;break}if(r=mr(n,"ix.cadence"),C(Iu(r)||Su(r),"Cadence needs to be a function or a string."),!Iu(r)){e.next=7;break}return e.next=6,r({});case 6:r=e.sent;case 7:return C(Su(r),"Cadence needs to be a string at this point."),e.next=10,j().where(/^0x/).then(function(a){return Object.entries(a).reduce(function(o,u){var i=Lt(u,2),l=i[1],d=new RegExp("(\\b"+i[0]+"\\b)","g");return o.replace(d,l)},r)});case 10:n.message.cadence=e.sent;case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}},t)}))).apply(this,arguments)}var Ge=function(t){return"function"==typeof t};function ef(t){return C(null!=z(t.xform),"No type specified for argument: ".concat(t.value)),Ge(t.xform)?t.xform(t.value):Ge(t.xform.asArgument)?t.xform.asArgument(t.value):void C(!1,"Invalid Argument",t)}function Ru(t){return Me.apply(this,arguments)}function Me(){return Me=x(h.mark(function t(n){var r,a=arguments;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(C((r=a.length>1&&void 0!==a[1]?a[1]:3)>0,"Argument Resolve Recursion Limit Exceeded for Arg: ".concat(n.tempId)),!Ge(n.resolveArgument)){o.next=9;break}return o.next=5,n.resolveArgument();case 5:return o.abrupt("return",Ru(o.sent,r-1));case 9:return o.abrupt("return",n);case 10:case"end":return o.stop()}},t)})),Me.apply(this,arguments)}function ze(){return ze=x(h.mark(function t(n){var r,e,a,o,u;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!en(n)&&!Be(n)){c.next=11;break}r=0,e=Object.entries(n.arguments);case 2:if(!(re.signerIndex?1:r.signerIndexe.keyId?1:r.keyId3&&void 0!==d[3]?d[3]:3,"Account Resolve Recursion Limit Exceeded",{ix:n,accounts:r}),o=[],u=bt(r),g.prev=4,c=h.mark(function v(){var m,b,E,S;return h.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(b=(m=i.value).resolve,m.resolve=null,l=e||m,!vf(b)){N.next=8;break}return N.next=7,b(m,yf(m,n));case 7:m=N.sent;case 8:if(!Array.isArray(m)){N.next=13;break}return N.next=11,qe(n,m,l,a-1);case 11:N.next=30;break;case 13:if(m.addr&&(m.addr=Z(m.addr)),null!=m.addr&&null!=m.keyId&&(m.tempId=Vu(m)),n.accounts[m.tempId]=n.accounts[m.tempId]||m,n.accounts[m.tempId].role.proposer=n.accounts[m.tempId].role.proposer||m.role.proposer,n.accounts[m.tempId].role.payer=n.accounts[m.tempId].role.payer||m.role.payer,n.accounts[m.tempId].role.authorizer=n.accounts[m.tempId].role.authorizer||m.role.authorizer,n.accounts[m.tempId].role.proposer&&n.proposer===l.tempId&&(n.proposer=m.tempId),!n.accounts[m.tempId].role.payer){N.next=29;break}if(n.payer=Array.isArray(n.payer)?Array.from(new Set([].concat(K(n.payer),[m.tempId]).map(function(T){return T===l.tempId?m.tempId:T}))):Array.from(new Set([n.payer,m.tempId].map(function(T){return T===l.tempId?m.tempId:T}))),!(n.payer.length>1)){N.next=29;break}if(E=[],S=[],n.payer=n.payer.reduce(function(T,R){var L=n.accounts[R].addr,I=Vu(n.accounts[R]);return S.push(L),E.includes(I)?T:(E.push(I),[].concat(K(T),[R]))},[]),!(Array.from(new Set(S)).length>1)){N.next=29;break}throw new Error("Payer can not be different accounts");case 29:n.accounts[m.tempId].role.authorizer&&(e?o=Array.from(new Set([].concat(K(o),[m.tempId]))):n.authorizations=n.authorizations.map(function(T){return T===l.tempId?m.tempId:T}));case 30:l.tempId!=m.tempId&&delete n.accounts[l.tempId];case 31:case"end":return N.stop()}},v)}),u.s();case 7:if((i=u.n()).done){g.next=11;break}return g.delegateYield(c(),"t0",9);case 9:g.next=7;break;case 11:g.next=16;break;case 13:g.prev=13,g.t1=g.catch(4),u.e(g.t1);case 16:return g.prev=16,u.f(),g.finish(16);case 19:e&&(n.authorizations=n.authorizations.map(function(v){return v===e.tempId?o:v}).reduce(function(v,m){return Array.isArray(m)?[].concat(K(v),K(m)):[].concat(K(v),[m])},[]));case 20:case"end":return g.stop()}},t,null,[[4,13,16,19]])})),Ke.apply(this,arguments)}function Ju(){return(Ju=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!en(n)){r.next=13;break}return Array.isArray(n.payer)||wt.deprecate({pkg:"FCL",subject:'"ix.payer" must be an array. Support for ix.payer as a singular',message:"See changelog for more info."}),r.prev=2,r.next=5,qe(n,Object.values(n.accounts));case 5:return r.next=7,qe(n,Object.values(n.accounts));case 7:r.next=13;break;case 9:throw r.prev=9,r.t0=r.catch(2),console.error("=== SAD PANDA ===\n\n",r.t0,"\n\n=== SAD PANDA ==="),r.t0;case 13:return r.abrupt("return",n);case 14:case"end":return r.stop()}},t,null,[[2,9]])}))).apply(this,arguments)}function Xu(){return(Xu=x(h.mark(function t(n){var r,e,a,o;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!en(n)){u.next=16;break}return u.prev=1,r=Hu(n),e=Cu($u(n)),u.next=6,Promise.all(r.map(Zu(n,e)));case 6:return a=Wu(n),o=Ou(O(O({},$u(n)),{},{payloadSigs:r.map(function(i){return{address:n.accounts[i].addr,keyId:n.accounts[i].keyId,sig:n.accounts[i].signature}})})),u.next=10,Promise.all(a.map(Zu(n,o)));case 10:u.next=16;break;case 12:throw u.prev=12,u.t0=u.catch(1),console.error("Signatures",u.t0,{ix:n}),u.t0;case 16:return u.abrupt("return",n);case 17:case"end":return u.stop()}},t,null,[[1,12]])}))).apply(this,arguments)}function Zu(t,n){return r=x(h.mark(function e(a){var o;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(null==(o=t.accounts[a]).signature){c.next=3;break}return c.abrupt("return");case 3:return c.next=5,o.signingFunction(bf(o,n,t));case 5:t.accounts[a].signature=c.sent.signature;case 8:case"end":return c.stop()}},e)})),function(e){return r.apply(this,arguments)};var r}function bf(t,n,r){try{return{f_type:"Signable",f_vsn:"1.0.1",message:n,addr:Z(t.addr),keyId:t.keyId,roles:t.role,cadence:r.message.cadence,args:r.message.arguments.map(function(e){return r.arguments[e].asArgument}),data:{},interaction:r,voucher:Yn(r)}}catch(e){throw console.error("buildSignable",e),e}}function $u(t){var n=Z((Array.isArray(t.payer)?t.accounts[t.payer[0]]:t.accounts[t.payer]).addr);return{cadence:t.message.cadence,refBlock:t.message.refBlock||null,computeLimit:t.message.computeLimit,arguments:t.message.arguments.map(function(r){return t.arguments[r].asArgument}),proposalKey:{address:Z(t.accounts[t.proposer].addr),keyId:t.accounts[t.proposer].keyId,sequenceNum:t.accounts[t.proposer].sequenceNum},payer:n,authorizers:t.authorizations.map(function(r){return Z(t.accounts[r].addr)}).reduce(function(r,e){return r.find(function(a){return a===e})?r:[].concat(K(r),[e])},[])}}function Qu(){return(Qu=x(h.mark(function t(n){var r;return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=mr(n,"ix.validators",[]),e.abrupt("return",st(n,r.map(function(a){return function(o){return a(o,{Ok:ht,Bad:Ne})}})));case 2:case"end":return e.stop()}},t)}))).apply(this,arguments)}function ts(){return(ts=x(h.mark(function t(n){var r,e,a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:for(r=0,e=Object.keys(n.accounts);r1&&void 0!==arguments[1]?arguments[1]:wf;return r=x(h.mark(function e(a){var o,u;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return o=function(c){return["\nAccounts:",{proposer:c.proposer,authorizations:c.authorizations,payer:c.payer},"\n\nDetails:",c.accounts].filter(Boolean)},u=function(){for(var c,l=arguments.length,d=new Array(l),g=0;g1){var e=n[0],a=n[1];return G(function(u,i){var l=i.Bad;return e?(0,i.Ok)(u):l(u,a)})}var o=n[0];return function(u){return o(u,{Ok:ht,Bad:Ne})}}var Ot=function(){var t=x(h.mark(function n(){var r,e,a,o,u=arguments;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=u.length>0&&void 0!==u[0]?u[0]:[],e=u.length>1&&void 0!==u[1]?u[1]:{},i.next=4,j.first(["sdk.transport","sdk.send"],e.send||de);case 4:return G(a=i.sent,"Required value for sdk.transport is not defined in config. See: ".concat("https://github.com/onflow/fcl-js/blob/master/packages/sdk/CHANGELOG.md#0057-alpha1----2022-01-21")),i.next=8,j.first(["sdk.resolve"],e.resolve||He);case 8:if(o=i.sent,i.t0=e.node,i.t0){i.next=14;break}return i.next=13,j().get("accessNode.api");case 13:i.t0=i.sent;case 14:return e.node=i.t0,Array.isArray(r)&&(r=st(pr(),r)),i.t1=a,i.next=19,o(r);case 19:return i.t2=i.sent,i.t3={config:j,response:je,ix:Fe,Buffer:X.Buffer},i.t4=e,i.abrupt("return",(0,i.t1)(i.t2,i.t3,i.t4));case 23:case"end":return i.stop()}},n)}));return function(){return t.apply(this,arguments)}}();function Sn(t){return We.apply(this,arguments)}function We(){return We=x(h.mark(function t(n){var e;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,j().where(/^decoder\./);case 2:return e=Object.entries(a.sent).map(function(o){var u=Lt(o,2),i=u[0],c=u[1];return[i="/".concat(i.replace(/^decoder\./,""),"$/"),c]}),a.abrupt("return",Jt(n,Object.fromEntries(e)));case 5:case"end":return a.stop()}},t)})),We.apply(this,arguments)}var xf=function(t){zr(r,t);var n=Yr(r);function r(e){var a;Dr(this,r);var o="\n Encode Message From Signable Error: Unable to determine message encoding for signer addresss: ".concat(e,". \n Please ensure the address: ").concat(e," is intended to sign the given transaction as specified by the transaction signable.\n ").trim();return(a=n.call(this,o)).name="Unable To Determine Message Encoding For Signer Addresss",a}return Gr(r)}(ir(Error));function Ve(t){return xu("ix.validators",function(n){return Array.isArray(n)?n.push(t):[t]})}function xr(t){return st([function(n){return n.block.height=t,n},Ve(function(n){if("boolean"==typeof n.block.isSealed)throw new Error("Unable to specify both block height and isSealed.");if(n.block.id)throw new Error("Unable to specify both block height and block id.");return n})])}function Je(t){return st([function(n){return n.block.id=t,ht(n)},Ve(function(n,r){var e=r.Ok,a=r.Bad;return Le(n)?a(n,"Unable to specify a block id with a Get Account interaction."):"boolean"==typeof n.block.isSealed?a(n,"Unable to specify both block id and isSealed."):n.block.height?a(n,"Unable to specify both block id and block height."):e(n)})])}function qn(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.sealed,r=void 0!==n&&n,e=t.id,a=t.height,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C(!(r&&e||r&&a),'Method: block -- Cannot pass "sealed" with "id" or "height"'),C(!(e&&a),'Method: block -- Cannot pass "id" and "height" simultaneously'),e?Ot([Mn(),Je(e)],o).then(Jt):a?Ot([Mn(),xr(a)],o).then(Jt):Ot([Mn(r)],o).then(Jt)}function os(){return st((arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(function(n){return dr(n,{role:Te})}))}function us(t,n,r){return st([hr,function(e){return e.events.eventType=t,e.events.start=n,e.events.end=r,ht(e)}])}function ss(t){return st([lu,function(n){return n.transaction.id=t,ht(n)}])}function Xe(t){return function(n){return n.message.computeLimit=t,n}}function Ze(){return st((arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(iu))}function $e(t,n){return{value:t,xform:n}}function is(t){return Qe.apply(this,arguments)}function Qe(){return Qe=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",dr(n,{role:Qo}));case 1:case"end":return r.stop()}},t)})),Qe.apply(this,arguments)}function cs(t){return ta.apply(this,arguments)}function ta(){return ta=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",dr(n,{role:Ce}));case 1:case"end":return r.stop()}},t)})),ta.apply(this,arguments)}function fs(t){return st([function(n){return n.message.refBlock=t,ht(n)}])}function ls(){return st([cu,vr("ix.cadence",cr.apply(void 0,arguments))])}var kf=[];function ps(){return st([fu,vr("ix.cadence",cr.apply(void 0,arguments)),function(t){return t.message.refBlock=t.message.refBlock||null,t.authorizations=t.authorizations||kf,ht(t)}])}function Ef(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return C(t.account,"mockAccountResponse(ix) -- ix.account is missing",t),C(t.account.addr,"mockAccountResponse(ix) -- ix.account.addr is missing",t),{account:{addr:t.account.addr,keys:Array.from({length:n},function(e,a){return{index:a,sequenceNumber:42}})}}}var If=function(t){return t},Sf=["tempId"];function ds(t){return["SIGNATURE",t.addr,t.keyId].join(".")}function Kn(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){var r=O(O(O({},n),t),{},{signingFunction:t.signingFunction||n.signingFunction||function(e){return{addr:r.addr,keyId:r.keyId,signature:ds(r)}}});return r}}var hs,na={proposer:!1,authorizer:!1,payer:!1},Af=Object.freeze({__proto__:null,mockSend:function(){var n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:If;return n=x(h.mark(function r(e){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,e;case 2:e=a.sent,a.t0=!0,a.next=a.t0===Le(e)?6:a.t0===yu(e)?7:8;break;case 6:return a.abrupt("return",Ef(e));case 7:return a.abrupt("return",{tag:"GET_BLOCK",block:{id:"32"}});case 8:return a.abrupt("return",t(e));case 9:case"end":return a.stop()}},r)})),function(r){return n.apply(this,arguments)}},authzFn:Kn,authzResolve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){var r=t.tempId,e=Bc(t,Sf);return O(O({},n),{},{tempId:r||"WITH_RESOLVE",resolve:Kn(e)})}},authzResolveMany:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){var r=t.tempId||"AUTHZ_RESOLVE_MANY";return O(O({},n),{},{tempId:r,resolve:function(){return[t.proposer&&Kn(t.proposer)({role:O(O({},na),{},{proposer:!0})})].concat(K(t.authorizations.map(Kn).map(function(e){return e({role:O(O({},na),{},{authorizer:!0})})})),[t.payer&&Kn(t.payer)({role:O(O({},na),{},{payer:!0})})]).filter(Boolean)}})}},sig:ds,idof:function(t){return"".concat(at(t.addr),"-").concat(t.keyId)},run:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return yr([fs("123")].concat(K(t))).then(He)}}),kr=function(t){return function(n){return z(n)===t}},Xt=function(t){return null!=t},Rf=kr("object"),An=kr("string"),gs=kr("function"),_f=kr("number"),Tf="function"==typeof queueMicrotask?queueMicrotask:function(t){return(hs||(hs=Promise.resolve())).then(t).catch(function(n){return setTimeout(function(){throw n},0)})},Cf=function(){var t,n=[];return{deliver:function(r){return x(h.mark(function e(){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:n.push(r),t&&(t(n.shift()),t=void 0);case 2:case"end":return a.stop()}},e)}))()},receive:function(){return new Promise(function(r){var e=n.shift();if(e)return r(e);t=r})}}},ms="SUBSCRIBE",ra="UNSUBSCRIBE",Of="UPDATED",Q="object"===(typeof self>"u"?"undefined":z(self))&&self.self===self&&self||"object"===(typeof global>"u"?"undefined":z(global))&&global.global===global&&global||"object"===(typeof window>"u"?"undefined":z(window))&&window.window===window&&window;Q.FCL_REGISTRY=Q.FCL_REGISTRY??{};var Ht,Nf=0,Pt=function(t,n,r){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise(function(a,o){var u=e.expectReply||!1,i=null!=e.timeout?e.timeout:5e3;u&&i&&setTimeout(function(){return o(new Error("Timeout: ".concat(i,"ms passed without a response.")))},i);var c={to:t,from:e.from,tag:n,data:r,timeout:i,reply:a,reject:o};try{Q.FCL_REGISTRY[t]&&Q.FCL_REGISTRY[t].mailbox.deliver(c),u||a(!0)}catch(l){console.error("FCL.Actor -- Could Not Deliver Message",c,Q.FCL_REGISTRY[t],l)}})},Bf=function(t){delete Q.FCL_REGISTRY[t]},Lf=function(){var n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n=x(h.mark(function r(e){var a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if("function"!=typeof t.INIT){o.next=3;break}return o.next=3,t.INIT(e);case 3:return o.next=6,e.receive();case 6:if(a=o.sent,o.prev=7,"EXIT"!==a.tag){o.next=13;break}if("function"!=typeof t.TERMINATE){o.next=12;break}return o.next=12,t.TERMINATE(e,a,a.data||{});case 12:return o.abrupt("break",25);case 13:return o.next=15,t[a.tag](e,a,a.data||{});case 15:o.next=20;break;case 17:o.prev=17,o.t0=o.catch(7),console.error("".concat(e.self()," Error"),a,o.t0);case 20:return o.prev=20,o.abrupt("continue",3);case 23:o.next=3;break;case 25:case"end":return o.stop()}},r,null,[[7,17,20,23]])})),function(r){return n.apply(this,arguments)}},ea=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null==n&&(n=++Nf),null!=Q.FCL_REGISTRY[n])return n;Q.FCL_REGISTRY[n]={addr:n,mailbox:Cf(),subs:new Set,kvs:{},error:null};var r={self:function(){return n},receive:function(){return Q.FCL_REGISTRY[n].mailbox.receive()},send:function(e,a,o){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u.from=n,Pt(e,a,o,u)},sendSelf:function(e,a,o){Q.FCL_REGISTRY[n]&&Pt(n,e,a,o)},broadcast:function(e,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o.from=n;var u,i=bt(Q.FCL_REGISTRY[n].subs);try{for(i.s();!(u=i.n()).done;)Pt(u.value,e,a,o)}catch(l){i.e(l)}finally{i.f()}},subscribe:function(e){return null!=e&&Q.FCL_REGISTRY[n].subs.add(e)},unsubscribe:function(e){return null!=e&&Q.FCL_REGISTRY[n].subs.delete(e)},subscriberCount:function(){return Q.FCL_REGISTRY[n].subs.size},hasSubs:function(){return!!Q.FCL_REGISTRY[n].subs.size},put:function(e,a){null!=e&&(Q.FCL_REGISTRY[n].kvs[e]=a)},get:function(e,a){return Q.FCL_REGISTRY[n].kvs[e]??a},delete:function(e){delete Q.FCL_REGISTRY[n].kvs[e]},update:function(e,a){null!=e&&(Q.FCL_REGISTRY[n].kvs[e]=a(Q.FCL_REGISTRY[n].kvs[e]))},keys:function(){return Object.keys(Q.FCL_REGISTRY[n].kvs)},all:function(){return Q.FCL_REGISTRY[n].kvs},where:function(e){return Object.keys(Q.FCL_REGISTRY[n].kvs).reduce(function(a,o){return e.test(o)?O(O({},a),{},q({},o,Q.FCL_REGISTRY[n].kvs[o])):a},{})},merge:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(e).forEach(function(a){return Q.FCL_REGISTRY[n].kvs[a]=e[a]})},fatalError:function(e){Q.FCL_REGISTRY[n].error=e;var a,o=bt(Q.FCL_REGISTRY[n].subs);try{for(o.s();!(a=o.n()).done;)Pt(a.value,Of)}catch(i){o.e(i)}finally{o.f()}}};return"object"===z(t)&&(t=Lf(t)),Tf(x(h.mark(function e(){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t(r);case 2:Bf(n);case 3:case"end":return a.stop()}},e)}))),n},Wt="config",vs="PUT_CONFIG",ys="GET_CONFIG",bs="GET_ALL_CONFIG",ws="UPDATE_CONFIG",xs="DELETE_CONFIG",ks="CLEAR_CONFIG",Es="WHERE_CONFIG",Hn="CONFIG/UPDATED",Is=function(t){return t},Ss=(q(Ht={},vs,function(t,n,r){var e=r.key,a=r.value;if(null==e)throw new Error("Missing 'key' for config/put.");t.put(e,a),t.broadcast(Hn,O({},t.all()))}),q(Ht,ys,function(t,n,r){var e=r.key,a=r.fallback;if(null==e)throw new Error("Missing 'key' for config/get");n.reply(t.get(e,a))}),q(Ht,bs,function(t,n){n.reply(O({},t.all()))}),q(Ht,ws,function(t,n,r){var e=r.key,a=r.fn;if(null==e)throw new Error("Missing 'key' for config/update");t.update(e,a||Is),t.broadcast(Hn,O({},t.all()))}),q(Ht,xs,function(t,n,r){var e=r.key;if(null==e)throw new Error("Missing 'key' for config/delete");t.delete(e),t.broadcast(Hn,O({},t.all()))}),q(Ht,ks,function(t,n){for(var r=0,e=Object.keys(t.all());r1?i[1]:void 0,(n=i.length>0&&void 0!==i[0]?i[0]:[]).length){c.next=4;break}return c.abrupt("return",r);case 4:return e=Fn(n),a=e[0],o=e.slice(1),c.next=7,oa(a);case 7:if(null!=(u=c.sent)){c.next=10;break}return c.abrupt("return",ua(o,r));case 10:return c.abrupt("return",u);case 11:case"end":return c.stop()}},t)})),sa.apply(this,arguments)}function Er(){return Pt(Wt,bs,null,{expectReply:!0,timeout:10})}function As(t){return Pt(Wt,ws,{key:t,fn:arguments.length>1&&void 0!==arguments[1]?arguments[1]:Is}),Et()}function Rs(t){return Pt(Wt,xs,{key:t}),Et()}function _s(t){return Pt(Wt,Es,{pattern:t},{expectReply:!0,timeout:10})}function Ts(t){return function(n,r,e){ea(Ss,Wt);var u,a="@EXIT",o=ea((u=x(h.mark(function i(c){var l,d;return h.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:c.send(n,ms);case 1:return g.next=4,c.receive();case 4:if(d=Q.FCL_REGISTRY[n].error,(l=g.sent).tag!==a){g.next=9;break}return c.send(n,ra),g.abrupt("return");case 9:if(!d){g.next=13;break}return e(null,d),c.send(n,ra),g.abrupt("return");case 13:e(l.data,null),g.next=1;break;case 16:case"end":return g.stop()}},i)})),function(i){return u.apply(this,arguments)}));return function(){return Pt(o,a)}}(Wt,0,t)}function Cs(t){return Pt(Wt,ks).then(Et(t))}function Et(t){return null!=t&&"object"===z(t)&&Object.keys(t).map(function(n){return aa(n,t[n])}),{put:aa,get:oa,all:Er,first:ua,update:As,delete:Rs,where:_s,subscribe:Ts,overload:Os}}ea(Ss,Wt),Et.put=aa,Et.get=oa,Et.all=Er,Et.first=ua,Et.update=As,Et.delete=Rs,Et.where=_s,Et.subscribe=Ts,Et.overload=Os;var Uf=function(t){return t};function Os(){var r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uf;return new Promise((r=x(h.mark(function e(a,o){var u,i;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,Er();case 2:return u=c.sent,c.prev=3,Et(t),c.t0=n,c.next=8,Er();case 8:return c.t1=c.sent,c.next=11,(0,c.t0)(c.t1);case 11:return i=c.sent,c.next=14,Cs(u);case 14:a(i),c.next=22;break;case 17:return c.prev=17,c.t2=c.catch(3),c.next=21,Cs(u);case 21:o(c.t2);case 22:case"end":return c.stop()}},e,null,[[3,17]])})),function(e,a){return r.apply(this,arguments)}))}var Rn=Object.freeze({debug:5,info:4,log:3,warn:2,error:1}),Ff=function(t){var r=t.message;return["\n %c".concat(t.title,"\n ============================\n\n ").concat(r,"\n\n ============================\n ").replace(/\n[^\S\r\n]+/g,"\n").trim(),,"font-weight:bold;font-family:monospace;"]},Ir=function(){var t=x(h.mark(function n(r){var e,a,o,u,i,c,l,d,g,v,m,b;return h.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return c=r.title,l=r.message,d=r.level,v=void 0!==(g=r.always)&&g,E.next=3,Et.get("logger.level",Rn.warn);case 3:if(m=E.sent,v||!(m8)&&H("Expected at least one digit, and at most 8 digits following the decimal of the [U]Fix64 value but found ".concat(n[1].length," digits. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers")),n[1]=n[1].padEnd(8,"0"),{type:"UFix64",value:t=n.join(".")}}if(ct(t))return Ns(),{type:"UFix64",value:t.toString()};H("Expected String for UFix64")},function(t){return t}),al=V("Fix64",function(t){if(et(t)){var n=t.split(".");return 2!==n.length&&H("Expected one decimal but found ".concat(n.length," in the [U]Fix64 value. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers")),(0==n[1].length||n[1].length>8)&&H("Expected at least one digit, and at most 8 digits following the decimal of the [U]Fix64 value but found ".concat(n[1].length," digits. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers")),n[1]=n[1].padEnd(8,"0"),{type:"Fix64",value:t=n.join(".")}}if(ct(t))return Ns(),{type:"Fix64",value:t.toString()};H("Expected String for Fix64")},function(t){return t}),ol=V("String",function(t){if(et(t))return{type:"String",value:t};H("Expected String for type String")},function(t){return t}),ul=V("Character",function(t){if(et(t))return{type:"Character",value:t};H("Expected Character for type Character")},function(t){return t}),sl=V("Bool",function(t){if("boolean"==typeof t)return{type:"Bool",value:t};H("Expected Boolean for type Bool")},function(t){return t}),Bs=V("Address",function(t){if(et(t))return{type:"Address",value:t};H("Expected Address for type Address")},function(t){return t}),il=V("Void",function(t){if(!t||Ps(t))return{type:"Void"};H("Expected Void for type Void")},function(t){return t}),cl=V("Reference",function(t){if(pn(t))return{type:"Reference",value:t};H("Expected Object for type Reference")},function(t){return t}),Ls=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return V("Array",function(n){return{type:"Array",value:ln(t)?t.map(function(r,e){return r.asArgument(n[e])}):n.map(function(r){return t.asArgument(r)})}},function(n){return n})},fl=V("Path",function(t){if(pn(t))return et(t.domain)||H("Expected a string for the Path domain but found ".concat(t.domain,". Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path")),"storage"!==t.domain&&"private"!==t.domain&&"public"!==t.domain&&H('Expected either "storage", "private" or "public" as the Path domain but found '.concat(t.domain,". Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path")),et(t.identifier)||H("Expected a string for the Path identifier but found ".concat(t.identifier,". Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path")),{type:"Path",value:{domain:t.domain,identifier:t.identifier}};H("Expected Object for type Path")},function(t){return t}),Us=Object.freeze({__proto__:null,Address:Bs,Array:Ls,Bool:sl,Character:ul,Dictionary:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return V("Dictionary",function(n){if(pn(n))return{type:"Dictionary",value:ln(t)?t.map(function(r,e){return{key:r.key.asArgument(n[e].key),value:r.value.asArgument(n[e].value)}}):ln(n)?n.map(function(r){return{key:t.key.asArgument(r.key),value:t.value.asArgument(r.value)}}):[{key:t.key.asArgument(n.key),value:t.value.asArgument(n.value)}]};H("Expected Object for type Dictionary")},function(n){return n})},Enum:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return V("Enum",function(r){if(pn(r))return{type:"Enum",value:{id:t,fields:ln(n)?n.map(function(e,a){return{name:r.fields[a].name,value:e.value.asArgument(r.fields[a].value)}}):r.fields.map(function(e){return{name:e.name,value:n.value.asArgument(e.value)}})}};H("Expected Object for type Enum")},function(r){return r})},Event:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return V("Event",function(r){if(pn(r))return{type:"Event",value:{id:t,fields:ln(n)?n.map(function(e,a){return{name:r.fields[a].name,value:e.value.asArgument(r.fields[a].value)}}):r.fields.map(function(e){return{name:e.name,value:n.value.asArgument(e.value)}})}};H("Expected Object for type Event")},function(r){return r})},Fix64:al,Identity:jf,Int:Gf,Int128:Xf,Int16:qf,Int256:$f,Int32:Hf,Int64:Vf,Int8:zf,Optional:function(t){return V("Optional",function(n){return{type:"Optional",value:Ps(n)?null:t.asArgument(n)}},function(n){return n})},Path:fl,Reference:cl,Resource:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return V("Resource",function(r){if(pn(r))return{type:"Resource",value:{id:t,fields:ln(n)?n.map(function(e,a){return{name:r.fields[a].name,value:e.value.asArgument(r.fields[a].value)}}):r.fields.map(function(e){return{name:e.name,value:n.value.asArgument(e.value)}})}};H("Expected Object for type Resource")},function(r){return r})},String:ol,Struct:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return V("Struct",function(r){if(pn(r))return{type:"Struct",value:{id:t,fields:ln(n)?n.map(function(e,a){return{name:r.fields[a].name,value:e.value.asArgument(r.fields[a].value)}}):r.fields.map(function(e){return{name:e.name,value:n.value.asArgument(e.value)}})}};H("Expected Object for type Struct")},function(r){return r})},UFix64:el,UInt:Df,UInt128:Jf,UInt16:Yf,UInt256:Zf,UInt32:Kf,UInt64:Wf,UInt8:Mf,Void:il,Word16:tl,Word32:nl,Word64:rl,Word8:Qf,_Array:Ls});function Fs(t){return gs(t)?t($e,Us):[]}function js(t){return Ds.apply(this,arguments)}function Ds(){return(Ds=x(h.mark(function t(n){var r,e;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return C(void 0!==(r=n.url),"retrieve({ url }) -- url must be defined"),o.prev=2,o.next=5,_o(r);case 5:e=o.sent,o.next=11;break;case 8:throw o.prev=8,o.t0=o.catch(2),new Error("httpDocumentResolver Error: Failed to retrieve document.");case 11:if(!e.ok){o.next=17;break}return o.next=14,e.json();case 14:o.t1=o.sent,o.next=18;break;case 17:o.t1=null;case 18:return o.abrupt("return",o.t1);case 20:case"end":return o.stop()}},t,null,[[2,8]])}))).apply(this,arguments)}var Gs=new Map([["http",js],["https",js]]);function ll(t){return Ms.apply(this,arguments)}function Ms(){return(Ms=x(h.mark(function t(n){var r,e,a,o,u;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return C(void 0!==(r=n.url),"retrieve({ url }) -- url must be defined"),C("string"==typeof r,"retrieve({ url }) -- url must be a string"),c.next=5,j().where(/^document\.resolver\./);case 5:return e=c.sent,Object.keys(e).map(function(l){var d=e[l],g=l.replace(/^document\.resolver\./,"");Gs.set(g,d)}),C(a=/^(.*):\/\/([A-Za-z0-9\-\.]+)(:[0-9]+)?(.*)$/.exec(r),"Failed to parse URL"),o=a[1],C(a,"Failed to parse URL protocol"),C(u=Gs.get(o),"No resolver found for protcol=".concat(o)),c.next=15,u({url:r});case 15:return c.abrupt("return",c.sent);case 17:case"end":return c.stop()}},t)}))).apply(this,arguments)}function Wn(t){if(null==t)return null;if("1.0.0"===t.f_version)return t;throw new Error("normalizeInteractionTemplate Error: Invalid InteractionTemplate")}function zs(t){var n,r,e=t.network,a=t.template;if(G(null!=e,"deriveCadenceByNetwork({ network }) -- network must be defined"),G("string"==typeof e,"deriveCadenceByNetwork({ network }) -- network must be a string"),G(null!=a,"generateDependencyPin({ template }) -- template must be defined"),G("object"===z(a),"generateDependencyPin({ template }) -- template must be an object"),G("InteractionTemplate"===a.f_type,"generateDependencyPin({ template }) -- template must be an InteractionTemplate"),"1.0.0"===(a=Wn(a)).f_version)return Object.keys(null===(n=a)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.dependencies).map(function(o){var u,i,c,l=Object.values(null===(u=a)||void 0===u||null===(i=u.data)||void 0===i||null===(c=i.dependencies)||void 0===c?void 0:c[o]);G(l,"deriveCadenceByNetwork -- Could not find contracts for dependency placeholder: ".concat(o)),G(0===l.length,"deriveCadenceByNetwork -- Could not find contracts for dependency placeholder: ".concat(o));var d=l[0],g=null==d?void 0:d[e];return G(g,"deriveCadenceByNetwork -- Could not find ".concat(e," network information for dependency: ").concat(o)),[o,g.address]}).reduce(function(o,u){var i=Lt(u,2),l=i[1],d=new RegExp("(\\b"+i[0]+"\\b)","g");return o.replace(d,l)},a.data.cadence);throw new Error("deriveCadenceByNetwork Error: Unsupported template version")}function pl(t){return ia.apply(this,arguments)}function ia(){return ia=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d,g,v,b;return h.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return e=n.template,E.next=3,j.get("flow.network");case 3:C(a=E.sent,"FCL configureDependencies Error: Missing configuration value for 'flow.network'"),o={},E.t0=e.f_version,E.next="1.0.0"===E.t0?9:12;break;case 9:for(u=Object.keys(null==e||null===(r=e.data)||void 0===r?void 0:r.dependencies),i=0,c=u;i0,"FCL configureDependencies Error: No contracts found in template for placeholder=".concat(d)),C(b=g[v[0]][a],"FCL configureDependencies Error: No dependency information for placeholder=".concat(d," contract=").concat(v[0]," network=").concat(a)),C(null==b?void 0:b.address,"FCL configureDependencies Error: No address information for placeholder=".concat(d," contract=").concat(v[0]," network=").concat(a)),o[d]=at(null==b?void 0:b.address);return E.abrupt("return",o);case 12:throw new Error("FCL configureDependencies Error: Unsupported template version");case 13:case"end":return E.stop()}},t)})),ia.apply(this,arguments)}function Ys(t){return qs.apply(this,arguments)}function qs(){return(qs=x(h.mark(function t(n){var r;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!An(null==n?void 0:n.template)){a.next=4;break}return a.next=3,ll({url:null==n?void 0:n.template});case 3:n.template=a.sent;case 4:if(r={},null==n||!n.template){a.next=10;break}return n.template=Wn(null==n?void 0:n.template),a.next=9,pl({template:n.template});case 9:r=a.sent;case 10:if(a.t0=n.cadence,a.t0){a.next=19;break}return a.t1=zs,a.t2=n.template,a.next=16,j().get("flow.network");case 16:a.t3=a.sent,a.t4={template:a.t2,network:a.t3},a.t0=(0,a.t1)(a.t4);case 19:return n.cadence=a.t0,n.dependencies=r,a.abrupt("return",n);case 23:case"end":return a.stop()}},t)}))).apply(this,arguments)}function Ks(t,n){return ca.apply(this,arguments)}function ca(){return ca=x(h.mark(function t(n,r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(C(Xt(r),"".concat(n,"(opts) -- opts is required")),C(Rf(r),"".concat(n,"(opts) -- opts must be an object")),C(!(r.cadence&&r.template),"".concat(n,"({ template, cadence }) -- cannot pass both cadence and template")),C(Xt(r.cadence||(null==r?void 0:r.template)),"".concat(n,"({ cadence }) -- cadence is required")),C(An(r.cadence)||(null==r?void 0:r.template),"".concat(n,"({ cadence }) -- cadence must be a string")),e.t0=C,e.t1=r.cadence,e.t1){e.next=11;break}return e.next=10,j().get("flow.network");case 10:e.t1=e.sent;case 11:return e.t2=e.t1,e.t3="".concat(n,'(opts) -- Required value for "flow.network" not defined in config. See: ',"https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/exec/query.md#configuration"),(0,e.t0)(e.t2,e.t3),e.t4=C,e.next=17,j().get("accessNode.api");case 17:e.t5=e.sent,e.t6="".concat(n,'(opts) -- Required value for "accessNode.api" not defined in config. See: ',"https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/exec/query.md#configuration"),(0,e.t4)(e.t5,e.t6);case 20:case"end":return e.stop()}},t)})),ca.apply(this,arguments)}function dl(t){return Hs.apply(this,arguments)}function Hs(){return(Hs=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Ks("mutate",n));case 1:case"end":return r.stop()}},t)}))).apply(this,arguments)}function hl(t){return Ws.apply(this,arguments)}function Ws(){return(Ws=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Ks("query",n));case 1:case"end":return r.stop()}},t)}))).apply(this,arguments)}function Sr(){return fa.apply(this,arguments)}function fa(){return fa=x(h.mark(function t(){var n,r=arguments;return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>0&&void 0!==r[0]?r[0]:{},e.next=3,hl(n);case 3:return e.next=5,Ys(n);case 5:return n=e.sent,e.abrupt("return",j().overload(n.dependencies||{},x(h.mark(function a(){return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Ot([ls(n.cadence),Ze(Fs(n.args||[])),n.limit&&"number"==typeof n.limit&&Xe(n.limit)]).then(Sn));case 1:case"end":return o.stop()}},a)}))));case 7:case"end":return e.stop()}},t)})),fa.apply(this,arguments)}function gl(t,n){return la.apply(this,arguments)}function la(){return la=x(h.mark(function t(n,r){var e,a,o,u,i;return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(null!=n&&null!=r){l.next=2;break}return l.abrupt("return",[]);case 2:return(e=new URL(n)).searchParams.append("code",r),l.next=6,fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}}).then(function(d){return d.json()});case 6:if(a=l.sent,!Array.isArray(a)){l.next=9;break}return l.abrupt("return",a);case 9:if(o=[],Array.isArray(a.authorizations)){u=bt(a.authorizations);try{for(u.s();!(i=u.n()).done;)o.push(O({type:"authz",keyId:a.keyId},i.value))}catch(d){u.e(d)}finally{u.f()}}return null!=a.provider&&o.push(O({type:"authn",id:"wallet-provider#authn"},a.provider)),l.abrupt("return",o);case 13:case"end":return l.stop()}},t)})),la.apply(this,arguments)}function ml(){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return[].concat(K(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),K(n))}var _n={f_type:"Service",f_vsn:"1.0.0"},Vs={f_type:"Identity",f_vsn:"1.0.0"},vl={f_type:"USER",f_vsn:"1.0.0"},yl={f_type:"PollingResponse",f_vsn:"1.0.0"},pa={f_type:"CompositeSignature",f_vsn:"1.0.0"};function Js(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({old:t},_n),{},{type:"frame",endpoint:t.endpoint,params:t.params||{},data:t.data||{}})}function Xs(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},_n),{},{type:"back-channel-rpc",endpoint:t.endpoint,method:t.method,params:t.params||{},data:t.data||{}})}function Zs(t){return null==t?null:(null==t.method&&(t=O(O({},t),{},{type:"local-view",method:"VIEW/IFRAME"})),"1.0.0"===t.f_vsn?t:O(O({},_n),{},{type:t.type||"local-view",method:t.method,endpoint:t.endpoint,data:t.data||{},params:t.params||{}}))}var bl={"back-channel-rpc":Xs,"pre-authz":function(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},_n),{},{type:t.type,uid:t.id,endpoint:t.endpoint,method:t.method,identity:O(O({},Vs),{},{address:at(t.addr),keyId:t.keyId}),params:t.params,data:t.data})},authz:function(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},_n),{},{type:t.type,uid:t.id,endpoint:t.endpoint,method:t.method,identity:O(O({},Vs),{},{address:at(t.addr),keyId:t.keyId}),params:t.params,data:t.data})},authn:function(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},_n),{},{type:t.type,uid:t.id,endpoint:t.authn,id:t.pid,provider:{address:at(t.addr),name:t.name,icon:t.icon}})},frame:Js,"open-id":function(t){return null==t?null:"1.0.0"===t.f_vsn?t:null},"user-signature":function(t){if(null==t)return null;if("1.0.0"===t.f_vsn)return t;throw new Error("Invalid user-signature service")},"local-view":Zs,"account-proof":function(t){if(null==t)return null;if("1.0.0"===t.f_vsn)return t;throw new Error("FCL Normalizer Error: Invalid account-proof service")},"authn-refresh":function(t){if(null==t)return null;if("1.0.0"===t.f_vsn)return t;throw new Error("Invalid authn-refresh service")}};function wl(t,n){try{return bl[t.type](t,n)}catch(r){return console.error("Unrecognized FCL Service Type [".concat(t.type,"]"),t,r),t}}function xl(t){return fn([t.provider.address||t.provider.name||"UNSPECIFIED",t.id]).toString("hex")}function kl(t){return t.addr=t.addr?at(t.addr):null,t.paddr=t.paddr?at(t.paddr):null,t}function El(t,n){return n.find(function(r){return r.type===t})}function $s(t){return da.apply(this,arguments)}function da(){return da=x(h.mark(function t(n){var r,e;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return n=kl(n),a.t0=ml,a.t1=n.services||[],a.next=5,gl(n.hks,n.code);case 5:return a.t2=a.sent,r=(0,a.t0)(a.t1,a.t2).map(function(o){return wl(o,n)}),e=El("authn",r),a.abrupt("return",O(O({},vl),{},{addr:at(n.addr),cid:xl(e),loggedIn:!0,services:r,expiresAt:n.expires}));case 9:case"end":return a.stop()}},t)})),da.apply(this,arguments)}function Ar(){var n=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find(function(r){return r.type===n})}function Vn(t){var n=new URL(t.endpoint);if(n.searchParams.append("l6n",window.location.origin),null!=t.params)for(var r=0,e=Object.entries(t.params||{});r1&&void 0!==arguments[1]?arguments[1]:{},r=n.method||"POST",e="GET"===r?void 0:JSON.stringify(n.data||t.data||{});return fetch(Vn(t),{method:r,headers:O(O(O({},t.headers||{}),n.headers||{}),{},{"Content-Type":"application/json"}),body:e}).then(function(a){return a.json()})}function Zt(t){var n,r;return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},yl),{},{status:null!==(n=t.status)&&void 0!==n?n:"APPROVED",reason:null!==(r=t.reason)&&void 0!==r?r:null,data:t.compositeSignature||t.data||O({},t)||{},updates:Xs(t.authorizationUpdates),local:Js((t.local||[])[0])})}var ti={"HTTP/GET":"GET","HTTP/POST":"POST"},Il=function(t){return C(ti[t.method],"Invalid Service Method for type back-channel-rpc",{service:t}),ti[t.method]};function ni(t){return ha.apply(this,arguments)}function ha(){return ha=x(h.mark(function t(n){var r,e,a=arguments;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r=a.length>1&&void 0!==a[1]?a[1]:function(){return!0},C(n,"Missing Polling Service",{service:n}),r()){o.next=4;break}throw new Error("Externally Halted");case 4:return o.next=6,Qs(n,{method:Il(n)}).then(Zt);case 6:o.t0=(e=o.sent).status,o.next="APPROVED"===o.t0?10:"DECLINED"===o.t0?11:12;break;case 10:return o.abrupt("return",e.data);case 11:throw new Error("Declined: ".concat(e.reason||"No reason supplied."));case 12:return o.next=14,new Promise(function(u){return setTimeout(u,500)});case 14:return o.abrupt("return",ni(e.updates,r));case 15:case"end":return o.stop()}},t)})),ha.apply(this,arguments)}var Rr="FCL_IFRAME";function ri(t){C(!document.getElementById(Rr),"Attempt at triggering multiple Frames",{src:t});var n=document.createElement("iframe");return n.src=t,n.id=Rr,n.allow="usb *; hid *",n.frameBorder="0",n.style.cssText="\n position:fixed;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n height: 100%;\n width: 100vw;\n display:block;\n background:rgba(0,0,0,0.25);\n z-index: 2147483647;\n box-sizing: border-box;\n color-scheme: light;\n",document.body.append(n),[n.contentWindow,function(){document.getElementById(Rr)&&document.getElementById(Rr).remove()}]}var Dt=null,ei=null;function ai(t){var n;return null==Dt||null!==(n=Dt)&&void 0!==n&&n.closed?Dt=function(r,e,a,o,u){var i=a.top.outerHeight/2+a.top.screenY-385,c=a.top.outerWidth/2+a.top.screenX-320,l=a.open(r,"FCL_POP","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=".concat(640,", height=").concat(770,", top=").concat(i,", left=").concat(c));if(!l)throw new Error("Popup failed to open (was it blocked by a popup blocker?)");return l}(t,0,window):(ei!==t&&Dt.location.replace(t),Dt.focus()),ei=t,[Dt,function(){Dt&&!Dt.closed&&Dt.close(),Dt=null}]}var Gt=null,oi=null;function ui(t){var n;if(null==Gt||null!==(n=Gt)&&void 0!==n&&n.closed){if(!(Gt=window.open(t,"_blank")))throw new Error("Tab failed to open (was it blocked by the browser?)")}else oi!==t&&Gt.location.replace(t),Gt.focus();return oi=t,[Gt,function(){Gt&&!Gt.closed&&Gt.close(),Gt=null}]}var Sl={"VIEW/IFRAME":ri,"VIEW/POP":ai,"VIEW/TAB":ui};function Al(t){return ga.apply(this,arguments)}function ga(){return ga=x(h.mark(function t(n){var r,e=arguments;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=e.length>1&&void 0!==e[1]?e[1]:{},a.prev=1,a.abrupt("return",Sl[n.method](Vn(n),r));case 5:throw a.prev=5,a.t0=a.catch(1),console.error("execLocal({service, opts = {}})",a.t0,{service:n,opts:r}),a.t0;case 9:case"end":return a.stop()}},t,null,[[1,5]])})),ga.apply(this,arguments)}function si(t){return ma.apply(this,arguments)}function ma(){return ma=x(h.mark(function t(n){var r,e,a,o,u,c,l,d;return h.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return r=n.service,e=n.body,a=n.config,g.next=3,Qs(r,{data:O({fclVersion:Ut,service:{params:r.params,data:r.data,type:r.type},config:a},e)}).then(Zt);case 3:if("APPROVED"!==(o=g.sent).status){g.next=8;break}return g.abrupt("return",o.data);case 8:if("DECLINED"!==o.status){g.next=12;break}throw new Error("Declined: ".concat(o.reason||"No reason supplied."));case 12:if("REDIRECT"!==o.status){g.next=16;break}return g.abrupt("return",o);case 16:if("PENDING"!==o.status){g.next=28;break}return u=!0,g.next=20,Al(Zs(o.local));case 20:return c=Lt(g.sent,2),l=c[1],d=function(){try{l(),u=!1}catch(v){console.error("Frame Close Error",v)}},g.abrupt("return",ni(o.updates,function(){return u}).then(function(v){return d(),v}).catch(function(v){throw console.error(v),d(),v}));case 28:throw console.error("Auto Decline: Invalid Response",{service:r,resp:o}),new Error("Auto Decline: Invalid Response");case 30:case"end":return g.stop()}},t)})),ma.apply(this,arguments)}var ii="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",Rl=ii.length;function va(){for(var t="",n=32;n--;)t+=ii[Math.random()*Rl|0];return t}var wa,Jn,ci,xa,_r="FCL:VIEW:CLOSE",ya="FCL:VIEW:READY",ba="FCL:VIEW:RESPONSE",ft=function(t){return"string"==typeof t&&t.toLowerCase()},_l=new Set(["monetizationstart","monetizationpending","monetizationprogress","monetizationstop"]),dn=function(t,n){return console.warn("DEPRECATION NOTICE","Received ".concat(t,", please use ").concat(n," for this and future versions of FCL"))},Tr=function(t){var n=t.close,r=t.send,e=t.onReady,a=t.onResponse,o=t.onMessage;return function(u){try{if("object"!==z(u.data)||_l.has(u.data.type))return;ft(u.data.type)===ft(_r)&&n(),ft(u.data.type)===ft(ya)&&e(u,{send:r,close:n}),ft(u.data.type)===ft(ba)&&a(u,{send:r,close:n}),o(u,{send:r,close:n}),ft(u.data.type)===ft("FCL:FRAME:READY")&&(dn(u.data.type,ya),e(u,{send:r,close:n})),ft(u.data.type)===ft("FCL:FRAME:RESPONSE")&&(dn(u.data.type,ba),a(u,{send:r,close:n})),ft(u.data.type)===ft("FCL:FRAME:CLOSE")&&(dn(u.data.type,_r),n()),ft(u.data.type)===ft("FCL::CHALLENGE::RESPONSE")&&(dn(u.data.type,ba),a(u,{send:r,close:n})),ft(u.data.type)===ft("FCL::AUTHZ_READY")&&(dn(u.data.type,ya),e(u,{send:r,close:n})),ft(u.data.type)===ft("FCL::CHALLENGE::CANCEL")&&(dn(u.data.type,_r),n()),ft(u.data.type)===ft("FCL::CANCEL")&&(dn(u.data.type,_r),n())}catch(i){console.error("Frame Callback Error",i),n()}}},Tn=function(){},Cn=function(){},On=function(){},Pn=function(){},fi={"HTTP/RPC":si,"HTTP/POST":si,"IFRAME/RPC":function(t){var n=t.service,r=t.body,e=t.config,a=t.opts;return new Promise(function(o,u){var i=va(),c=a.includeOlderJsonRpcCall;!function(l){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==l)return{send:Tn,close:Tn};var g=d.onClose||Tn,E=Tr({close:R,send:L,onReady:d.onReady||Tn,onResponse:d.onResponse||Tn,onMessage:d.onMessage||Tn});window.addEventListener("message",E);var S=Lt(ri(Vn(l)),2),N=S[0],T=S[1];return{send:L,close:R};function R(){try{window.removeEventListener("message",E),T(),g()}catch(I){console.error("Frame Close Error",I)}}function L(I){try{N.postMessage(JSON.parse(JSON.stringify(I||{})),"*")}catch(W){console.error("Frame Send Error",I,W)}}}(n,{onReady:function(l,d){return x(h.mark(function g(){var v;return h.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:v=d.send,m.prev=1,v({type:"FCL:VIEW:READY:RESPONSE",fclVersion:Ut,body:r,service:{params:n.params,data:n.data,type:n.type},config:e}),v({fclVersion:Ut,type:"FCL:FRAME:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),c&&v({jsonrpc:"2.0",id:i,method:"fcl:sign",params:[r,n.params],deprecated:{message:"jsonrpc is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),m.next=10;break;case 7:throw m.prev=7,m.t0=m.catch(1),m.t0;case 10:case"end":return m.stop()}},g,null,[[1,7]])}))()},onResponse:function(l,d){var g=d.close;try{if("object"!==z(l.data))return;var v=Zt(l.data);switch(v.status){case"APPROVED":o(v.data),g();break;case"DECLINED":u("Declined: ".concat(v.reason||"No reason supplied")),g();break;case"REDIRECT":o(v),g();break;default:u("Declined: No reason supplied"),g()}}catch(m){throw console.error("execIframeRPC onResponse error",m),m}},onMessage:function(l,d){var g=d.close;try{if("object"!==z(l.data)||"2.0"!==l.data.jsonrpc||l.data.id!==i)return;var v=Zt(l.data.result);switch(v.status){case"APPROVED":o(v.data),g();break;case"DECLINED":u("Declined: ".concat(v.reason||"No reason supplied")),g();break;case"REDIRECT":o(v),g();break;default:u("Declined: No reason supplied"),g()}}catch(m){throw console.error("execIframeRPC onMessage error",m),m}},onClose:function(){u("Declined: Externally Halted")}})})},"POP/RPC":function(t){var n=t.service,r=t.body,e=t.config,a=t.opts;return new Promise(function(o,u){var i=va(),c=a.redir,l=a.includeOlderJsonRpcCall;!function(d){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==d)return{send:Cn,close:Cn};var v=g.onClose||Cn,S=Tr({close:I,send:W,onReady:g.onReady||Cn,onResponse:g.onResponse||Cn,onMessage:g.onMessage||Cn});window.addEventListener("message",S);var N=Lt(ai(Vn(d)),2),T=N[0],R=N[1],L=setInterval(function(){T&&T.closed&&I()},500);return{send:W,close:I};function I(){try{window.removeEventListener("message",S),clearInterval(L),R(),v()}catch(lt){console.error("Popup Close Error",lt)}}function W(lt){try{T.postMessage(JSON.parse(JSON.stringify(lt||{})),"*")}catch(It){console.error("Popup Send Error",lt,It)}}}(n,{onReady:function(d,g){return x(h.mark(function v(){var m;return h.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:m=g.send,b.prev=1,m({fclVersion:Ut,type:"FCL:VIEW:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e}),m({fclVersion:Ut,type:"FCL:FRAME:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),l&&m({jsonrpc:"2.0",id:i,method:"fcl:sign",params:[r,n.params]}),b.next=10;break;case 7:throw b.prev=7,b.t0=b.catch(1),b.t0;case 10:case"end":return b.stop()}},v,null,[[1,7]])}))()},onResponse:function(d,g){var v=g.close;try{if("object"!==z(d.data))return;var m=Zt(d.data);switch(m.status){case"APPROVED":o(m.data),!c&&v();break;case"DECLINED":u("Declined: ".concat(m.reason||"No reason supplied")),v();break;case"REDIRECT":o(m),v();break;default:u("Declined: No reason supplied"),v()}}catch(b){throw console.error("execPopRPC onResponse error",b),b}},onMessage:function(d,g){var v=g.close;try{if("object"!==z(d.data)||"2.0"!==d.data.jsonrpc||d.data.id!==i)return;var m=Zt(d.data.result);switch(m.status){case"APPROVED":o(m.data),!c&&v();break;case"DECLINED":u("Declined: ".concat(m.reason||"No reason supplied")),v();break;case"REDIRECT":o(m),v();break;default:u("Declined: No reason supplied"),v()}}catch(b){throw console.error("execPopRPC onMessage error",b),b}},onClose:function(){u("Declined: Externally Halted")}})})},"TAB/RPC":function(t){var n=t.service,r=t.body,e=t.config,a=t.opts;return new Promise(function(o,u){var i=va(),c=a.redir,l=a.includeOlderJsonRpcCall;!function(d){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==d)return{send:On,close:On};var v=g.onClose||On,S=Tr({close:I,send:W,onReady:g.onReady||On,onResponse:g.onResponse||On,onMessage:g.onMessage||On});window.addEventListener("message",S);var N=Lt(ui(Vn(d)),2),T=N[0],R=N[1],L=setInterval(function(){T&&T.closed&&I()},500);return{send:W,close:I};function I(){try{window.removeEventListener("message",S),clearInterval(L),R(),v()}catch(lt){console.error("Tab Close Error",lt)}}function W(lt){try{T.postMessage(JSON.parse(JSON.stringify(lt||{})),"*")}catch(It){console.error("Tab Send Error",lt,It)}}}(n,{onReady:function(d,g){return x(h.mark(function v(){var m;return h.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:m=g.send,b.prev=1,m({fclVersion:Ut,type:"FCL:VIEW:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e}),m({fclVersion:Ut,type:"FCL:FRAME:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),l&&m({jsonrpc:"2.0",id:i,method:"fcl:sign",params:[r,n.params]}),b.next=10;break;case 7:throw b.prev=7,b.t0=b.catch(1),b.t0;case 10:case"end":return b.stop()}},v,null,[[1,7]])}))()},onResponse:function(d,g){var v=g.close;try{if("object"!==z(d.data))return;var m=Zt(d.data);switch(m.status){case"APPROVED":o(m.data),!c&&v();break;case"DECLINED":u("Declined: ".concat(m.reason||"No reason supplied")),v();break;case"REDIRECT":o(m),v();break;default:u("Declined: No reason supplied"),v()}}catch(b){throw console.error("execPopRPC onResponse error",b),b}},onMessage:function(d,g){var v=g.close;try{if("object"!==z(d.data)||"2.0"!==d.data.jsonrpc||d.data.id!==i)return;var m=Zt(d.data.result);switch(m.status){case"APPROVED":o(m.data),!c&&v();break;case"DECLINED":u("Declined: ".concat(m.reason||"No reason supplied")),v();break;case"REDIRECT":o(m),v();break;default:u("Declined: No reason supplied"),v()}}catch(b){throw console.error("execPopRPC onMessage error",b),b}},onClose:function(){u("Declined: Externally Halted")}})})},"EXT/RPC":function(t){var n=t.service,r=t.body,e=t.config;return new Promise(function(a,o){!function(u){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==u)return{send:Pn,close:Pn};var c=i.onClose||Pn,v=Tr({close:m,send:b,onReady:i.onReady||Pn,onResponse:i.onResponse||Pn,onMessage:i.onMessage||Pn});return window.addEventListener("message",v),b({service:u}),{send:b,close:m};function m(){try{window.removeEventListener("message",v),c()}catch(E){console.error("Ext Close Error",E)}}function b(E){try{window&&window.postMessage(JSON.parse(JSON.stringify(E||{})),"*")}catch(S){console.error("Ext Send Error",E,S)}}}(n,{onReady:function(u,i){return x(h.mark(function c(){var l;return h.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:l=i.send,d.prev=1,l({fclVersion:Ut,type:"FCL:VIEW:READY:RESPONSE",body:r,service:{params:n.params,data:n.data,type:n.type},config:e}),d.next=8;break;case 5:throw d.prev=5,d.t0=d.catch(1),d.t0;case 8:case"end":return d.stop()}},c,null,[[1,5]])}))()},onResponse:function(u,i){var c=i.close;try{if("object"!==z(u.data))return;var l=Zt(u.data);switch(l.status){case"APPROVED":a(l.data),c();break;case"DECLINED":o("Declined: ".concat(l.reason||"No reason supplied")),c();break;case"REDIRECT":a(l),c();break;default:o("Declined: No reason supplied"),c()}}catch(d){throw console.error("execExtRPC onResponse error",d),d}},onClose:function(){o("Declined: Externally Halted")}})})}},Tl=["ServicePlugin"],Cl=["discovery-service"],Xn=(wa=new Set,Jn=new Map(Object.entries(fi)),ci=function(t){return wa=new Set(K(t))},Object.freeze({add:function(t){if(C(Cl.includes(t.type),"Service Plugin type ".concat(t.type," is not supported")),"discovery-service"===t.type){var n=function(a){var o=a.services,u=a.serviceStrategy;C(Array.isArray(o)&&o.length,"Array of Discovery Services is required");var i,c=bt(o);try{for(c.s();!(i=c.n()).done;){var l=i.value;C(Xt(l.f_type)&&"Service"===l.f_type,"Service is required"),C(Xt(l.type)&&"authn"===l.type,"Service must be type authn. Received ".concat(l.type)),C(l.method in fi||u.method===l.method,"Service method ".concat(l.method," is not supported"))}}catch(d){c.e(d)}finally{c.f()}return C(Xt(u),"Service strategy is required"),C(Xt(u.method)&&An(u.method),"Service strategy method is required"),C(Xt(u.exec)&&gs(u.exec),"Service strategy exec function is required"),{discoveryServices:o,serviceStrategy:u}}(t),e=n.serviceStrategy;ci(n.discoveryServices),Jn.has(e.method)?wt({title:"Add Service Plugin",message:"Service strategy for ".concat(e.method," already exists"),level:St.warn}):Jn.set(e.method,e.exec)}},getServices:function(){return K(wa)},getStrategy:function(t){return Jn.get(t)},getStrategies:function(){return K(Jn.keys())}})),Ol=(xa=new Map,Object.freeze({add:function(t){var n,r=function(o){var u;C(o,"No plugins supplied");var i,c=bt(u=Array.isArray(o)?K(o):[o]);try{for(c.s();!(i=c.n()).done;){var l=i.value;C(Xt(l.name),"Plugin name is required"),C(Xt(l.f_type),"Plugin f_type is required"),C(Tl.includes(l.f_type),"Plugin type ".concat(l.f_type," is not supported"))}}catch(d){c.e(d)}finally{c.f()}return u}(t),e=bt(r);try{for(e.s();!(n=e.n()).done;){var a=n.value;xa.set(a.name,a),"ServicePlugin"===a.f_type&&Xn.add(a)}}catch(o){e.e(o)}finally{e.f()}},getPlugins:function(){return xa}})),Pl=function(){var t=x(h.mark(function n(r){var e,a,o,u,i;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a=r.body,o=r.config,u=r.opts,i=Xn.getStrategy((e=r.service).method),c.abrupt("return",i({service:e,body:a,config:o,opts:u}));case 3:case"end":return c.stop()}},n)}));return function(n){return t.apply(this,arguments)}}();function hn(t){return ka.apply(this,arguments)}function ka(){return ka=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d,g,v,m;return h.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return l=void 0===(c=n.config)?{}:c,g=void 0===(d=n.opts)?{}:d,(i=void 0===(u=n.msg)?{}:u).data=(o=n.service).data,b.next=4,xo(/^service\./);case 4:return b.t0=b.sent,b.next=7,xo(/^app\.detail\./);case 7:return b.t1=b.sent,b.t2=O(O({},l.client),{},{fclVersion:Ut,fclLibrary:"https://github.com/onflow/fcl-js",hostname:null!==(r=null===(e=window)||void 0===e||null===(a=e.location)||void 0===a?void 0:a.hostname)&&void 0!==r?r:null}),v={services:b.t0,app:b.t1,client:b.t2},b.prev=10,b.next=13,Pl({service:o,body:i,config:v,opts:g});case 13:if("REDIRECT"!==(m=b.sent).status){b.next=21;break}return C(o.type===m.data.type,"Cannot shift recursive service type in execService"),b.next=18,hn({service:m.data,msg:i,config:v,opts:g});case 18:return b.abrupt("return",b.sent);case 21:return b.abrupt("return",m);case 22:b.next=28;break;case 24:throw b.prev=24,b.t3=b.catch(10),wt({title:"Error on execService ".concat(null==o?void 0:o.type),message:b.t3,level:St.error}),b.t3;case 28:case"end":return b.stop()}},t,null,[[10,24]])})),ka.apply(this,arguments)}function Ea(t){return null==t?null:"1.0.0"===t.f_vsn?t:O(O({},pa),{},{addr:Z(t.addr||t.address),signature:t.signature||t.sig,keyId:t.keyId})}var Nn,li=function(){var t=x(h.mark(function n(){var r,e;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e=(null===(r=window)||void 0===r?void 0:r.fcl_extensions)||[],a.abrupt("return",[].concat(K(e),K(Xn.getServices())));case 2:case"end":return a.stop()}},n)}));return function(){return t.apply(this,arguments)}}();function Nl(t){return pi.apply(this,arguments)}function pi(){return(pi=x(h.mark(function t(n){var r,e,a,o,u;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,j.get("discovery.authn.include",[]);case 2:return e=i.sent,i.next=5,j.first(["discovery.wallet.method","discovery.wallet.method.default"]);case 5:if(a=i.sent,o=null!=n&&n.method?n.method:a,null===(r=null==n?void 0:n.endpoint)||void 0===r){i.next=11;break}i.t0=r,i.next=14;break;case 11:return i.next=13,j.first(["discovery.wallet","challenge.handshake"]);case 13:i.t0=i.sent;case 14:return C(u=i.t0,'\n If no service is passed to "authenticate," then "discovery.wallet" must be defined in fcl config.\n See: "https://docs.onflow.org/fcl/reference/api/#setting-configuration-values"\n '),i.abrupt("return",O(O({},n),{},{type:"authn",endpoint:u,method:o,discoveryAuthnInclude:e}));case 17:case"end":return i.stop()}},t)}))).apply(this,arguments)}function Bl(t){return Ia.apply(this,arguments)}function Ia(){return Ia=x(h.mark(function t(n){var r,e,a,o,u,i;return h.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a=n.types,c.next=3,j.get("discovery.authn.endpoint");case 3:return o=c.sent,C(Boolean(o),'"discovery.authn.endpoint" in config must be defined.'),c.next=7,j.get("discovery.authn.include",[]);case 7:return u=c.sent,i=new URL(o),c.t0=fetch,c.t1=i,c.t2={"Content-Type":"application/json"},c.t3=JSON,c.t4=a,c.t5=Ut,c.t6=u,c.next=18,li();case 18:return c.t7=c.sent,c.t8=Xn.getStrategies(),c.t9=null===(r=window)||void 0===r||null===(e=r.navigator)||void 0===e?void 0:e.userAgent,c.t10={type:c.t4,fclVersion:c.t5,include:c.t6,clientServices:c.t7,supportedStrategies:c.t8,userAgent:c.t9},c.t11=c.t3.stringify.call(c.t3,c.t10),c.t12={method:"POST",headers:c.t2,body:c.t11},c.abrupt("return",(0,c.t0)(c.t1,c.t12).then(function(l){return l.json()}));case 25:case"end":return c.stop()}},t)})),Ia.apply(this,arguments)}var di,hi,gn,Zn="authn",gi="UPDATED",mi="UPDATE_RESULTS",Sa=function(){var t=x(h.mark(function n(){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Bl({types:[Zn]});case 3:dt(Zn,mi,{results:e.sent}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),wt({title:"".concat(e.t0.name," Error fetching Discovery API services."),message:e.t0.message,level:St.error});case 10:case"end":return e.stop()}},n,null,[[0,7]])}));return function(){return t.apply(this,arguments)}}(),Ul=(q(Nn={},Nr,(hi=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:typeof window>"u"&&console.warn("\n %cFCL Warning\n ============================\n ".concat('"fcl.discovery" is only available in the browser.',"\n For more info, please see the docs: https://docs.onflow.org/fcl/\n ============================\n "),"font-weight:bold;font-family:monospace;"),"complete"===document.readyState?Sa():window.onload=x(h.mark(function o(){return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:Sa();case 1:case"end":return u.stop()}},o)}));case 2:case"end":return r.stop()}},t)})),function(t){return hi.apply(this,arguments)})),q(Nn,mi,function(t,n,r){t.merge(r),t.broadcast(gi,O({},t.all()))}),q(Nn,cn,function(t,n){t.subscribe(n.from),t.send(n.from,gi,O({},t.all()))}),q(Nn,nn,function(t,n){return t.unsubscribe(n.from)}),q(Nn,"SNAPSHOT",(di=x(h.mark(function t(n,r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.reply(O({},n.all())));case 1:case"end":return e.stop()}},t)})),function(t,n){return di.apply(this,arguments)})),Nn),vi=function(){return rn(Ul,Zn)},Fl={authn:{subscribe:function(t){return ur(Zn,vi,t)},snapshot:function(){return ro(Zn,vi)},update:function(){return Sa()}}};function Dl(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)||function jl(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)||typeof navigator<"u"&&/iPad/.test(navigator.userAgent)}()}var yi,bi,Gl=function(t){return"function"==typeof t},Mt="CURRENT_USER",Aa="CURRENT_USER/UPDATED",wi="SNAPSHOT",Ra="SET_CURRENT_USER",xi="DEL_CURRENT_USER",_a='{\n "f_type": "User",\n "f_vsn": "1.0.0",\n "addr":null,\n "cid":null,\n "loggedIn":null,\n "expiresAt":null,\n "services":[]\n}',Ml=function(){var t=x(h.mark(function n(r){var e,a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return e=JSON.parse(_a),o.next=3,r.get(Mt);case 3:if(null==(a=o.sent)||e.f_vsn===a.f_vsn){o.next=7;break}return r.removeItem(Mt),o.abrupt("return",e);case 7:return o.abrupt("return",a||e);case 8:case"end":return o.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),zl=(q(gn={},Nr,function(){var t=x(h.mark(function n(r){var e,a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return typeof window>"u"&&console.warn('\n %cFCL Warning\n ============================\n "currentUser" is only available in the browser.\n For more info, please see the docs: https://docs.onflow.org/fcl/\n ============================\n ',"font-weight:bold;font-family:monospace;"),r.merge(JSON.parse(_a)),o.next=4,j.first(["fcl.storage","fcl.storage.default"]);case 4:if(!(e=o.sent).can){o.next=10;break}return o.next=8,Ml(e);case 8:Yl(a=o.sent)&&r.merge(a);case 10:case"end":return o.stop()}},n)}));return function(n){return t.apply(this,arguments)}}()),q(gn,cn,function(t,n){t.subscribe(n.from),t.send(n.from,Aa,O({},t.all()))}),q(gn,nn,function(t,n){t.unsubscribe(n.from)}),q(gn,wi,(bi=x(h.mark(function t(n,r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r.reply(O({},n.all()));case 1:case"end":return e.stop()}},t)})),function(t,n){return bi.apply(this,arguments)})),q(gn,Ra,function(){var t=x(h.mark(function n(r,e,a){var o;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return r.merge(a),u.next=3,j.first(["fcl.storage","fcl.storage.default"]);case 3:(o=u.sent).can&&o.put(Mt,r.all()),r.broadcast(Aa,O({},r.all()));case 6:case"end":return u.stop()}},n)}));return function(n,r,e){return t.apply(this,arguments)}}()),q(gn,xi,(yi=x(h.mark(function t(n,r){var e;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return n.merge(JSON.parse(_a)),a.next=3,j.first(["fcl.storage","fcl.storage.default"]);case 3:(e=a.sent).can&&e.put(Mt,n.all()),n.broadcast(Aa,O({},n.all()));case 6:case"end":return a.stop()}},t)})),function(t,n){return yi.apply(this,arguments)})),gn),Bn=function(){return rn(zl,Mt)};function Yl(t){return null==t.expiresAt||0===t.expiresAt||t.expiresAt>Date.now()}function ql(){return ki.apply(this,arguments)}function ki(){return(ki=x(h.mark(function t(){var n,r;return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j.get("fcl.accountProof.resolver");case 2:if(Gl(n=e.sent)){e.next=5;break}return e.abrupt("return");case 5:return e.next=7,n();case 7:if(null!=(r=e.sent)){e.next=10;break}return e.abrupt("return");case 10:return C("string"==typeof r.appIdentifier,"appIdentifier must be a string"),C(/^[0-9a-f]+$/i.test(r.nonce),"Nonce must be a hex string"),e.abrupt("return",r);case 13:case"end":return e.stop()}},t)}))).apply(this,arguments)}var Kl=function(){var t=x(h.mark(function n(r){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.t0=r.discoveryAuthnInclude,a.next=4,li();case 4:return a.t1=a.sent,a.t2=Xn.getStrategies(),a.t3={discoveryAuthnInclude:a.t0,clientServices:a.t1,supportedStrategies:a.t2},a.abrupt("return",{client:a.t3});case 8:case"end":return a.stop()}},n)}));return function(n){return t.apply(this,arguments)}}();function $n(){return Ta.apply(this,arguments)}function Ta(){return Ta=x(h.mark(function t(){var n,r,e,a,o,u,i,c=arguments;return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(u=void 0!==(o=(e=c.length>0&&void 0!==c[0]?c[0]:{}).redir)&&o,!(a=e.service)||null!=a&&null!==(n=a.provider)&&void 0!==n&&n.is_installed||null==a||null===(r=a.provider)||void 0===r||!r.requires_install){l.next=4;break}return window.location.href=null==a||null===(i=a.provider)||void 0===i?void 0:i.install_link,l.abrupt("return");case 4:return l.abrupt("return",new Promise(function(){var d=x(h.mark(function g(v,m){var b,E,S,N,T,R,L;return h.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return Bn(),b={redir:u},I.next=4,Qn();case 4:return E=I.sent,I.next=7,Nl(a);case 7:return S=I.sent,N=Ar(E.services,"authn-refresh"),I.prev=9,I.next=12,ql();case 12:T=I.sent,I.next=19;break;case 15:return I.prev=15,I.t0=I.catch(9),console.error("Error During Authentication: Could not resolve account proof data.\n ".concat(I.t0)),I.abrupt("return",m(I.t0));case 19:if(!E.loggedIn){I.next=47;break}if(!N){I.next=46;break}return I.prev=21,I.next=24,hn({service:N,msg:T,opts:b});case 24:return R=I.sent,I.t1=dt,I.t2=Mt,I.t3=Ra,I.next=30,$s(R);case 30:I.t4=I.sent,(0,I.t1)(I.t2,I.t3,I.t4),I.next=37;break;case 34:I.prev=34,I.t5=I.catch(21),console.error("Error: Could not refresh authentication.",I.t5);case 37:return I.prev=37,I.t6=v,I.next=41,Qn();case 41:return I.t7=I.sent,I.abrupt("return",(0,I.t6)(I.t7));case 44:I.next=47;break;case 46:return I.abrupt("return",v(E));case 47:return I.prev=47,I.t8=hn,I.t9=S,I.t10=T,I.next=53,Kl(S);case 53:return I.t11=I.sent,I.t12=b,I.t13={service:I.t9,msg:I.t10,config:I.t11,opts:I.t12},I.next=58,(0,I.t8)(I.t13);case 58:return L=I.sent,I.t14=dt,I.t15=Mt,I.t16=Ra,I.next=64,$s(L);case 64:I.t17=I.sent,(0,I.t14)(I.t15,I.t16,I.t17),I.next=71;break;case 68:I.prev=68,I.t18=I.catch(47),console.error("Error while authenticating",I.t18);case 71:return I.prev=71,I.t19=v,I.next=75,Qn();case 75:return I.t20=I.sent,(0,I.t19)(I.t20),I.finish(71);case 78:case"end":return I.stop()}},g,null,[[9,15],[21,34,37,44],[47,68,71,78]])}));return function(g,v){return d.apply(this,arguments)}}()));case 5:case"end":return l.stop()}},t)})),Ta.apply(this,arguments)}function Ei(){Bn(),dt(Mt,xi)}function Hl(t){var d,n={f_type:"PreAuthzResponse",f_vsn:"1.0.0",proposer:((d=t)||{}).proposer,payer:(d||{}).payer||[],authorization:(d||{}).authorization||[]},r=[];null!=n.proposer&&r.push(["PROPOSER",n.proposer]);var e,a=bt(n.payer||[]);try{for(a.s();!(e=a.n()).done;)r.push(["PAYER",e.value])}catch(d){a.e(d)}finally{a.f()}var u,i=bt(n.authorization||[]);try{for(i.s();!(u=i.n()).done;)r.push(["AUTHORIZER",u.value])}catch(d){i.e(d)}finally{i.f()}var l=r.map(function(d){var g=Lt(d,2),v=g[0],m=g[1];return{tempId:[m.identity.address,m.identity.keyId].join("|"),addr:m.identity.address,keyId:m.identity.keyId,signingFunction:function(b){return hn({service:m,msg:b})},role:{proposer:"PROPOSER"===v,payer:"PAYER"===v,authorizer:"AUTHORIZER"===v}}});return l}function Ii(t){return Ca.apply(this,arguments)}function Ca(){return Ca=x(h.mark(function t(n){return h.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return Bn(),r.abrupt("return",O(O({},n),{},{tempId:"CURRENT_USER",resolve:function(e,a){return x(h.mark(function o(){var u,i,c,l;return h.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,$n({redir:!0});case 2:if(i=Ar((u=d.sent).services,"authz"),!(c=Ar(u.services,"pre-authz"))){d.next=11;break}return d.t0=Hl,d.next=9,hn({service:c,msg:a});case 9:return d.t1=d.sent,d.abrupt("return",(0,d.t0)(d.t1));case 11:if(!i){d.next=14;break}return Dl()&&"WC/RPC"===i.method&&(l=window.open("","_blank")),d.abrupt("return",O(O({},e),{},{tempId:"CURRENT_USER",resolve:null,addr:Z(i.identity.address),keyId:i.identity.keyId,sequenceNum:null,signature:null,signingFunction:function(g){return x(h.mark(function v(){return h.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.t0=Ea,m.next=3,hn({service:i,msg:g,opts:{includeOlderJsonRpcCall:!0,windowRef:l}});case 3:return m.t1=m.sent,m.abrupt("return",(0,m.t0)(m.t1));case 5:case"end":return m.stop()}},v)}))()}}));case 14:throw new Error("No Authz or PreAuthz Service configured for CURRENT_USER");case 15:case"end":return d.stop()}},o)}))()}}));case 2:case"end":return r.stop()}},t)})),Ca.apply(this,arguments)}function Si(t){Bn();var e,n="@EXIT",r=rn((e=x(h.mark(function a(o){var u;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:o.send(Mt,cn);case 1:return i.next=4,o.receive();case 4:if((u=i.sent).tag!==n){i.next=8;break}return o.send(Mt,nn),i.abrupt("return");case 8:t(u.data),i.next=1;break;case 11:case"end":return i.stop()}},a)})),function(a){return e.apply(this,arguments)}));return function(){return dt(r,n)}}function Qn(){return Bn(),dt(Mt,wi,null,{expectReply:!0,timeout:0})}function Ai(){return Ri.apply(this,arguments)}function Ri(){return(Ri=x(h.mark(function t(){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$n();case 2:return e.abrupt("return",$e(at(e.sent.addr),Bs));case 5:case"end":return e.stop()}},t)}))).apply(this,arguments)}var Wl=function(t){return C(/^[0-9a-f]+$/i.test(t),"Message must be a hex string"),{message:t}};function _i(t){return Oa.apply(this,arguments)}function Oa(){return Oa=x(h.mark(function t(n){var e,a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return Bn(),o.next=3,$n({redir:!0});case 3:return C(e=Ar(o.sent.services,"user-signature"),"Current user must have authorized a signing service."),o.prev=6,o.next=9,hn({service:e,msg:Wl(n)});case 9:if(a=o.sent,!Array.isArray(a)){o.next=14;break}return o.abrupt("return",a.map(function(u){return Ea(u)}));case 14:return o.abrupt("return",[Ea(a)]);case 15:o.next=20;break;case 17:return o.prev=17,o.t0=o.catch(6),o.abrupt("return",o.t0);case 20:case"end":return o.stop()}},t,null,[[6,17]])})),Oa.apply(this,arguments)}var xt=function(){return{authenticate:$n,unauthenticate:Ei,authorization:Ii,signUserMessage:_i,subscribe:Si,snapshot:Qn,resolveArgument:Ai}};function Pa(){return Pa=x(h.mark(function t(){var n,r,e,a=arguments;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return n=a.length>0&&void 0!==a[0]?a[0]:{},o.prev=1,o.next=4,dl(n);case 4:return o.next=6,Ys(n);case 6:return n=o.sent,o.next=9,j().get("fcl.authz",xt().authorization);case 9:return e=o.sent,r=j().overload(n.dependencies||{},x(h.mark(function u(){return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Ot([ps(n.cadence),Ze(Fs(n.args||[])),n.limit&&_f(n.limit)&&Xe(n.limit),is(n.proposer||n.authz||e),cs(n.payer||n.authz||e),os(n.authorizations||[n.authz||e])]).then(Sn));case 1:case"end":return i.stop()}},u)}))),o.abrupt("return",r);case 14:throw o.prev=14,o.t0=o.catch(1),o.t0;case 17:case"end":return o.stop()}},t,null,[[1,14]])})),Pa.apply(this,arguments)}xt.authenticate=$n,xt.unauthenticate=Ei,xt.authorization=Ii,xt.signUserMessage=_i,xt.subscribe=Si,xt.snapshot=Qn,xt.resolveArgument=Ai;var Ti=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=function(a){var o;return a.deprecated&&console.warn("DEPRECATION NOTICE",a.deprecated.message),null==a||null===(o=a.body)||void 0===o||delete o.interaction,a},e=function(a){var o=a.data;"object"===z(o)&&null!=z(o)&&o.type===t&&n(r(o))};return window.addEventListener("message",e),function(){return window.removeEventListener("message",e)}},Ln=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(window.location!==window.parent.location)window.parent.postMessage(O(O({},n),{},{type:t}),"*");else{if(!window.opener)throw new Error("Unable to communicate with parent FCL instance");window.opener.postMessage(O(O({},n),{},{type:t}),"*")}},Vl=function(t,n){return X.Buffer.from(t.padEnd(2*n,"0"),"hex")},Ci=function(t){return X.Buffer.from(t.padStart(16,"0"),"hex")},Oi=function(t){return X.Buffer.from(t,"hex")},Pi=function(t){var n=t.address,r=t.nonce,e=t.appIdentifier,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];C(n,"Encode Message For Provable Authn Error: address must be defined"),C(r,"Encode Message For Provable Authn Error: nonce must be defined"),C(e,"Encode Message For Provable Authn Error: appIdentifier must be defined"),C(r.length>=64,"Encode Message For Provable Authn Error: nonce must be minimum of 32 bytes");var o=Vl(X.Buffer.from("FCL-ACCOUNT-PROOF-V0.0").toString("hex"),32);return a?X.Buffer.concat([o,fn([e,Ci(Z(n)),Oi(r)])]).toString("hex"):fn([e,Ci(Z(n)),Oi(r)]).toString("hex")},Jl=Object.freeze({__proto__:null,sendMsgToFCL:Ln,ready:function(t){Ti("FCL:VIEW:READY:RESPONSE",t),Ln("FCL:VIEW:READY")},close:function(){Ln("FCL:VIEW:CLOSE")},approve:function(t){Ln("FCL:VIEW:RESPONSE",{f_type:"PollingResponse",f_vsn:"1.0.0",status:"APPROVED",reason:null,data:t})},decline:function(t){Ln("FCL:VIEW:RESPONSE",{f_type:"PollingResponse",f_vsn:"1.0.0",status:"DECLINED",reason:t,data:null})},redirect:function(t){Ln("FCL:VIEW:RESPONSE",{f_type:"PollingResponse",f_vsn:"1.0.0",status:"REDIRECT",reason:null,data:t})},onMessageFromFCL:Ti,encodeMessageFromSignable:function(t,n){var r,e,a=(r=t.voucher,(e=new Set(r.authorizers)).add(r.proposalKey.address),e.delete(r.payer),Array.from(e).map(at)),o=Array.from(new Set([t.voucher.payer])).map(at),u=a.includes(at(n)),i=o.includes(at(n));if(!u&&!i)throw new xf(n);var c={cadence:t.voucher.cadence,refBlock:t.voucher.refBlock,computeLimit:t.voucher.computeLimit,arguments:t.voucher.arguments,proposalKey:O(O({},t.voucher.proposalKey),{},{address:Z(t.voucher.proposalKey.address)}),payer:Z(t.voucher.payer),authorizers:t.voucher.authorizers.map(Z),payloadSigs:t.voucher.payloadSigs.map(function(l){return O(O({},l),{},{address:Z(l.address)})})};return u?Cu(c):Ou(c)},CompositeSignature:function(t,n,r){this.f_type=pa.f_type,this.f_vsn=pa.f_vsn,this.addr=at(t),this.keyId=Number(n),this.signature=r},encodeAccountProof:Pi,injectExtService:function(t){"authn"===t.type&&null!=t.endpoint?(Array.isArray(window.fcl_extensions)||(window.fcl_extensions=[]),window.fcl_extensions.push(t)):console.warn("Authn service is required")}}),Xl="ACCOUNT_PROOF",Zl="USER_SIGNATURE",Ni=function(t){if(t.appIdentifier){var r=t.address,e=t.nonce,a=t.signatures;return C(An(t.appIdentifier),"verifyAccountProof({ appIdentifier }) -- appIdentifier must be a string"),C(An(r)&&16===Z(r).length,"verifyAccountProof({ address }) -- address must be a valid address"),C(/^[0-9a-f]+$/i.test(e),"nonce must be a hex string"),C(Array.isArray(a)&&a.every(function(c,l,d){return"CompositeSignature"===c.f_type}),"Must include an Array of CompositeSignatures to verify"),C(a.map(function(c){return c.addr}).every(function(c,l,d){return c===d[0]}),"User signatures to be verified must be from a single account address"),!0}var u=t.address,i=t.compSigs;return C(/^[0-9a-f]+$/i.test(t.message),"Signed message must be a hex string"),C(An(u)&&16===Z(u).length,"verifyUserSignatures({ address }) -- address must be a valid address"),C(Array.isArray(i)&&i.every(function(c,l,d){return"CompositeSignature"===c.f_type}),"Must include an Array of CompositeSignatures to verify"),C(i.map(function(c){return c.addr}).every(function(c,l,d){return c===d[0]}),"User signatures to be verified must be from a single account address"),!0},Bi=function(){var t=x(h.mark(function n(r,e){var a,o;return h.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return a="ACCOUNT_PROOF"===r?"verifyAccountProofSignatures":"verifyUserSignatures",i.next=3,j.get("flow.network");case 3:if(o=i.sent){i.next=9;break}return i.next=7,j.get("env");case 7:(o=i.sent)&&wt.deprecate({pkg:"FCL",subject:'Using the "env" configuration key for specifying the flow network',message:'Please use "flow.network" instead.',transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/TRANSITIONS.md#0001-deprecate-env-config-key"});case 9:return C(e.fclCryptoContract||"testnet"===o||"mainnet"===o,"${verifyFunction}({ fclCryptoContract }) -- config.flow.network must be specified (testnet || mainnet) or contract address provided via opts.fclCryptoContract"),i.abrupt("return","\n import FCLCrypto from ".concat(e.fclCryptoContract?e.fclCryptoContract:"testnet"===o?"0x74daa6f9c7ef24b1":"0xb4b82a1c9d21d284","\n\n pub fun main(\n address: Address, \n message: String, \n keyIndices: [Int], \n signatures: [String]\n ): Bool {\n return FCLCrypto.").concat(a,"(address: address, message: message, keyIndices: keyIndices, signatures: signatures)\n }\n "));case 12:case"end":return i.stop()}},n)}));return function(n,r){return t.apply(this,arguments)}}();function Na(){return Na=x(h.mark(function t(n,r){var e,a,o,u,i,c,l,d,g,v,m=arguments;return h.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:u=m.length>2&&void 0!==m[2]?m[2]:{},Ni({appIdentifier:n,address:e=r.address,nonce:a=r.nonce,signatures:o=r.signatures}),i=Pi({address:e,nonce:a,appIdentifier:n},!1),c=[],l=[],d=bt(o);try{for(d.s();!(g=d.n()).done;)c.push((v=g.value).signature),l.push(v.keyId.toString())}catch(E){d.e(E)}finally{d.f()}return b.t0=Sr,b.next=11,Bi(Xl,u);case 11:return b.t1=b.sent,b.t2=function(E,S){return[E(at(e),S.Address),E(i,S.String),E(l,S.Array(S.Int)),E(c,S.Array(S.String))]},b.t3={cadence:b.t1,args:b.t2},b.abrupt("return",(0,b.t0)(b.t3));case 15:case"end":return b.stop()}},t)})),Na.apply(this,arguments)}function Li(t,n){return Ba.apply(this,arguments)}function Ba(){return Ba=x(h.mark(function t(n,r){var e,a,o,u,i,c,l,d=arguments;return h.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:e=d.length>2&&void 0!==d[2]?d[2]:{},a=at(r[0].addr),Ni({message:n,address:a,compSigs:r}),o=[],u=[],i=bt(r);try{for(i.s();!(c=i.n()).done;)o.push((l=c.value).signature),u.push(l.keyId.toString())}catch(v){i.e(v)}finally{i.f()}return g.t0=Sr,g.next=10,Bi(Zl,e);case 10:return g.t1=g.sent,g.t2=function(v,m){return[v(a,m.Address),v(n,m.String),v(u,m.Array(m.Int)),v(o,m.Array(m.String))]},g.t3={cadence:g.t1,args:g.t2},g.abrupt("return",(0,g.t0)(g.t3));case 14:case"end":return g.stop()}},t)})),Ba.apply(this,arguments)}var Un,Cr,$l=Object.freeze({__proto__:null,verifyAccountProof:function(t,n){return Na.apply(this,arguments)},verifyUserSignatures:Li}),Ql=wt.deprecate({pkg:"FCL",subject:"fcl.verifyUserSignatures()",message:"Please use fcl.AppUtils.verifyUserSignatures()",callback:function(t,n){return Li(t,n)}}),tp=function(){var t=x(h.mark(function n(){var r,e,a,o=arguments;return h.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return r=o.length>0&&void 0!==o[0]?o[0]:[],e=o.length>1&&void 0!==o[1]?o[1]:{},u.next=4,j.first(["sdk.resolve"],e.resolve||He);case 4:if(a=u.sent,!Array.isArray(r)){u.next=9;break}return u.next=8,st(pr(),r);case 8:r=u.sent;case 9:return u.t0=JSON,u.t1=Yn,u.next=13,a(r);case 13:return u.t2=u.sent,u.t3=(0,u.t1)(u.t2),u.abrupt("return",u.t0.stringify.call(u.t0,u.t3,null,2));case 16:case"end":return u.stop()}},n)}));return function(){return t.apply(this,arguments)}}(),La="POLL",np=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ot([ss(r)]).then(Sn));case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),Ua=function(t){return t.status>=4},Ui=function(t){return t.status>=3},Fi=function(t){return t.status>=2},rp=(q(Un={},Nr,function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r.sendSelf(La);case 1:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}()),q(Un,cn,function(t,n){t.subscribe(n.from),t.send(n.from,Br,t.all())}),q(Un,nn,function(t,n){t.unsubscribe(n.from)}),q(Un,no,function(){var t=x(h.mark(function n(r,e){return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e.reply(r.all());case 1:case"end":return a.stop()}},n)}));return function(n,r){return t.apply(this,arguments)}}()),q(Un,La,function(){var t=x(h.mark(function n(r){var e;return h.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,np(r.self());case 3:e=a.sent,a.next=9;break;case 6:return a.prev=6,a.t0=a.catch(0),a.abrupt("return",r.fatalError(a.t0));case 9:Ua(e)||setTimeout(function(){return r.sendSelf(La)},2500),o=r.all(),u=e,JSON.stringify(o)!==JSON.stringify(u)&&r.broadcast(Br,e),r.merge(e);case 12:case"end":return a.stop()}var o,u},n,null,[[0,6]])}));return function(n){return t.apply(this,arguments)}}()),Un),ji=function(t){if("object"===z(t)&&(t=t.transactionId),null==t)throw new Error("transactionId required");return t},Di=function(t){return rn(rp,ji(t))};function mn(t){function n(e){return ur(ji(t),Di,e)}function r(e){return function(){var o=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).suppress||!1;return new Promise(function(u,i){var c=n(function(l,d){!d&&!l.statusCode||o?e(l)&&(u(l),c()):(i(d||l.errorMessage),c())})})}}return{snapshot:function(){return ro(t,Di)},subscribe:n,onceFinalized:r(Fi),onceExecuted:r(Ui),onceSealed:r(Ua)}}mn.isUnknown=function(t){return t.status>=0},mn.isPending=function(t){return t.status>=1},mn.isFinalized=Fi,mn.isExecuted=Ui,mn.isSealed=Ua,mn.isExpired=function(t){return 5===t.status};var vn="TICK",Or="hwm",Fa=function(){var t=x(h.mark(function n(r){return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=setTimeout,e.t1=function(){return r.sendSelf(vn)},e.next=4,j().get("fcl.eventPollRate",1e4);case 4:return e.t2=e.sent,e.abrupt("return",(0,e.t0)(e.t1,e.t2));case 6:case"end":return e.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),ep=(q(Cr={},vn,function(){var t=x(h.mark(function n(r){var e,a,u,i;return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(r.hasSubs()){l.next=2;break}return l.abrupt("return");case 2:if(null!=(e=r.get(Or))){l.next=18;break}return l.t0=r,l.t1=Or,l.next=8,qn();case 8:return l.t2=l.sent,l.t0.put.call(l.t0,l.t1,l.t2),l.t3=r,l.t4=vn,l.next=14,Fa(r);case 14:l.t5=l.sent,l.t3.put.call(l.t3,l.t4,l.t5),l.next=34;break;case 18:return l.next=20,qn();case 20:if(r.put(Or,a=l.sent),!(e.height1&&void 0!==d[1]?d[1]:{},G(null!=(r=n.template),"getInteractionTemplateAudits({ template }) -- template must be defined"),G("InteractionTemplate"===(r=Wn(r)).f_type,"getInteractionTemplateAudits({ template }) -- template must be an InteractionTemplate"),g.next=7,Mi({template:r});case 7:if((o=g.sent)===r.id){g.next=11;break}throw wt({title:"getInteractionTemplateAudits Debug Error",message:"Could not recompute and match template ID\n computed: ".concat(o,"\n template: ").concat(r.id,"\n "),level:St.debug}),new Error("getInteractionTemplateAudits Error: Could not recompute and match template ID");case 11:g.t0=r.f_version,g.next="1.0.0"===g.t0?14:33;break;case 14:if(g.t1=e,g.t1){g.next=19;break}return g.next=18,j().get("flow.auditors");case 18:g.t1=g.sent;case 19:if(G(u=g.t1,"getInteractionTemplateAudits Error: Required configuration for 'fcl.auditors' is not set"),G(Array.isArray(u),"getInteractionTemplateAudits Error: Required configuration for 'fcl.auditors' is not an array"),i=a.flowInteractionAuditContract){g.next=29;break}return g.next=26,j().get("flow.network");case 26:G("mainnet"===(c=g.sent)||"testnet"===c,"getInteractionTemplateAudits Error: Unable to determine address for FlowInteractionTemplateAudit contract. Set configuration for 'fcl.network' to 'mainnet' or 'testnet'"),i="mainnet"===c?"0xfd100e39d50a13e6":"0xf78bfc12d0a786dc";case 29:return g.next=31,Sr({cadence:"\n import FlowInteractionTemplateAudit from ".concat(i,"\n pub fun main(templateId: String, auditors: [Address]): {Address:Bool} {\n return FlowInteractionTemplateAudit.getHasTemplateBeenAuditedByAuditors(templateId: templateId, auditors: auditors)\n }\n "),args:function(v,m){return[v(o,m.String),v(u,m.Array(m.Address))]}});case 31:return g.abrupt("return",g.sent);case 33:throw new Error("getInteractionTemplateAudits Error: Unsupported template version");case 34:case"end":return g.stop()}},t)})),Da.apply(this,arguments)}function zi(t){return{contractName:t.contractName,address:t.address,contract:""}}function op(t){var n,r=[],e=bt(t.match(/import ((\w|,| )+)* from 0x\w+/g)||[]);try{for(e.s();!(n=e.n()).done;){var a,u=/import ((\w+|, |)*) from (0x\w+)/g.exec(n.value),i=bt(u[1].match(/((?:\w+)+),?/g)||[]);try{for(i.s();!(a=i.n()).done;)r.push(zi({address:u[3],contractName:a.value.replace(/,/g,"")}))}catch(l){i.e(l)}finally{i.f()}}}catch(l){e.e(l)}finally{e.f()}return r}function Ga(t){return Ma.apply(this,arguments)}function Ma(){return Ma=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,d,g,v,m,b,E=arguments;return h.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:e=n.contractName,a=n.blockHeight,o=E.length>1&&void 0!==E[1]?E[1]:{},G(null!=(r=n.address),"generateDependencyPin({ address }) -- address must be defined"),G(null!=e,"generateDependencyPin({ contractName }) -- contractName must be defined"),G(null!=a,"generateDependencyPin({ blockHeight }) -- blockHeight must be defined"),G("string"==typeof r,"generateDependencyPin({ address }) -- address must be a string"),G("string"==typeof e,"generateDependencyPin({ contractName }) -- contractName must be a string"),G("number"==typeof a,"generateDependencyPin({ blockHeight }) -- blockHeight must be a number"),u=[zi({contractName:e,address:r})],i=0,c=u;case 10:if(!(i1&&void 0!==i[1]?i[1]:{},c.next=4,qn({sealed:!0},a);case 4:return c.abrupt("return",Ga({address:r,contractName:e,blockHeight:null==(o=c.sent)?void 0:o.height},a));case 7:case"end":return c.stop()}},t)})),za.apply(this,arguments)}function up(t){if(null==t)return null;if("1.0.0"===t.f_version)return t;throw new Error("normalizeInteractionTemplateInterface Error: Invalid InteractionTemplateInterface")}function Ya(){return Ya=x(h.mark(function t(n){var r,e,a;return h.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:G(null!=(r=n.templateInterface),"generateTemplateInterfaceId({ templateInterface }) -- templateInterface must be defined"),G("object"===z(r),"generateTemplateInterfaceId({ templateInterface }) -- templateInterface must be an object"),G("InteractionTemplateInterface"==typeof r.f_type,"generateTemplateInterfaceId({ templateInterface }) -- templateInterface object must be an InteractionTemplate"),r=up(r),o.t0=r.f_version,o.next="1.0.0"===o.t0?8:25;break;case 8:return e=r.data,o.t1=fn,o.next=12,J("InteractionTemplateInterface");case 12:return o.t2=o.sent,o.next=15,J("1.0.0");case 15:return o.t3=o.sent,o.next=18,J(e.flip);case 18:return o.t4=o.sent,o.next=21,Promise.all(Object.keys(e.arguments).map(function(){var u=x(h.mark(function i(c){return h.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,J(c);case 2:return l.t0=l.sent,l.next=5,J(String(e.arguments[c].index));case 5:return l.t1=l.sent,l.next=8,J(e.arguments[c].type);case 8:return l.t2=l.sent,l.abrupt("return",[l.t0,l.t1,l.t2]);case 10:case"end":return l.stop()}},i)}));return function(i){return u.apply(this,arguments)}}()));case 21:return o.t5=o.sent,o.t6=[o.t2,o.t3,o.t4,o.t5],a=(0,o.t1)(o.t6).toString("hex"),o.abrupt("return",J(a));case 25:throw new Error("generateTemplateInterfaceId Error: Unsupported templateInterface version");case 26:case"end":return o.stop()}},t)})),Ya.apply(this,arguments)}function Yi(t){return qa.apply(this,arguments)}function qa(){return qa=x(h.mark(function t(n){var r,e,a,o,u,i,c,l,g,v,m,S,N,T=arguments;return h.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:e=n.blockHeight,a=n.network,o=T.length>1&&void 0!==T[1]?T[1]:{},G(null!=(r=n.template),"generateDependencyPin({ template }) -- template must be defined"),G("object"===z(r),"generateDependencyPin({ template }) -- template must be an object"),G("InteractionTemplate"===r.f_type,"generateDependencyPin({ template }) -- template must be an InteractionTemplate"),r=Wn(r),G(null!=a,"generateDependencyPin({ network }) network must be defined"),G(null!=e,"generateDependencyPin({ blockHeight }) blockHeight must be defined"),G("number"==typeof e,"generateDependencyPin({ blockHeight }) blockHeight must be a number"),R.t0=r.f_version,R.next="1.0.0"===R.t0?12:38;break;case 12:u=Object.keys(r.data.dependencies),i=0,c=u;case 14:if(!(i1&&void 0!==i[1]?i[1]:{},c.next=4,qn({sealed:!0});case 4:return c.abrupt("return",Yi({template:r,network:e,blockHeight:null==(o=c.sent)?void 0:o.height},a));case 7:case"end":return c.stop()}},t)})),Ka.apply(this,arguments)}var sp=Object.freeze({__proto__:null,getInteractionTemplateAudits:function(t){return Da.apply(this,arguments)},generateDependencyPin:Ga,generateDependencyPinAtLatestSealedBlock:function(t){return za.apply(this,arguments)},generateTemplateId:Mi,generateTemplateInterfaceId:function(t){return Ya.apply(this,arguments)},verifyDependencyPinsSame:Yi,verifyDependencyPinsSameAtLatestSealedBlock:function(t){return Ka.apply(this,arguments)},deriveCadenceByNetwork:zs,getTemplateMessage:function(t){var n,r,e,a=t.localization,o=void 0===a?"en-US":a,u=t.messageKey,i=t.template;G(u,"getMessage({ messageKey }) -- messageKey must be defined"),G("stirng"==typeof u,"getMessage({ messageKey }) -- messageKey must be a string"),G(o,"getMessage({ localization }) -- localization must be defined"),G("stirng"==typeof o,"getMessage({ localization }) -- localization must be a string"),G(null!=i,"generateTemplateId({ template }) -- template must be defined"),G("object"===z(i),"generateTemplateId({ template }) -- template must be an object"),G("InteractionTemplate"==typeof i.f_type,"generateTemplateId({ template }) -- template object must be an InteractionTemplate");var c=null==i||null===(n=i.data)||void 0===n?void 0:n.messages;return null==c||null===(r=c[u])||void 0===r||null===(e=r.i18n)||void 0===e?void 0:e[o]},getTemplateArgumentMessage:function(t){var n,r,e,a,o,u=t.localization,i=void 0===u?"en-US":u,c=t.argumentLabel,l=t.messageKey,d=t.template;G(l,"getMessage({ messageKey }) -- messageKey must be defined"),G("stirng"==typeof l,"getMessage({ messageKey }) -- messageKey must be a string"),G(c,"getMessage({ argumentLabel }) -- argumentLabel must be defined"),G("stirng"==typeof l,"getMessage({ argumentLabel }) -- argumentLabel must be a string"),G(i,"getMessage({ localization }) -- localization must be defined"),G("stirng"==typeof i,"getMessage({ localization }) -- localization must be a string"),G(null!=d,"generateTemplateId({ template }) -- template must be defined"),G("object"===z(d),"generateTemplateId({ template }) -- template must be an object"),G("InteractionTemplate"==typeof d.f_type,"generateTemplateId({ template }) -- template object must be an InteractionTemplate");var g=null==d||null===(n=d.data)||void 0===n?void 0:n.arguments;return null==g||null===(r=g[c])||void 0===r||null===(e=r.messages)||void 0===e||null===(a=e[l])||void 0===a||null===(o=a.i18n)||void 0===o?void 0:o[i]}}),ip=xt().authorization,cp=Us;B.AppUtils=$l,B.InteractionTemplateUtils=sp,B.TestUtils=Af,B.VERSION=Ut,B.WalletUtils=Jl,B.account=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.height,e=n.id,a=arguments.length>2?arguments[2]:void 0;return C(!(e&&r),'Method: account -- Cannot pass "id" and "height" simultaneously'),e?Ot([xn(t),Je(e)],a).then(Jt):r?Ot([xn(t),xr(r)],a).then(Jt):Ot([xn(t)],a).then(Jt)},B.arg=$e,B.args=Ze,B.atBlockHeight=xr,B.atBlockId=Je,B.authenticate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt().authenticate(t)},B.authorization=function(t,n,r,e){return{addr:t,signingFunction:n,keyId:r,sequenceNum:e}},B.authorizations=os,B.authz=ip,B.block=qn,B.build=yr,B.cadence=cr,B.cdc=cr,B.config=j,B.createSignableVoucher=Yn,B.currentUser=xt,B.decode=Sn,B.discovery=Fl,B.display=function(t){return at(t)},B.events=function(t){return{subscribe:function(n){return ur(t,ap,n)}}},B.getAccount=xn,B.getBlock=Mn,B.getBlockHeader=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return st([mu,function(n){return n.block.isSealed=t,ht(n)}])},B.getCollection=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return st([vu,function(n){return n.collection.id=t,n}])},B.getEvents=function(t,n,r){return void 0===n&&void 0===r||wt.deprecate({pkg:"FCL/SDK",subject:"Passing a start and end into getEvents",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0005-deprecate-start-end-get-events-builder"}),st([hr,function(e){return e.events.eventType=t,e.events.start=n,e.events.end=r,ht(e)}])},B.getEventsAtBlockHeightRange=us,B.getEventsAtBlockIds=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return st([hr,function(r){return r.events.eventType=t,r.events.blockIds=n,ht(r)}])},B.getTransaction=function(t){return st([pu,function(n){return n.transaction.id=t,ht(n)}])},B.getTransactionStatus=ss,B.invariant=G,B.isBad=Ue,B.isOk=bu,B.limit=Xe,B.logIn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt().authenticate(t)},B.mutate=function(){return Pa.apply(this,arguments)},B.param=function(t){return wt.deprecate({pkg:"FCL/SDK",message:"The param builder has been removed from the Flow JS-SDK/FCL.",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0001-deprecate-params",level:St.error})},B.params=function(t){return wt.deprecate({pkg:"FCL/SDK",message:"The params builder has been removed from the Flow JS-SDK/FCL.",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0001-deprecate-params",level:St.error})},B.payer=cs,B.ping=function(){return hu},B.pipe=st,B.pluginRegistry=Ol,B.proposer=is,B.query=Sr,B.reauthenticate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt().unauthenticate(),xt().authenticate(t)},B.ref=fs,B.sansPrefix=Z,B.script=ls,B.send=Ot,B.serialize=tp,B.signUp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt().authenticate(t)},B.t=cp,B.transaction=ps,B.tx=mn,B.unauthenticate=function(){return xt().unauthenticate()},B.validator=Ve,B.verifyUserSignatures=Ql,B.voucherIntercept=function(t){return vr("ix.voucher-intercept",t)},B.voucherToTxId=function(t){return function(t){var n=new he.SHA3(256);return n.update(X.Buffer.from(t,"hex")),n.digest().toString("hex")}(Ye(function(t){pf(t);var n=Du(t),r=function(e){return e.map(function(a){var u=a.keyId,i=a.sig;return{signerIndex:n.get(a.address),keyId:u,sig:i}}).sort(function(a,o){return a.signerIndex>o.signerIndex?1:a.signerIndexo.keyId?1:a.keyId{"use strict";B.r(er),B.d(er,{getFlowProvider:()=>yn});var tn=B(18983);tn.config({"accessNode.api":"https://rest-mainnet.onflow.org","discovery.wallet":"https://fcl-discovery.onflow.org/authn"});var yn=function(){return tn}}}]); \ No newline at end of file diff --git a/angular-bare-bones-demo/dist/296.7144c734f45c25bd.js b/angular-bare-bones-demo/dist/296.7144c734f45c25bd.js new file mode 100644 index 000000000..ee5fabf74 --- /dev/null +++ b/angular-bare-bones-demo/dist/296.7144c734f45c25bd.js @@ -0,0 +1 @@ +(self.webpackChunkAngular_bare_bones_demo=self.webpackChunkAngular_bare_bones_demo||[]).push([[296],{34296:(Re,Oe,ge)=>{"use strict";ge.r(Oe),ge.d(Oe,{getTorusProviderInstance:()=>Ae});var Tt=ge(37838),Ee=ge.n(Tt),Ae=function(){return O=void 0,v=void 0,e=function(){return function(O,v){var e,y,c,h,i={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]};return h={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function n(a){return function(d){return function r(a){if(e)throw new TypeError("Generator is already executing.");for(;h&&(h=0,a[0]&&(i=0)),i;)try{if(e=1,y&&(c=2&a[0]?y.return:a[0]?y.throw||((c=y.return)&&c.call(y),0):y.next)&&!(c=c.call(y,a[1])).done)return c;switch(y=0,c&&(a=[2&a[0],c.value]),a[0]){case 0:case 1:c=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,y=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(c=(c=i.trys).length>0&&c[c.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!c||a[1]>c[0]&&a[1]{var Tt=ge(91052).default;self,Re.exports=(()=>(()=>{var Ee={5508:(O,v,i)=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0}),v.ComposedStore=void 0;const e=i(8877);v.ComposedStore=class y extends e.ObservableStore{constructor(h){super({}),this._children=h||{},Object.keys(this._children).forEach(n=>{this._addChild(n,this._children[n])})}_addChild(h,n){const r=a=>{const d=this.getState();d[h]=a,this.putState(d)};n.subscribe(r),r(n.getState())}}},401:(O,v,i)=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0}),v.MergedStore=void 0;const e=i(8877);v.MergedStore=class y extends e.ObservableStore{constructor(h=[]){super({}),this._children=h,h.forEach(n=>this._addChild(n)),this._updateWholeState()}_addChild(h){h.subscribe(()=>this._updateWholeState())}_updateWholeState(){const h=this._children.map(r=>r.getState()),n=Object.assign({},...h);this.putState(n)}}},8877:function(O,v,i){"use strict";var e=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(v,"__esModule",{value:!0}),v.ObservableStore=void 0;const y=e(i(9394));v.ObservableStore=class c extends y.default{constructor(n){super(),this._state=n||{}}getState(){return this._getState()}putState(n){this._putState(n),this.emit("update",n)}updateState(n){if(n&&"object"==typeof n){const r=this.getState();this.putState(Object.assign(Object.assign({},r),n))}else this.putState(n)}subscribe(n){this.on("update",n)}unsubscribe(n){this.removeListener("update",n)}_getState(){return this._state}_putState(n){this._state=n}}},7969:(O,v,i)=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0}),v.storeAsStream=void 0;const e=i(2830);class y extends e.Duplex{constructor(h){super({objectMode:!0}),this.resume(),this.handler=n=>this.push(n),this.obsStore=h,this.obsStore.subscribe(this.handler)}pipe(h,n){const r=super.pipe(h,n);return h.write(this.obsStore.getState()),r}_write(h,n,r){this.obsStore.putState(h),r()}_read(h){}_destroy(h,n){this.obsStore.unsubscribe(this.handler),super._destroy(h,n)}}v.storeAsStream=function(c){return new y(c)}},2724:function(O,v,i){"use strict";var e=this&&this.__createBinding||(Object.create?function(c,h,n,r){void 0===r&&(r=n),Object.defineProperty(c,r,{enumerable:!0,get:function(){return h[n]}})}:function(c,h,n,r){void 0===r&&(r=n),c[r]=h[n]}),y=this&&this.__exportStar||function(c,h){for(var n in c)"default"===n||Object.prototype.hasOwnProperty.call(h,n)||e(h,c,n)};Object.defineProperty(v,"__esModule",{value:!0}),y(i(7969),v),y(i(5508),v),y(i(401),v),y(i(8877),v),y(i(6546),v)},6546:(O,v,i)=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0}),v.storeTransformStream=void 0;const e=i(4650);v.storeTransformStream=function(y){return e.obj((c,h,n)=>{try{return void n(null,y(c))}catch(r){return void n(r)}})}},9394:(O,v,i)=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});const e=i(7187);function y(h,n,r){try{Reflect.apply(h,n,r)}catch(a){setTimeout(()=>{throw a})}}v.default=class c extends e.EventEmitter{emit(n,...r){let a="error"===n;const d=this._events;if(void 0!==d)a=a&&void 0===d.error;else if(!a)return!1;if(a){let g;if(r.length>0&&([g]=r),g instanceof Error)throw g;const o=new Error("Unhandled error."+(g?` (${g.message})`:""));throw o.context=g,o}const S=d[n];if(void 0===S)return!1;if("function"==typeof S)y(S,this,r);else{const g=S.length,o=function(s){const f=s.length,l=new Array(f);for(let p=0;p{"use strict";v.byteLength=function(d){var S=r(d),o=S[1];return 3*(S[0]+o)/4-o},v.toByteArray=function(d){var S,g,M,o=r(d),s=o[0],f=o[1],l=new y(3*(s+(M=f))/4-M),p=0,_=f>0?s-4:s;for(g=0;g<_;g+=4)S=e[d.charCodeAt(g)]<<18|e[d.charCodeAt(g+1)]<<12|e[d.charCodeAt(g+2)]<<6|e[d.charCodeAt(g+3)],l[p++]=S>>16&255,l[p++]=S>>8&255,l[p++]=255&S;return 2===f&&(S=e[d.charCodeAt(g)]<<2|e[d.charCodeAt(g+1)]>>4,l[p++]=255&S),1===f&&(S=e[d.charCodeAt(g)]<<10|e[d.charCodeAt(g+1)]<<4|e[d.charCodeAt(g+2)]>>2,l[p++]=S>>8&255,l[p++]=255&S),l},v.fromByteArray=function(d){for(var S,g=d.length,o=g%3,s=[],f=16383,l=0,p=g-o;lp?p:l+f));return 1===o?s.push(i[(S=d[g-1])>>2]+i[S<<4&63]+"=="):2===o&&s.push(i[(S=(d[g-2]<<8)+d[g-1])>>10]+i[S>>4&63]+i[S<<2&63]+"="),s.join("")};for(var i=[],e=[],y=typeof Uint8Array<"u"?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,n=c.length;h0)throw new Error("Invalid string. Length must be a multiple of 4");var g=d.indexOf("=");return-1===g&&(g=S),[g,g===S?0:4-g%4]}function a(d,S,g){for(var s,f=[],l=S;l>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return f.join("")}e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63},2240:(O,v,i)=>{"use strict";var e=i(8764).Buffer,y=i(1518);function c(a,d){return void 0===d&&(d="utf8"),e.isBuffer(a)?n(a.toString("base64")):n(e.from(a,d).toString("base64"))}function h(a){return a=a.toString(),y.default(a).replace(/\-/g,"+").replace(/_/g,"/")}function n(a){return a.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var r=c;r.encode=c,r.decode=function(a,d){return void 0===d&&(d="utf8"),e.from(h(a),"base64").toString(d)},r.toBase64=h,r.fromBase64=n,r.toBuffer=function(a){return e.from(h(a),"base64")},v.default=r},1518:(O,v,i)=>{"use strict";var e=i(8764).Buffer;Object.defineProperty(v,"__esModule",{value:!0}),v.default=function(y){var c=y.length,h=c%4;if(!h)return y;var n=c,r=4-h,d=e.alloc(c+r);for(d.write(y);r--;)d.write("=",n++);return d.toString()}},5772:(O,v,i)=>{O.exports=i(2240).default,O.exports.default=O.exports},8764:(O,v,i)=>{"use strict";var e=i(9742),y=i(645),c="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;v.Buffer=r,v.SlowBuffer=function(t){return+t!=t&&(t=0),r.alloc(+t)},v.INSPECT_MAX_BYTES=50;var h=2147483647;function n(t){if(t>h)throw new RangeError('The value "'+t+'" is invalid for option "size"');var u=new Uint8Array(t);return Object.setPrototypeOf(u,r.prototype),u}function r(t,u,b){if("number"==typeof t){if("string"==typeof u)throw new TypeError('The "string" argument must be of type string. Received type number');return S(t)}return a(t,u,b)}function a(t,u,b){if("string"==typeof t)return function(N,Y){if("string"==typeof Y&&""!==Y||(Y="utf8"),!r.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);var ct=0|f(N,Y),pt=n(ct),gt=pt.write(N,Y);return gt!==ct&&(pt=pt.slice(0,gt)),pt}(t,u);if(ArrayBuffer.isView(t))return function(N){if(J(N,Uint8Array)){var Y=new Uint8Array(N);return o(Y.buffer,Y.byteOffset,Y.byteLength)}return g(N)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return o(t,u,b);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var C=t.valueOf&&t.valueOf();if(null!=C&&C!==t)return r.from(C,u,b);var x=function(N){if(r.isBuffer(N)){var Y=0|s(N.length),ct=n(Y);return 0===ct.length||N.copy(ct,0,0,Y),ct}return void 0!==N.length?"number"!=typeof N.length||T(N.length)?n(0):g(N):"Buffer"===N.type&&Array.isArray(N.data)?g(N.data):void 0}(t);if(x)return x;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return r.from(t[Symbol.toPrimitive]("string"),u,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function d(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function S(t){return d(t),n(t<0?0:0|s(t))}function g(t){for(var u=t.length<0?0:0|s(t.length),b=n(u),C=0;C=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return 0|t}function f(t,u){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var b=t.length,C=arguments.length>2&&!0===arguments[2];if(!C&&0===b)return 0;for(var x=!1;;)switch(u){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*b;case"hex":return b>>>1;case"base64":return Q(t).length;default:if(x)return C?-1:K(t).length;u=(""+u).toLowerCase(),x=!0}}function l(t,u,b){var C=!1;if((void 0===u||u<0)&&(u=0),u>this.length||((void 0===b||b>this.length)&&(b=this.length),b<=0)||(b>>>=0)<=(u>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return at(this,u,b);case"utf8":case"utf-8":return $(this,u,b);case"ascii":return et(this,u,b);case"latin1":case"binary":return Z(this,u,b);case"base64":return L(this,u,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ut(this,u,b);default:if(C)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),C=!0}}function p(t,u,b){var C=t[u];t[u]=t[b],t[b]=C}function _(t,u,b,C,x){if(0===t.length)return-1;if("string"==typeof b?(C=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),T(b=+b)&&(b=x?0:t.length-1),b<0&&(b=t.length+b),b>=t.length){if(x)return-1;b=t.length-1}else if(b<0){if(!x)return-1;b=0}if("string"==typeof u&&(u=r.from(u,C)),r.isBuffer(u))return 0===u.length?-1:E(t,u,b,C,x);if("number"==typeof u)return u&=255,"function"==typeof Uint8Array.prototype.indexOf?x?Uint8Array.prototype.indexOf.call(t,u,b):Uint8Array.prototype.lastIndexOf.call(t,u,b):E(t,[u],b,C,x);throw new TypeError("val must be string, number or Buffer")}function E(t,u,b,C,x){var N,Y=1,ct=t.length,pt=u.length;if(void 0!==C&&("ucs2"===(C=String(C).toLowerCase())||"ucs-2"===C||"utf16le"===C||"utf-16le"===C)){if(t.length<2||u.length<2)return-1;Y=2,ct/=2,pt/=2,b/=2}function gt(Rt,Mt){return 1===Y?Rt[Mt]:Rt.readUInt16BE(Mt*Y)}if(x){var yt=-1;for(N=b;Nct&&(b=ct-pt),N=b;N>=0;N--){for(var bt=!0,Et=0;Etx&&(C=x):C=x;var N=u.length;C>N/2&&(C=N/2);for(var Y=0;Y>8,gt.push(Y%256),gt.push(ct);return gt}(u,t.length-b),t,b,C)}function L(t,u,b){return e.fromByteArray(0===u&&b===t.length?t:t.slice(u,b))}function $(t,u,b){b=Math.min(t.length,b);for(var C=[],x=u;x239?4:gt>223?3:gt>191?2:1;if(x+bt<=b)switch(bt){case 1:gt<128&&(yt=gt);break;case 2:128==(192&(N=t[x+1]))&&(pt=(31>)<<6|63&N)>127&&(yt=pt);break;case 3:Y=t[x+2],128==(192&(N=t[x+1]))&&128==(192&Y)&&(pt=(15>)<<12|(63&N)<<6|63&Y)>2047&&(pt<55296||pt>57343)&&(yt=pt);break;case 4:Y=t[x+2],ct=t[x+3],128==(192&(N=t[x+1]))&&128==(192&Y)&&128==(192&ct)&&(pt=(15>)<<18|(63&N)<<12|(63&Y)<<6|63&ct)>65535&&pt<1114112&&(yt=pt)}null===yt?(yt=65533,bt=1):yt>65535&&(C.push((yt-=65536)>>>10&1023|55296),yt=56320|1023&yt),C.push(yt),x+=bt}return function(Et){var Rt=Et.length;if(Rt<=ot)return String.fromCharCode.apply(String,Et);for(var Mt="",Vt=0;Vt"u"||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}}),r.poolSize=8192,r.from=function(t,u,b){return a(t,u,b)},Object.setPrototypeOf(r.prototype,Uint8Array.prototype),Object.setPrototypeOf(r,Uint8Array),r.alloc=function(t,u,b){return x=u,N=b,d(C=t),C<=0?n(C):void 0!==x?"string"==typeof N?n(C).fill(x,N):n(C).fill(x):n(C);var C,x,N},r.allocUnsafe=function(t){return S(t)},r.allocUnsafeSlow=function(t){return S(t)},r.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==r.prototype},r.compare=function(t,u){if(J(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),J(u,Uint8Array)&&(u=r.from(u,u.offset,u.byteLength)),!r.isBuffer(t)||!r.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===u)return 0;for(var b=t.length,C=u.length,x=0,N=Math.min(b,C);xC.length?r.from(N).copy(C,x):Uint8Array.prototype.set.call(C,N,x);else{if(!r.isBuffer(N))throw new TypeError('"list" argument must be an Array of Buffers');N.copy(C,x)}x+=N.length}return C},r.byteLength=f,r.prototype._isBuffer=!0,r.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 u=0;uu&&(t+=" ... "),""},c&&(r.prototype[c]=r.prototype.inspect),r.prototype.compare=function(t,u,b,C,x){if(J(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),!r.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===u&&(u=0),void 0===b&&(b=t?t.length:0),void 0===C&&(C=0),void 0===x&&(x=this.length),u<0||b>t.length||C<0||x>this.length)throw new RangeError("out of range index");if(C>=x&&u>=b)return 0;if(C>=x)return-1;if(u>=b)return 1;if(this===t)return 0;for(var N=(x>>>=0)-(C>>>=0),Y=(b>>>=0)-(u>>>=0),ct=Math.min(N,Y),pt=this.slice(C,x),gt=t.slice(u,b),yt=0;yt>>=0,isFinite(b)?(b>>>=0,void 0===C&&(C="utf8")):(C=b,b=void 0)}var x=this.length-u;if((void 0===b||b>x)&&(b=x),t.length>0&&(b<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");C||(C="utf8");for(var N=!1;;)switch(C){case"hex":return j(this,t,u,b);case"utf8":case"utf-8":return M(this,t,u,b);case"ascii":case"latin1":case"binary":return F(this,t,u,b);case"base64":return G(this,t,u,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,u,b);default:if(N)throw new TypeError("Unknown encoding: "+C);C=(""+C).toLowerCase(),N=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ot=4096;function et(t,u,b){var C="";b=Math.min(t.length,b);for(var x=u;xC)&&(b=C);for(var x="",N=u;Nb)throw new RangeError("Trying to access beyond buffer length")}function m(t,u,b,C,x,N){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>x||ut.length)throw new RangeError("Index out of range")}function D(t,u,b,C,x,N){if(b+C>t.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function A(t,u,b,C,x){return u=+u,b>>>=0,x||D(t,0,b,4),y.write(t,u,b,C,23,4),b+4}function R(t,u,b,C,x){return u=+u,b>>>=0,x||D(t,0,b,8),y.write(t,u,b,C,52,8),b+8}r.prototype.slice=function(t,u){var b=this.length;(t=~~t)<0?(t+=b)<0&&(t=0):t>b&&(t=b),(u=void 0===u?b:~~u)<0?(u+=b)<0&&(u=0):u>b&&(u=b),u>>=0,u>>>=0,b||I(t,u,this.length);for(var C=this[t],x=1,N=0;++N>>=0,u>>>=0,b||I(t,u,this.length);for(var C=this[t+--u],x=1;u>0&&(x*=256);)C+=this[t+--u]*x;return C},r.prototype.readUint8=r.prototype.readUInt8=function(t,u){return t>>>=0,u||I(t,1,this.length),this[t]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(t,u){return t>>>=0,u||I(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(t,u){return t>>>=0,u||I(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(t,u){return t>>>=0,u||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(t,u){return t>>>=0,u||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readIntLE=function(t,u,b){t>>>=0,u>>>=0,b||I(t,u,this.length);for(var C=this[t],x=1,N=0;++N=(x*=128)&&(C-=Math.pow(2,8*u)),C},r.prototype.readIntBE=function(t,u,b){t>>>=0,u>>>=0,b||I(t,u,this.length);for(var C=u,x=1,N=this[t+--C];C>0&&(x*=256);)N+=this[t+--C]*x;return N>=(x*=128)&&(N-=Math.pow(2,8*u)),N},r.prototype.readInt8=function(t,u){return t>>>=0,u||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,u){t>>>=0,u||I(t,2,this.length);var b=this[t]|this[t+1]<<8;return 32768&b?4294901760|b:b},r.prototype.readInt16BE=function(t,u){t>>>=0,u||I(t,2,this.length);var b=this[t+1]|this[t]<<8;return 32768&b?4294901760|b:b},r.prototype.readInt32LE=function(t,u){return t>>>=0,u||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,u){return t>>>=0,u||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,u){return t>>>=0,u||I(t,4,this.length),y.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,u){return t>>>=0,u||I(t,4,this.length),y.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,u){return t>>>=0,u||I(t,8,this.length),y.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,u){return t>>>=0,u||I(t,8,this.length),y.read(this,t,!1,52,8)},r.prototype.writeUintLE=r.prototype.writeUIntLE=function(t,u,b,C){t=+t,u>>>=0,b>>>=0,C||m(this,t,u,b,Math.pow(2,8*b)-1,0);var x=1,N=0;for(this[u]=255&t;++N>>=0,b>>>=0,C||m(this,t,u,b,Math.pow(2,8*b)-1,0);var x=b-1,N=1;for(this[u+x]=255&t;--x>=0&&(N*=256);)this[u+x]=t/N&255;return u+b},r.prototype.writeUint8=r.prototype.writeUInt8=function(t,u,b){return t=+t,u>>>=0,b||m(this,t,u,1,255,0),this[u]=255&t,u+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(t,u,b){return t=+t,u>>>=0,b||m(this,t,u,2,65535,0),this[u]=255&t,this[u+1]=t>>>8,u+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(t,u,b){return t=+t,u>>>=0,b||m(this,t,u,2,65535,0),this[u]=t>>>8,this[u+1]=255&t,u+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(t,u,b){return t=+t,u>>>=0,b||m(this,t,u,4,4294967295,0),this[u+3]=t>>>24,this[u+2]=t>>>16,this[u+1]=t>>>8,this[u]=255&t,u+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(t,u,b){return t=+t,u>>>=0,b||m(this,t,u,4,4294967295,0),this[u]=t>>>24,this[u+1]=t>>>16,this[u+2]=t>>>8,this[u+3]=255&t,u+4},r.prototype.writeIntLE=function(t,u,b,C){if(t=+t,u>>>=0,!C){var x=Math.pow(2,8*b-1);m(this,t,u,b,x-1,-x)}var N=0,Y=1,ct=0;for(this[u]=255&t;++N>0)-ct&255;return u+b},r.prototype.writeIntBE=function(t,u,b,C){if(t=+t,u>>>=0,!C){var x=Math.pow(2,8*b-1);m(this,t,u,b,x-1,-x)}var N=b-1,Y=1,ct=0;for(this[u+N]=255&t;--N>=0&&(Y*=256);)t<0&&0===ct&&0!==this[u+N+1]&&(ct=1),this[u+N]=(t/Y>>0)-ct&255;return u+b},r.prototype.writeInt8=function(t,u,b){return t=+t,u>>>=0,b||m(this,t,u,1,127,-128),t<0&&(t=255+t+1),this[u]=255&t,u+1},r.prototype.writeInt16LE=function(t,u,b){return t=+t,u>>>=0,b||m(this,t,u,2,32767,-32768),this[u]=255&t,this[u+1]=t>>>8,u+2},r.prototype.writeInt16BE=function(t,u,b){return t=+t,u>>>=0,b||m(this,t,u,2,32767,-32768),this[u]=t>>>8,this[u+1]=255&t,u+2},r.prototype.writeInt32LE=function(t,u,b){return t=+t,u>>>=0,b||m(this,t,u,4,2147483647,-2147483648),this[u]=255&t,this[u+1]=t>>>8,this[u+2]=t>>>16,this[u+3]=t>>>24,u+4},r.prototype.writeInt32BE=function(t,u,b){return t=+t,u>>>=0,b||m(this,t,u,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[u]=t>>>24,this[u+1]=t>>>16,this[u+2]=t>>>8,this[u+3]=255&t,u+4},r.prototype.writeFloatLE=function(t,u,b){return A(this,t,u,!0,b)},r.prototype.writeFloatBE=function(t,u,b){return A(this,t,u,!1,b)},r.prototype.writeDoubleLE=function(t,u,b){return R(this,t,u,!0,b)},r.prototype.writeDoubleBE=function(t,u,b){return R(this,t,u,!1,b)},r.prototype.copy=function(t,u,b,C){if(!r.isBuffer(t))throw new TypeError("argument should be a Buffer");if(b||(b=0),C||0===C||(C=this.length),u>=t.length&&(u=t.length),u||(u=0),C>0&&C=this.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("sourceEnd out of bounds");C>this.length&&(C=this.length),t.length-u>>=0,b=void 0===b?this.length:b>>>0,t||(t=0),"number"==typeof t)for(N=u;N55295&&b<57344){if(!x){if(b>56319){(u-=3)>-1&&N.push(239,191,189);continue}if(Y+1===C){(u-=3)>-1&&N.push(239,191,189);continue}x=b;continue}if(b<56320){(u-=3)>-1&&N.push(239,191,189),x=b;continue}b=65536+(x-55296<<10|b-56320)}else x&&(u-=3)>-1&&N.push(239,191,189);if(x=null,b<128){if((u-=1)<0)break;N.push(b)}else if(b<2048){if((u-=2)<0)break;N.push(b>>6|192,63&b|128)}else if(b<65536){if((u-=3)<0)break;N.push(b>>12|224,b>>6&63|128,63&b|128)}else{if(!(b<1114112))throw new Error("Invalid code point");if((u-=4)<0)break;N.push(b>>18|240,b>>12&63|128,b>>6&63|128,63&b|128)}}return N}function Q(t){return e.toByteArray(function(u){if((u=(u=u.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;u.length%4!=0;)u+="=";return u}(t))}function nt(t,u,b,C){for(var x=0;x=u.length||x>=t.length);++x)u[x+b]=t[x];return x}function J(t,u){return t instanceof u||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===u.name}function T(t){return t!=t}var k=function(){for(var t="0123456789abcdef",u=new Array(256),b=0;b<16;++b)for(var C=16*b,x=0;x<16;++x)u[C+x]=t[b]+t[x];return u}()},1924:(O,v,i)=>{"use strict";var e=i(210),y=i(5559),c=y(e("String.prototype.indexOf"));O.exports=function(h,n){var r=e(h,!!n);return"function"==typeof r&&c(h,".prototype.")>-1?y(r):r}},5559:(O,v,i)=>{"use strict";var e=i(8612),y=i(210),c=y("%Function.prototype.apply%"),h=y("%Function.prototype.call%"),n=y("%Reflect.apply%",!0)||e.call(h,c),r=y("%Object.getOwnPropertyDescriptor%",!0),a=y("%Object.defineProperty%",!0),d=y("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}O.exports=function(g){var o=n(e,h,arguments);if(r&&a){var s=r(o,"length");s.configurable&&a(o,"length",{value:1+d(0,g.length-(arguments.length-1))})}return o};var S=function(){return n(e,c,arguments)};a?a(O.exports,"apply",{value:S}):O.exports.apply=S},1027:(O,v,i)=>{var e=i(9509).Buffer,y=i(2830).Transform,c=i(2553).s;function h(n){y.call(this),this.hashMode="string"==typeof n,this.hashMode?this[n]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}i(5717)(h,y),h.prototype.update=function(n,r,a){"string"==typeof n&&(n=e.from(n,r));var d=this._update(n);return this.hashMode?this:(a&&(d=this._toString(d,a)),d)},h.prototype.setAutoPadding=function(){},h.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},h.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},h.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},h.prototype._transform=function(n,r,a){var d;try{this.hashMode?this._update(n):this.push(this._update(n))}catch(S){d=S}finally{a(d)}},h.prototype._flush=function(n){var r;try{this.push(this.__final())}catch(a){r=a}n(r)},h.prototype._finalOrDigest=function(n){var r=this.__final()||e.alloc(0);return n&&(r=this._toString(r,n,!0)),r},h.prototype._toString=function(n,r,a){if(this._decoder||(this._decoder=new c(r),this._encoding=r),this._encoding!==r)throw new Error("can't switch encodings");var d=this._decoder.write(n);return a&&(d+=this._decoder.end()),d},O.exports=h},6497:(O,v,i)=>{function e(y){return Object.prototype.toString.call(y)}v.isArray=function(y){return Array.isArray?Array.isArray(y):"[object Array]"===e(y)},v.isBoolean=function(y){return"boolean"==typeof y},v.isNull=function(y){return null===y},v.isNullOrUndefined=function(y){return null==y},v.isNumber=function(y){return"number"==typeof y},v.isString=function(y){return"string"==typeof y},v.isSymbol=function(y){return"symbol"==typeof y},v.isUndefined=function(y){return void 0===y},v.isRegExp=function(y){return"[object RegExp]"===e(y)},v.isObject=function(y){return"object"==typeof y&&null!==y},v.isDate=function(y){return"[object Date]"===e(y)},v.isError=function(y){return"[object Error]"===e(y)||y instanceof Error},v.isFunction=function(y){return"function"==typeof y},v.isPrimitive=function(y){return null===y||"boolean"==typeof y||"number"==typeof y||"string"==typeof y||"symbol"==typeof y||void 0===y},v.isBuffer=i(8764).Buffer.isBuffer},3482:(O,v,i)=>{"use strict";var e=i(5717),y=i(2318),c=i(9785),h=i(9072),n=i(1027);function r(a){n.call(this,"digest"),this._hash=a}e(r,n),r.prototype._update=function(a){this._hash.update(a)},r.prototype._final=function(){return this._hash.digest()},O.exports=function(a){return"md5"===(a=a.toLowerCase())?new y:"rmd160"===a||"ripemd160"===a?new c:new r(h(a))}},2840:(O,v,i)=>{var e=i(4155),y=i(778),c=function(){},h=function(n,r,a){if("function"==typeof r)return h(n,null,r);r||(r={}),a=y(a||c);var G,d=n._writableState,S=n._readableState,g=r.readable||!1!==r.readable&&n.readable,o=r.writable||!1!==r.writable&&n.writable,s=!1,f=function(){n.writable||l()},l=function(){o=!1,g||a.call(n)},p=function(){g=!1,o||a.call(n)},_=function(G){a.call(n,G?new Error("exited with error code: "+G):null)},E=function(G){a.call(n,G)},j=function(){e.nextTick(M)},M=function(){if(!s)return(!g||S&&S.ended&&!S.destroyed)&&(!o||d&&d.ended&&!d.destroyed)?void 0:a.call(n,new Error("premature close"))},F=function(){n.req.on("finish",l)};return(G=n).setHeader&&"function"==typeof G.abort?(n.on("complete",l),n.on("abort",j),n.req?F():n.on("request",F)):o&&!d&&(n.on("end",f),n.on("close",f)),function(G){return G.stdio&&Array.isArray(G.stdio)&&3===G.stdio.length}(n)&&n.on("exit",_),n.on("end",p),n.on("finish",l),!1!==r.error&&n.on("error",E),n.on("close",j),function(){s=!0,n.removeListener("complete",l),n.removeListener("abort",j),n.removeListener("request",F),n.req&&n.req.removeListener("finish",l),n.removeListener("end",f),n.removeListener("close",f),n.removeListener("finish",l),n.removeListener("exit",_),n.removeListener("end",p),n.removeListener("error",E),n.removeListener("close",j)}};O.exports=h},2294:(O,v,i)=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0}),v.EthereumProviderError=v.EthereumRpcError=void 0;const e=i(4445);class y extends Error{constructor(n,r,a){if(!Number.isInteger(n))throw new Error('"code" must be an integer.');if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string.');super(r),this.code=n,void 0!==a&&(this.data=a)}serialize(){const n={code:this.code,message:this.message};return void 0!==this.data&&(n.data=this.data),this.stack&&(n.stack=this.stack),n}toString(){return e.default(this.serialize(),c,2)}}function c(h,n){if("[Circular]"!==n)return n}v.EthereumRpcError=y,v.EthereumProviderError=class extends y{constructor(h,n,r){if(a=h,!(Number.isInteger(a)&&a>=1e3&&a<=4999))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');var a;super(h,n,r)}}},2662:(O,v)=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0}),v.errorValues=v.errorCodes=void 0,v.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},v.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},8797:(O,v,i)=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0}),v.ethErrors=void 0;const e=i(2294),y=i(8753),c=i(2662);function h(a,d){const[S,g]=r(d);return new e.EthereumRpcError(a,S||y.getMessageFromCode(a),g)}function n(a,d){const[S,g]=r(d);return new e.EthereumProviderError(a,S||y.getMessageFromCode(a),g)}function r(a){if(a){if("string"==typeof a)return[a];if("object"==typeof a&&!Array.isArray(a)){const{message:d,data:S}=a;if(d&&"string"!=typeof d)throw new Error("Must specify string message.");return[d||void 0,S]}}return[]}v.ethErrors={rpc:{parse:a=>h(c.errorCodes.rpc.parse,a),invalidRequest:a=>h(c.errorCodes.rpc.invalidRequest,a),invalidParams:a=>h(c.errorCodes.rpc.invalidParams,a),methodNotFound:a=>h(c.errorCodes.rpc.methodNotFound,a),internal:a=>h(c.errorCodes.rpc.internal,a),server:a=>{if(!a||"object"!=typeof a||Array.isArray(a))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:d}=a;if(!Number.isInteger(d)||d>-32005||d<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return h(d,a)},invalidInput:a=>h(c.errorCodes.rpc.invalidInput,a),resourceNotFound:a=>h(c.errorCodes.rpc.resourceNotFound,a),resourceUnavailable:a=>h(c.errorCodes.rpc.resourceUnavailable,a),transactionRejected:a=>h(c.errorCodes.rpc.transactionRejected,a),methodNotSupported:a=>h(c.errorCodes.rpc.methodNotSupported,a),limitExceeded:a=>h(c.errorCodes.rpc.limitExceeded,a)},provider:{userRejectedRequest:a=>n(c.errorCodes.provider.userRejectedRequest,a),unauthorized:a=>n(c.errorCodes.provider.unauthorized,a),unsupportedMethod:a=>n(c.errorCodes.provider.unsupportedMethod,a),disconnected:a=>n(c.errorCodes.provider.disconnected,a),chainDisconnected:a=>n(c.errorCodes.provider.chainDisconnected,a),custom:a=>{if(!a||"object"!=typeof a||Array.isArray(a))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:d,message:S,data:g}=a;if(!S||"string"!=typeof S)throw new Error('"message" must be a nonempty string');return new e.EthereumProviderError(d,S,g)}}}},9826:(O,v,i)=>{"use strict";v.Xy=v.Cg=v.Sy=void 0;const e=i(2294);Object.defineProperty(v,"Cg",{enumerable:!0,get:function(){return e.EthereumRpcError}});const y=i(8753);Object.defineProperty(v,"Xy",{enumerable:!0,get:function(){return y.serializeError}});const c=i(8797);Object.defineProperty(v,"Sy",{enumerable:!0,get:function(){return c.ethErrors}}),i(2662)},8753:(O,v,i)=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0}),v.serializeError=v.isValidCode=v.getMessageFromCode=v.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=i(2662),y=i(2294),c=e.errorCodes.rpc.internal,h={code:c,message:n(c)};function n(g,o="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(g)){const s=g.toString();if(S(e.errorValues,s))return e.errorValues[s].message;if(a(g))return v.JSON_RPC_SERVER_ERROR_MESSAGE}return o}function r(g){if(!Number.isInteger(g))return!1;const o=g.toString();return!!e.errorValues[o]||!!a(g)}function a(g){return g>=-32099&&g<=-32e3}function d(g){return g&&"object"==typeof g&&!Array.isArray(g)?Object.assign({},g):g}function S(g,o){return Object.prototype.hasOwnProperty.call(g,o)}v.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",v.getMessageFromCode=n,v.isValidCode=r,v.serializeError=function(g,{fallbackError:o=h,shouldIncludeStack:s=!1}={}){var f,l;if(!o||!Number.isInteger(o.code)||"string"!=typeof o.message)throw new Error("Must provide fallback error with integer number code and string message.");if(g instanceof y.EthereumRpcError)return g.serialize();const p={};if(g&&"object"==typeof g&&!Array.isArray(g)&&S(g,"code")&&r(g.code)){const E=g;p.code=E.code,E.message&&"string"==typeof E.message?(p.message=E.message,S(E,"data")&&(p.data=E.data)):(p.message=n(p.code),p.data={originalError:d(g)})}else{p.code=o.code;const E=null===(f=g)||void 0===f?void 0:f.message;p.message=E&&"string"==typeof E?E:o.message,p.data={originalError:d(g)}}const _=null===(l=g)||void 0===l?void 0:l.stack;return s&&g&&_&&"string"==typeof _&&(p.stack=_),p}},7187:O=>{"use strict";var v,i="object"==typeof Reflect?Reflect:null,e=i&&"function"==typeof i.apply?i.apply:function(l,p,_){return Function.prototype.apply.call(l,p,_)};v=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(l){return Object.getOwnPropertyNames(l).concat(Object.getOwnPropertySymbols(l))}:function(l){return Object.getOwnPropertyNames(l)};var y=Number.isNaN||function(l){return l!=l};function c(){c.init.call(this)}O.exports=c,O.exports.once=function(l,p){return new Promise(function(_,E){function j(F){l.removeListener(p,M),E(F)}function M(){"function"==typeof l.removeListener&&l.removeListener("error",j),_([].slice.call(arguments))}var F;f(l,p,M,{once:!0}),"error"!==p&&("function"==typeof(F=l).on&&f(F,"error",j,{once:!0}))})},c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var h=10;function n(l){if("function"!=typeof l)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof l)}function r(l){return void 0===l._maxListeners?c.defaultMaxListeners:l._maxListeners}function a(l,p,_,E){var j,M,F;if(n(_),void 0===(M=l._events)?(M=l._events=Object.create(null),l._eventsCount=0):(void 0!==M.newListener&&(l.emit("newListener",p,_.listener?_.listener:_),M=l._events),F=M[p]),void 0===F)F=M[p]=_,++l._eventsCount;else if("function"==typeof F?F=M[p]=E?[_,F]:[F,_]:E?F.unshift(_):F.push(_),(j=r(l))>0&&F.length>j&&!F.warned){F.warned=!0;var U=new Error("Possible EventEmitter memory leak detected. "+F.length+" "+String(p)+" listeners added. Use emitter.setMaxListeners() to increase limit");U.name="MaxListenersExceededWarning",U.emitter=l,U.type=p,U.count=F.length,console&&console.warn&&console.warn(U)}return l}function d(){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 S(l,p,_){var E={fired:!1,wrapFn:void 0,target:l,type:p,listener:_},j=d.bind(E);return j.listener=_,E.wrapFn=j,j}function g(l,p,_){var E=l._events;if(void 0===E)return[];var j=E[p];return void 0===j?[]:"function"==typeof j?_?[j.listener||j]:[j]:_?function(M){for(var F=new Array(M.length),G=0;G0&&(M=p[0]),M instanceof Error)throw M;var F=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw F.context=M,F}var G=j[l];if(void 0===G)return!1;if("function"==typeof G)e(G,this,p);else{var U=G.length,L=s(G,U);for(_=0;_=0;M--)if(_[M]===p||_[M].listener===p){F=_[M].listener,j=M;break}if(j<0)return this;0===j?_.shift():function(G,U){for(;U+1=0;E--)this.removeListener(l,p[E]);return this},c.prototype.listeners=function(l){return g(this,l,!0)},c.prototype.rawListeners=function(l){return g(this,l,!1)},c.listenerCount=function(l,p){return"function"==typeof l.listenerCount?l.listenerCount(p):o.call(l,p)},c.prototype.listenerCount=o,c.prototype.eventNames=function(){return this._eventsCount>0?v(this._events):[]}},4063:O=>{"use strict";O.exports=function v(i,e){if(i===e)return!0;if(i&&e&&"object"==typeof i&&"object"==typeof e){if(i.constructor!==e.constructor)return!1;var y,c,h;if(Array.isArray(i)){if((y=i.length)!=e.length)return!1;for(c=y;0!=c--;)if(!v(i[c],e[c]))return!1;return!0}if(i.constructor===RegExp)return i.source===e.source&&i.flags===e.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===e.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===e.toString();if((y=(h=Object.keys(i)).length)!==Object.keys(e).length)return!1;for(c=y;0!=c--;)if(!Object.prototype.hasOwnProperty.call(e,h[c]))return!1;for(c=y;0!=c--;){var n=h[c];if(!v(i[n],e[n]))return!1}return!0}return i!=i&&e!=e}},4445:O=>{O.exports=h,h.default=h,h.stable=d,h.stableStringify=d;var v="[...]",i="[Circular]",e=[],y=[];function c(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function h(o,s,f,l){var p;void 0===l&&(l=c()),r(o,"",0,[],void 0,0,l);try{p=0===y.length?JSON.stringify(o,s,f):JSON.stringify(o,g(s),f)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==e.length;){var _=e.pop();4===_.length?Object.defineProperty(_[0],_[1],_[3]):_[0][_[1]]=_[2]}}return p}function n(o,s,f,l){var p=Object.getOwnPropertyDescriptor(l,f);void 0!==p.get?p.configurable?(Object.defineProperty(l,f,{value:o}),e.push([l,f,s,p])):y.push([s,f,o]):(l[f]=o,e.push([l,f,s]))}function r(o,s,f,l,p,_,E){var j;if(_+=1,"object"==typeof o&&null!==o){for(j=0;jE.depthLimit||void 0!==E.edgesLimit&&f+1>E.edgesLimit)return void n(v,o,s,p);if(l.push(o),Array.isArray(o))for(j=0;js?1:0}function d(o,s,f,l){void 0===l&&(l=c());var p,_=S(o,"",0,[],void 0,0,l)||o;try{p=0===y.length?JSON.stringify(_,s,f):JSON.stringify(_,g(s),f)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==e.length;){var E=e.pop();4===E.length?Object.defineProperty(E[0],E[1],E[3]):E[0][E[1]]=E[2]}}return p}function S(o,s,f,l,p,_,E){var j;if(_+=1,"object"==typeof o&&null!==o){for(j=0;jE.depthLimit||void 0!==E.edgesLimit&&f+1>E.edgesLimit)return void n(v,o,s,p);if(l.push(o),Array.isArray(o))for(j=0;j0)for(var l=0;l{"use strict";var e=i(5320),y=Object.prototype.toString,c=Object.prototype.hasOwnProperty,h=function(a,d,S){for(var g=0,o=a.length;g=3&&(g=S),"[object Array]"===y.call(a)?h(a,d,g):"string"==typeof a?n(a,d,g):r(a,d,g)}},7648:O=>{"use strict";var v="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,e=Object.prototype.toString,y="[object Function]";O.exports=function(c){var h=this;if("function"!=typeof h||e.call(h)!==y)throw new TypeError(v+h);for(var n,r=i.call(arguments,1),a=function(){if(this instanceof n){var s=h.apply(this,r.concat(i.call(arguments)));return Object(s)===s?s:this}return h.apply(c,r.concat(i.call(arguments)))},d=Math.max(0,h.length-r.length),S=[],g=0;g{"use strict";var e=i(7648);O.exports=Function.prototype.bind||e},210:(O,v,i)=>{"use strict";var e,y=SyntaxError,c=Function,h=TypeError,n=function(et){try{return c('"use strict"; return ('+et+").constructor;")()}catch{}},r=Object.getOwnPropertyDescriptor;if(r)try{r({},"")}catch{r=null}var a=function(){throw new h},d=r?function(){try{return a}catch{try{return r(arguments,"callee").get}catch{return a}}}():a,S=i(1405)(),g=Object.getPrototypeOf||function(et){return et.__proto__},o={},s=typeof Uint8Array>"u"?e:g(Uint8Array),f={"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":S?g([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":o,"%AsyncGenerator%":o,"%AsyncGeneratorFunction%":o,"%AsyncIteratorPrototype%":o,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":c,"%GeneratorFunction%":o,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S?g(g([][Symbol.iterator]())):e,"%JSON%":"object"==typeof JSON?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map<"u"&&S?g((new Map)[Symbol.iterator]()):e,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set<"u"&&S?g((new Set)[Symbol.iterator]()):e,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S?g(""[Symbol.iterator]()):e,"%Symbol%":S?Symbol:e,"%SyntaxError%":y,"%ThrowTypeError%":d,"%TypedArray%":s,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet},l=function et(Z){var at;if("%AsyncFunction%"===Z)at=n("async function () {}");else if("%GeneratorFunction%"===Z)at=n("function* () {}");else if("%AsyncGeneratorFunction%"===Z)at=n("async function* () {}");else if("%AsyncGenerator%"===Z){var ut=et("%AsyncGeneratorFunction%");ut&&(at=ut.prototype)}else if("%AsyncIteratorPrototype%"===Z){var I=et("%AsyncGenerator%");I&&(at=g(I.prototype))}return f[Z]=at,at},p={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=i(8612),E=i(7642),j=_.call(Function.call,Array.prototype.concat),M=_.call(Function.apply,Array.prototype.splice),F=_.call(Function.call,String.prototype.replace),G=_.call(Function.call,String.prototype.slice),U=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,L=/\\(\\)?/g,$=function(et){var Z=G(et,0,1),at=G(et,-1);if("%"===Z&&"%"!==at)throw new y("invalid intrinsic syntax, expected closing `%`");if("%"===at&&"%"!==Z)throw new y("invalid intrinsic syntax, expected opening `%`");var ut=[];return F(et,U,function(I,m,D,A){ut[ut.length]=D?F(A,L,"$1"):m||I}),ut},ot=function(et,Z){var at,ut=et;if(E(p,ut)&&(ut="%"+(at=p[ut])[0]+"%"),E(f,ut)){var I=f[ut];if(I===o&&(I=l(ut)),void 0===I&&!Z)throw new h("intrinsic "+et+" exists, but is not available. Please file an issue!");return{alias:at,name:ut,value:I}}throw new y("intrinsic "+et+" does not exist!")};O.exports=function(et,Z){if("string"!=typeof et||0===et.length)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof Z)throw new h('"allowMissing" argument must be a boolean');var at=$(et),ut=at.length>0?at[0]:"",I=ot("%"+ut+"%",Z),m=I.name,D=I.value,A=!1,R=I.alias;R&&(ut=R[0],M(at,j([0,1],R)));for(var z=1,K=!0;z=at.length){var T=r(D,Q);D=(K=!!T)&&"get"in T&&!("originalValue"in T.get)?T.get:D[Q]}else K=E(D,Q),D=D[Q];K&&!A&&(f[m]=D)}}return D}},1405:(O,v,i)=>{"use strict";var e=typeof Symbol<"u"&&Symbol,y=i(5419);O.exports=function(){return"function"==typeof e&&"function"==typeof Symbol&&"symbol"==typeof e("foo")&&"symbol"==typeof Symbol("bar")&&y()}},5419:O=>{"use strict";O.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var v={},i=Symbol("test"),e=Object(i);if("string"==typeof i||"[object Symbol]"!==Object.prototype.toString.call(i)||"[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(i in v[i]=42,v)return!1;if("function"==typeof Object.keys&&0!==Object.keys(v).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(v).length)return!1;var y=Object.getOwnPropertySymbols(v);if(1!==y.length||y[0]!==i||!Object.prototype.propertyIsEnumerable.call(v,i))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var c=Object.getOwnPropertyDescriptor(v,i);if(42!==c.value||!0!==c.enumerable)return!1}return!0}},6410:(O,v,i)=>{"use strict";var e=i(5419);O.exports=function(){return e()&&!!Symbol.toStringTag}},7642:(O,v,i)=>{"use strict";var e=i(8612);O.exports=e.call(Function.call,Object.prototype.hasOwnProperty)},3349:(O,v,i)=>{"use strict";var e=i(9509).Buffer,y=i(8473).Transform;function c(h){y.call(this),this._block=e.allocUnsafe(h),this._blockSize=h,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}i(5717)(c,y),c.prototype._transform=function(h,n,r){var a=null;try{this.update(h,n)}catch(d){a=d}r(a)},c.prototype._flush=function(h){var n=null;try{this.push(this.digest())}catch(r){n=r}h(n)},c.prototype.update=function(h,n){if(function(o,s){if(!e.isBuffer(o)&&"string"!=typeof o)throw new TypeError("Data must be a string or a buffer")}(h),this._finalized)throw new Error("Digest already called");e.isBuffer(h)||(h=e.from(h,n));for(var r=this._block,a=0;this._blockOffset+h.length-a>=this._blockSize;){for(var d=this._blockOffset;d0;++S)this._length[S]+=g,(g=this._length[S]/4294967296|0)>0&&(this._length[S]-=4294967296*g);return this},c.prototype._update=function(){throw new Error("_update is not implemented")},c.prototype.digest=function(h){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var n=this._digest();void 0!==h&&(n=n.toString(h)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return n},c.prototype._digest=function(){throw new Error("_digest is not implemented")},O.exports=c},645:(O,v)=>{v.read=function(i,e,y,c,h){var n,r,a=8*h-c-1,d=(1<>1,g=-7,o=y?h-1:0,s=y?-1:1,f=i[e+o];for(o+=s,n=f&(1<<-g)-1,f>>=-g,g+=a;g>0;n=256*n+i[e+o],o+=s,g-=8);for(r=n&(1<<-g)-1,n>>=-g,g+=c;g>0;r=256*r+i[e+o],o+=s,g-=8);if(0===n)n=1-S;else{if(n===d)return r?NaN:1/0*(f?-1:1);r+=Math.pow(2,c),n-=S}return(f?-1:1)*r*Math.pow(2,n-c)},v.write=function(i,e,y,c,h,n){var r,a,d,S=8*n-h-1,g=(1<>1,s=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,f=c?0:n-1,l=c?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,r=g):(r=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-r))<1&&(r--,d*=2),(e+=r+o>=1?s/d:s*Math.pow(2,1-o))*d>=2&&(r++,d/=2),r+o>=g?(a=0,r=g):r+o>=1?(a=(e*d-1)*Math.pow(2,h),r+=o):(a=e*Math.pow(2,o-1)*Math.pow(2,h),r=0));h>=8;i[y+f]=255&a,f+=l,a/=256,h-=8);for(r=r<0;i[y+f]=255&r,f+=l,r/=256,S-=8);i[y+f-l]|=128*p}},5717:O=>{O.exports="function"==typeof Object.create?function(v,i){i&&(v.super_=i,v.prototype=Object.create(i.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}))}:function(v,i){if(i){v.super_=i;var e=function(){};e.prototype=i.prototype,v.prototype=new e,v.prototype.constructor=v}}},2584:(O,v,i)=>{"use strict";var e=i(6410)(),y=i(1924)("Object.prototype.toString"),c=function(r){return!(e&&r&&"object"==typeof r&&Symbol.toStringTag in r)&&"[object Arguments]"===y(r)},h=function(r){return!!c(r)||null!==r&&"object"==typeof r&&"number"==typeof r.length&&r.length>=0&&"[object Array]"!==y(r)&&"[object Function]"===y(r.callee)},n=function(){return c(arguments)}();c.isLegacyArguments=h,O.exports=n?c:h},5320:O=>{"use strict";var v,i,e=Function.prototype.toString,y="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof y&&"function"==typeof Object.defineProperty)try{v=Object.defineProperty({},"length",{get:function(){throw i}}),i={},y(function(){throw 42},null,v)}catch(d){d!==i&&(y=null)}else y=null;var c=/^\s*class\b/,h=function(d){try{var S=e.call(d);return c.test(S)}catch{return!1}},n=Object.prototype.toString,r="function"==typeof Symbol&&!!Symbol.toStringTag,a="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};O.exports=y?function(d){if(d===a)return!0;if(!d||"function"!=typeof d&&"object"!=typeof d)return!1;if("function"==typeof d&&!d.prototype)return!0;try{y(d,null,v)}catch(S){if(S!==i)return!1}return!h(d)}:function(d){if(d===a)return!0;if(!d||"function"!=typeof d&&"object"!=typeof d)return!1;if("function"==typeof d&&!d.prototype)return!0;if(r)return function(g){try{return!h(g)&&(e.call(g),!0)}catch{return!1}}(d);if(h(d))return!1;var S=n.call(d);return"[object Function]"===S||"[object GeneratorFunction]"===S}},8662:(O,v,i)=>{"use strict";var e,y=Object.prototype.toString,c=Function.prototype.toString,h=/^\s*(?:function)?\*/,n=i(6410)(),r=Object.getPrototypeOf;O.exports=function(a){if("function"!=typeof a)return!1;if(h.test(c.call(a)))return!0;if(!n)return"[object GeneratorFunction]"===y.call(a);if(!r)return!1;if(void 0===e){var d=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}}();e=!!d&&r(d)}return r(a)===e}},4970:O=>{"use strict";const v=i=>null!==i&&"object"==typeof i&&"function"==typeof i.pipe;v.writable=i=>v(i)&&!1!==i.writable&&"function"==typeof i._write&&"object"==typeof i._writableState,v.readable=i=>v(i)&&!1!==i.readable&&"function"==typeof i._read&&"object"==typeof i._readableState,v.duplex=i=>v.writable(i)&&v.readable(i),v.transform=i=>v.duplex(i)&&"function"==typeof i._transform,O.exports=v},5692:(O,v,i)=>{"use strict";var e=i(4029),y=i(3083),c=i(1924),h=c("Object.prototype.toString"),n=i(6410)(),r=typeof globalThis>"u"?i.g:globalThis,a=y(),d=c("Array.prototype.indexOf",!0)||function(f,l){for(var p=0;p-1}return!!o&&(p=f,_=!1,e(g,function(E,j){if(!_)try{_=E.call(p)===j}catch{}}),_);var p,_}},5811:(O,v,i)=>{O.exports=i(6066)(i(9653))},6066:(O,v,i)=>{const e=i(7016),y=i(5675);O.exports=function(c){const h=e(c),n=y(c);return function(r,a){switch("string"==typeof r?r.toLowerCase():r){case"keccak224":return new h(1152,448,null,224,a);case"keccak256":return new h(1088,512,null,256,a);case"keccak384":return new h(832,768,null,384,a);case"keccak512":return new h(576,1024,null,512,a);case"sha3-224":return new h(1152,448,6,224,a);case"sha3-256":return new h(1088,512,6,256,a);case"sha3-384":return new h(832,768,6,384,a);case"sha3-512":return new h(576,1024,6,512,a);case"shake128":return new n(1344,256,31,a);case"shake256":return new n(1088,512,31,a);default:throw new Error("Invald algorithm: "+r)}}}},7016:(O,v,i)=>{var e=i(8764).Buffer;const{Transform:y}=i(8473);O.exports=c=>class je extends y{constructor(n,r,a,d,S){super(S),this._rate=n,this._capacity=r,this._delimitedSuffix=a,this._hashBitLength=d,this._options=S,this._state=new c,this._state.initialize(n,r),this._finalized=!1}_transform(n,r,a){let d=null;try{this.update(n,r)}catch(S){d=S}a(d)}_flush(n){let r=null;try{this.push(this.digest())}catch(a){r=a}n(r)}update(n,r){if(!e.isBuffer(n)&&"string"!=typeof n)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return e.isBuffer(n)||(n=e.from(n,r)),this._state.absorb(n),this}digest(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let r=this._state.squeeze(this._hashBitLength/8);return void 0!==n&&(r=r.toString(n)),this._resetState(),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new je(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}}},5675:(O,v,i)=>{var e=i(8764).Buffer;const{Transform:y}=i(8473);O.exports=c=>class xe extends y{constructor(n,r,a,d){super(d),this._rate=n,this._capacity=r,this._delimitedSuffix=a,this._options=d,this._state=new c,this._state.initialize(n,r),this._finalized=!1}_transform(n,r,a){let d=null;try{this.update(n,r)}catch(S){d=S}a(d)}_flush(){}_read(n){this.push(this.squeeze(n))}update(n,r){if(!e.isBuffer(n)&&"string"!=typeof n)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return e.isBuffer(n)||(n=e.from(n,r)),this._state.absorb(n),this}squeeze(n,r){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let a=this._state.squeeze(n);return void 0!==r&&(a=a.toString(r)),a}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new xe(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}}},4040:(O,v)=>{const i=[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.p1600=function(e){for(let y=0;y<24;++y){const c=e[0]^e[10]^e[20]^e[30]^e[40],h=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],r=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],d=e[5]^e[15]^e[25]^e[35]^e[45],S=e[6]^e[16]^e[26]^e[36]^e[46],g=e[7]^e[17]^e[27]^e[37]^e[47],o=e[8]^e[18]^e[28]^e[38]^e[48],s=e[9]^e[19]^e[29]^e[39]^e[49];let f=o^(n<<1|r>>>31),l=s^(r<<1|n>>>31);const p=e[0]^f,_=e[1]^l,E=e[10]^f,j=e[11]^l,M=e[20]^f,F=e[21]^l,G=e[30]^f,U=e[31]^l,L=e[40]^f,$=e[41]^l;f=c^(a<<1|d>>>31),l=h^(d<<1|a>>>31);const ot=e[2]^f,et=e[3]^l,Z=e[12]^f,at=e[13]^l,ut=e[22]^f,I=e[23]^l,m=e[32]^f,D=e[33]^l,A=e[42]^f,R=e[43]^l;f=n^(S<<1|g>>>31),l=r^(g<<1|S>>>31);const z=e[4]^f,K=e[5]^l,Q=e[14]^f,nt=e[15]^l,J=e[24]^f,T=e[25]^l,k=e[34]^f,t=e[35]^l,u=e[44]^f,b=e[45]^l;f=a^(o<<1|s>>>31),l=d^(s<<1|o>>>31);const C=e[6]^f,x=e[7]^l,N=e[16]^f,Y=e[17]^l,ct=e[26]^f,pt=e[27]^l,gt=e[36]^f,yt=e[37]^l,bt=e[46]^f,Et=e[47]^l;f=S^(c<<1|h>>>31),l=g^(h<<1|c>>>31);const Rt=e[8]^f,Mt=e[9]^l,Vt=e[18]^f,Pt=e[19]^l,Nt=e[28]^f,qt=e[29]^l,Ut=e[38]^f,ce=e[39]^l,he=e[48]^f,me=e[49]^l,Zt=p,St=_,Bt=j<<4|E>>>28,Qt=E<<4|j>>>28,re=M<<3|F>>>29,zt=F<<3|M>>>29,ne=U<<9|G>>>23,Ht=G<<9|U>>>23,Yt=L<<18|$>>>14,ie=$<<18|L>>>14,oe=ot<<1|et>>>31,te=et<<1|ot>>>31,fe=at<<12|Z>>>20,se=Z<<12|at>>>20,q=ut<<10|I>>>22,H=I<<10|ut>>>22,it=D<<13|m>>>19,ft=m<<13|D>>>19,vt=A<<2|R>>>30,Ot=R<<2|A>>>30,At=K<<30|z>>>2,It=z<<30|K>>>2,jt=Q<<6|nt>>>26,xt=nt<<6|Q>>>26,kt=T<<11|J>>>21,Jt=J<<11|T>>>21,Xt=k<<15|t>>>17,Gt=t<<15|k>>>17,Kt=b<<29|u>>>3,Wt=u<<29|b>>>3,Lt=C<<28|x>>>4,de=x<<28|C>>>4,ee=Y<<23|N>>>9,W=N<<23|Y>>>9,w=ct<<25|pt>>>7,P=pt<<25|ct>>>7,B=gt<<21|yt>>>11,V=yt<<21|gt>>>11,tt=Et<<24|bt>>>8,X=bt<<24|Et>>>8,st=Rt<<27|Mt>>>5,rt=Mt<<27|Rt>>>5,lt=Vt<<20|Pt>>>12,ht=Pt<<20|Vt>>>12,dt=qt<<7|Nt>>>25,mt=Nt<<7|qt>>>25,_t=Ut<<8|ce>>>24,Dt=ce<<8|Ut>>>24,Ct=he<<14|me>>>18,Ft=me<<14|he>>>18;e[0]=Zt^~fe&kt,e[1]=St^~se&Jt,e[10]=Lt^~lt&re,e[11]=de^~ht&zt,e[20]=oe^~jt&w,e[21]=te^~xt&P,e[30]=st^~Bt&q,e[31]=rt^~Qt&H,e[40]=At^~ee&dt,e[41]=It^~W&mt,e[2]=fe^~kt&B,e[3]=se^~Jt&V,e[12]=lt^~re&it,e[13]=ht^~zt&ft,e[22]=jt^~w&_t,e[23]=xt^~P&Dt,e[32]=Bt^~q&Xt,e[33]=Qt^~H&Gt,e[42]=ee^~dt&ne,e[43]=W^~mt&Ht,e[4]=kt^~B&Ct,e[5]=Jt^~V&Ft,e[14]=re^~it&Kt,e[15]=zt^~ft&Wt,e[24]=w^~_t&Yt,e[25]=P^~Dt&ie,e[34]=q^~Xt&tt,e[35]=H^~Gt&X,e[44]=dt^~ne&vt,e[45]=mt^~Ht&Ot,e[6]=B^~Ct&Zt,e[7]=V^~Ft&St,e[16]=it^~Kt&Lt,e[17]=ft^~Wt&de,e[26]=_t^~Yt&oe,e[27]=Dt^~ie&te,e[36]=Xt^~tt&st,e[37]=Gt^~X&rt,e[46]=ne^~vt&At,e[47]=Ht^~Ot&It,e[8]=Ct^~Zt&fe,e[9]=Ft^~St&se,e[18]=Kt^~Lt<,e[19]=Wt^~de&ht,e[28]=Yt^~oe&jt,e[29]=ie^~te&xt,e[38]=tt^~st&Bt,e[39]=X^~rt&Qt,e[48]=vt^~At&ee,e[49]=Ot^~It&W,e[0]^=i[2*y],e[1]^=i[2*y+1]}}},9653:(O,v,i)=>{var e=i(8764).Buffer;const y=i(4040);function c(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}c.prototype.initialize=function(h,n){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=h/8,this.count=0,this.squeezing=!1},c.prototype.absorb=function(h){for(let n=0;n>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(y.p1600(this.state),this.count=0);return n},c.prototype.copy=function(h){for(let n=0;n<50;++n)h.state[n]=this.state[n];h.blockSize=this.blockSize,h.count=this.count,h.squeezing=this.squeezing},O.exports=c},2378:(O,v,i)=>{O=i.nmd(O);var e="__lodash_hash_undefined__",y=9007199254740991,c="[object Arguments]",h="[object Function]",n="[object Object]",r=/^\[object .+?Constructor\]$/,a=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[c]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d[h]=d["[object Map]"]=d["[object Number]"]=d[n]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1;var S="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,g="object"==typeof self&&self&&self.Object===Object&&self,o=S||g||Function("return this")(),s=v&&!v.nodeType&&v,f=s&&O&&!O.nodeType&&O,l=f&&f.exports===s,p=l&&S.process,_=function(){try{return f&&f.require&&f.require("util").types||p&&p.binding&&p.binding("util")}catch{}}(),E=_&&_.isTypedArray;function j(q,H,it){switch(it.length){case 0:return q.call(H);case 1:return q.call(H,it[0]);case 2:return q.call(H,it[0],it[1]);case 3:return q.call(H,it[0],it[1],it[2])}return q.apply(H,it)}var M,F,G,U=Array.prototype,$=Object.prototype,ot=o["__core-js_shared__"],et=Function.prototype.toString,Z=$.hasOwnProperty,at=(M=/[^.]+$/.exec(ot&&ot.keys&&ot.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",ut=$.toString,I=et.call(Object),m=RegExp("^"+et.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),D=l?o.Buffer:void 0,A=o.Symbol,R=o.Uint8Array,z=(F=Object.getPrototypeOf,G=Object,function(q){return F(G(q))}),K=Object.create,Q=$.propertyIsEnumerable,nt=U.splice,J=A?A.toStringTag:void 0,T=function(){try{var q=qt(Object,"defineProperty");return q({},"",{}),q}catch{}}(),k=D?D.isBuffer:void 0,t=Math.max,u=Date.now,b=qt(o,"Map"),C=qt(Object,"create"),x=function(){function q(){}return function(H){if(!Ht(H))return{};if(K)return K(H);q.prototype=H;var it=new q;return q.prototype=void 0,it}}();function N(q){var H=-1,it=null==q?0:q.length;for(this.clear();++H-1},Y.prototype.set=function(q,H){var it=this.__data__,ft=bt(it,q);return ft<0?(++this.size,it.push([q,H])):it[ft][1]=H,this},ct.prototype.clear=function(){this.size=0,this.__data__={hash:new N,map:new(b||Y),string:new N}},ct.prototype.delete=function(q){var H=Nt(this,q).delete(q);return this.size-=H?1:0,H},ct.prototype.get=function(q){return Nt(this,q).get(q)},ct.prototype.has=function(q){return Nt(this,q).has(q)},ct.prototype.set=function(q,H){var it=Nt(this,q),ft=it.size;return it.set(q,H),this.size+=it.size==ft?0:1,this},pt.prototype.clear=function(){this.__data__=new Y,this.size=0},pt.prototype.delete=function(q){var H=this.__data__,it=H.delete(q);return this.size=H.size,it},pt.prototype.get=function(q){return this.__data__.get(q)},pt.prototype.has=function(q){return this.__data__.has(q)},pt.prototype.set=function(q,H){var it=this.__data__;if(it instanceof Y){var ft=it.__data__;if(!b||ft.length<199)return ft.push([q,H]),this.size=++it.size,this;it=this.__data__=new ct(ft)}return it.set(q,H),this.size=it.size,this};var Pt=T?function(q,H){return T(q,"toString",{configurable:!0,enumerable:!1,value:(it=H,function(){return it}),writable:!0});var it}:se;function Nt(q,H){var it,ft,vt=q.__data__;return("string"==(ft=typeof(it=H))||"number"==ft||"symbol"==ft||"boolean"==ft?"__proto__"!==it:null===it)?vt["string"==typeof H?"string":"hash"]:vt.map}function qt(q,H){var ft,it=null==(ft=q)?void 0:ft[H];return function(ft){return!(!Ht(ft)||function(vt){return!!at&&at in vt}(ft))&&(zt(ft)?m:r).test(function(vt){if(null!=vt){try{return et.call(vt)}catch{}try{return vt+""}catch{}}return""}(ft))}(it)?it:void 0}function Ut(q,H){var it=typeof q;return!!(H=H??y)&&("number"==it||"symbol"!=it&&a.test(q))&&q>-1&&q%1==0&&q0){if(++H>=800)return arguments[0]}else H=0;return q.apply(void 0,arguments)});function Zt(q,H){return q===H||q!=q&&H!=H}var St=Mt(function(){return arguments}())?Mt:function(q){return Yt(q)&&Z.call(q,"callee")&&!Q.call(q,"callee")},Bt=Array.isArray;function Qt(q){return null!=q&&ne(q.length)&&!zt(q)}var re=k||function(){return!1};function zt(q){if(!Ht(q))return!1;var H=Rt(q);return H==h||"[object GeneratorFunction]"==H||"[object AsyncFunction]"==H||"[object Proxy]"==H}function ne(q){return"number"==typeof q&&q>-1&&q%1==0&&q<=y}function Ht(q){var H=typeof q;return null!=q&&("object"==H||"function"==H)}function Yt(q){return null!=q&&"object"==typeof q}var ie=E?function(q){return function(H){return q(H)}}(E):function(q){return Yt(q)&&ne(q.length)&&!!d[Rt(q)]};function oe(q){return Qt(q)?function(H,it){var ft=Bt(H),vt=!ft&&St(H),Ot=!ft&&!vt&&re(H),At=!ft&&!vt&&!Ot&&ie(H),It=ft||vt||Ot||At,jt=It?function(Jt,Xt){for(var Gt=-1,Kt=Array(Jt);++Gt1?H[ft-1]:void 0,Ot=ft>2?H[2]:void 0;for(vt=te.length>3&&"function"==typeof vt?(ft--,vt):void 0,Ot&&function(It,jt,xt){if(!Ht(xt))return!1;var kt=typeof jt;return!!("number"==kt?Qt(xt)&&Ut(jt,xt.length):"string"==kt&&jt in xt)&&Zt(xt[jt],It)}(H[0],H[1],Ot)&&(vt=ft<3?void 0:vt,ft=1),q=Object(q);++it=0&&Z<=L.levels.SILENT))throw"log.setLevel() called with invalid level: "+Z;if(U=Z,!1!==at&&function(ut){var I=(d[ut]||"silent").toUpperCase();if(typeof window!==r&&$){try{return void(window.localStorage[$]=I)}catch{}try{window.document.cookie=encodeURIComponent($)+"="+I+";"}catch{}}}(Z),s.call(L,Z,M),typeof console===r&&Z{"use strict";var e=i(5717),y=i(3349),c=i(9509).Buffer,h=new Array(16);function n(){y.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function r(o,s){return o<>>32-s}function a(o,s,f,l,p,_,E){return r(o+(s&f|~s&l)+p+_|0,E)+s|0}function d(o,s,f,l,p,_,E){return r(o+(s&l|f&~l)+p+_|0,E)+s|0}function S(o,s,f,l,p,_,E){return r(o+(s^f^l)+p+_|0,E)+s|0}function g(o,s,f,l,p,_,E){return r(o+(f^(s|~l))+p+_|0,E)+s|0}e(n,y),n.prototype._update=function(){for(var o=h,s=0;s<16;++s)o[s]=this._block.readInt32LE(4*s);var f=this._a,l=this._b,p=this._c,_=this._d;f=a(f,l,p,_,o[0],3614090360,7),_=a(_,f,l,p,o[1],3905402710,12),p=a(p,_,f,l,o[2],606105819,17),l=a(l,p,_,f,o[3],3250441966,22),f=a(f,l,p,_,o[4],4118548399,7),_=a(_,f,l,p,o[5],1200080426,12),p=a(p,_,f,l,o[6],2821735955,17),l=a(l,p,_,f,o[7],4249261313,22),f=a(f,l,p,_,o[8],1770035416,7),_=a(_,f,l,p,o[9],2336552879,12),p=a(p,_,f,l,o[10],4294925233,17),l=a(l,p,_,f,o[11],2304563134,22),f=a(f,l,p,_,o[12],1804603682,7),_=a(_,f,l,p,o[13],4254626195,12),p=a(p,_,f,l,o[14],2792965006,17),f=d(f,l=a(l,p,_,f,o[15],1236535329,22),p,_,o[1],4129170786,5),_=d(_,f,l,p,o[6],3225465664,9),p=d(p,_,f,l,o[11],643717713,14),l=d(l,p,_,f,o[0],3921069994,20),f=d(f,l,p,_,o[5],3593408605,5),_=d(_,f,l,p,o[10],38016083,9),p=d(p,_,f,l,o[15],3634488961,14),l=d(l,p,_,f,o[4],3889429448,20),f=d(f,l,p,_,o[9],568446438,5),_=d(_,f,l,p,o[14],3275163606,9),p=d(p,_,f,l,o[3],4107603335,14),l=d(l,p,_,f,o[8],1163531501,20),f=d(f,l,p,_,o[13],2850285829,5),_=d(_,f,l,p,o[2],4243563512,9),p=d(p,_,f,l,o[7],1735328473,14),f=S(f,l=d(l,p,_,f,o[12],2368359562,20),p,_,o[5],4294588738,4),_=S(_,f,l,p,o[8],2272392833,11),p=S(p,_,f,l,o[11],1839030562,16),l=S(l,p,_,f,o[14],4259657740,23),f=S(f,l,p,_,o[1],2763975236,4),_=S(_,f,l,p,o[4],1272893353,11),p=S(p,_,f,l,o[7],4139469664,16),l=S(l,p,_,f,o[10],3200236656,23),f=S(f,l,p,_,o[13],681279174,4),_=S(_,f,l,p,o[0],3936430074,11),p=S(p,_,f,l,o[3],3572445317,16),l=S(l,p,_,f,o[6],76029189,23),f=S(f,l,p,_,o[9],3654602809,4),_=S(_,f,l,p,o[12],3873151461,11),p=S(p,_,f,l,o[15],530742520,16),f=g(f,l=S(l,p,_,f,o[2],3299628645,23),p,_,o[0],4096336452,6),_=g(_,f,l,p,o[7],1126891415,10),p=g(p,_,f,l,o[14],2878612391,15),l=g(l,p,_,f,o[5],4237533241,21),f=g(f,l,p,_,o[12],1700485571,6),_=g(_,f,l,p,o[3],2399980690,10),p=g(p,_,f,l,o[10],4293915773,15),l=g(l,p,_,f,o[1],2240044497,21),f=g(f,l,p,_,o[8],1873313359,6),_=g(_,f,l,p,o[15],4264355552,10),p=g(p,_,f,l,o[6],2734768916,15),l=g(l,p,_,f,o[13],1309151649,21),f=g(f,l,p,_,o[4],4149444226,6),_=g(_,f,l,p,o[11],3174756917,10),p=g(p,_,f,l,o[2],718787259,15),l=g(l,p,_,f,o[9],3951481745,21),this._a=this._a+f|0,this._b=this._b+l|0,this._c=this._c+p|0,this._d=this._d+_|0},n.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var o=c.allocUnsafe(16);return o.writeInt32LE(this._a,0),o.writeInt32LE(this._b,4),o.writeInt32LE(this._c,8),o.writeInt32LE(this._d,12),o},O.exports=n},778:(O,v,i)=>{var e=i(2479);function y(h){var n=function(){return n.called?n.value:(n.called=!0,n.value=h.apply(this,arguments))};return n.called=!1,n}function c(h){var n=function(){if(n.called)throw new Error(n.onceError);return n.called=!0,n.value=h.apply(this,arguments)};return n.onceError=(h.name||"Function wrapped with `once`")+" shouldn't be called more than once",n.called=!1,n}O.exports=e(y),O.exports.strict=e(c),y.proto=y(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return y(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return c(this)},configurable:!0})})},8212:(O,v,i)=>{"use strict";var e=i(4155);O.exports=void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?{nextTick:function(y,c,h,n){if("function"!=typeof y)throw new TypeError('"callback" argument must be a function');var r,a,d=arguments.length;switch(d){case 0:case 1:return e.nextTick(y);case 2:return e.nextTick(function(){y.call(null,c)});case 3:return e.nextTick(function(){y.call(null,c,h)});case 4:return e.nextTick(function(){y.call(null,c,h,n)});default:for(r=new Array(d-1),a=0;a{var v,i,e=O.exports={};function y(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function h(f){if(v===setTimeout)return setTimeout(f,0);if((v===y||!v)&&setTimeout)return v=setTimeout,setTimeout(f,0);try{return v(f,0)}catch{try{return v.call(null,f,0)}catch{return v.call(this,f,0)}}}!function(){try{v="function"==typeof setTimeout?setTimeout:y}catch{v=y}try{i="function"==typeof clearTimeout?clearTimeout:c}catch{i=c}}();var n,r=[],a=!1,d=-1;function S(){a&&n&&(a=!1,n.length?r=n.concat(r):d=-1,r.length&&g())}function g(){if(!a){var f=h(S);a=!0;for(var l=r.length;l;){for(n=r,r=[];++d1)for(var p=1;p{var e=i(4155),y=i(778),c=i(2840),h=i(1156),n=function(){},r=/^v?\.0/.test(e.version),a=function(o){return"function"==typeof o},d=function(o,s,f,l){l=y(l);var p=!1;o.on("close",function(){p=!0}),c(o,{readable:s,writable:f},function(E){if(E)return l(E);p=!0,l()});var _=!1;return function(E){if(!p&&!_)return _=!0,j=o,r&&h&&(j instanceof(h.ReadStream||n)||j instanceof(h.WriteStream||n))&&a(j.close)?o.close(n):function(j){return j.setHeader&&a(j.abort)}(o)?o.abort():a(o.destroy)?o.destroy():void l(E||new Error("stream was destroyed"));var j}},S=function(o){o()},g=function(o,s){return o.pipe(s)};O.exports=function(){var o,s=Array.prototype.slice.call(arguments),f=a(s[s.length-1]||n)&&s.pop()||n;if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new Error("pump requires two streams per minimum");var l=s.map(function(p,_){var E=_0,function(j){o||(o=j),j&&l.forEach(S),E||(l.forEach(S),f(o))})});return s.reduce(g)}},1798:(O,v,i)=>{"use strict";var e=i(4155),y=65536,c=i(9509).Buffer,h=i.g.crypto||i.g.msCrypto;O.exports=h&&h.getRandomValues?function(n,r){if(n>4294967295)throw new RangeError("requested too many random bytes");var a=c.allocUnsafe(n);if(n>0)if(n>y)for(var d=0;d{"use strict";var v={};function i(y,c,h){h||(h=Error);var n=function(r){var a,d;function S(g,o,s){return r.call(this,"string"==typeof c?c:c(g,o,s))||this}return d=r,(a=S).prototype=Object.create(d.prototype),a.prototype.constructor=a,a.__proto__=d,S}(h);n.prototype.name=h.name,n.prototype.code=y,v[y]=n}function e(y,c){if(Array.isArray(y)){var h=y.length;return y=y.map(function(n){return String(n)}),h>2?"one of ".concat(c," ").concat(y.slice(0,h-1).join(", "),", or ")+y[h-1]:2===h?"one of ".concat(c," ").concat(y[0]," or ").concat(y[1]):"of ".concat(c," ").concat(y[0])}return"of ".concat(c," ").concat(String(y))}i("ERR_INVALID_OPT_VALUE",function(y,c){return'The value "'+c+'" is invalid for option "'+y+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(y,c,h){var n,a,d,S,o,f;if("string"==typeof c&&"not "===c.substr(0,"not ".length)?(n="must not be",c=c.replace(/^not /,"")):n="must be",o=y,(void 0===f||f>o.length)&&(f=o.length)," argument"===o.substring(f-" argument".length,f))a="The ".concat(y," ").concat(n," ").concat(e(c,"type"));else{var g=("number"!=typeof S&&(S=0),S+1>(d=y).length||-1===d.indexOf(".",S)?"argument":"property");a='The "'.concat(y,'" ').concat(g," ").concat(n," ").concat(e(c,"type"))}return a+". Received type ".concat(typeof h)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(y){return"The "+y+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(y){return"Cannot call "+y+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(y){return"Unknown encoding: "+y},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),O.exports.q=v},6753:(O,v,i)=>{"use strict";var e=i(4155),y=Object.keys||function(o){var s=[];for(var f in o)s.push(f);return s};O.exports=d;var c=i(9481),h=i(4229);i(5717)(d,c);for(var n=y(h.prototype),r=0;r{"use strict";O.exports=y;var e=i(4605);function y(c){if(!(this instanceof y))return new y(c);e.call(this,c)}i(5717)(y,e),y.prototype._transform=function(c,h,n){n(null,c)}},9481:(O,v,i)=>{"use strict";var e,y=i(4155);O.exports=L,L.ReadableState=U,i(7187);var c,h=function(T,k){return T.listeners(k).length},n=i(2503),r=i(8764).Buffer,a=i.g.Uint8Array||function(){},d=i(4616);c=d&&d.debuglog?d.debuglog("stream"):function(){};var S,g,o,s=i(7327),f=i(1195),l=i(2457).getHighWaterMark,p=i(4281).q,_=p.ERR_INVALID_ARG_TYPE,E=p.ERR_STREAM_PUSH_AFTER_EOF,j=p.ERR_METHOD_NOT_IMPLEMENTED,M=p.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;i(5717)(L,n);var F=f.errorOrDestroy,G=["error","close","destroy","pause","resume"];function U(T,k,t){e=e||i(6753),"boolean"!=typeof t&&(t=k instanceof e),this.objectMode=!!(T=T||{}).objectMode,t&&(this.objectMode=this.objectMode||!!T.readableObjectMode),this.highWaterMark=l(this,T,"readableHighWaterMark",t),this.buffer=new s,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==T.emitClose,this.autoDestroy=!!T.autoDestroy,this.destroyed=!1,this.defaultEncoding=T.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,T.encoding&&(S||(S=i(2553).s),this.decoder=new S(T.encoding),this.encoding=T.encoding)}function L(T){if(e=e||i(6753),!(this instanceof L))return new L(T);this._readableState=new U(T,this,this instanceof e),this.readable=!0,T&&("function"==typeof T.read&&(this._read=T.read),"function"==typeof T.destroy&&(this._destroy=T.destroy)),n.call(this)}function $(T,k,t,u,b){c("readableAddChunk",k);var C,N,Y,ct,pt,x=T._readableState;if(null===k)x.reading=!1,function(N,Y){if(c("onEofChunk"),!Y.ended){if(Y.decoder){var ct=Y.decoder.end();ct&&ct.length&&(Y.buffer.push(ct),Y.length+=Y.objectMode?1:ct.length)}Y.ended=!0,Y.sync?at(N):(Y.needReadable=!1,Y.emittedReadable||(Y.emittedReadable=!0,ut(N)))}}(T,x);else if(b||(N=x,r.isBuffer(pt=Y=k)||pt instanceof a||"string"==typeof Y||void 0===Y||N.objectMode||(ct=new _("chunk",["string","Buffer","Uint8Array"],Y)),C=ct),C)F(T,C);else if(x.objectMode||k&&k.length>0)if("string"==typeof k||x.objectMode||Object.getPrototypeOf(k)===r.prototype||(k=function(N){return r.from(N)}(k)),u)x.endEmitted?F(T,new M):ot(T,x,k,!0);else if(x.ended)F(T,new E);else{if(x.destroyed)return!1;x.reading=!1,x.decoder&&!t?(k=x.decoder.write(k),x.objectMode||0!==k.length?ot(T,x,k,!1):I(T,x)):ot(T,x,k,!1)}else u||(x.reading=!1,I(T,x));return!x.ended&&(x.lengthk.highWaterMark&&(k.highWaterMark=((t=T)>=et?t=et:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t)),T<=k.length?T:k.ended?k.length:(k.needReadable=!0,0));var t}function at(T){var k=T._readableState;c("emitReadable",k.needReadable,k.emittedReadable),k.needReadable=!1,k.emittedReadable||(c("emitReadable",k.flowing),k.emittedReadable=!0,y.nextTick(ut,T))}function ut(T){var k=T._readableState;c("emitReadable_",k.destroyed,k.length,k.ended),k.destroyed||!k.length&&!k.ended||(T.emit("readable"),k.emittedReadable=!1),k.needReadable=!k.flowing&&!k.ended&&k.length<=k.highWaterMark,z(T)}function I(T,k){k.readingMore||(k.readingMore=!0,y.nextTick(m,T,k))}function m(T,k){for(;!k.reading&&!k.ended&&(k.length0,k.resumeScheduled&&!k.paused?k.flowing=!0:T.listenerCount("data")>0&&T.resume()}function A(T){c("readable nexttick read 0"),T.read(0)}function R(T,k){c("resume",k.reading),k.reading||T.read(0),k.resumeScheduled=!1,T.emit("resume"),z(T),k.flowing&&!k.reading&&T.read(0)}function z(T){var k=T._readableState;for(c("flow",k.flowing);k.flowing&&null!==T.read(););}function K(T,k){return 0===k.length?null:(k.objectMode?t=k.buffer.shift():!T||T>=k.length?(t=k.decoder?k.buffer.join(""):1===k.buffer.length?k.buffer.first():k.buffer.concat(k.length),k.buffer.clear()):t=k.buffer.consume(T,k.decoder),t);var t}function Q(T){var k=T._readableState;c("endReadable",k.endEmitted),k.endEmitted||(k.ended=!0,y.nextTick(nt,k,T))}function nt(T,k){if(c("endReadableNT",T.endEmitted,T.length),!T.endEmitted&&0===T.length&&(T.endEmitted=!0,k.readable=!1,k.emit("end"),T.autoDestroy)){var t=k._writableState;(!t||t.autoDestroy&&t.finished)&&k.destroy()}}function J(T,k){for(var t=0,u=T.length;t=k.highWaterMark:k.length>0)||k.ended))return c("read: emitReadable",k.length,k.ended),0===k.length&&k.ended?Q(this):at(this),null;if(0===(T=Z(T,k))&&k.ended)return 0===k.length&&Q(this),null;var u,b=k.needReadable;return c("need readable",b),(0===k.length||k.length-T0?K(T,k):null)?(k.needReadable=k.length<=k.highWaterMark,T=0):(k.length-=T,k.awaitDrain=0),0===k.length&&(k.ended||(k.needReadable=!0),t!==T&&k.ended&&Q(this)),null!==u&&this.emit("data",u),u},L.prototype._read=function(T){F(this,new j("_read()"))},L.prototype.pipe=function(T,k){var t=this,u=this._readableState;switch(u.pipesCount){case 0:u.pipes=T;break;case 1:u.pipes=[u.pipes,T];break;default:u.pipes.push(T)}u.pipesCount+=1,c("pipe count=%d opts=%j",u.pipesCount,k);var b=k&&!1===k.end||T===y.stdout||T===y.stderr?yt:C;function C(){c("onend"),T.end()}u.endEmitted?y.nextTick(b):t.once("end",b),T.on("unpipe",function bt(Et,Rt){c("onunpipe"),Et===t&&Rt&&!1===Rt.hasUnpiped&&(Rt.hasUnpiped=!0,c("cleanup"),T.removeListener("close",pt),T.removeListener("finish",gt),T.removeListener("drain",x),T.removeListener("error",ct),T.removeListener("unpipe",bt),t.removeListener("end",C),t.removeListener("end",yt),t.removeListener("data",Y),N=!0,!u.awaitDrain||T._writableState&&!T._writableState.needDrain||x())});var bt,x=(bt=t,function(){var Et=bt._readableState;c("pipeOnDrain",Et.awaitDrain),Et.awaitDrain&&Et.awaitDrain--,0===Et.awaitDrain&&h(bt,"data")&&(Et.flowing=!0,z(bt))});T.on("drain",x);var N=!1;function Y(bt){c("ondata");var Et=T.write(bt);c("dest.write",Et),!1===Et&&((1===u.pipesCount&&u.pipes===T||u.pipesCount>1&&-1!==J(u.pipes,T))&&!N&&(c("false write response, pause",u.awaitDrain),u.awaitDrain++),t.pause())}function ct(bt){c("onerror",bt),yt(),T.removeListener("error",ct),0===h(T,"error")&&F(T,bt)}function pt(){T.removeListener("finish",gt),yt()}function gt(){c("onfinish"),T.removeListener("close",pt),yt()}function yt(){c("unpipe"),t.unpipe(T)}return t.on("data",Y),function(bt,Et,Rt){if("function"==typeof bt.prependListener)return bt.prependListener("error",Rt);bt._events&&bt._events.error?Array.isArray(bt._events.error)?bt._events.error.unshift(Rt):bt._events.error=[Rt,bt._events.error]:bt.on("error",Rt)}(T,0,ct),T.once("close",pt),T.once("finish",gt),T.emit("pipe",t),u.flowing||(c("pipe resume"),t.resume()),T},L.prototype.unpipe=function(T){var k=this._readableState,t={hasUnpiped:!1};if(0===k.pipesCount)return this;if(1===k.pipesCount)return T&&T!==k.pipes||(T||(T=k.pipes),k.pipes=null,k.pipesCount=0,k.flowing=!1,T&&T.emit("unpipe",this,t)),this;if(!T){var u=k.pipes,b=k.pipesCount;k.pipes=null,k.pipesCount=0,k.flowing=!1;for(var C=0;C0,!1!==u.flowing&&this.resume()):"readable"===T&&(u.endEmitted||u.readableListening||(u.readableListening=u.needReadable=!0,u.flowing=!1,u.emittedReadable=!1,c("on readable",u.length,u.reading),u.length?at(this):u.reading||y.nextTick(A,this))),t},L.prototype.removeListener=function(T,k){var t=n.prototype.removeListener.call(this,T,k);return"readable"===T&&y.nextTick(D,this),t},L.prototype.removeAllListeners=function(T){var k=n.prototype.removeAllListeners.apply(this,arguments);return"readable"!==T&&void 0!==T||y.nextTick(D,this),k},L.prototype.resume=function(){var t,T=this._readableState;return T.flowing||(c("resume"),T.flowing=!T.readableListening,this,(t=T).resumeScheduled||(t.resumeScheduled=!0,y.nextTick(R,this,t))),T.paused=!1,this},L.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},L.prototype.wrap=function(T){var k=this,t=this._readableState,u=!1;for(var b in T.on("end",function(){if(c("wrapped end"),t.decoder&&!t.ended){var x=t.decoder.end();x&&x.length&&k.push(x)}k.push(null)}),T.on("data",function(x){c("wrapped data"),t.decoder&&(x=t.decoder.write(x)),t.objectMode&&null==x||(t.objectMode||x&&x.length)&&(k.push(x)||(u=!0,T.pause()))}),T)void 0===this[b]&&"function"==typeof T[b]&&(this[b]=function(x){return function(){return T[x].apply(T,arguments)}}(b));for(var C=0;C{"use strict";O.exports=d;var e=i(4281).q,y=e.ERR_METHOD_NOT_IMPLEMENTED,c=e.ERR_MULTIPLE_CALLBACK,h=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=e.ERR_TRANSFORM_WITH_LENGTH_0,r=i(6753);function a(o,s){var f=this._transformState;f.transforming=!1;var l=f.writecb;if(null===l)return this.emit("error",new c);f.writechunk=null,f.writecb=null,null!=s&&this.push(s),l(o);var p=this._readableState;p.reading=!1,(p.needReadable||p.length{"use strict";var e,y=i(4155);function c(I){var m=this;this.next=null,this.entry=null,this.finish=function(){!function(D,A,R){var z=D.entry;for(D.entry=null;z;){var K=z.callback;A.pendingcb--,K(void 0),z=z.next}A.corkedRequestsFree.next=D}(m,I)}}O.exports=L,L.WritableState=U;var h,n={deprecate:i(4927)},r=i(2503),a=i(8764).Buffer,d=i.g.Uint8Array||function(){},S=i(1195),g=i(2457).getHighWaterMark,o=i(4281).q,s=o.ERR_INVALID_ARG_TYPE,f=o.ERR_METHOD_NOT_IMPLEMENTED,l=o.ERR_MULTIPLE_CALLBACK,p=o.ERR_STREAM_CANNOT_PIPE,_=o.ERR_STREAM_DESTROYED,E=o.ERR_STREAM_NULL_VALUES,j=o.ERR_STREAM_WRITE_AFTER_END,M=o.ERR_UNKNOWN_ENCODING,F=S.errorOrDestroy;function G(){}function U(I,m,D){e=e||i(6753),"boolean"!=typeof D&&(D=m instanceof e),this.objectMode=!!(I=I||{}).objectMode,D&&(this.objectMode=this.objectMode||!!I.writableObjectMode),this.highWaterMark=g(this,I,"writableHighWaterMark",D),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===I.decodeStrings),this.defaultEncoding=I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(R){!function(z,K){var k,Q=z._writableState,nt=Q.sync,J=Q.writecb;if("function"!=typeof J)throw new l;if((k=Q).writing=!1,k.writecb=null,k.length-=k.writelen,k.writelen=0,K)!function(k,t,u,b,C){--t.pendingcb,u?(y.nextTick(C,b),y.nextTick(ut,k,t),k._writableState.errorEmitted=!0,F(k,b)):(C(b),k._writableState.errorEmitted=!0,F(k,b),ut(k,t))}(z,Q,nt,K,J);else{var T=Z(Q)||z.destroyed;T||Q.corked||Q.bufferProcessing||!Q.bufferedRequest||et(z,Q),nt?y.nextTick(ot,z,Q,T,J):ot(z,Q,T,J)}}(m,R)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==I.emitClose,this.autoDestroy=!!I.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}function L(I){var m=this instanceof(e=e||i(6753));if(!m&&!h.call(L,this))return new L(I);this._writableState=new U(I,this,m),this.writable=!0,I&&("function"==typeof I.write&&(this._write=I.write),"function"==typeof I.writev&&(this._writev=I.writev),"function"==typeof I.destroy&&(this._destroy=I.destroy),"function"==typeof I.final&&(this._final=I.final)),r.call(this)}function $(I,m,D,A,R,z,K){m.writelen=A,m.writecb=K,m.writing=!0,m.sync=!0,m.destroyed?m.onwrite(new _("write")):D?I._writev(R,m.onwrite):I._write(R,z,m.onwrite),m.sync=!1}function ot(I,m,D,A){var R,z;D||(R=I,0===(z=m).length&&z.needDrain&&(z.needDrain=!1,R.emit("drain"))),m.pendingcb--,A(),ut(I,m)}function et(I,m){m.bufferProcessing=!0;var D=m.bufferedRequest;if(I._writev&&D&&D.next){var R=new Array(m.bufferedRequestCount),z=m.corkedRequestsFree;z.entry=D;for(var K=0,Q=!0;D;)R[K]=D,D.isBuf||(Q=!1),D=D.next,K+=1;R.allBuffers=Q,$(I,m,!0,m.length,R,"",z.finish),m.pendingcb++,m.lastBufferedRequest=null,z.next?(m.corkedRequestsFree=z.next,z.next=null):m.corkedRequestsFree=new c(m),m.bufferedRequestCount=0}else{for(;D;){var nt=D.chunk;if($(I,m,!1,m.objectMode?1:nt.length,nt,D.encoding,D.callback),D=D.next,m.bufferedRequestCount--,m.writing)break}null===D&&(m.lastBufferedRequest=null)}m.bufferedRequest=D,m.bufferProcessing=!1}function Z(I){return I.ending&&0===I.length&&null===I.bufferedRequest&&!I.finished&&!I.writing}function at(I,m){I._final(function(D){m.pendingcb--,D&&F(I,D),m.prefinished=!0,I.emit("prefinish"),ut(I,m)})}function ut(I,m){var R,z,D=Z(m);if(D&&(R=I,(z=m).prefinished||z.finalCalled||("function"!=typeof R._final||z.destroyed?(z.prefinished=!0,R.emit("prefinish")):(z.pendingcb++,z.finalCalled=!0,y.nextTick(at,R,z))),0===m.pendingcb&&(m.finished=!0,I.emit("finish"),m.autoDestroy))){var A=I._readableState;(!A||A.autoDestroy&&A.endEmitted)&&I.destroy()}return D}i(5717)(L,r),U.prototype.getBuffer=function(){for(var I=this.bufferedRequest,m=[];I;)m.push(I),I=I.next;return m},function(){try{Object.defineProperty(U.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(I){return!!h.call(this,I)||this===L&&I&&I._writableState instanceof U}})):h=function(I){return I instanceof this},L.prototype.pipe=function(){F(this,new p)},L.prototype.write=function(I,m,D){var A,Q,nt,J,R=this._writableState,z=!1,K=!R.objectMode&&(a.isBuffer(A=I)||A instanceof d);return K&&!a.isBuffer(I)&&(I=a.from(I)),"function"==typeof m&&(D=m,m=null),K?m="buffer":m||(m=R.defaultEncoding),"function"!=typeof D&&(D=G),R.ending?(Q=this,nt=D,J=new j,F(Q,J),y.nextTick(nt,J)):(K||function(Q,nt,J,T){var k;return null===J?k=new E:"string"==typeof J||nt.objectMode||(k=new s("chunk",["string","Buffer"],J)),!k||(F(Q,k),y.nextTick(T,k),!1)}(this,R,I,D))&&(R.pendingcb++,z=function(Q,nt,J,T,k,t){if(!J){var u=(Y=T,(N=nt).objectMode||!1===N.decodeStrings||"string"!=typeof Y||(Y=a.from(Y,k)),Y);T!==u&&(J=!0,k="buffer",T=u)}var N,Y,b=nt.objectMode?1:T.length;nt.length+=b;var C=nt.length-1))throw new M(I);return this._writableState.defaultEncoding=I,this},Object.defineProperty(L.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),L.prototype._write=function(I,m,D){D(new f("_write()"))},L.prototype._writev=null,L.prototype.end=function(I,m,D){var R,z,K,A=this._writableState;return"function"==typeof I?(D=I,I=null,m=null):"function"==typeof m&&(D=m,m=null),null!=I&&this.write(I,m),A.corked&&(A.corked=1,this.uncork()),A.ending||(R=this,K=D,(z=A).ending=!0,ut(R,z),K&&(z.finished?y.nextTick(K):R.once("finish",K)),z.ended=!0,R.writable=!1),this},Object.defineProperty(L.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(L.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(I){this._writableState&&(this._writableState.destroyed=I)}}),L.prototype.destroy=S.destroy,L.prototype._undestroy=S.undestroy,L.prototype._destroy=function(I,m){m(I)}},5850:(O,v,i)=>{"use strict";var e,y=i(4155);function c(E,j,M){return j in E?Object.defineProperty(E,j,{value:M,enumerable:!0,configurable:!0,writable:!0}):E[j]=M,E}var h=i(8610),n=Symbol("lastResolve"),r=Symbol("lastReject"),a=Symbol("error"),d=Symbol("ended"),S=Symbol("lastPromise"),g=Symbol("handlePromise"),o=Symbol("stream");function s(E,j){return{value:E,done:j}}function f(E){var j=E[n];if(null!==j){var M=E[o].read();null!==M&&(E[S]=null,E[n]=null,E[r]=null,j(s(M,!1)))}}function l(E){y.nextTick(f,E)}var p=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((c(e={get stream(){return this[o]},next:function(){var E=this,j=this[a];if(null!==j)return Promise.reject(j);if(this[d])return Promise.resolve(s(void 0,!0));if(this[o].destroyed)return new Promise(function(U,L){y.nextTick(function(){E[a]?L(E[a]):U(s(void 0,!0))})});var M,U,L,F=this[S];if(F)M=new Promise((U=F,L=this,function($,ot){U.then(function(){L[d]?$(s(void 0,!0)):L[g]($,ot)},ot)}));else{var G=this[o].read();if(null!==G)return Promise.resolve(s(G,!1));M=new Promise(this[g])}return this[S]=M,M}},Symbol.asyncIterator,function(){return this}),c(e,"return",function(){var E=this;return new Promise(function(j,M){E[o].destroy(null,function(F){F?M(F):j(s(void 0,!0))})})}),e),p);O.exports=function(E){var j,M=Object.create(_,(c(j={},o,{value:E,writable:!0}),c(j,n,{value:null,writable:!0}),c(j,r,{value:null,writable:!0}),c(j,a,{value:null,writable:!0}),c(j,d,{value:E._readableState.endEmitted,writable:!0}),c(j,g,{value:function(F,G){var U=M[o].read();U?(M[S]=null,M[n]=null,M[r]=null,F(s(U,!1))):(M[n]=F,M[r]=G)},writable:!0}),j));return M[S]=null,h(E,function(F){if(F&&"ERR_STREAM_PREMATURE_CLOSE"!==F.code){var G=M[r];return null!==G&&(M[S]=null,M[n]=null,M[r]=null,G(F)),void(M[a]=F)}var U=M[n];null!==U&&(M[S]=null,M[n]=null,M[r]=null,U(s(void 0,!0))),M[d]=!0}),E.on("readable",l.bind(null,M)),M}},7327:(O,v,i)=>{"use strict";function e(a,d){var S=Object.keys(a);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(a);d&&(g=g.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),S.push.apply(S,g)}return S}function y(a,d,S){return d in a?Object.defineProperty(a,d,{value:S,enumerable:!0,configurable:!0,writable:!0}):a[d]=S,a}var h=i(8764).Buffer,n=i(2361).inspect,r=n&&n.custom||"inspect";O.exports=function(){function a(){(function(g,o){if(!(g instanceof o))throw new TypeError("Cannot call a class as a function")})(this,a),this.head=null,this.tail=null,this.length=0}var S;return S=[{key:"push",value:function(g){var o={data:g,next:null};this.length>0?this.tail.next=o:this.head=o,this.tail=o,++this.length}},{key:"unshift",value:function(g){var o={data:g,next:this.head};0===this.length&&(this.tail=o),this.head=o,++this.length}},{key:"shift",value:function(){if(0!==this.length){var g=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,g}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(g){if(0===this.length)return"";for(var o=this.head,s=""+o.data;o=o.next;)s+=g+o.data;return s}},{key:"concat",value:function(g){if(0===this.length)return h.alloc(0);for(var l=h.allocUnsafe(g>>>0),p=this.head,_=0;p;)h.prototype.copy.call(p.data,l,_),_+=p.data.length,p=p.next;return l}},{key:"consume",value:function(g,o){var s;return gl.length?l.length:g;if(f+=p===l.length?l:l.slice(0,g),0==(g-=p)){p===l.length?(++s,this.head=o.next?o.next:this.tail=null):(this.head=o,o.data=l.slice(p));break}++s}return this.length-=s,f}},{key:"_getBuffer",value:function(g){var o=h.allocUnsafe(g),s=this.head,f=1;for(s.data.copy(o),g-=s.data.length;s=s.next;){var l=s.data,p=g>l.length?l.length:g;if(l.copy(o,o.length-g,0,p),0==(g-=p)){p===l.length?(++f,this.head=s.next?s.next:this.tail=null):(this.head=s,s.data=l.slice(p));break}++f}return this.length-=f,o}},{key:r,value:function(g,o){return n(this,function(s){for(var f=1;f{"use strict";var e=i(4155);function y(n,r){h(n,r),c(n)}function c(n){n._writableState&&!n._writableState.emitClose||n._readableState&&!n._readableState.emitClose||n.emit("close")}function h(n,r){n.emit("error",r)}O.exports={destroy:function(n,r){var a=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(r?r(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(h,this,n)):e.nextTick(h,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,function(g){!r&&g?a._writableState?a._writableState.errorEmitted?e.nextTick(c,a):(a._writableState.errorEmitted=!0,e.nextTick(y,a,g)):e.nextTick(y,a,g):r?(e.nextTick(c,a),r(g)):e.nextTick(c,a)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(n,r){var a=n._readableState,d=n._writableState;a&&a.autoDestroy||d&&d.autoDestroy?n.destroy(r):n.emit("error",r)}}},8610:(O,v,i)=>{"use strict";var e=i(4281).q.ERR_STREAM_PREMATURE_CLOSE;function y(){}O.exports=function c(h,n,r){if("function"==typeof n)return c(h,null,n);var E,j;n||(n={}),E=r||y,j=!1,r=function(){if(!j){j=!0;for(var M=arguments.length,F=new Array(M),G=0;G{O.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(O,v,i)=>{"use strict";var e,y=i(4281).q,c=y.ERR_MISSING_ARGS,h=y.ERR_STREAM_DESTROYED;function n(g){if(g)throw g}function r(g,o,s,f){var _,E;_=f,E=!1,f=function(){E||(E=!0,_.apply(void 0,arguments))};var l=!1;g.on("close",function(){l=!0}),void 0===e&&(e=i(8610)),e(g,{readable:o,writable:s},function(_){if(_)return f(_);l=!0,f()});var p=!1;return function(_){if(!l&&!p)return p=!0,function(E){return E.setHeader&&"function"==typeof E.abort}(g)?g.abort():"function"==typeof g.destroy?g.destroy():void f(_||new h("pipe"))}}function a(g){g()}function d(g,o){return g.pipe(o)}function S(g){return g.length?"function"!=typeof g[g.length-1]?n:g.pop():n}O.exports=function(){for(var g=arguments.length,o=new Array(g),s=0;s0,function(M){f||(f=M),M&&p.forEach(a),j||(p.forEach(a),l(f))})});return o.reduce(d)}},2457:(O,v,i)=>{"use strict";var e=i(4281).q.ERR_INVALID_OPT_VALUE;O.exports={getHighWaterMark:function(y,c,h,n){var a,r=null!=(a=c).highWaterMark?a.highWaterMark:n?a[h]:null;if(null!=r){if(!isFinite(r)||Math.floor(r)!==r||r<0)throw new e(n?h:"highWaterMark",r);return Math.floor(r)}return y.objectMode?16:16384}}},2503:(O,v,i)=>{O.exports=i(7187).EventEmitter},8473:(O,v,i)=>{(v=O.exports=i(9481)).Stream=v,v.Readable=v,v.Writable=i(4229),v.Duplex=i(6753),v.Transform=i(4605),v.PassThrough=i(2725),v.finished=i(8610),v.pipeline=i(9946)},9785:(O,v,i)=>{"use strict";var e=i(8764).Buffer,y=i(5717),c=i(3349),h=new Array(16),n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],r=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],a=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],d=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],S=[0,1518500249,1859775393,2400959708,2840853838],g=[1352829926,1548603684,1836072691,2053994217,0];function o(){c.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function s(j,M){return j<>>32-M}function f(j,M,F,G,U,L,$,ot){return s(j+(M^F^G)+L+$|0,ot)+U|0}function l(j,M,F,G,U,L,$,ot){return s(j+(M&F|~M&G)+L+$|0,ot)+U|0}function p(j,M,F,G,U,L,$,ot){return s(j+((M|~F)^G)+L+$|0,ot)+U|0}function _(j,M,F,G,U,L,$,ot){return s(j+(M&G|F&~G)+L+$|0,ot)+U|0}function E(j,M,F,G,U,L,$,ot){return s(j+(M^(F|~G))+L+$|0,ot)+U|0}y(o,c),o.prototype._update=function(){for(var j=h,M=0;M<16;++M)j[M]=this._block.readInt32LE(4*M);for(var F=0|this._a,G=0|this._b,U=0|this._c,L=0|this._d,$=0|this._e,ot=0|this._a,et=0|this._b,Z=0|this._c,at=0|this._d,ut=0|this._e,I=0;I<80;I+=1){var m,D;I<16?(m=f(F,G,U,L,$,j[n[I]],S[0],a[I]),D=E(ot,et,Z,at,ut,j[r[I]],g[0],d[I])):I<32?(m=l(F,G,U,L,$,j[n[I]],S[1],a[I]),D=_(ot,et,Z,at,ut,j[r[I]],g[1],d[I])):I<48?(m=p(F,G,U,L,$,j[n[I]],S[2],a[I]),D=p(ot,et,Z,at,ut,j[r[I]],g[2],d[I])):I<64?(m=_(F,G,U,L,$,j[n[I]],S[3],a[I]),D=l(ot,et,Z,at,ut,j[r[I]],g[3],d[I])):(m=E(F,G,U,L,$,j[n[I]],S[4],a[I]),D=f(ot,et,Z,at,ut,j[r[I]],g[4],d[I])),F=$,$=L,L=s(U,10),U=G,G=m,ot=ut,ut=at,at=s(Z,10),Z=et,et=D}var A=this._b+U+at|0;this._b=this._c+L+ut|0,this._c=this._d+$+ot|0,this._d=this._e+F+et|0,this._e=this._a+G+Z|0,this._a=A},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var j=e.alloc?e.alloc(20):new e(20);return j.writeInt32LE(this._a,0),j.writeInt32LE(this._b,4),j.writeInt32LE(this._c,8),j.writeInt32LE(this._d,12),j.writeInt32LE(this._e,16),j},O.exports=o},9509:(O,v,i)=>{var e=i(8764),y=e.Buffer;function c(n,r){for(var a in n)r[a]=n[a]}function h(n,r,a){return y(n,r,a)}y.from&&y.alloc&&y.allocUnsafe&&y.allocUnsafeSlow?O.exports=e:(c(e,v),v.Buffer=h),h.prototype=Object.create(y.prototype),c(y,h),h.from=function(n,r,a){if("number"==typeof n)throw new TypeError("Argument must not be a number");return y(n,r,a)},h.alloc=function(n,r,a){if("number"!=typeof n)throw new TypeError("Argument must be a number");var d=y(n);return void 0!==r?"string"==typeof a?d.fill(r,a):d.fill(r):d.fill(0),d},h.allocUnsafe=function(n){if("number"!=typeof n)throw new TypeError("Argument must be a number");return y(n)},h.allocUnsafeSlow=function(n){if("number"!=typeof n)throw new TypeError("Argument must be a number");return e.SlowBuffer(n)}},4189:(O,v,i)=>{var e=i(9509).Buffer;function y(c,h){this._block=e.alloc(c),this._finalSize=h,this._blockSize=c,this._len=0}y.prototype.update=function(c,h){"string"==typeof c&&(c=e.from(c,h=h||"utf8"));for(var n=this._block,r=this._blockSize,a=c.length,d=this._len,S=0;S=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0;this._block.writeUInt32BE((n-r)/4294967296,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var d=this._hash();return c?d.toString(c):d},y.prototype._update=function(){throw new Error("_update must be implemented by subclass")},O.exports=y},9072:(O,v,i)=>{var e=O.exports=function(y){y=y.toLowerCase();var c=e[y];if(!c)throw new Error(y+" is not supported (we accept pull requests)");return new c};e.sha=i(4448),e.sha1=i(8336),e.sha224=i(8432),e.sha256=i(7499),e.sha384=i(1686),e.sha512=i(7816)},4448:(O,v,i)=>{var e=i(5717),y=i(4189),c=i(9509).Buffer,h=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function r(){this.init(),this._w=n,y.call(this,64,56)}function a(S){return S<<30|S>>>2}function d(S,g,o,s){return 0===S?g&o|~g&s:2===S?g&o|g&s|o&s:g^o^s}e(r,y),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(S){for(var g,o=this._w,s=0|this._a,f=0|this._b,l=0|this._c,p=0|this._d,_=0|this._e,E=0;E<16;++E)o[E]=S.readInt32BE(4*E);for(;E<80;++E)o[E]=o[E-3]^o[E-8]^o[E-14]^o[E-16];for(var j=0;j<80;++j){var M=~~(j/20),F=0|((g=s)<<5|g>>>27)+d(M,f,l,p)+_+o[j]+h[M];_=p,p=l,l=a(f),f=s,s=F}this._a=s+this._a|0,this._b=f+this._b|0,this._c=l+this._c|0,this._d=p+this._d|0,this._e=_+this._e|0},r.prototype._hash=function(){var S=c.allocUnsafe(20);return S.writeInt32BE(0|this._a,0),S.writeInt32BE(0|this._b,4),S.writeInt32BE(0|this._c,8),S.writeInt32BE(0|this._d,12),S.writeInt32BE(0|this._e,16),S},O.exports=r},8336:(O,v,i)=>{var e=i(5717),y=i(4189),c=i(9509).Buffer,h=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function r(){this.init(),this._w=n,y.call(this,64,56)}function a(g){return g<<5|g>>>27}function d(g){return g<<30|g>>>2}function S(g,o,s,f){return 0===g?o&s|~o&f:2===g?o&s|o&f|s&f:o^s^f}e(r,y),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(g){for(var o,s=this._w,f=0|this._a,l=0|this._b,p=0|this._c,_=0|this._d,E=0|this._e,j=0;j<16;++j)s[j]=g.readInt32BE(4*j);for(;j<80;++j)s[j]=(o=s[j-3]^s[j-8]^s[j-14]^s[j-16])<<1|o>>>31;for(var M=0;M<80;++M){var F=~~(M/20),G=a(f)+S(F,l,p,_)+E+s[M]+h[F]|0;E=_,_=p,p=d(l),l=f,f=G}this._a=f+this._a|0,this._b=l+this._b|0,this._c=p+this._c|0,this._d=_+this._d|0,this._e=E+this._e|0},r.prototype._hash=function(){var g=c.allocUnsafe(20);return g.writeInt32BE(0|this._a,0),g.writeInt32BE(0|this._b,4),g.writeInt32BE(0|this._c,8),g.writeInt32BE(0|this._d,12),g.writeInt32BE(0|this._e,16),g},O.exports=r},8432:(O,v,i)=>{var e=i(5717),y=i(7499),c=i(4189),h=i(9509).Buffer,n=new Array(64);function r(){this.init(),this._w=n,c.call(this,64,56)}e(r,y),r.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},r.prototype._hash=function(){var a=h.allocUnsafe(28);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a},O.exports=r},7499:(O,v,i)=>{var e=i(5717),y=i(4189),c=i(9509).Buffer,h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],n=new Array(64);function r(){this.init(),this._w=n,y.call(this,64,56)}function a(s,f,l){return l^s&(f^l)}function d(s,f,l){return s&f|l&(s|f)}function S(s){return(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10)}function g(s){return(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7)}function o(s){return(s>>>7|s<<25)^(s>>>18|s<<14)^s>>>3}e(r,y),r.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},r.prototype._update=function(s){for(var f,l=this._w,p=0|this._a,_=0|this._b,E=0|this._c,j=0|this._d,M=0|this._e,F=0|this._f,G=0|this._g,U=0|this._h,L=0;L<16;++L)l[L]=s.readInt32BE(4*L);for(;L<64;++L)l[L]=0|(((f=l[L-2])>>>17|f<<15)^(f>>>19|f<<13)^f>>>10)+l[L-7]+o(l[L-15])+l[L-16];for(var $=0;$<64;++$){var ot=U+g(M)+a(M,F,G)+h[$]+l[$]|0,et=S(p)+d(p,_,E)|0;U=G,G=F,F=M,M=j+ot|0,j=E,E=_,_=p,p=ot+et|0}this._a=p+this._a|0,this._b=_+this._b|0,this._c=E+this._c|0,this._d=j+this._d|0,this._e=M+this._e|0,this._f=F+this._f|0,this._g=G+this._g|0,this._h=U+this._h|0},r.prototype._hash=function(){var s=c.allocUnsafe(32);return s.writeInt32BE(this._a,0),s.writeInt32BE(this._b,4),s.writeInt32BE(this._c,8),s.writeInt32BE(this._d,12),s.writeInt32BE(this._e,16),s.writeInt32BE(this._f,20),s.writeInt32BE(this._g,24),s.writeInt32BE(this._h,28),s},O.exports=r},1686:(O,v,i)=>{var e=i(5717),y=i(7816),c=i(4189),h=i(9509).Buffer,n=new Array(160);function r(){this.init(),this._w=n,c.call(this,128,112)}e(r,y),r.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},r.prototype._hash=function(){var a=h.allocUnsafe(48);function d(S,g,o){a.writeInt32BE(S,o),a.writeInt32BE(g,o+4)}return d(this._ah,this._al,0),d(this._bh,this._bl,8),d(this._ch,this._cl,16),d(this._dh,this._dl,24),d(this._eh,this._el,32),d(this._fh,this._fl,40),a},O.exports=r},7816:(O,v,i)=>{var e=i(5717),y=i(4189),c=i(9509).Buffer,h=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],n=new Array(160);function r(){this.init(),this._w=n,y.call(this,128,112)}function a(_,E,j){return j^_&(E^j)}function d(_,E,j){return _&E|j&(_|E)}function S(_,E){return(_>>>28|E<<4)^(E>>>2|_<<30)^(E>>>7|_<<25)}function g(_,E){return(_>>>14|E<<18)^(_>>>18|E<<14)^(E>>>9|_<<23)}function o(_,E){return(_>>>1|E<<31)^(_>>>8|E<<24)^_>>>7}function s(_,E){return(_>>>1|E<<31)^(_>>>8|E<<24)^(_>>>7|E<<25)}function f(_,E){return(_>>>19|E<<13)^(E>>>29|_<<3)^_>>>6}function l(_,E){return(_>>>19|E<<13)^(E>>>29|_<<3)^(_>>>6|E<<26)}function p(_,E){return _>>>0>>0?1:0}e(r,y),r.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},r.prototype._update=function(_){for(var E=this._w,j=0|this._ah,M=0|this._bh,F=0|this._ch,G=0|this._dh,U=0|this._eh,L=0|this._fh,$=0|this._gh,ot=0|this._hh,et=0|this._al,Z=0|this._bl,at=0|this._cl,ut=0|this._dl,I=0|this._el,m=0|this._fl,D=0|this._gl,A=0|this._hl,R=0;R<32;R+=2)E[R]=_.readInt32BE(4*R),E[R+1]=_.readInt32BE(4*R+4);for(;R<160;R+=2){var z=E[R-30],K=E[R-30+1],Q=o(z,K),nt=s(K,z),J=f(z=E[R-4],K=E[R-4+1]),T=l(K,z),u=E[R-32],b=E[R-32+1],C=nt+E[R-14+1]|0,x=Q+E[R-14]+p(C,nt)|0;x=(x=x+J+p(C=C+T|0,T)|0)+u+p(C=C+b|0,b)|0,E[R]=x,E[R+1]=C}for(var N=0;N<160;N+=2){x=E[N],C=E[N+1];var Y=d(j,M,F),ct=d(et,Z,at),pt=S(j,et),gt=S(et,j),yt=g(U,I),bt=g(I,U),Et=h[N],Rt=h[N+1],Mt=a(U,L,$),Vt=a(I,m,D),Pt=A+bt|0,Nt=ot+yt+p(Pt,A)|0;Nt=(Nt=(Nt=Nt+Mt+p(Pt=Pt+Vt|0,Vt)|0)+Et+p(Pt=Pt+Rt|0,Rt)|0)+x+p(Pt=Pt+C|0,C)|0;var qt=gt+ct|0,Ut=pt+Y+p(qt,gt)|0;ot=$,A=D,$=L,D=m,L=U,m=I,U=G+Nt+p(I=ut+Pt|0,ut)|0,G=F,ut=at,F=M,at=Z,M=j,Z=et,j=Nt+Ut+p(et=Pt+qt|0,Pt)|0}this._al=this._al+et|0,this._bl=this._bl+Z|0,this._cl=this._cl+at|0,this._dl=this._dl+ut|0,this._el=this._el+I|0,this._fl=this._fl+m|0,this._gl=this._gl+D|0,this._hl=this._hl+A|0,this._ah=this._ah+j+p(this._al,et)|0,this._bh=this._bh+M+p(this._bl,Z)|0,this._ch=this._ch+F+p(this._cl,at)|0,this._dh=this._dh+G+p(this._dl,ut)|0,this._eh=this._eh+U+p(this._el,I)|0,this._fh=this._fh+L+p(this._fl,m)|0,this._gh=this._gh+$+p(this._gl,D)|0,this._hh=this._hh+ot+p(this._hl,A)|0},r.prototype._hash=function(){var _=c.allocUnsafe(64);function E(j,M,F){_.writeInt32BE(j,F),_.writeInt32BE(M,F+4)}return E(this._ah,this._al,0),E(this._bh,this._bl,8),E(this._ch,this._cl,16),E(this._dh,this._dl,24),E(this._eh,this._el,32),E(this._fh,this._fl,40),E(this._gh,this._gl,48),E(this._hh,this._hl,56),_},O.exports=r},2830:(O,v,i)=>{O.exports=y;var e=i(7187).EventEmitter;function y(){e.call(this)}i(5717)(y,e),y.Readable=i(9481),y.Writable=i(4229),y.Duplex=i(6753),y.Transform=i(4605),y.PassThrough=i(2725),y.finished=i(8610),y.pipeline=i(9946),y.Stream=y,y.prototype.pipe=function(c,h){var n=this;function r(f){c.writable&&!1===c.write(f)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",r),c.on("drain",a),c._isStdio||h&&!1===h.end||(n.on("end",S),n.on("close",g));var d=!1;function S(){d||(d=!0,c.end())}function g(){d||(d=!0,"function"==typeof c.destroy&&c.destroy())}function o(f){if(s(),0===e.listenerCount(this,"error"))throw f}function s(){n.removeListener("data",r),c.removeListener("drain",a),n.removeListener("end",S),n.removeListener("close",g),n.removeListener("error",o),c.removeListener("error",o),n.removeListener("end",s),n.removeListener("close",s),c.removeListener("close",s)}return n.on("error",o),c.on("error",o),n.on("end",s),n.on("close",s),c.on("close",s),c.emit("pipe",n),c}},2553:(O,v,i)=>{"use strict";var e=i(9509).Buffer,y=e.isEncoding||function(s){switch((s=""+s)&&s.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function c(s){var f;switch(this.encoding=function(l){var p=function(_){if(!_)return"utf8";for(var E;;)switch(_){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return _;default:if(E)return;_=(""+_).toLowerCase(),E=!0}}(l);if("string"!=typeof p&&(e.isEncoding===y||!y(l)))throw new Error("Unknown encoding: "+l);return p||l}(s),this.encoding){case"utf16le":this.text=r,this.end=a,f=4;break;case"utf8":this.fillLast=n,f=4;break;case"base64":this.text=d,this.end=S,f=3;break;default:return this.write=g,void(this.end=o)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(f)}function h(s){return s<=127?0:s>>5==6?2:s>>4==14?3:s>>3==30?4:s>>6==2?-1:-2}function n(s){var f=this.lastTotal-this.lastNeed,l=function(p,_,E){if(128!=(192&_[0]))return p.lastNeed=0,"\ufffd";if(p.lastNeed>1&&_.length>1){if(128!=(192&_[1]))return p.lastNeed=1,"\ufffd";if(p.lastNeed>2&&_.length>2&&128!=(192&_[2]))return p.lastNeed=2,"\ufffd"}}(this,s);return void 0!==l?l:this.lastNeed<=s.length?(s.copy(this.lastChar,f,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(s.copy(this.lastChar,f,0,s.length),void(this.lastNeed-=s.length))}function r(s,f){if((s.length-f)%2==0){var l=s.toString("utf16le",f);if(l){var p=l.charCodeAt(l.length-1);if(p>=55296&&p<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=s[s.length-2],this.lastChar[1]=s[s.length-1],l.slice(0,-1)}return l}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=s[s.length-1],s.toString("utf16le",f,s.length-1)}function a(s){var f=s&&s.length?this.write(s):"";return this.lastNeed?f+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):f}function d(s,f){var l=(s.length-f)%3;return 0===l?s.toString("base64",f):(this.lastNeed=3-l,this.lastTotal=3,1===l?this.lastChar[0]=s[s.length-1]:(this.lastChar[0]=s[s.length-2],this.lastChar[1]=s[s.length-1]),s.toString("base64",f,s.length-l))}function S(s){var f=s&&s.length?this.write(s):"";return this.lastNeed?f+this.lastChar.toString("base64",0,3-this.lastNeed):f}function g(s){return s.toString(this.encoding)}function o(s){return s&&s.length?this.write(s):""}v.s=c,c.prototype.write=function(s){if(0===s.length)return"";var f,l;if(this.lastNeed){if(void 0===(f=this.fillLast(s)))return"";l=this.lastNeed,this.lastNeed=0}else l=0;return l=0?(F>0&&(_.lastNeed=F-1),F):--M=0?(F>0&&(_.lastNeed=F-2),F):--M=0?(F>0&&(2===F?F=0:_.lastNeed=F-3),F):0}(this,s,f);if(!this.lastNeed)return s.toString("utf8",f);this.lastTotal=l;var p=s.length-(l-this.lastNeed);return s.copy(this.lastChar,0,p),s.toString("utf8",f,p)},c.prototype.fillLast=function(s){if(this.lastNeed<=s.length)return s.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);s.copy(this.lastChar,this.lastTotal-this.lastNeed,0,s.length),this.lastNeed-=s.length}},5940:O=>{var v={}.toString;O.exports=Array.isArray||function(i){return"[object Array]"==v.call(i)}},5867:(O,v,i)=>{"use strict";var e=i(8212),y=Object.keys||function(s){var f=[];for(var l in s)f.push(l);return f};O.exports=S;var c=Object.create(i(6497));c.inherits=i(5717);var h=i(4278),n=i(759);c.inherits(S,h);for(var r=y(n.prototype),a=0;a{"use strict";O.exports=c;var e=i(62),y=Object.create(i(6497));function c(h){if(!(this instanceof c))return new c(h);e.call(this,h)}y.inherits=i(5717),y.inherits(c,e),c.prototype._transform=function(h,n,r){r(null,h)}},4278:(O,v,i)=>{"use strict";var e=i(4155),y=i(8212);O.exports=E;var c,h=i(5940);E.ReadableState=_,i(7187);var n=function(A,R){return A.listeners(R).length},r=i(4104),a=i(4591).Buffer,d=i.g.Uint8Array||function(){},S=Object.create(i(6497));S.inherits=i(5717);var g=i(6882),o=void 0;o=g&&g.debuglog?g.debuglog("stream"):function(){};var s,f=i(3912),l=i(5513);S.inherits(E,r);var p=["error","close","destroy","pause","resume"];function _(A,R){A=A||{};var z=R instanceof(c=c||i(5867));this.objectMode=!!A.objectMode,z&&(this.objectMode=this.objectMode||!!A.readableObjectMode);var K=A.highWaterMark,Q=A.readableHighWaterMark;this.highWaterMark=K||0===K?K:z&&(Q||0===Q)?Q:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=A.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,A.encoding&&(s||(s=i(7989).s),this.decoder=new s(A.encoding),this.encoding=A.encoding)}function E(A){if(c=c||i(5867),!(this instanceof E))return new E(A);this._readableState=new _(A,this),this.readable=!0,A&&("function"==typeof A.read&&(this._read=A.read),"function"==typeof A.destroy&&(this._destroy=A.destroy)),r.call(this)}function j(A,R,z,K,Q){var nt,T,k,t,u,J=A._readableState;return null===R?(J.reading=!1,function(T,k){if(!k.ended){if(k.decoder){var t=k.decoder.end();t&&t.length&&(k.buffer.push(t),k.length+=k.objectMode?1:t.length)}k.ended=!0,U(T)}}(A,J)):(Q||(T=J,a.isBuffer(u=k=R)||u instanceof d||"string"==typeof k||void 0===k||T.objectMode||(t=new TypeError("Invalid non-string/buffer chunk")),nt=t),nt?A.emit("error",nt):J.objectMode||R&&R.length>0?("string"==typeof R||J.objectMode||Object.getPrototypeOf(R)===a.prototype||(R=function(T){return a.from(T)}(R)),K?J.endEmitted?A.emit("error",new Error("stream.unshift() after end event")):M(A,J,R,!0):J.ended?A.emit("error",new Error("stream.push() after EOF")):(J.reading=!1,J.decoder&&!z?(R=J.decoder.write(R),J.objectMode||0!==R.length?M(A,J,R,!1):$(A,J)):M(A,J,R,!1))):K||(J.reading=!1)),function(T){return!T.ended&&(T.needReadable||T.lengthR.highWaterMark&&(R.highWaterMark=((z=A)>=F?z=F:(z--,z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z++),z)),A<=R.length?A:R.ended?R.length:(R.needReadable=!0,0));var z}function U(A){var R=A._readableState;R.needReadable=!1,R.emittedReadable||(o("emitReadable",R.flowing),R.emittedReadable=!0,R.sync?y.nextTick(L,A):L(A))}function L(A){o("emit readable"),A.emit("readable"),at(A)}function $(A,R){R.readingMore||(R.readingMore=!0,y.nextTick(ot,A,R))}function ot(A,R){for(var z=R.length;!R.reading&&!R.flowing&&!R.ended&&R.length=R.length?(z=R.decoder?R.buffer.join(""):1===R.buffer.length?R.buffer.head.data:R.buffer.concat(R.length),R.buffer.clear()):(nt=R.decoder,(K=A)<(Q=R.buffer).head.data.length?(J=Q.head.data.slice(0,K),Q.head.data=Q.head.data.slice(K)):J=K===Q.head.data.length?Q.shift():nt?function(T,k){var t=k.head,u=1,b=t.data;for(T-=b.length;t=t.next;){var C=t.data,x=T>C.length?C.length:T;if(b+=x===C.length?C:C.slice(0,T),0==(T-=x)){x===C.length?(++u,k.head=t.next?t.next:k.tail=null):(k.head=t,t.data=C.slice(x));break}++u}return k.length-=u,b}(K,Q):function(T,k){var t=a.allocUnsafe(T),u=k.head,b=1;for(u.data.copy(t),T-=u.data.length;u=u.next;){var C=u.data,x=T>C.length?C.length:T;if(C.copy(t,t.length-T,0,x),0==(T-=x)){x===C.length?(++b,k.head=u.next?u.next:k.tail=null):(k.head=u,u.data=C.slice(x));break}++b}return k.length-=b,t}(K,Q),z=J),z);var K,Q,nt,J,z}function I(A){var R=A._readableState;if(R.length>0)throw new Error('"endReadable()" called on non-empty stream');R.endEmitted||(R.ended=!0,y.nextTick(m,R,A))}function m(A,R){A.endEmitted||0!==A.length||(A.endEmitted=!0,R.readable=!1,R.emit("end"))}function D(A,R){for(var z=0,K=A.length;z=R.highWaterMark||R.ended))return o("read: emitReadable",R.length,R.ended),0===R.length&&R.ended?I(this):U(this),null;if(0===(A=G(A,R))&&R.ended)return 0===R.length&&I(this),null;var K,Q=R.needReadable;return o("need readable",Q),(0===R.length||R.length-A0?ut(A,R):null)?(R.needReadable=!0,A=0):R.length-=A,0===R.length&&(R.ended||(R.needReadable=!0),z!==A&&R.ended&&I(this)),null!==K&&this.emit("data",K),K},E.prototype._read=function(A){this.emit("error",new Error("_read() is not implemented"))},E.prototype.pipe=function(A,R){var z=this,K=this._readableState;switch(K.pipesCount){case 0:K.pipes=A;break;case 1:K.pipes=[K.pipes,A];break;default:K.pipes.push(A)}K.pipesCount+=1,o("pipe count=%d opts=%j",K.pipesCount,R);var Q=R&&!1===R.end||A===e.stdout||A===e.stderr?x:nt;function nt(){o("onend"),A.end()}K.endEmitted?y.nextTick(Q):z.once("end",Q),A.on("unpipe",function N(Y,ct){o("onunpipe"),Y===z&&ct&&!1===ct.hasUnpiped&&(ct.hasUnpiped=!0,o("cleanup"),A.removeListener("close",b),A.removeListener("finish",C),A.removeListener("drain",J),A.removeListener("error",u),A.removeListener("unpipe",N),z.removeListener("end",nt),z.removeListener("end",x),z.removeListener("data",t),T=!0,!K.awaitDrain||A._writableState&&!A._writableState.needDrain||J())});var N,J=(N=z,function(){var Y=N._readableState;o("pipeOnDrain",Y.awaitDrain),Y.awaitDrain&&Y.awaitDrain--,0===Y.awaitDrain&&n(N,"data")&&(Y.flowing=!0,at(N))});A.on("drain",J);var T=!1,k=!1;function t(N){o("ondata"),k=!1,!1!==A.write(N)||k||((1===K.pipesCount&&K.pipes===A||K.pipesCount>1&&-1!==D(K.pipes,A))&&!T&&(o("false write response, pause",z._readableState.awaitDrain),z._readableState.awaitDrain++,k=!0),z.pause())}function u(N){o("onerror",N),x(),A.removeListener("error",u),0===n(A,"error")&&A.emit("error",N)}function b(){A.removeListener("finish",C),x()}function C(){o("onfinish"),A.removeListener("close",b),x()}function x(){o("unpipe"),z.unpipe(A)}return z.on("data",t),function(N,Y,ct){if("function"==typeof N.prependListener)return N.prependListener(Y,ct);N._events&&N._events.error?h(N._events.error)?N._events.error.unshift(ct):N._events.error=[ct,N._events.error]:N.on(Y,ct)}(A,"error",u),A.once("close",b),A.once("finish",C),A.emit("pipe",z),K.flowing||(o("pipe resume"),z.resume()),A},E.prototype.unpipe=function(A){var R=this._readableState,z={hasUnpiped:!1};if(0===R.pipesCount)return this;if(1===R.pipesCount)return A&&A!==R.pipes||(A||(A=R.pipes),R.pipes=null,R.pipesCount=0,R.flowing=!1,A&&A.emit("unpipe",this,z)),this;if(!A){var K=R.pipes,Q=R.pipesCount;R.pipes=null,R.pipesCount=0,R.flowing=!1;for(var nt=0;nt{"use strict";O.exports=h;var e=i(5867),y=Object.create(i(6497));function c(a,d){var S=this._transformState;S.transforming=!1;var g=S.writecb;if(!g)return this.emit("error",new Error("write callback called multiple times"));S.writechunk=null,S.writecb=null,null!=d&&this.push(d),g(a);var o=this._readableState;o.reading=!1,(o.needReadable||o.length{"use strict";var e=i(4155),y=i(8212);function c(U){var L=this;this.next=null,this.entry=null,this.finish=function(){!function($,ot,et){var Z=$.entry;for($.entry=null;Z;){var at=Z.callback;ot.pendingcb--,at(void 0),Z=Z.next}ot.corkedRequestsFree?ot.corkedRequestsFree.next=$:ot.corkedRequestsFree=$}(L,U)}}O.exports=p;var h,n=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?setImmediate:y.nextTick;p.WritableState=l;var r=Object.create(i(6497));r.inherits=i(5717);var a,d={deprecate:i(4927)},S=i(4104),g=i(4591).Buffer,o=i.g.Uint8Array||function(){},s=i(5513);function f(){}function l(U,L){h=h||i(5867);var $=L instanceof h;this.objectMode=!!(U=U||{}).objectMode,$&&(this.objectMode=this.objectMode||!!U.writableObjectMode);var ot=U.highWaterMark,et=U.writableHighWaterMark;this.highWaterMark=ot||0===ot?ot:$&&(et||0===et)?et:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===U.decodeStrings),this.defaultEncoding=U.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ut){!function(I,m){var K,D=I._writableState,A=D.sync,R=D.writecb;if((K=D).writing=!1,K.writecb=null,K.length-=K.writelen,K.writelen=0,m)!function(K,Q,nt,J,T){--Q.pendingcb,nt?(y.nextTick(T,J),y.nextTick(G,K,Q),K._writableState.errorEmitted=!0,K.emit("error",J)):(T(J),K._writableState.errorEmitted=!0,K.emit("error",J),G(K,Q))}(I,D,A,m,R);else{var z=M(D);z||D.corked||D.bufferProcessing||!D.bufferedRequest||j(I,D),A?n(E,I,D,z,R):E(I,D,z,R)}}(L,ut)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}function p(U){if(h=h||i(5867),!(a.call(p,this)||this instanceof h))return new p(U);this._writableState=new l(U,this),this.writable=!0,U&&("function"==typeof U.write&&(this._write=U.write),"function"==typeof U.writev&&(this._writev=U.writev),"function"==typeof U.destroy&&(this._destroy=U.destroy),"function"==typeof U.final&&(this._final=U.final)),S.call(this)}function _(U,L,$,ot,et,Z,at){L.writelen=ot,L.writecb=at,L.writing=!0,L.sync=!0,$?U._writev(et,L.onwrite):U._write(et,Z,L.onwrite),L.sync=!1}function E(U,L,$,ot){var et,Z;$||(et=U,0===(Z=L).length&&Z.needDrain&&(Z.needDrain=!1,et.emit("drain"))),L.pendingcb--,ot(),G(U,L)}function j(U,L){L.bufferProcessing=!0;var $=L.bufferedRequest;if(U._writev&&$&&$.next){var et=new Array(L.bufferedRequestCount),Z=L.corkedRequestsFree;Z.entry=$;for(var at=0,ut=!0;$;)et[at]=$,$.isBuf||(ut=!1),$=$.next,at+=1;et.allBuffers=ut,_(U,L,!0,L.length,et,"",Z.finish),L.pendingcb++,L.lastBufferedRequest=null,Z.next?(L.corkedRequestsFree=Z.next,Z.next=null):L.corkedRequestsFree=new c(L),L.bufferedRequestCount=0}else{for(;$;){var I=$.chunk;if(_(U,L,!1,L.objectMode?1:I.length,I,$.encoding,$.callback),$=$.next,L.bufferedRequestCount--,L.writing)break}null===$&&(L.lastBufferedRequest=null)}L.bufferedRequest=$,L.bufferProcessing=!1}function M(U){return U.ending&&0===U.length&&null===U.bufferedRequest&&!U.finished&&!U.writing}function F(U,L){U._final(function($){L.pendingcb--,$&&U.emit("error",$),L.prefinished=!0,U.emit("prefinish"),G(U,L)})}function G(U,L){var ot,et,$=M(L);return $&&(ot=U,(et=L).prefinished||et.finalCalled||("function"==typeof ot._final?(et.pendingcb++,et.finalCalled=!0,y.nextTick(F,ot,et)):(et.prefinished=!0,ot.emit("prefinish"))),0===L.pendingcb&&(L.finished=!0,U.emit("finish"))),$}r.inherits(p,S),l.prototype.getBuffer=function(){for(var U=this.bufferedRequest,L=[];U;)L.push(U),U=U.next;return L},function(){try{Object.defineProperty(l.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(U){return!!a.call(this,U)||this===p&&U&&U._writableState instanceof l}})):a=function(U){return U instanceof this},p.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},p.prototype.write=function(U,L,$){var ot,ut,I,m,et=this._writableState,Z=!1,at=!et.objectMode&&(g.isBuffer(ot=U)||ot instanceof o);return at&&!g.isBuffer(U)&&(U=g.from(U)),"function"==typeof L&&($=L,L=null),at?L="buffer":L||(L=et.defaultEncoding),"function"!=typeof $&&($=f),et.ended?(ut=this,I=$,m=new Error("write after end"),ut.emit("error",m),y.nextTick(I,m)):(at||function(ut,I,m,D){var A=!0,R=!1;return null===m?R=new TypeError("May not write null values to stream"):"string"==typeof m||void 0===m||I.objectMode||(R=new TypeError("Invalid non-string/buffer chunk")),R&&(ut.emit("error",R),y.nextTick(D,R),A=!1),A}(this,et,U,$))&&(et.pendingcb++,Z=function(ut,I,m,D,A,R){if(!m){var z=(T=D,(J=I).objectMode||!1===J.decodeStrings||"string"!=typeof T||(T=g.from(T,A)),T);D!==z&&(m=!0,A="buffer",D=z)}var J,T,K=I.objectMode?1:D.length;I.length+=K;var Q=I.length-1))throw new TypeError("Unknown encoding: "+U);return this._writableState.defaultEncoding=U,this},Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),p.prototype._write=function(U,L,$){$(new Error("_write() is not implemented"))},p.prototype._writev=null,p.prototype.end=function(U,L,$){var Z,at,ot=this._writableState;"function"==typeof U?($=U,U=null,L=null):"function"==typeof L&&($=L,L=null),null!=U&&this.write(U,L),ot.corked&&(ot.corked=1,this.uncork()),ot.ending||ot.finished||(this,at=$,(Z=ot).ending=!0,G(this,Z),at&&(Z.finished?y.nextTick(at):this.once("finish",at)),Z.ended=!0,this.writable=!1)},Object.defineProperty(p.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(U){this._writableState&&(this._writableState.destroyed=U)}}),p.prototype.destroy=s.destroy,p.prototype._undestroy=s.undestroy,p.prototype._destroy=function(U,L){this.end(),L(U)}},3912:(O,v,i)=>{"use strict";var e=i(4591).Buffer,y=i(522);O.exports=function(){function c(){(function(h,n){if(!(h instanceof n))throw new TypeError("Cannot call a class as a function")})(this,c),this.head=null,this.tail=null,this.length=0}return c.prototype.push=function(h){var n={data:h,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},c.prototype.unshift=function(h){var n={data:h,next:this.head};0===this.length&&(this.tail=n),this.head=n,++this.length},c.prototype.shift=function(){if(0!==this.length){var h=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,h}},c.prototype.clear=function(){this.head=this.tail=null,this.length=0},c.prototype.join=function(h){if(0===this.length)return"";for(var n=this.head,r=""+n.data;n=n.next;)r+=h+n.data;return r},c.prototype.concat=function(h){if(0===this.length)return e.alloc(0);if(1===this.length)return this.head.data;for(var a=e.allocUnsafe(h>>>0),d=this.head,S=0;d;)d.data.copy(a,S),S+=d.data.length,d=d.next;return a},c}(),y&&y.inspect&&y.inspect.custom&&(O.exports.prototype[y.inspect.custom]=function(){var c=y.inspect({length:this.length});return this.constructor.name+" "+c})},5513:(O,v,i)=>{"use strict";var e=i(8212);function y(c,h){c.emit("error",h)}O.exports={destroy:function(c,h){var n=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(h?h(c):!c||this._writableState&&this._writableState.errorEmitted||e.nextTick(y,this,c),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(c||null,function(d){!h&&d?(e.nextTick(y,n,d),n._writableState&&(n._writableState.errorEmitted=!0)):h&&h(d)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},4104:(O,v,i)=>{O.exports=i(7187).EventEmitter},6801:(O,v,i)=>{(v=O.exports=i(4278)).Stream=v,v.Readable=v,v.Writable=i(759),v.Duplex=i(5867),v.Transform=i(62),v.PassThrough=i(3431)},4591:(O,v,i)=>{var e=i(8764),y=e.Buffer;function c(n,r){for(var a in n)r[a]=n[a]}function h(n,r,a){return y(n,r,a)}y.from&&y.alloc&&y.allocUnsafe&&y.allocUnsafeSlow?O.exports=e:(c(e,v),v.Buffer=h),c(y,h),h.from=function(n,r,a){if("number"==typeof n)throw new TypeError("Argument must not be a number");return y(n,r,a)},h.alloc=function(n,r,a){if("number"!=typeof n)throw new TypeError("Argument must be a number");var d=y(n);return void 0!==r?"string"==typeof a?d.fill(r,a):d.fill(r):d.fill(0),d},h.allocUnsafe=function(n){if("number"!=typeof n)throw new TypeError("Argument must be a number");return y(n)},h.allocUnsafeSlow=function(n){if("number"!=typeof n)throw new TypeError("Argument must be a number");return e.SlowBuffer(n)}},7989:(O,v,i)=>{"use strict";var e=i(4591).Buffer,y=e.isEncoding||function(s){switch((s=""+s)&&s.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function c(s){var f;switch(this.encoding=function(l){var p=function(_){if(!_)return"utf8";for(var E;;)switch(_){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return _;default:if(E)return;_=(""+_).toLowerCase(),E=!0}}(l);if("string"!=typeof p&&(e.isEncoding===y||!y(l)))throw new Error("Unknown encoding: "+l);return p||l}(s),this.encoding){case"utf16le":this.text=r,this.end=a,f=4;break;case"utf8":this.fillLast=n,f=4;break;case"base64":this.text=d,this.end=S,f=3;break;default:return this.write=g,void(this.end=o)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(f)}function h(s){return s<=127?0:s>>5==6?2:s>>4==14?3:s>>3==30?4:s>>6==2?-1:-2}function n(s){var f=this.lastTotal-this.lastNeed,l=function(p,_,E){if(128!=(192&_[0]))return p.lastNeed=0,"\ufffd";if(p.lastNeed>1&&_.length>1){if(128!=(192&_[1]))return p.lastNeed=1,"\ufffd";if(p.lastNeed>2&&_.length>2&&128!=(192&_[2]))return p.lastNeed=2,"\ufffd"}}(this,s);return void 0!==l?l:this.lastNeed<=s.length?(s.copy(this.lastChar,f,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(s.copy(this.lastChar,f,0,s.length),void(this.lastNeed-=s.length))}function r(s,f){if((s.length-f)%2==0){var l=s.toString("utf16le",f);if(l){var p=l.charCodeAt(l.length-1);if(p>=55296&&p<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=s[s.length-2],this.lastChar[1]=s[s.length-1],l.slice(0,-1)}return l}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=s[s.length-1],s.toString("utf16le",f,s.length-1)}function a(s){var f=s&&s.length?this.write(s):"";return this.lastNeed?f+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):f}function d(s,f){var l=(s.length-f)%3;return 0===l?s.toString("base64",f):(this.lastNeed=3-l,this.lastTotal=3,1===l?this.lastChar[0]=s[s.length-1]:(this.lastChar[0]=s[s.length-2],this.lastChar[1]=s[s.length-1]),s.toString("base64",f,s.length-l))}function S(s){var f=s&&s.length?this.write(s):"";return this.lastNeed?f+this.lastChar.toString("base64",0,3-this.lastNeed):f}function g(s){return s.toString(this.encoding)}function o(s){return s&&s.length?this.write(s):""}v.s=c,c.prototype.write=function(s){if(0===s.length)return"";var f,l;if(this.lastNeed){if(void 0===(f=this.fillLast(s)))return"";l=this.lastNeed,this.lastNeed=0}else l=0;return l=0?(F>0&&(_.lastNeed=F-1),F):--M=0?(F>0&&(_.lastNeed=F-2),F):--M=0?(F>0&&(2===F?F=0:_.lastNeed=F-3),F):0}(this,s,f);if(!this.lastNeed)return s.toString("utf8",f);this.lastTotal=l;var p=s.length-(l-this.lastNeed);return s.copy(this.lastChar,0,p),s.toString("utf8",f,p)},c.prototype.fillLast=function(s){if(this.lastNeed<=s.length)return s.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);s.copy(this.lastChar,this.lastTotal-this.lastNeed,0,s.length),this.lastNeed-=s.length}},4650:(O,v,i)=>{var e=i(4155),y=i(6801).Transform,c=i(9539).inherits,h=i(7529);function n(d){y.call(this,d),this._destroyed=!1}function r(d,S,g){g(null,d)}function a(d){return function(S,g,o){return"function"==typeof S&&(o=g,g=S,S={}),"function"!=typeof g&&(g=r),"function"!=typeof o&&(o=null),d(S,g,o)}}c(n,y),n.prototype.destroy=function(d){if(!this._destroyed){this._destroyed=!0;var S=this;e.nextTick(function(){d&&S.emit("error",d),S.emit("close")})}},O.exports=a(function(d,S,g){var o=new n(d);return o._transform=S,g&&(o._flush=g),o}),O.exports.ctor=a(function(d,S,g){function o(s){if(!(this instanceof o))return new o(s);this.options=h(d,s),n.call(this,this.options)}return c(o,n),o.prototype._transform=S,g&&(o.prototype._flush=g),o}),O.exports.obj=a(function(d,S,g){var o=new n(h({objectMode:!0,highWaterMark:16},d));return o._transform=S,g&&(o._flush=g),o})},4927:(O,v,i)=>{function e(y){try{if(!i.g.localStorage)return!1}catch{return!1}var c=i.g.localStorage[y];return null!=c&&"true"===String(c).toLowerCase()}O.exports=function(y,c){if(e("noDeprecation"))return y;var h=!1;return function(){if(!h){if(e("throwDeprecation"))throw new Error(c);e("traceDeprecation")?console.trace(c):console.warn(c),h=!0}return y.apply(this,arguments)}}},384:O=>{O.exports=function(v){return v&&"object"==typeof v&&"function"==typeof v.copy&&"function"==typeof v.fill&&"function"==typeof v.readUInt8}},5955:(O,v,i)=>{"use strict";var e=i(2584),y=i(8662),c=i(6430),h=i(5692);function n(m){return m.call.bind(m)}var r=typeof BigInt<"u",a=typeof Symbol<"u",d=n(Object.prototype.toString),S=n(Number.prototype.valueOf),g=n(String.prototype.valueOf),o=n(Boolean.prototype.valueOf);if(r)var s=n(BigInt.prototype.valueOf);if(a)var f=n(Symbol.prototype.valueOf);function l(m,D){if("object"!=typeof m)return!1;try{return D(m),!0}catch{return!1}}function p(m){return"[object Map]"===d(m)}function _(m){return"[object Set]"===d(m)}function E(m){return"[object WeakMap]"===d(m)}function j(m){return"[object WeakSet]"===d(m)}function M(m){return"[object ArrayBuffer]"===d(m)}function F(m){return typeof ArrayBuffer<"u"&&(M.working?M(m):m instanceof ArrayBuffer)}function G(m){return"[object DataView]"===d(m)}function U(m){return typeof DataView<"u"&&(G.working?G(m):m instanceof DataView)}v.isArgumentsObject=e,v.isGeneratorFunction=y,v.isTypedArray=h,v.isPromise=function(m){return typeof Promise<"u"&&m instanceof Promise||null!==m&&"object"==typeof m&&"function"==typeof m.then&&"function"==typeof m.catch},v.isArrayBufferView=function(m){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(m):h(m)||U(m)},v.isUint8Array=function(m){return"Uint8Array"===c(m)},v.isUint8ClampedArray=function(m){return"Uint8ClampedArray"===c(m)},v.isUint16Array=function(m){return"Uint16Array"===c(m)},v.isUint32Array=function(m){return"Uint32Array"===c(m)},v.isInt8Array=function(m){return"Int8Array"===c(m)},v.isInt16Array=function(m){return"Int16Array"===c(m)},v.isInt32Array=function(m){return"Int32Array"===c(m)},v.isFloat32Array=function(m){return"Float32Array"===c(m)},v.isFloat64Array=function(m){return"Float64Array"===c(m)},v.isBigInt64Array=function(m){return"BigInt64Array"===c(m)},v.isBigUint64Array=function(m){return"BigUint64Array"===c(m)},p.working=typeof Map<"u"&&p(new Map),v.isMap=function(m){return typeof Map<"u"&&(p.working?p(m):m instanceof Map)},_.working=typeof Set<"u"&&_(new Set),v.isSet=function(m){return typeof Set<"u"&&(_.working?_(m):m instanceof Set)},E.working=typeof WeakMap<"u"&&E(new WeakMap),v.isWeakMap=function(m){return typeof WeakMap<"u"&&(E.working?E(m):m instanceof WeakMap)},j.working=typeof WeakSet<"u"&&j(new WeakSet),v.isWeakSet=function(m){return j(m)},M.working=typeof ArrayBuffer<"u"&&M(new ArrayBuffer),v.isArrayBuffer=F,G.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&G(new DataView(new ArrayBuffer(1),0,1)),v.isDataView=U;var L=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function $(m){return"[object SharedArrayBuffer]"===d(m)}function ot(m){return void 0!==L&&(void 0===$.working&&($.working=$(new L)),$.working?$(m):m instanceof L)}function et(m){return l(m,S)}function Z(m){return l(m,g)}function at(m){return l(m,o)}function ut(m){return r&&l(m,s)}function I(m){return a&&l(m,f)}v.isSharedArrayBuffer=ot,v.isAsyncFunction=function(m){return"[object AsyncFunction]"===d(m)},v.isMapIterator=function(m){return"[object Map Iterator]"===d(m)},v.isSetIterator=function(m){return"[object Set Iterator]"===d(m)},v.isGeneratorObject=function(m){return"[object Generator]"===d(m)},v.isWebAssemblyCompiledModule=function(m){return"[object WebAssembly.Module]"===d(m)},v.isNumberObject=et,v.isStringObject=Z,v.isBooleanObject=at,v.isBigIntObject=ut,v.isSymbolObject=I,v.isBoxedPrimitive=function(m){return et(m)||Z(m)||at(m)||ut(m)||I(m)},v.isAnyArrayBuffer=function(m){return typeof Uint8Array<"u"&&(F(m)||ot(m))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(m){Object.defineProperty(v,m,{enumerable:!1,value:function(){throw new Error(m+" is not supported in userland")}})})},9539:(O,v,i)=>{var e=i(4155),y=Object.getOwnPropertyDescriptors||function(m){for(var D=Object.keys(m),A={},R=0;R=z)return nt;switch(nt){case"%s":return String(R[A++]);case"%d":return Number(R[A++]);case"%j":try{return JSON.stringify(R[A++])}catch{return"[Circular]"}default:return nt}}),Q=R[A];A=3&&(A.depth=arguments[2]),arguments.length>=4&&(A.colors=arguments[3]),l(D)?A.showHidden=D:D&&v._extend(A,D),j(A.showHidden)&&(A.showHidden=!1),j(A.depth)&&(A.depth=2),j(A.colors)&&(A.colors=!1),j(A.customInspect)&&(A.customInspect=!0),A.colors&&(A.stylize=d),g(A,m,A.depth)}function d(m,D){var A=a.styles[D];return A?"\x1b["+a.colors[A][0]+"m"+m+"\x1b["+a.colors[A][1]+"m":m}function S(m,D){return m}function g(m,D,A){if(m.customInspect&&D&&L(D.inspect)&&D.inspect!==v.inspect&&(!D.constructor||D.constructor.prototype!==D)){var R=D.inspect(A,m);return E(R)||(R=g(m,R,A)),R}var z=function(u,b){if(j(b))return u.stylize("undefined","undefined");if(E(b)){var C="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return u.stylize(C,"string")}return _(b)?u.stylize(""+b,"number"):l(b)?u.stylize(""+b,"boolean"):p(b)?u.stylize("null","null"):void 0}(m,D);if(z)return z;var b,K=Object.keys(D),Q=(b={},K.forEach(function(C,x){b[C]=!0}),b);if(m.showHidden&&(K=Object.getOwnPropertyNames(D)),U(D)&&(K.indexOf("message")>=0||K.indexOf("description")>=0))return o(D);if(0===K.length){if(L(D))return m.stylize("[Function"+(D.name?": "+D.name:"")+"]","special");if(M(D))return m.stylize(RegExp.prototype.toString.call(D),"regexp");if(G(D))return m.stylize(Date.prototype.toString.call(D),"date");if(U(D))return o(D)}var J,T="",k=!1,t=["{","}"];return f(D)&&(k=!0,t=["[","]"]),L(D)&&(T=" [Function"+(D.name?": "+D.name:"")+"]"),M(D)&&(T=" "+RegExp.prototype.toString.call(D)),G(D)&&(T=" "+Date.prototype.toUTCString.call(D)),U(D)&&(T=" "+o(D)),0!==K.length||k&&0!=D.length?A<0?M(D)?m.stylize(RegExp.prototype.toString.call(D),"regexp"):m.stylize("[Object]","special"):(m.seen.push(D),J=k?function(u,b,C,x,N){for(var Y=[],ct=0,pt=b.length;ct60?C[0]+(""===b?"":b+"\n ")+" "+u.join(",\n ")+" "+C[1]:C[0]+b+" "+u.join(", ")+" "+C[1]}(J,T,t)):t[0]+T+t[1]}function o(m){return"["+Error.prototype.toString.call(m)+"]"}function s(m,D,A,R,z,K){var Q,nt,J;if((J=Object.getOwnPropertyDescriptor(D,z)||{value:D[z]}).get?nt=m.stylize(J.set?"[Getter/Setter]":"[Getter]","special"):J.set&&(nt=m.stylize("[Setter]","special")),at(R,z)||(Q="["+z+"]"),nt||(m.seen.indexOf(J.value)<0?(nt=p(A)?g(m,J.value,null):g(m,J.value,A-1)).indexOf("\n")>-1&&(nt=K?nt.split("\n").map(function(T){return" "+T}).join("\n").substr(2):"\n"+nt.split("\n").map(function(T){return" "+T}).join("\n")):nt=m.stylize("[Circular]","special")),j(Q)){if(K&&z.match(/^\d+$/))return nt;(Q=JSON.stringify(""+z)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Q=Q.substr(1,Q.length-2),Q=m.stylize(Q,"name")):(Q=Q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Q=m.stylize(Q,"string"))}return Q+": "+nt}function f(m){return Array.isArray(m)}function l(m){return"boolean"==typeof m}function p(m){return null===m}function _(m){return"number"==typeof m}function E(m){return"string"==typeof m}function j(m){return void 0===m}function M(m){return F(m)&&"[object RegExp]"===$(m)}function F(m){return"object"==typeof m&&null!==m}function G(m){return F(m)&&"[object Date]"===$(m)}function U(m){return F(m)&&("[object Error]"===$(m)||m instanceof Error)}function L(m){return"function"==typeof m}function $(m){return Object.prototype.toString.call(m)}function ot(m){return m<10?"0"+m.toString(10):m.toString(10)}v.debuglog=function(m){if(m=m.toUpperCase(),!h[m])if(n.test(m)){var D=e.pid;h[m]=function(){var A=v.format.apply(v,arguments);console.error("%s %d: %s",m,D,A)}}else h[m]=function(){};return h[m]},v.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},v.types=i(5955),v.isArray=f,v.isBoolean=l,v.isNull=p,v.isNullOrUndefined=function(m){return null==m},v.isNumber=_,v.isString=E,v.isSymbol=function(m){return"symbol"==typeof m},v.isUndefined=j,v.isRegExp=M,v.types.isRegExp=M,v.isObject=F,v.isDate=G,v.types.isDate=G,v.isError=U,v.types.isNativeError=U,v.isFunction=L,v.isPrimitive=function(m){return null===m||"boolean"==typeof m||"number"==typeof m||"string"==typeof m||"symbol"==typeof m||void 0===m},v.isBuffer=i(384);var et=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Z(){var m=new Date,D=[ot(m.getHours()),ot(m.getMinutes()),ot(m.getSeconds())].join(":");return[m.getDate(),et[m.getMonth()],D].join(" ")}function at(m,D){return Object.prototype.hasOwnProperty.call(m,D)}v.log=function(){console.log("%s - %s",Z(),v.format.apply(v,arguments))},v.inherits=i(5717),v._extend=function(m,D){if(!D||!F(D))return m;for(var A=Object.keys(D),R=A.length;R--;)m[A[R]]=D[A[R]];return m};var ut=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function I(m,D){if(!m){var A=new Error("Promise was rejected with a falsy value");A.reason=m,m=A}return D(m)}v.promisify=function(m){if("function"!=typeof m)throw new TypeError('The "original" argument must be of type Function');if(ut&&m[ut]){var D;if("function"!=typeof(D=m[ut]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(D,ut,{value:D,enumerable:!1,writable:!1,configurable:!0}),D}function D(){for(var A,R,z=new Promise(function(nt,J){A=nt,R=J}),K=[],Q=0;Q{"use strict";var e=i(4029),y=i(3083),c=i(1924),h=c("Object.prototype.toString"),n=i(6410)(),r=typeof globalThis>"u"?i.g:globalThis,a=y(),d=c("String.prototype.slice"),S={},g=i(882),o=Object.getPrototypeOf;n&&g&&o&&e(a,function(f){if("function"==typeof r[f]){var l=new r[f];if(Symbol.toStringTag in l){var p=o(l),_=g(p,Symbol.toStringTag);if(!_){var E=o(p);_=g(E,Symbol.toStringTag)}S[f]=_.get}}});var s=i(5692);O.exports=function(f){return!!s(f)&&(n&&Symbol.toStringTag in f?(l=f,p=!1,e(S,function(_,E){if(!p)try{var j=_.call(l);j===E&&(p=j)}catch{}}),p):d(h(f),8,-1));var l,p}},2479:O=>{O.exports=function v(i,e){if(i&&e)return v(i)(e);if("function"!=typeof i)throw new TypeError("need wrapper function");return Object.keys(i).forEach(function(c){y[c]=i[c]}),y;function y(){for(var c=new Array(arguments.length),h=0;h{O.exports=function(){for(var i={},e=0;e{},2361:()=>{},4616:()=>{},522:()=>{},6882:()=>{},3083:(O,v,i)=>{"use strict";var e=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],y=typeof globalThis>"u"?i.g:globalThis;O.exports=function(){for(var c=[],h=0;h{"use strict";var e=i(210)("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}O.exports=e}},be={};function wt(O){var v=be[O];if(void 0!==v)return v.exports;var i=be[O]={id:O,loaded:!1,exports:{}};return Ee[O].call(i.exports,i,i.exports,wt),i.loaded=!0,i.exports}wt.n=O=>{var v=O&&O.__esModule?()=>O.default:()=>O;return wt.d(v,{a:v}),v},wt.d=(O,v)=>{for(var i in v)wt.o(v,i)&&!wt.o(O,i)&&Object.defineProperty(O,i,{enumerable:!0,get:v[i]})},wt.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch{if("object"==typeof window)return window}}(),wt.o=(O,v)=>Object.prototype.hasOwnProperty.call(O,v),wt.nmd=O=>(O.paths=[],O.children||(O.children=[]),O);var Ae={};return(()=>{"use strict";function O(W,w,P){return w in W?Object.defineProperty(W,w,{value:P,enumerable:!0,configurable:!0,writable:!0}):W[w]=P,W}wt.d(Ae,{default:()=>ee});var v=wt(2378),i=wt.n(v),e=wt(2043),y=wt.n(e);function c(W,w){var P=Object.keys(W);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(W);w&&(B=B.filter(function(V){return Object.getOwnPropertyDescriptor(W,V).enumerable})),P.push.apply(P,B)}return P}function h(W){for(var w=1;w1&&void 0!==arguments[1]?arguments[1]:{},B=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const V={mode:"cors",headers:{}};B.useAPIKey&&(V.headers=h(h({},V.headers),g()));const tt=i()(V,P,{method:"GET"}),X=yield d(w,tt);if(X.ok)return X.json();throw o(X),X});return function(P){return W.apply(this,arguments)}}();var f=wt(8473),l=wt(1798),p=wt.n(l);wt(5772),wt(5811),wt(8764);var _=wt(7187),E=wt(4445),j=wt.n(E),M=wt(9826),F=wt(2840),G=wt.n(F),U=wt(778),L=wt.n(U),$=wt(4286),ot=wt.n($);function et(){}const Z="ACK";class at extends f.Duplex{constructor(w){let{name:P,target:B,targetWindow:V=window,targetOrigin:tt="*"}=w;if(super({objectMode:!0}),O(this,"_init",void 0),O(this,"_haveSyn",void 0),O(this,"_name",void 0),O(this,"_target",void 0),O(this,"_targetWindow",void 0),O(this,"_targetOrigin",void 0),O(this,"_onMessage",void 0),O(this,"_synIntervalId",void 0),!P||!B)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=P,this._target=B,this._targetWindow=V,this._targetOrigin=tt,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write("BRK",null,et),this._haveSyn=!1,this._init=!1}_handShake(){this._write("SYN",null,et),this.cork()}_onData(w){if(this._init)if("BRK"===w)this._break();else try{this.push(w)}catch(P){this.emit("error",P)}else"SYN"===w?(this._haveSyn=!0,this._write(Z,null,et)):w===Z&&(this._init=!0,this._haveSyn||this._write(Z,null,et),this.uncork())}_postMessage(w){this._targetWindow.postMessage({target:this._target,data:w},this._targetOrigin)}onMessage(w){const P=w.data;"*"!==this._targetOrigin&&w.origin!==this._targetOrigin||w.source!==this._targetWindow||"object"!=typeof P||P.target!==this._name||!P.data||this._onData(P.data)}_read(){}_write(w,P,B){this._postMessage(w),B()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}function ut(W,w,P){try{Reflect.apply(W,w,P)}catch(B){setTimeout(()=>{throw B})}}class I extends _.EventEmitter{emit(w){let P="error"===w;const B=this._events;if(void 0!==B)P=P&&void 0===B.error;else if(!P)return!1;for(var V=arguments.length,tt=new Array(V>1?V-1:0),X=1;X0&&([rt]=tt),rt instanceof Error)throw rt;const lt=new Error("Unhandled error.".concat(rt?" (".concat(rt.message,")"):""));throw lt.context=rt,lt}const st=B[w];if(void 0===st)return!1;if("function"==typeof st)ut(st,this,tt);else{const rt=st.length,lt=function(ht){const dt=ht.length,mt=new Array(dt);for(let _t=0;_t{const X=rt=>{const lt=rt||P.error;lt&&(P.error=(0,M.Xy)(lt)),tt([lt,!0])},st=rt=>{P.error?X(P.error):(rt&&("function"!=typeof rt&&X(new m({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),V.push(rt)),tt([null,!1]))};try{B(w,P,st,X)}catch(rt){X(rt)}})}static _runReturnHandlers(w){return Tt(function*(){for(const P of w)yield new Promise((B,V)=>{P(tt=>tt?V(tt):B())})})()}static _checkForCompletion(w,P,B){if(!("result"in P)&&!("error"in P))throw new m({code:-32603,message:"Response has no error or result for request"});if(!B)throw new m({code:-32603,message:"Nothing ended request"})}push(w){this._middleware.push(w)}handle(w,P){if(P&&"function"!=typeof P)throw new Error('"callback" must be a function if provided.');return Array.isArray(w)?P?this._handleBatch(w,P):this._handleBatch(w):P?this._handle(w,P):this._promiseHandle(w)}asMiddleware(){var w=this;return function(){var P=Tt(function*(B,V,tt,X){try{const[st,rt,lt]=yield A._runAllMiddleware(B,V,w._middleware);return rt?(yield A._runReturnHandlers(lt),X(st)):tt(function(){var ht=Tt(function*(dt){try{yield A._runReturnHandlers(lt)}catch(mt){return dt(mt)}return dt()});return function(dt){return ht.apply(this,arguments)}}())}catch(st){return X(st)}});return function(B,V,tt,X){return P.apply(this,arguments)}}()}_handleBatch(w,P){var B=this;return Tt(function*(){try{const V=yield Promise.all(w.map(B._promiseHandle.bind(B)));return P?P(null,V):V}catch(V){if(P)return P(V);throw V}})()}_promiseHandle(w){return new Promise(P=>{this._handle(w,(B,V)=>{P(V)})})}_handle(w,P){var B=this;return Tt(function*(){if(!w||Array.isArray(w)||"object"!=typeof w){const st=new m({code:-32603,message:"request must be plain object"});return P(st,{id:void 0,jsonrpc:"2.0",error:st})}if("string"!=typeof w.method){const st=new m({code:-32603,message:"method must be string"});return P(st,{id:w.id,jsonrpc:"2.0",error:st})}const V=function(st){for(var rt=1;rt0&&void 0!==arguments[0]?arguments[0]:{}),{},{objectMode:!0})),O(this,"_substreams",void 0),O(this,"getStream",void 0),this._substreams={}}createStream(w){if(!w)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[w])throw new Error('ObjectMultiplex - Substream for name "'.concat(w,'" already exists'));const P=new R({parent:this,name:w});return this._substreams[w]=P,function(B,V){const tt=L()(X=>P.destroy(X||void 0));G()(B,{readable:!1},tt),G()(B,{writable:!1},tt)}(this),P}ignoreStream(w){if(!w)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[w])throw new Error('ObjectMultiplex - Substream for name "'.concat(w,'" already exists'));this._substreams[w]=Q}_read(){}_write(w,P,B){const{name:V,data:tt}=w;if(!V)return window.console.warn('ObjectMultiplex - malformed chunk without name "'.concat(w,'"')),B();const X=this._substreams[V];return X?(X!==Q&&X.push(tt),B()):(window.console.warn('ObjectMultiplex - orphaned data for stream "'.concat(V,'"')),B())}}const J={GOOGLE:"google",FACEBOOK:"facebook",TWITCH:"twitch",REDDIT:"reddit",DISCORD:"discord",EMAIL_PASSWORDLESS:"torus-auth0-email-passwordless"},T={[J.GOOGLE]:"tkey-google",[J.FACEBOOK]:"tkey-facebook",[J.TWITCH]:"tkey-twitch",[J.REDDIT]:"tkey-reddit",[J.DISCORD]:"tkey-discord",[J.EMAIL_PASSWORDLESS]:"tkey-auth0-email-passwordless"},k="moonpay",t="wyre",u="rampnetwork",b="xanpool",C="mercuryo",x="transak",N="banxa",Y="mainnet",ct="matic",pt="bsc_mainnet",gt="avalanche_mainnet",yt={PRODUCTION:"production",DEVELOPMENT:"development",BINANCE:"binance",TESTING:"testing",LRC:"lrc",BETA:"beta",BNB:"bnb",POLYGON:"polygon"},bt={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},Et={[k]:["AUD","BGN","BRL","CAD","CHF","CNY","COP","CZK","DKK","DOP","EGP","EUR","GBP","HKD","HRK","IDR","ILS","JPY","JOD","KES","KRW","KWD","LKR","MAD","MXN","MYR","NGN","NOK","NZD","OMR","PEN","PKR","PLN","RON","RUB","SEK","SGD","THB","TRY","TWD","USD","VND","ZAR"],[t]:["USD","EUR","GBP","AUD","CAD","NZD","ARS","BRL","CHF","CLP","COP","CZK","DKK","HKD","ILS","INR","ISK","JPY","KRW","MXN","MYR","NOK","PHP","PLN","SEK","THB","VND","ZAR"],[u]:["USD","EUR","GBP"],[b]:["SGD","HKD","THB","PHP","INR","IDR","MYR","AUD","NZD","KRW"],[C]:["EUR","USD","GBP","TRY","JPY","BRL","NGN","VND","MXN","KRW"],[x]:["ARS","AUD","BBD","BGN","BMD","BRL","CAD","CHF","CLP","CRC","CZK","DKK","DOP","EUR","FJD","FKP","GBP","GIP","HRK","HUF","IDR","ILS","ISK","JMD","JPY","KES","KRW","MDL","MXN","MYR","NOK","NZD","PEN","PHP","PLN","PYG","RON","SEK","SGD","THB","TRY","TZS","USD","ZAR"],[N]:["EUR","GBP","USD"]},Rt=new Set(["ETH","USDT","USDC","TUSD","EOSDT","USD","DAI","GUSD","DKKT","PAX","ILS","RUB","BYN","EUR","GBP","JPY","KRW","PLN","MXN","AUD","BRL","CAD","CHF","KPW","LAK","LBP","LKR","XOF","CNHT","DOGE","UAH","TRY","HKD","XJP","SGD","USC","NZD","NGN","RUR","COP","GHS","EGP","IDR","BHD","CRC","PEN","AED","DOP","PKR","HUF","VND","XAR","LTC","RON","OMR","MYR","DKK","UGX","ZMW","SAR","SEK","GEL","RWF","IRR","TZS","CNY","VEF","BDT","HRK","CLP","THB","XAF","ARS","UYU","SZL","KZT","NOK","KES","PAB","INR","CZK","MAD","TWD","PHP","ZAR","BOB","CDF","DASH","VES","ISK","MWK","BAM","TTD","XRP","JOD","RSD","HNL","BGN","GTQ","BWP","XMR","MMK","QAR","AOA","KWD","MUR","WUSD","WEUR","WAVES","WTRY","LRD","LSL","LYD","AWG","MDL","BTO","EURS","CHFT","MKD","MNT","MOP","MRO","MVR","VOLLAR","CKUSD","KHR","VUV","BITCNY","QC","BBD","NAD","NPR","PGK","PYG","BIF","BMD","BND","XLM","BNB","SCR","BAT","CRO","HT","KCS","LEO","LINK","MKR","NPXS","OMG","REP","ZB","ZIL","ZRX","BCH","BZD","CUP","CVE","DJF","DZD","ERN","ETB","FJD","FKP","BUSD","ANCT","ALL","AMD","ANG","CNYX","IQD","UZS","TND","GGP","XAU","KGS","GIP","JMD","ZEC","USDP","BSV","EMC2","SNT","GTO","POWR","EUSD","EURT","BCY","BTS","ATM","BLOCKPAY","ARDR","AMP","B2X","BITGOLD","BITEUR","ATB","BITUSD","AGRS","DFXT","HIKEN","BIX","KNC","EOS","COB","COSS","BMH","NANO","BDG","BNT","XVG","LKK1Y","LKK","USDK","EURN","NZDT","JSE","GMD","GNF","GYD","YER","XPF","HTG","SLL","SOS","WST","SVC","SYP","NEO","KMF","JUMP","AYA","BLAST","WGR","BCN","BTG","URALS","INN","USDQ","CNH","HUSD","BKRW","NZDX","EURX","CADX","USDEX","JPYX","AUDX","VNDC","EON","GBPX","CHFX","USDJ","IDRT","USDS","USDN","BIDR","IDK","BSD","BTN","KYD","NIO","SBD","SDG","SHP","TOP","XCD","XCHF","CNYT","GYEN","ZUSD","GOLD","TRX","TRYB","PLATC","STRAX","UST","GLM","VAI","BRZ","DDRST","XAUT","MIM"]);function Mt(W){return Et[W].filter(w=>Rt.has(w))}const Vt={[k]:{line1:"Credit/ Debit Card/ Apple Pay",line2:"4.5% or 5 USD",line3:"2,000\u20ac/day, 10,000\u20ac/mo",supportPage:"https://help.moonpay.io/en/",minOrderValue:24.99,maxOrderValue:5e4,validCurrencies:Mt(k),validCryptoCurrenciesByChain:{[Y]:[{value:"aave",display:"AAVE"},{value:"bat",display:"BAT"},{value:"dai",display:"DAI"},{value:"eth",display:"ETH"},{value:"mkr",display:"MKR"},{value:"matic",display:"MATIC"},{value:"usdt",display:"USDT"},{value:"usdc",display:"USDC"}],[ct]:[{value:"eth_polygon",display:"ETH"},{value:"matic_polygon",display:"MATIC"},{value:"usdc_polygon",display:"USDC"}],[pt]:[{value:"bnb_bsc",display:"BNB"},{value:"busd_bsc",display:"BUSD"}],[gt]:[{value:"avax_cchain",display:"AVAX"}]},includeFees:!0,api:!0,enforceMax:!1},[t]:{line1:"Apple Pay/ Debit/ Credit Card",line2:"4.9% + 30\xa2 or 5 USD",line3:"$250/day",supportPage:"https://support.sendwyre.com/en/",minOrderValue:5,maxOrderValue:500,validCurrencies:Mt(t),validCryptoCurrenciesByChain:{[Y]:[{value:"AAVE",display:"AAVE"},{value:"BAT",display:"BAT"},{value:"BUSD",display:"BUSD"},{value:"DAI",display:"DAI"},{value:"ETH",display:"ETH"},{value:"MKR",display:"MKR"},{value:"UNI",display:"UNI"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"}],[ct]:[{value:"MUSDC",display:"USDC"}],[gt]:[{value:"AVAXC",display:"AVAXC"}]},includeFees:!1,api:!0,enforceMax:!1},[u]:{line1:"Debit Card/
Apple Pay/ Bank transfer",line2:"0.49% - 2.9%",line3:"5,000\u20ac/purchase, 20,000\u20ac/mo",supportPage:"https://instant.ramp.network/",minOrderValue:50,maxOrderValue:2e4,validCurrencies:Mt(u),validCryptoCurrenciesByChain:{[Y]:[{value:"ETH",display:"ETH"},{value:"DAI",display:"DAI"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"}],[ct]:[{value:"MATIC_DAI",display:"DAI"},{value:"MATIC_MATIC",display:"MATIC"},{value:"MATIC_USDC",display:"USDC"}],[gt]:[{value:"AVAX",display:"AVAX"}]},includeFees:!0,api:!0,receiveHint:"walletTopUp.receiveHintRamp",enforceMax:!1},[b]:{line1:"PayNow/ InstaPay/ FPS/ GoJekPay/ UPI/ PromptPay/
ViettelPay/ DuitNow",line2:"2.5% buying, 3% selling",line3:"$2,500 / day",supportPage:"mailto:support@xanpool.com",minOrderValue:100,maxOrderValue:2500,validCurrencies:Mt(b),validCryptoCurrenciesByChain:{[Y]:[{value:"ETH",display:"ETH"},{value:"USDT",display:"USDT"}]},includeFees:!0,api:!0,sell:!0,enforceMax:!1},[C]:{line1:"Credit/ Debit Card/ Apple Pay",line2:"3.95% or 4 USD",line3:"10,000\u20ac/day, 25,000\u20ac/mo",supportPage:"mailto:support@mercuryo.io",minOrderValue:30,maxOrderValue:5e3,validCurrencies:Mt(C),validCryptoCurrenciesByChain:{[Y]:[{value:"ETH",display:"ETH"},{value:"BAT",display:"BAT"},{value:"USDT",display:"USDT"},{value:"DAI",display:"DAI"}],[pt]:[{value:"BNB",display:"BNB"},{value:"BUSD",display:"BUSD"},{value:"1INCH",display:"1INCH"}]},includeFees:!0,api:!0,enforceMax:!1},[x]:{line1:"Apple & Google Pay / Credit/Debit Card
Bangkok Bank Mobile & iPay
Bank Transfer (sepa/gbp) / SCB Mobile & Easy",line2:"0.99% - 5.5% or 5 USD",line3:"$5,000/day, $28,000/mo",supportPage:"https://support.transak.com/hc/en-US",minOrderValue:30,maxOrderValue:500,validCurrencies:Mt(x),validCryptoCurrenciesByChain:{[Y]:[{value:"AAVE",display:"AAVE"},{value:"DAI",display:"DAI"},{value:"ETH",display:"ETH"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"}],[ct]:[{value:"AAVE",display:"AAVE"},{value:"DAI",display:"DAI"},{value:"MATIC",display:"MATIC"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"},{value:"WETH",display:"WETH"}],[pt]:[{value:"BNB",display:"BNB"},{value:"BUSD",display:"BUSD"}],[gt]:[{value:"AVAX",display:"AVAX"}]},includeFees:!0,enforceMax:!0},[N]:{line1:"Debit Card/
Apple Pay/ Bank transfer",line2:"0.49% - 2.9%",line3:"5,000\u20ac/purchase, 20,000\u20ac/mo",supportPage:"https://support.banxa.com",minOrderValue:20,maxOrderValue:15e3,validCurrencies:Mt(N),validCryptoCurrenciesByChain:{[Y]:[{value:"ETH",display:"ETH"},{value:"USDT",display:"USDT"},{value:"BUSD",display:"BUSD"},{value:"LINK",display:"LINK"},{value:"USDC",display:"USDC"},{value:"CHZ",display:"CHZ"},{value:"BAT",display:"BAT"},{value:"MANA",display:"MANA"},{value:"AAVE",display:"AAVE"},{value:"COMP",display:"COMP"},{value:"ENJ",display:"ENJ"}],[ct]:[{value:"MATIC",display:"MATIC"}]},includeFees:!0,enforceMax:!0}},Pt={supportedVerifierList:Object.values(J),paymentProviders:Vt,api:"https://api.tor.us",translations:{en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies ben\xf6tigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"\u7d99\u7d9a\u3059\u308b",actionRequired:"\u8a8d\u8a3c\u304c\u5fc5\u8981\u3067\u3059",pendingAction:"\u7d9a\u884c\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u7d9a\u884c\u3057\u307e\u3059",cookiesRequired:"\u5fc5\u8981\u306a\u30af\u30c3\u30ad\u30fc",enableCookies:"Torus\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u306e\u8a2d\u5b9a\u3067Cookie\u3092\u6709\u52b9\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",clickHere:"\u8a73\u3057\u304f\u306f"}},ko:{embed:{continue:"\uacc4\uc18d\ud558\ub2e4",actionRequired:"\uc2b9\uc778 \ud544\uc694",pendingAction:"\ud31d\uc5c5\uc5d0\uc11c \uc694\uccad\uc744 \uc9c4\ud589\ud558\ub824\uba74 \uacc4\uc18d\uc744 \ud074\ub9ad\ud558\uc2ed\uc2dc\uc624.",cookiesRequired:"\ucfe0\ud0a4 \ud544\uc694",enableCookies:"\ube0c\ub77c\uc6b0\uc800 \ud658\uacbd \uc124\uc815\uc5d0\uc11c \ucfe0\ud0a4\ub97c \ud65c\uc131\ud654\ud558\uc5ec Torus\uc5d0 \uc561\uc138\uc2a4\ud558\uc2ed\uc2dc\uc624.",clickHere:"\ub354 \ub9ce\uc740 \uc815\ubcf4"}},zh:{embed:{continue:"\u7ee7\u7eed",actionRequired:"\u9700\u8981\u6388\u6743",pendingAction:"\u5355\u51fb\u7ee7\u7eed\u4ee5\u5728\u5f39\u51fa\u7a97\u53e3\u4e2d\u7ee7\u7eed\u60a8\u7684\u8bf7\u6c42",cookiesRequired:"\u5fc5\u586bCookie",enableCookies:"\u8bf7\u5728\u60a8\u7684\u6d4f\u89c8\u5668\u9996\u9009\u9879\u4e2d\u542f\u7528cookie\u4ee5\u8bbf\u95eeTorus\u3002",clickHere:"\u66f4\u591a\u4fe1\u606f"}}},prodTorusUrl:"",localStorageKeyPrefix:"torus-"},Nt=W=>new Promise((w,P)=>{null!=window.document.body?Promise.resolve(W()).then(w).catch(P):window.document.addEventListener("DOMContentLoaded",()=>{Promise.resolve(W()).then(w).catch(P)})}),qt=W=>{const w=window.document.createElement("template"),P=W.trim();return w.innerHTML=P,w.content.firstChild},Ut=(W,w,P)=>{const B=V=>{P(V),W.removeListener(w,B)};W.on(w,B)};var ce=wt(2724),he=wt(4063),me=wt.n(he),Zt=wt(4970);const St=y().getLogger("torus-embed"),Bt={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",sendSiteMetadata:()=>"Torus: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:W=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${W} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:(W,w)=>`Invalid options. Received: { maxEventListeners: ${W}, shouldSendMetadata: ${w} }`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:W=>`'args.logger' must include required method '${W}'.`},info:{connected:W=>`Torus: Connected to chain with ID "${W}".`},warnings:{enableDeprecation:'Torus: ""ethereum.enable()" is deprecated and may be removed in the future. Please use "ethereum.send("eth_requestAccounts")" instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1102',sendDeprecation:'Torus: "ethereum.send(...)" is deprecated and may be removed in the future. Please use "ethereum.sendAsync(...)" or "ethereum.request(...)" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',events:{close:'Torus: The event "close" is deprecated and may be removed in the future. Please use "disconnect" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',data:'Torus: The event "data" is deprecated and will be removed in the future.Use "message" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message',networkChanged:'Torus: The event "networkChanged" is deprecated and may be removed in the future. Please use "chainChanged" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',notification:'Torus: The event "notification" is deprecated and may be removed in the future. Please use "message" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193'},publicConfigStore:'Torus: The property "publicConfigStore" is deprecated and WILL be removed in the future.'}},{paymentProviders:Qt}=Pt;function re(W,w,P){let B=`MetaMask: Lost connection to "${W}".`;null!=w&&w.stack&&(B+=`\n${w.stack}`),St.warn(B),P&&P.listenerCount("error")>0&&P.emit("error",B)}const zt=()=>Math.random().toString(36).slice(2),ne=function(){var W=Tt(function*(w,P){let B,V,tt=P.version||"1.38.5";try{if(("binance"===w||"production"===w)&&!P.version){let X;X=Pt.prodTorusUrl?{data:Pt.prodTorusUrl}:yield s(`${Pt.api}/latestversion?name=@toruslabs/torus-embed&version=1.38.5`,{},{useAPIKey:!0}),tt=X.data,Pt.prodTorusUrl=X.data}}catch(X){St.error(X,"unable to fetch latest version")}switch(St.info("version used: ",tt),w){case"binance":B=`https://binance.tor.us/v${tt}`,V="info";break;case"testing":B="https://testing.tor.us",V="debug";break;case"bnb":B="https://bnb.tor.us",V="error";break;case"polygon":B="https://polygon.tor.us",V="error";break;case"lrc":B="https://lrc.tor.us",V="debug";break;case"beta":B="https://beta.tor.us",V="debug";break;case"development":B="http://localhost:4050",V="debug";break;default:B=`https://app.tor.us/v${tt}`,V="error"}return{torusUrl:B,logLevel:V}});return function(P,B){return W.apply(this,arguments)}}(),Ht=()=>{let W=window.navigator.language||"en-US";const w=W.split("-");return W=Object.prototype.hasOwnProperty.call(Pt.translations,w[0])?w[0]:"en",W},Yt=["eth_subscription"],ie=()=>{},oe="directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=660,width=375",te="directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=700,width=450";function fe(W,w){var P=Object.keys(W);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(W);w&&(B=B.filter(function(V){return Object.getOwnPropertyDescriptor(W,V).enumerable})),P.push.apply(P,B)}return P}I.defaultMaxListeners=100;const se=function(W,w){let P=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(B,V)=>B||V.error?w(B||V.error):!P||Array.isArray(V)?W(V):W(V.result)};class q extends I{constructor(w){let{maxEventListeners:P=100,shouldSendMetadata:B=!0,jsonRpcStreamName:V="provider"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),O(this,"chainId",void 0),O(this,"selectedAddress",void 0),O(this,"_rpcEngine",void 0),O(this,"networkVersion",void 0),O(this,"shouldSendMetadata",void 0),O(this,"isTorus",void 0),O(this,"_publicConfigStore",void 0),O(this,"tryPreopenHandle",void 0),O(this,"enable",void 0),O(this,"_state",void 0),O(this,"_jsonRpcConnection",void 0),O(this,"_sentWarnings",{enable:!1,experimentalMethods:!1,send:!1,publicConfigStore:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}}),!(0,Zt.duplex)(w))throw new Error(Bt.errors.invalidDuplexStream());this.isTorus=!0,this.setMaxListeners(P),this._state=function(rt){for(var lt=1;lt{this._state.isConnected=!0});const X=function(){const rt={},lt=new I,ht=new f.Duplex({objectMode:!0,read:function(){return!1},write:function(dt,mt,_t){let Dt;try{dt.id?function(Ct){const Ft=rt[Ct.id];if(!Ft)throw new Error('StreamMiddleware - Unknown response id "'.concat(Ct.id,'"'));delete rt[Ct.id],Object.assign(Ft.res,Ct),setTimeout(Ft.end)}(dt):lt.emit("notification",Ct=dt)}catch(Ct){Dt=Ct}var Ct;_t(Dt)}});return{events:lt,middleware:(dt,mt,_t,Dt)=>{ht.push(dt),rt[dt.id]={req:dt,res:mt,next:_t,end:Dt}},stream:ht}}();ot()(X.stream,tt.createStream(V),X.stream,this._handleStreamDisconnect.bind(this,"MetaMask RpcProvider"));const st=new A;st.push((rt,lt,ht,dt)=>{const mt=rt.id,_t=p()(32).toString("hex");rt.id=_t,lt.id=_t,ht(Dt=>{rt.id=mt,lt.id=mt,Dt()})}),st.push((rt,lt,ht)=>{"string"==typeof rt.method&&rt.method||(lt.error=M.Sy.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:rt})),ht(dt=>{const{error:mt}=lt;return mt&&St.error(`MetaMask - RPC Error: ${mt.message}`,mt),dt()})}),st.push(X.middleware),this._rpcEngine=st,X.events.on("notification",rt=>{const{method:lt,params:ht}=rt;"wallet_accountsChanged"===lt?this._handleAccountsChanged(ht):"wallet_unlockStateChanged"===lt?this._handleUnlockStateChanged(ht):"wallet_chainChanged"===lt?this._handleChainChanged(ht):Yt.includes(rt.method)&&(this.emit("data",rt),this.emit("notification",ht.result),this.emit("message",{type:lt,data:ht}))})}get publicConfigStore(){return this._sentWarnings.publicConfigStore||(St.warn(Bt.warnings.publicConfigStore),this._sentWarnings.publicConfigStore=!0),this._publicConfigStore}isConnected(){return this._state.isConnected}request(w){var P=this;return Tt(function*(){if(!w||"object"!=typeof w||Array.isArray(w))throw M.Sy.rpc.invalidRequest({message:Bt.errors.invalidRequestArgs(),data:w});const{method:B,params:V}=w;if("string"!=typeof B||0===B.length)throw M.Sy.rpc.invalidRequest({message:Bt.errors.invalidRequestMethod(),data:w});if(void 0!==V&&!Array.isArray(V)&&("object"!=typeof V||null===V))throw M.Sy.rpc.invalidRequest({message:Bt.errors.invalidRequestParams(),data:w});return new Promise((tt,X)=>{P._rpcRequest({method:B,params:V},se(tt,X))})})()}sendAsync(w,P){this._rpcRequest(w,P)}addListener(w,P){return this._warnOfDeprecation(w),super.addListener(w,P)}on(w,P){return this._warnOfDeprecation(w),super.on(w,P)}once(w,P){return this._warnOfDeprecation(w),super.once(w,P)}prependListener(w,P){return this._warnOfDeprecation(w),super.prependListener(w,P)}prependOnceListener(w,P){return this._warnOfDeprecation(w),super.prependOnceListener(w,P)}_initializeState(){var w=this;return Tt(function*(){try{const{accounts:P,chainId:B,isUnlocked:V,networkVersion:tt}=yield w.request({method:"wallet_getProviderState"});w.emit("connect",{chainId:B}),w._handleChainChanged({chainId:B,networkVersion:tt}),w._handleUnlockStateChanged({accounts:P,isUnlocked:V}),w._handleAccountsChanged(P)}catch(P){St.error("MetaMask: Failed to get initial state. Please report this bug.",P)}finally{St.info("initialized state"),w._state.initialized=!0,w.emit("_initialized")}})()}_rpcRequest(w,P){let B=arguments.length>2&&void 0!==arguments[2]&&arguments[2],V=P;const tt=w;if(!Array.isArray(tt))if(tt.jsonrpc||(tt.jsonrpc="2.0"),"eth_accounts"===tt.method||"eth_requestAccounts"===tt.method)V=(X,st)=>{this._handleAccountsChanged(st.result||[],"eth_accounts"===tt.method,B),P(X,st)};else if("wallet_getProviderState"===tt.method)return void this._rpcEngine.handle(w,V);this.tryPreopenHandle(tt,V)}send(w,P){return this._sentWarnings.send||(St.warn(Bt.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof w||P&&!Array.isArray(P)?w&&"object"==typeof w&&"function"==typeof P?this._rpcRequest(w,P):this._sendSync(w):new Promise((B,V)=>{try{this._rpcRequest({method:w,params:P},se(B,V,!1))}catch(tt){V(tt)}})}_sendSync(w){let P;switch(w.method){case"eth_accounts":P=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":P=this.selectedAddress||null;break;case"eth_uninstallFilter":this._rpcRequest(w,ie),P=!0;break;case"net_version":P=this.networkVersion||null;break;default:throw new Error(Bt.errors.unsupportedSync(w.method))}return{id:w.id,jsonrpc:w.jsonrpc,result:P}}_handleConnect(w){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:w}),St.debug(Bt.info.connected(w)))}_handleDisconnect(w,P){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!w){let B;this._state.isConnected=!1,w?(B=new M.Cg(1013,P||Bt.errors.disconnected()),St.debug(B)):(B=new M.Cg(1011,P||Bt.errors.permanentlyDisconnected()),St.error(B),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",B)}}_handleStreamDisconnect(w,P){re(w,P,this),this._handleDisconnect(!1,P?P.message:void 0)}_handleAccountsChanged(w){let P=arguments.length>1&&void 0!==arguments[1]&&arguments[1],B=arguments.length>2&&void 0!==arguments[2]&&arguments[2],V=w;Array.isArray(V)||(St.error("MetaMask: Received non-array accounts parameter. Please report this bug.",V),V=[]);for(const tt of w)if("string"!=typeof tt){St.error("MetaMask: Received non-string account. Please report this bug.",w),V=[];break}me()(this._state.accounts,V)||(P&&Array.isArray(this._state.accounts)&&this._state.accounts.length>0&&!B&&St.error('MetaMask: "eth_accounts" unexpectedly updated accounts. Please report this bug.',V),this._state.accounts=V,this.emit("accountsChanged",V)),this.selectedAddress!==V[0]&&(this.selectedAddress=V[0]||null)}_handleChainChanged(){let{chainId:w,networkVersion:P}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w&&P?"loading"===P?this._handleDisconnect(!0):(this._handleConnect(w),w!==this.chainId&&(this.chainId=w,this._state.initialized&&this.emit("chainChanged",this.chainId))):St.error("MetaMask: Received invalid network parameters. Please report this bug.",{chainId:w,networkVersion:P})}_handleUnlockStateChanged(){let{accounts:w,isUnlocked:P}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"boolean"==typeof P?P!==this._state.isUnlocked&&(this._state.isUnlocked=P,this._handleAccountsChanged(w||[])):St.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.",{isUnlocked:P})}_warnOfDeprecation(w){!1===this._sentWarnings.events[w]&&(St.warn(Bt.warnings.events[w]),this._sentWarnings.events[w]=!0)}}O(q,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});const H=q;var it=wt(3482),ft=wt.n(it);const vt=(W,w)=>{const P={};return W.algorithms.forEach(B=>{P[B]=ft()(B).update(w,"utf8").digest("base64")}),P},At=class Ot extends _.EventEmitter{constructor(w){let{url:P,target:B,features:V}=w;super(),O(this,"url",void 0),O(this,"target",void 0),O(this,"features",void 0),O(this,"window",void 0),O(this,"windowTimer",void 0),O(this,"iClosedWindow",void 0),this.url=P,this.target=B||"_blank",this.features=V||function(){const tt=void 0!==window.screenLeft?window.screenLeft:window.screenX,X=void 0!==window.screenTop?window.screenTop:window.screenY,st=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,rt=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,lt=Math.abs((st-1200)/2/1+tt);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=700,width=1200,top=${Math.abs((rt-700)/2/1+X)},left=${lt}`}(),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0),void 0===this.window&&clearInterval(this.windowTimer)},500))}open(){var w;return this.window=window.open(this.url.href,this.target,this.features),null!==(w=this.window)&&void 0!==w&&w.focus&&this.window.focus(),Promise.resolve()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(w){w?window.location.replace(this.url.href):window.location.href=this.url.href}};function It(W){return new Promise((w,P)=>{try{const B=document.createElement("img");B.onload=()=>w(!0),B.onerror=()=>w(!1),B.src=W}catch(B){P(B)}})}const jt=W=>{const{document:w}=W,P=w.querySelector('head > meta[property="og:site_name"]');if(P)return P.content;const B=w.querySelector('head > meta[name="title"]');return B?B.content:w.title&&w.title.length>0?w.title:W.location.hostname};function xt(W){return kt.apply(this,arguments)}function kt(){return(kt=Tt(function*(W){const{document:w}=W;let P=w.querySelector('head > link[rel="shortcut icon"]');return P&&(yield It(P.href))?P.href:(P=Array.from(w.querySelectorAll('head > link[rel="icon"]')).find(B=>Boolean(B.href)),P&&(yield It(P.href))?P.href:null)})).apply(this,arguments)}var Jt=wt(8764).Buffer;const Xt=["host","chainId","networkName"];function Gt(W,w){var P=Object.keys(W);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(W);w&&(B=B.filter(function(V){return Object.getOwnPropertyDescriptor(W,V).enumerable})),P.push.apply(P,B)}return P}function Kt(W){for(var w=1;w"u")return;const W=document.createElement("link"),{torusUrl:w}=yield ne("production",{check:!1,hash:Lt,version:""});W.href=`${w}/popup`,W.crossOrigin="anonymous",W.type="text/html",W.rel="prefetch",W.relList&&W.relList.supports&&W.relList.supports("prefetch")&&document.head.appendChild(W)}catch(W){St.warn(W)}})();const ee=class{constructor(){let{buttonPosition:W=bt.BOTTOM_LEFT,buttonSize:w=56,modalZIndex:P=99999,apiKey:B="torus-default"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};O(this,"buttonPosition",bt.BOTTOM_LEFT),O(this,"buttonSize",void 0),O(this,"torusUrl",void 0),O(this,"torusIframe",void 0),O(this,"styleLink",void 0),O(this,"isLoggedIn",void 0),O(this,"isInitialized",void 0),O(this,"torusWidgetVisibility",void 0),O(this,"torusAlert",void 0),O(this,"apiKey",void 0),O(this,"modalZIndex",void 0),O(this,"alertZIndex",void 0),O(this,"torusAlertContainer",void 0),O(this,"isIframeFullScreen",void 0),O(this,"whiteLabel",void 0),O(this,"requestedVerifier",void 0),O(this,"currentVerifier",void 0),O(this,"embedTranslations",void 0),O(this,"ethereum",void 0),O(this,"provider",void 0),O(this,"communicationMux",void 0),O(this,"isLoginCallback",void 0),O(this,"paymentProviders",Pt.paymentProviders),O(this,"loginHint",""),O(this,"useWalletConnect",void 0),O(this,"isCustomLogin",!1),this.buttonPosition=W,this.buttonSize=w,this.torusUrl="",this.isLoggedIn=!1,this.isInitialized=!1,this.torusWidgetVisibility=!0,this.requestedVerifier="",this.currentVerifier="",this.apiKey=B,function a(W){r=W}(B),this.modalZIndex=P,this.alertZIndex=P+1e3,this.isIframeFullScreen=!1}init(){var W=arguments,w=this;return Tt(function*(){let{buildEnv:P=yt.PRODUCTION,enableLogging:B=!1,enabledVerifiers:V=Wt,network:tt={host:"mainnet",chainId:null,networkName:"",blockExplorer:"",ticker:"",tickerName:""},loginConfig:X={},showTorusButton:st=!0,integrity:rt={check:!1,hash:Lt,version:""},whiteLabel:lt,skipTKey:ht=!1,useWalletConnect:dt=!1,mfaLevel:mt="default"}=W.length>0&&void 0!==W[0]?W[0]:{};if(w.isInitialized)throw new Error("Already initialized");const{torusUrl:_t,logLevel:Dt}=yield ne(P,rt);St.info(_t,"url loaded"),w.torusUrl=_t,w.whiteLabel=lt,w.useWalletConnect=dt,w.isCustomLogin=!!(X&&Object.keys(X).length>0)||!!(lt&&Object.keys(lt).length>0),St.setDefaultLevel(Dt),B?St.enableAll():St.disableAll(),w.torusWidgetVisibility=st;const Ct=new URL(_t);Ct.pathname.endsWith("/")?Ct.pathname+="popup":Ct.pathname+="/popup",Ct.hash=`#isCustomLogin=${w.isCustomLogin}`,w.torusIframe=qt(`