diff --git a/asset-manifest.json b/asset-manifest.json index cc25373ac..bfee13c8b 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "./static/css/main.f9ea61fb.css", - "main.js": "./static/js/main.9c4997ec.js", + "main.js": "./static/js/main.c5bf79ec.js", "static/js/514.71647b34.chunk.js": "./static/js/514.71647b34.chunk.js", "static/js/726.a6fa00bf.chunk.js": "./static/js/726.a6fa00bf.chunk.js", "static/js/199.7a2f7ff7.chunk.js": "./static/js/199.7a2f7ff7.chunk.js", @@ -124,6 +124,6 @@ }, "entrypoints": [ "static/css/main.f9ea61fb.css", - "static/js/main.9c4997ec.js" + "static/js/main.c5bf79ec.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index f6177a2aa..fa9d5f277 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Trisolaris
\ No newline at end of file +Trisolaris
\ No newline at end of file diff --git a/static/js/main.9c4997ec.js b/static/js/main.c5bf79ec.js similarity index 80% rename from static/js/main.9c4997ec.js rename to static/js/main.c5bf79ec.js index 0446d3653..a8f437913 100644 --- a/static/js/main.9c4997ec.js +++ b/static/js/main.c5bf79ec.js @@ -1,2 +1,2 @@ -/*! For license information please see main.9c4997ec.js.LICENSE.txt */ -!function(){var e={11395:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;var a=n(10080),o=n(55550),s=n(81689),u=n(34405),c=n(47993),l=n(16642),f=n(81107),d={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/6hnvSmry5GBrjanXK4WTHbqjFKTqBwcodwY8QnQU3ojt",REACT_APP_PORTIS_ID:"",REACT_APP_FORTMATIC_KEY:"",REACT_APP_GOOGLE_ANALYTICS_ID:"G-8RHNLJ21N1"}.LINK_API_URL||"https://www.walletlink.org",p={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/6hnvSmry5GBrjanXK4WTHbqjFKTqBwcodwY8QnQU3ojt",REACT_APP_PORTIS_ID:"",REACT_APP_FORTMATIC_KEY:"",REACT_APP_GOOGLE_ANALYTICS_ID:"G-8RHNLJ21N1"}.SDK_VERSION||n(40626).i8||"unknown",h=function(){function e(t){var n,i,a;r(this,e),this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;var s,f=t.linkAPIUrl||d;if(s=t.uiConstructor?t.uiConstructor:function(e){return new u.WalletSDKUI(e)},"undefined"===typeof t.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(n=t.overrideIsCoinbaseWallet)||void 0===n||n,this._overrideIsCoinbaseBrowser=null!==(i=t.overrideIsCoinbaseBrowser)&&void 0!==i&&i,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this._diagnosticLogger={log:t.eventListener.onEvent}:this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=null===(a=t.reloadOnDisconnect)||void 0===a||a;var h=new URL(f),m="".concat(h.protocol,"//").concat(h.host);this._storage=new o.ScopedLocalStorage("-walletlink:".concat(m)),this._storage.setItem("version",e.VERSION),this.walletExtension||this.coinbaseBrowser||(this._relayEventManager=new l.WalletSDKRelayEventManager,this._relay=new c.WalletSDKRelay({linkAPIUrl:f,version:p,darkMode:!!t.darkMode,uiConstructor:s,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(t.appName,t.appLogoUrl),t.headlessMode||this._relay.attachUI())}return i(e,[{key:"makeWeb3Provider",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,t),!1===this._reloadOnDisconnect&&"function"===typeof n.disableReloadOnDisconnect&&n.disableReloadOnDisconnect(),n;var r=this.coinbaseBrowser;if(r)return r;var i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||i.setConnectDisabled(!0),new s.CoinbaseWalletProvider({relayProvider:function(){return Promise.resolve(i)},relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:t,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}},{key:"setAppInfo",value:function(e,t){var n;this._appName=e||"DApp",this._appLogoUrl=t||(0,f.getFavicon)();var r=this.walletExtension;r?this.isCipherProvider(r)||r.setAppInfo(this._appName,this._appLogoUrl):null===(n=this._relay)||void 0===n||n.setAppInfo(this._appName,this._appLogoUrl)}},{key:"disconnect",value:function(){var e,t=this.walletExtension;t?t.close():null===(e=this._relay)||void 0===e||e.resetAndReload()}},{key:"getQrUrl",value:function(){var e,t;return null!==(t=null===(e=this._relay)||void 0===e?void 0:e.getQRCodeUrl())&&void 0!==t?t:null}},{key:"getCoinbaseWalletLogo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:240;return(0,a.walletLogo)(e,t)}},{key:"walletExtension",get:function(){var e;return null!==(e=window.coinbaseWalletExtension)&&void 0!==e?e:window.walletLinkExtension}},{key:"coinbaseBrowser",get:function(){var e,t;try{var n=null!==(e=window.ethereum)&&void 0!==e?e:null===(t=window.top)||void 0===t?void 0:t.ethereum;if(!n)return;return"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch(r){return}}},{key:"isCipherProvider",value:function(e){return"boolean"===typeof e.isCipher&&e.isCipher}}]),e}();t.CoinbaseWalletSDK=h,h.VERSION=p},10080:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.walletLogo=void 0;t.walletLogo=function(e,t){var n;switch(e){case"standard":default:return n=t,"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(n,"' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E ");case"circle":return n=t,"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='".concat(t,"' height='").concat(n,"' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E");case"text":return n=(.1*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(n,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E");case"textWithLogo":return n=(.25*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(n,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E");case"textLight":return n=(.1*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(n,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E");case"textWithLogoLight":return n=(.25*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(n,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E")}}},98470:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}"},44296:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseAppSteps=t.CoinbaseWalletSteps=t.ConnectItem=t.ConnectContent=void 0;var a=i(n(83061)),o=n(73856),s=n(98944),u=n(81107),c=n(27865),l=n(24662),f=i(n(24479)),d=i(n(20658)),p=n(96038),h=i(n(11541)),m=i(n(14206)),v=n(17993),y=n(52179),b=n(91807),g=i(n(98470)),w={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:d.default,steps:A},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:f.default,steps:E}},x=function(e){return"light"===e?"#FFFFFF":"#0A0B0D"};function k(e){var t=e.title,n=e.description,r=e.icon,i=e.selected,s=e.theme,u=e.onClick;return(0,o.h)("div",{onClick:u,class:(0,a.default)("-cbwsdk-connect-item",s,{selected:i})},(0,o.h)("div",null,(0,o.h)("img",{src:r,alt:t})),(0,o.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,o.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,o.h)("p",{class:"-cbwsdk-connect-item-description"},n)))}function A(e){var t=e.theme;return(0,o.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,o.h)("li",{class:(0,a.default)("-cbwsdk-wallet-steps-item",t)},(0,o.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,o.h)("li",{class:(0,a.default)("-cbwsdk-wallet-steps-item",t)},(0,o.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,o.h)("span",null,"Tap ",(0,o.h)("strong",null,"Scan")," "),(0,o.h)("span",{class:(0,a.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,o.h)(p.QRCodeIcon,{fill:x(t)})))))}function E(e){var t=e.theme;return(0,o.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,o.h)("li",{class:(0,a.default)("-cbwsdk-wallet-steps-item",t)},(0,o.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,o.h)("li",{class:(0,a.default)("-cbwsdk-wallet-steps-item",t)},(0,o.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,o.h)("span",null,"Tap ",(0,o.h)("strong",null,"More")),(0,o.h)("span",{class:(0,a.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,o.h)(v.StatusDotIcon,{fill:x(t)})),(0,o.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,o.h)("strong",null,"Scan")),(0,o.h)("span",{class:(0,a.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,o.h)(p.QRCodeIcon,{fill:x(t)})))))}t.ConnectContent=function(e){var t=e.theme,n=(0,s.useState)("coinbase-wallet-app"),i=r(n,2),f=i[0],d=i[1],p=(0,s.useCallback)((function(e){d(e)}),[]),v=(0,u.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId);if(!f)return null;var x,A=w[f].steps,E="coinbase-app"===f;return(0,o.h)("div",{"data-testid":"connect-content",class:(0,a.default)("-cbwsdk-connect-content",t)},(0,o.h)("style",null,g.default),(0,o.h)("div",{class:"-cbwsdk-connect-content-header"},(0,o.h)("h2",{class:(0,a.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with one of our mobile apps"),e.onCancel&&(0,o.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,o.h)(l.CloseIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,o.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,o.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,o.h)("div",null,Object.entries(w).map((function(e){var n=r(e,2),i=n[0],a=n[1];return(0,o.h)(k,{key:i,title:a.title,description:a.description,icon:a.icon,selected:f===i,onClick:function(){return p(i)},theme:t})}))),E&&(0,o.h)("div",{class:(0,a.default)("-cbwsdk-connect-content-update-app",t)},"Don\u2019t see a ",(0,o.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,o.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,o.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,o.h)(y.QRCode,{content:v,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:(x=f,"coinbase-app"===x?h.default:m.default),width:25,height:25}}),(0,o.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:c.LIB_VERSION}),(0,o.h)("input",{type:"hidden",value:v})),(0,o.h)(A,{theme:t}),!e.isConnected&&(0,o.h)("div",{"data-testid":"connecting-spinner",class:(0,a.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,o.h)(b.Spinner,{size:36,color:"dark"===t?"#FFF":"#000"}),(0,o.h)("p",null,"Connecting...")))))},t.ConnectItem=k,t.CoinbaseWalletSteps=A,t.CoinbaseAppSteps=E},99763:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}"},19236:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectDialog=void 0;var a=i(n(83061)),o=n(73856),s=n(98944),u=n(44296),c=n(69691),l=i(n(99763));t.ConnectDialog=function(e){var t=e.isOpen,n=e.darkMode,i=(0,s.useState)(!t),f=r(i,2),d=f[0],p=f[1],h=(0,s.useState)(!t),m=r(h,2),v=m[0],y=m[1];(0,s.useEffect)((function(){var e=[window.setTimeout((function(){y(!t)}),10)];return t?p(!1):e.push(window.setTimeout((function(){p(!0)}),360)),function(){e.forEach(window.clearTimeout)}}),[e.isOpen]);var b=n?"dark":"light";return(0,o.h)("div",{class:(0,a.default)("-cbwsdk-connect-dialog-container",d&&"-cbwsdk-connect-dialog-container-hidden")},(0,o.h)("style",null,l.default),(0,o.h)("div",{class:(0,a.default)("-cbwsdk-connect-dialog-backdrop",b,v&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,o.h)("div",{class:"-cbwsdk-connect-dialog"},(0,o.h)("div",{class:(0,a.default)("-cbwsdk-connect-dialog-box",v&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,o.h)(u.ConnectContent,{theme:b,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,o.h)(c.TryExtensionContent,{theme:b}))))}},247:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.LinkFlow=void 0;var a=n(73856),o=n(40623),s=n(19236),u=function(){function e(t){r(this,e),this.extensionUI$=new o.BehaviorSubject({}),this.subscriptions=new o.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection,this.connected$=t.connected$,this.chainId$=t.chainId$}return i(e,[{key:"attach",value:function(e){var t=this;this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((function(e){t.isConnected!==e&&(t.isConnected=e,t.render())}))),this.subscriptions.add(this.chainId$.subscribe((function(e){t.chainId!==e&&(t.chainId=e,t.render())})))}},{key:"detach",value:function(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,a.render)(null,this.root),null===(e=this.root.parentElement)||void 0===e||e.removeChild(this.root))}},{key:"setConnectDisabled",value:function(e){this.connectDisabled=e}},{key:"open",value:function(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}},{key:"close",value:function(){this.isOpen=!1,this.onCancel=null,this.render()}},{key:"render",value:function(){var e=this;if(this.root){var t=this.extensionUI$.subscribe((function(){e.root&&(0,a.render)((0,a.h)(s.ConnectDialog,{darkMode:e.darkMode,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isOpen:e.isOpen,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel,connectDisabled:e.connectDisabled}),e.root)}));this.subscriptions.add(t)}}}]),e}();t.LinkFlow=u},52179:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.QRCode=void 0;var a=n(73856),o=n(98944),s=i(n(16134));t.QRCode=function(e){var t=(0,o.useState)(""),n=r(t,2),i=n[0],u=n[1];return(0,o.useEffect)((function(){var t,n,r=new s.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(t=e.width)&&void 0!==t?t:256,height:null!==(n=e.height)&&void 0!==n?n:256,padding:0,image:e.image}),i=Buffer.from(r.svg(),"utf8").toString("base64");u("data:image/svg+xml;base64,".concat(i))})),i?(0,a.h)("img",{src:i,alt:"QR Code"}):null}},16627:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"},64620:function(e,t,n){"use strict";var r=n(27424).default,i=n(56690).default,a=n(89728).default,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;var s=o(n(83061)),u=n(73856),c=n(98944),l=o(n(16627));function f(e){return"coinbase-app"===e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}var d=function(){function e(t){i(this,e),this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=t.darkMode}return a(e,[{key:"attach",value:function(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}},{key:"presentItem",value:function(e){var t=this,n=this.nextItemKey++;return this.items.set(n,e),this.render(),function(){t.items.delete(n),t.render()}}},{key:"clear",value:function(){this.items.clear(),this.render()}},{key:"render",value:function(){this.root&&(0,u.render)((0,u.h)("div",null,(0,u.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map((function(e){var n=r(e,2),i=n[0],a=n[1];return(0,u.h)(t.SnackbarInstance,Object.assign({},a,{key:i}))})))),this.root)}}]),e}();t.Snackbar=d;t.SnackbarContainer=function(e){return(0,u.h)("div",{class:(0,s.default)("-cbwsdk-snackbar-container")},(0,u.h)("style",null,l.default),(0,u.h)("div",{class:"-cbwsdk-snackbar"},e.children))};t.SnackbarInstance=function(e){var t=e.autoExpand,n=e.message,i=e.menuItems,a=e.appSrc,o=(0,c.useState)(!0),l=r(o,2),d=l[0],p=l[1],h=(0,c.useState)(null!==t&&void 0!==t&&t),m=r(h,2),v=m[0],y=m[1];(0,c.useEffect)((function(){var e=[window.setTimeout((function(){p(!1)}),1),window.setTimeout((function(){y(!0)}),1e4)];return function(){e.forEach(window.clearTimeout)}}));return(0,u.h)("div",{class:(0,s.default)("-cbwsdk-snackbar-instance",d&&"-cbwsdk-snackbar-instance-hidden",v&&"-cbwsdk-snackbar-instance-expanded")},(0,u.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:function(){y(!v)}},(0,u.h)("img",{src:f(a),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,u.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},n),(0,u.h)("div",{class:"-gear-container"},!v&&(0,u.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,u.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,u.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),i&&i.length>0&&(0,u.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},i.map((function(e,t){return(0,u.h)("div",{class:(0,s.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,u.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,u.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,u.h)("span",{class:(0,s.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info))}))))}},57470:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}"},91807:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Spinner=void 0;var i=n(73856),a=r(n(57470));t.Spinner=function(e){var t,n=null!==(t=e.size)&&void 0!==t?t:64,r=e.color||"#000";return(0,i.h)("div",{class:"-cbwsdk-spinner"},(0,i.h)("style",null,a.default),(0,i.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},(0,i.h)("circle",{style:{cx:50,cy:50,r:45,stroke:r}})))}},64980:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}"},69691:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TryExtensionContent=void 0;var a=i(n(83061)),o=n(73856),s=n(98944),u=n(31834),c=n(76642),l=n(83404),f=i(n(64980));t.TryExtensionContent=function(e){var t=e.theme,n=(0,s.useState)(!1),i=r(n,2),d=i[0],p=i[1],h=(0,s.useCallback)((function(){window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}),[]),m=(0,s.useCallback)((function(){d?window.location.reload():(h(),p(!0))}),[h,d]);return(0,o.h)("div",{class:(0,a.default)("-cbwsdk-try-extension",t)},(0,o.h)("style",null,f.default),(0,o.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,o.h)("h3",{class:(0,a.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,o.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,o.h)("button",{class:(0,a.default)("-cbwsdk-try-extension-cta",t),onClick:m},d?"Refresh":"Install"),(0,o.h)("div",null,!d&&(0,o.h)(u.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===t?"#0052FF":"#588AF5"})))),(0,o.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,o.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,o.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,o.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,o.h)("span",{class:(0,a.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,o.h)(c.LaptopIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,o.h)("div",{class:(0,a.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,o.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,o.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,o.h)("span",{class:(0,a.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,o.h)(l.SafeIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,o.h)("div",{class:(0,a.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}},31834:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowLeftIcon=void 0;var r=n(73856);t.ArrowLeftIcon=function(e){return(0,r.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}},24662:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CloseIcon=void 0;var r=n(73856);t.CloseIcon=function(e){return(0,r.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}},76642:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaptopIcon=void 0;var r=n(73856);t.LaptopIcon=function(e){return(0,r.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,r.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}},96038:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QRCodeIcon=void 0;var r=n(73856);t.QRCodeIcon=function(e){return(0,r.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,r.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,r.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,r.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,r.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,r.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,r.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,r.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,r.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}},11541:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default='\n \n \n \n \n \n'},14206:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='\n \n \n \n \n \n \n'},83404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeIcon=void 0;var r=n(73856);t.SafeIcon=function(e){return(0,r.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}},17993:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusDotIcon=void 0;var r=n(73856);t.StatusDotIcon=function(e){return(0,r.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}},24479:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4="},20658:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg=="},70732:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientMessagePublishEvent=t.ClientMessageSetSessionConfig=t.ClientMessageGetSessionConfig=t.ClientMessageIsLinked=t.ClientMessageHostSession=void 0,t.ClientMessageHostSession=function(e){return Object.assign({type:"HostSession"},e)},t.ClientMessageIsLinked=function(e){return Object.assign({type:"IsLinked"},e)},t.ClientMessageGetSessionConfig=function(e){return Object.assign({type:"GetSessionConfig"},e)},t.ClientMessageSetSessionConfig=function(e){return Object.assign({type:"SetSessionConfig"},e)},t.ClientMessagePublishEvent=function(e){return Object.assign({type:"PublishEvent"},e)}},56171:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EVENTS=void 0,t.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"}},10680:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;var a,o=n(40623),s=n(21807);!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(a=t.ConnectionState||(t.ConnectionState={}));var u=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:WebSocket;r(this,e),this.WebSocketClass=n,this.webSocket=null,this.connectionStateSubject=new o.BehaviorSubject(a.DISCONNECTED),this.incomingDataSubject=new o.Subject,this.url=t.replace(/^http/,"ws")}return i(e,[{key:"connect",value:function(){var e=this;return this.webSocket?(0,o.throwError)(new Error("webSocket object is not null")):new o.Observable((function(t){var n;try{e.webSocket=n=new e.WebSocketClass(e.url)}catch(r){return void t.error(r)}e.connectionStateSubject.next(a.CONNECTING),n.onclose=function(n){e.clearWebSocket(),t.error(new Error("websocket error ".concat(n.code,": ").concat(n.reason))),e.connectionStateSubject.next(a.DISCONNECTED)},n.onopen=function(n){t.next(),t.complete(),e.connectionStateSubject.next(a.CONNECTED)},n.onmessage=function(t){e.incomingDataSubject.next(t.data)}})).pipe((0,s.take)(1))}},{key:"disconnect",value:function(){var e=this.webSocket;if(e){this.clearWebSocket(),this.connectionStateSubject.next(a.DISCONNECTED);try{e.close()}catch(t){}}}},{key:"connectionState$",get:function(){return this.connectionStateSubject.asObservable()}},{key:"incomingData$",get:function(){return this.incomingDataSubject.asObservable()}},{key:"incomingJSONData$",get:function(){return this.incomingData$.pipe((0,s.flatMap)((function(e){var t;try{t=JSON.parse(e)}catch(n){return(0,o.empty)()}return(0,o.of)(t)})))}},{key:"sendData",value:function(e){var t=this.webSocket;if(!t)throw new Error("websocket is not connected");t.send(e)}},{key:"clearWebSocket",value:function(){var e=this.webSocket;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}]),e}();t.RxWebSocket=u},82747:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isServerMessageFail=void 0,t.isServerMessageFail=function(e){return e&&"Fail"===e.type&&"number"===typeof e.id&&"string"===typeof e.sessionId&&"string"===typeof e.error}},62569:function(e,t,n){"use strict";var r=n(38416).default,i=n(56690).default,a=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKConnection=void 0;var o=n(40623),s=n(21807),u=n(35836),c=n(99306),l=n(70732),f=n(56171),d=n(10680),p=n(82747),h=function(){function e(t,n,r,a){var l=this,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:WebSocket;i(this,e),this.sessionId=t,this.sessionKey=n,this.diagnostic=a,this.subscriptions=new o.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,c.IntNumber)(1),this.connectedSubject=new o.BehaviorSubject(!1),this.linkedSubject=new o.BehaviorSubject(!1),this.sessionConfigSubject=new o.ReplaySubject(1);var h=new d.RxWebSocket(r+"/rpc",p);this.ws=h,this.subscriptions.add(h.connectionState$.pipe((0,s.tap)((function(e){var n;return null===(n=l.diagnostic)||void 0===n?void 0:n.log(f.EVENTS.CONNECTED_STATE_CHANGE,{state:e,sessionIdHash:u.Session.hash(t)})})),(0,s.skip)(1),(0,s.filter)((function(e){return e===d.ConnectionState.DISCONNECTED&&!l.destroyed})),(0,s.delay)(5e3),(0,s.filter)((function(e){return!l.destroyed})),(0,s.flatMap)((function(e){return h.connect()})),(0,s.retry)()).subscribe()),this.subscriptions.add(h.connectionState$.pipe((0,s.skip)(2),(0,s.switchMap)((function(e){return(0,o.iif)((function(){return e===d.ConnectionState.CONNECTED}),l.authenticate().pipe((0,s.tap)((function(e){return l.sendIsLinked()})),(0,s.tap)((function(e){return l.sendGetSessionConfig()})),(0,s.map)((function(e){return!0}))),(0,o.of)(!1))})),(0,s.distinctUntilChanged)(),(0,s.catchError)((function(e){return(0,o.of)(!1)}))).subscribe((function(e){return l.connectedSubject.next(e)}))),this.subscriptions.add(h.connectionState$.pipe((0,s.skip)(1),(0,s.switchMap)((function(e){return(0,o.iif)((function(){return e===d.ConnectionState.CONNECTED}),(0,o.timer)(0,1e4))}))).subscribe((function(e){return 0===e?l.updateLastHeartbeat():l.heartbeat()}))),this.subscriptions.add(h.incomingData$.pipe((0,s.filter)((function(e){return"h"===e}))).subscribe((function(e){return l.updateLastHeartbeat()}))),this.subscriptions.add(h.incomingJSONData$.pipe((0,s.filter)((function(e){return["IsLinkedOK","Linked"].includes(e.type)}))).subscribe((function(e){var n,r=e;null===(n=l.diagnostic)||void 0===n||n.log(f.EVENTS.LINKED,{sessionIdHash:u.Session.hash(t),linked:r.linked,type:e.type,onlineGuests:r.onlineGuests}),l.linkedSubject.next(r.linked||r.onlineGuests>0)}))),this.subscriptions.add(h.incomingJSONData$.pipe((0,s.filter)((function(e){return["GetSessionConfigOK","SessionConfigUpdated"].includes(e.type)}))).subscribe((function(e){var n,r=e;null===(n=l.diagnostic)||void 0===n||n.log(f.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:u.Session.hash(t),metadata_keys:r&&r.metadata?Object.keys(r.metadata):void 0}),l.sessionConfigSubject.next({webhookId:r.webhookId,webhookUrl:r.webhookUrl,metadata:r.metadata})})))}return a(e,[{key:"connect",value:function(){var e;if(this.destroyed)throw new Error("instance is destroyed");null===(e=this.diagnostic)||void 0===e||e.log(f.EVENTS.STARTED_CONNECTING,{sessionIdHash:u.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}},{key:"destroy",value:function(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),null===(e=this.diagnostic)||void 0===e||e.log(f.EVENTS.DISCONNECTED,{sessionIdHash:u.Session.hash(this.sessionId)}),this.destroyed=!0}},{key:"isDestroyed",get:function(){return this.destroyed}},{key:"connected$",get:function(){return this.connectedSubject.asObservable()}},{key:"onceConnected$",get:function(){return this.connected$.pipe((0,s.filter)((function(e){return e})),(0,s.take)(1),(0,s.map)((function(){})))}},{key:"linked$",get:function(){return this.linkedSubject.asObservable()}},{key:"onceLinked$",get:function(){return this.linked$.pipe((0,s.filter)((function(e){return e})),(0,s.take)(1),(0,s.map)((function(){})))}},{key:"sessionConfig$",get:function(){return this.sessionConfigSubject.asObservable()}},{key:"incomingEvent$",get:function(){return this.ws.incomingJSONData$.pipe((0,s.filter)((function(e){if("Event"!==e.type)return!1;var t=e;return"string"===typeof t.sessionId&&"string"===typeof t.eventId&&"string"===typeof t.event&&"string"===typeof t.data})),(0,s.map)((function(e){return e})))}},{key:"setSessionMetadata",value:function(e,t){var n=this,i=(0,l.ClientMessageSetSessionConfig)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:r({},e,t)});return this.onceConnected$.pipe((0,s.flatMap)((function(e){return n.makeRequest(i)})),(0,s.map)((function(e){if((0,p.isServerMessageFail)(e))throw new Error(e.error||"failed to set session metadata")})))}},{key:"publishEvent",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=(0,l.ClientMessagePublishEvent)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:t,callWebhook:r});return this.onceLinked$.pipe((0,s.flatMap)((function(e){return n.makeRequest(i)})),(0,s.map)((function(e){if((0,p.isServerMessageFail)(e))throw new Error(e.error||"failed to publish event");return e.eventId})))}},{key:"sendData",value:function(e){this.ws.sendData(JSON.stringify(e))}},{key:"updateLastHeartbeat",value:function(){this.lastHeartbeatResponse=Date.now()}},{key:"heartbeat",value:function(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(e){}}},{key:"makeRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4,n=e.id;try{this.sendData(e)}catch(r){return(0,o.throwError)(r)}return this.ws.incomingJSONData$.pipe((0,s.timeoutWith)(t,(0,o.throwError)(new Error("request ".concat(n," timed out")))),(0,s.filter)((function(e){return e.id===n})),(0,s.take)(1))}},{key:"authenticate",value:function(){var e=(0,l.ClientMessageHostSession)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,s.map)((function(e){if((0,p.isServerMessageFail)(e))throw new Error(e.error||"failed to authentcate")})))}},{key:"sendIsLinked",value:function(){var e=(0,l.ClientMessageIsLinked)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}},{key:"sendGetSessionConfig",value:function(){var e=(0,l.ClientMessageGetSessionConfig)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}]),e}();t.WalletSDKConnection=h},27312:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;var r=n(98689),i=n(87734),a=n(27865);t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},r.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},r.errorCodes.provider),{unsupportedChain:4902}))})),t.standardErrorMessage=function(e){return void 0!==e?(0,r.getMessageFromCode)(e):"Unknown error"},t.standardErrors=Object.freeze(Object.assign(Object.assign({},r.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},r.ethErrors.provider),{unsupportedChain:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return r.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:"Unrecognized chain ID ".concat(e,". Try adding the chain using wallet_addEthereumChain first.")})}}))})),t.serializeError=function(e,n){var o=(0,r.serializeError)(function(e){return"string"===typeof e?{message:e,code:t.standardErrorCodes.rpc.internal}:(0,i.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method,result:e.result}}):e}(e),{shouldIncludeStack:!0}),s=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");s.searchParams.set("version",a.LIB_VERSION),s.searchParams.set("code",o.code.toString());var u=function(e,t){var n,r=null===(n=e)||void 0===n?void 0:n.method;if(r)return r;return void 0===t?void 0:"string"===typeof t?t:Array.isArray(t)?t.length>0?t[0].method:void 0:t.method}(o.data,n);return u&&s.searchParams.set("method",u),s.searchParams.set("message",o.message),Object.assign(Object.assign({},o),{docUrl:s.href})},t.getErrorCode=function(e){var t;return"number"===typeof e?e:function(e){return"object"===typeof e&&null!==e&&("number"===typeof e.code||"number"===typeof e.errorCode)}(e)?null!==(t=e.code)&&void 0!==t?t:e.errorCode:void 0}},52836:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;var r=n(11395),i=n(81689),a=n(11395);Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return a.CoinbaseWalletSDK}});var o=n(81689);Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return o.CoinbaseWalletProvider}}),t.default=r.CoinbaseWalletSDK,"undefined"!==typeof window&&(window.CoinbaseWalletSDK=r.CoinbaseWalletSDK,window.CoinbaseWalletProvider=i.CoinbaseWalletProvider,window.WalletLink=r.CoinbaseWalletSDK,window.WalletLinkProvider=i.CoinbaseWalletProvider)},55550:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ScopedLocalStorage=void 0;var a=function(){function e(t){r(this,e),this.scope=t}return i(e,[{key:"setItem",value:function(e,t){localStorage.setItem(this.scopedKey(e),t)}},{key:"getItem",value:function(e){return localStorage.getItem(this.scopedKey(e))}},{key:"removeItem",value:function(e){localStorage.removeItem(this.scopedKey(e))}},{key:"clear",value:function(){for(var e=this.scopedKey(""),t=[],n=0;n0&&r.initializeRelay(),window.addEventListener("message",(function(e){var t;if(e.origin===location.origin&&e.source===window&&"walletLinkMessage"===e.data.type){if("defaultChainChanged"===e.data.data.action||"dappChainSwitched"===e.data.data.action){var n=e.data.data.chainId,i=null!==(t=e.data.data.jsonRpcUrl)&&void 0!==t?t:r.jsonRpcUrl;r.updateProviderInfo(i,Number(n))}"addressChanged"===e.data.data.action&&r._setAddresses([e.data.data.address])}})),r}return s(n,[{key:"selectedAddress",get:function(){return this._addresses[0]||void 0}},{key:"networkVersion",get:function(){return this.getChainId().toString(10)}},{key:"chainId",get:function(){return(0,w.prepend0x)(this.getChainId().toString(16))}},{key:"isWalletLink",get:function(){return!0}},{key:"isMetaMask",get:function(){return this._overrideIsMetaMask}},{key:"host",get:function(){return this.jsonRpcUrl}},{key:"connected",get:function(){return!0}},{key:"isConnected",value:function(){return!0}},{key:"jsonRpcUrl",get:function(){var e;return null!==(e=this._storage.getItem(T))&&void 0!==e?e:this._jsonRpcUrlFromOpts},set:function(e){this._storage.setItem(T,e)}},{key:"disableReloadOnDisconnect",value:function(){this.reloadOnDisconnect=!1}},{key:"setProviderInfo",value:function(e,t){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=t,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}},{key:"updateProviderInfo",value:function(e,t){this.jsonRpcUrl=e;var n=this.getChainId();this._storage.setItem(_,t.toString(10)),!((0,w.ensureIntNumber)(t)!==n)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}},{key:"watchAsset",value:function(){var e=a(i().mark((function e(t,n,r,a,o,s){var u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return u=e.sent,e.next=5,u.watchAsset(t,n,r,a,o,null===s||void 0===s?void 0:s.toString()).promise;case 5:return c=e.sent,e.abrupt("return",!!c.result);case 7:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,a,o){return e.apply(this,arguments)}}()},{key:"addEthereumChain",value:function(){var e=a(i().mark((function e(t,n,r,a,o,s){var u,c,l,f,d;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,w.ensureIntNumber)(t)!==this.getChainId()){e.next=2;break}return e.abrupt("return",!1);case 2:return e.next=4,this.initializeRelay();case 4:if(l=e.sent,f=l.inlineAddEthereumChain(t.toString()),this._isAuthorized()||f){e.next=9;break}return e.next=9,l.requestEthereumAccounts().promise;case 9:return e.next=11,l.addEthereumChain(t.toString(),n,o,r,a,s).promise;case 11:return d=e.sent,!0===(null===(u=d.result)||void 0===u?void 0:u.isApproved)&&this.updateProviderInfo(n[0],t),e.abrupt("return",!0===(null===(c=d.result)||void 0===c?void 0:c.isApproved));case 14:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,a,o){return e.apply(this,arguments)}}()},{key:"switchEthereumChain",value:function(){var e=a(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return n=e.sent,e.next=5,n.switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;case 5:if(r=e.sent,!(0,g.isErrorResponse)(r)||!r.errorCode){e.next=12;break}if(r.errorCode!==m.standardErrorCodes.provider.unsupportedChain){e.next=11;break}throw m.standardErrors.provider.unsupportedChain(t);case 11:throw m.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode});case 12:(a=r.result).isApproved&&a.rpcUrl.length>0&&this.updateProviderInfo(a.rpcUrl,t);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setAppInfo",value:function(e,t){this.initializeRelay().then((function(n){return n.setAppInfo(e,t)}))}},{key:"enable",value:function(){var e=a(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this.diagnostic)||void 0===t||t.log(h.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?v.Session.hash(this._relay.session.id):void 0}),!(this._addresses.length>0)){e.next=3;break}return e.abrupt("return",r(this._addresses));case 3:return e.next=5,this.send(A.JSONRPCMethod.eth_requestAccounts);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=a(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:e.sent.resetAndReload();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(e,t){try{var n=this._send(e,t);if(n instanceof Promise)return n.catch((function(t){throw(0,m.serializeError)(t,e)}))}catch(r){throw(0,m.serializeError)(r,e)}}},{key:"_send",value:function(e,t){var n=this;if("string"===typeof e){var r={jsonrpc:"2.0",id:0,method:e,params:Array.isArray(t)?t:void 0!==t?[t]:[]};return this._sendRequestAsync(r).then((function(e){return e.result}))}if("function"===typeof t){var i=e,a=t;return this._sendAsync(i,a)}if(Array.isArray(e))return e.map((function(e){return n._sendRequest(e)}));var o=e;return this._sendRequest(o)}},{key:"sendAsync",value:function(){var e=a(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",this._sendAsync(t,n).catch((function(e){throw(0,m.serializeError)(e,t)})));case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return",Promise.reject((0,m.serializeError)(e.t0,t)));case 7:case"end":return e.stop()}}),e,this,[[0,4]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_sendAsync",value:function(){var e=a(i().mark((function e(t,n){var r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"===typeof n){e.next=2;break}throw new Error("callback is required");case 2:if(!Array.isArray(t)){e.next=6;break}return r=n,this._sendMultipleRequestsAsync(t).then((function(e){return r(null,e)})).catch((function(e){return r(e,null)})),e.abrupt("return");case 6:return a=n,e.abrupt("return",this._sendRequestAsync(t).then((function(e){return a(null,e)})).catch((function(e){return a(e,null)})));case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"request",value:function(){var e=a(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",this._request(t).catch((function(e){throw(0,m.serializeError)(e,t.method)})));case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return",Promise.reject((0,m.serializeError)(e.t0,t.method)));case 7:case"end":return e.stop()}}),e,this,[[0,4]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_request",value:function(){var e=a(i().mark((function e(t){var n,r,a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"object"===typeof t&&!Array.isArray(t)){e.next=2;break}throw m.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});case 2:if(n=t.method,r=t.params,"string"===typeof n&&0!==n.length){e.next=5;break}throw m.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});case 5:if(void 0===r||Array.isArray(r)||"object"===typeof r&&null!==r){e.next=7;break}throw m.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});case 7:return a=void 0===r?[]:r,o=this._relayEventManager.makeRequestId(),e.next=11,this._sendRequestAsync({method:n,params:a,jsonrpc:"2.0",id:o});case 11:return s=e.sent,e.abrupt("return",s.result);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"scanQRCode",value:function(){var e=a(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return r=e.sent,e.next=5,r.scanQRCode((0,w.ensureRegExpString)(t)).promise;case 5:if("string"===typeof(a=e.sent).result){e.next=8;break}throw(0,m.serializeError)(null!==(n=a.errorMessage)&&void 0!==n?n:"result was not a string",b.Web3Method.scanQRCode);case 8:return e.abrupt("return",a.result);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"genericRequest",value:function(){var e=a(i().mark((function e(t,n){var r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return a=e.sent,e.next=5,a.genericRequest(t,n).promise;case 5:if("string"===typeof(o=e.sent).result){e.next=8;break}throw(0,m.serializeError)(null!==(r=o.errorMessage)&&void 0!==r?r:"result was not a string",b.Web3Method.generic);case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"selectProvider",value:function(){var e=a(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return r=e.sent,e.next=5,r.selectProvider(t).promise;case 5:if("string"===typeof(a=e.sent).result){e.next=8;break}throw(0,m.serializeError)(null!==(n=a.errorMessage)&&void 0!==n?n:"result was not a string",b.Web3Method.selectProvider);case 8:return e.abrupt("return",a.result);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"supportsSubscriptions",value:function(){return!1}},{key:"subscribe",value:function(){throw new Error("Subscriptions are not supported")}},{key:"unsubscribe",value:function(){throw new Error("Subscriptions are not supported")}},{key:"disconnect",value:function(){return!0}},{key:"_sendRequest",value:function(e){var t={jsonrpc:"2.0",id:e.id},n=e.method;if(t.result=this._handleSynchronousMethods(e),void 0===t.result)throw new Error("Coinbase Wallet does not support calling ".concat(n," synchronously without ")+"a callback. Please provide a callback parameter to call ".concat(n," ")+"asynchronously.");return t}},{key:"_setAddresses",value:function(e,t){if(!Array.isArray(e))throw new Error("addresses is not an array");var n=e.map((function(e){return(0,w.ensureAddressString)(e)}));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&!1===this.supportsAddressSwitching&&!t||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(y.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}},{key:"_sendRequestAsync",value:function(e){var t=this;return new Promise((function(n,r){try{var i=t._handleSynchronousMethods(e);if(void 0!==i)return n({jsonrpc:"2.0",id:e.id,result:i});var a=t._handleAsynchronousFilterMethods(e);if(void 0!==a)return void a.then((function(t){return n(Object.assign(Object.assign({},t),{id:e.id}))})).catch((function(e){return r(e)}));var o=t._handleSubscriptionMethods(e);if(void 0!==o)return void o.then((function(t){return n({jsonrpc:"2.0",id:e.id,result:t.result})})).catch((function(e){return r(e)}))}catch(s){return r(s)}t._handleAsynchronousMethods(e).then((function(t){return t&&n(Object.assign(Object.assign({},t),{id:e.id}))})).catch((function(e){return r(e)}))}))}},{key:"_sendMultipleRequestsAsync",value:function(e){var t=this;return Promise.all(e.map((function(e){return t._sendRequestAsync(e)})))}},{key:"_handleSynchronousMethods",value:function(e){var t=e.method,n=e.params||[];switch(t){case A.JSONRPCMethod.eth_accounts:return this._eth_accounts();case A.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case A.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case A.JSONRPCMethod.net_version:return this._net_version();case A.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}},{key:"_handleAsynchronousMethods",value:function(){var e=a(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.method,r=t.params||[],e.t0=n,e.next=e.t0===A.JSONRPCMethod.eth_requestAccounts?5:e.t0===A.JSONRPCMethod.eth_sign?6:e.t0===A.JSONRPCMethod.eth_ecRecover?7:e.t0===A.JSONRPCMethod.personal_sign?8:e.t0===A.JSONRPCMethod.personal_ecRecover?9:e.t0===A.JSONRPCMethod.eth_signTransaction?10:e.t0===A.JSONRPCMethod.eth_sendRawTransaction?11:e.t0===A.JSONRPCMethod.eth_sendTransaction?12:e.t0===A.JSONRPCMethod.eth_signTypedData_v1?13:e.t0===A.JSONRPCMethod.eth_signTypedData_v2?14:e.t0===A.JSONRPCMethod.eth_signTypedData_v3?15:e.t0===A.JSONRPCMethod.eth_signTypedData_v4||e.t0===A.JSONRPCMethod.eth_signTypedData?16:e.t0===A.JSONRPCMethod.cbWallet_arbitrary?17:e.t0===A.JSONRPCMethod.wallet_addEthereumChain?18:e.t0===A.JSONRPCMethod.wallet_switchEthereumChain?19:e.t0===A.JSONRPCMethod.wallet_watchAsset?20:21;break;case 5:return e.abrupt("return",this._eth_requestAccounts());case 6:return e.abrupt("return",this._eth_sign(r));case 7:return e.abrupt("return",this._eth_ecRecover(r));case 8:return e.abrupt("return",this._personal_sign(r));case 9:return e.abrupt("return",this._personal_ecRecover(r));case 10:return e.abrupt("return",this._eth_signTransaction(r));case 11:return e.abrupt("return",this._eth_sendRawTransaction(r));case 12:return e.abrupt("return",this._eth_sendTransaction(r));case 13:return e.abrupt("return",this._eth_signTypedData_v1(r));case 14:return e.abrupt("return",this._throwUnsupportedMethodError());case 15:return e.abrupt("return",this._eth_signTypedData_v3(r));case 16:return e.abrupt("return",this._eth_signTypedData_v4(r));case 17:return e.abrupt("return",this._cbwallet_arbitrary(r));case 18:return e.abrupt("return",this._wallet_addEthereumChain(r));case 19:return e.abrupt("return",this._wallet_switchEthereumChain(r));case 20:return e.abrupt("return",this._wallet_watchAsset(r));case 21:return e.next=23,this.initializeRelay();case 23:return a=e.sent,e.abrupt("return",a.makeEthereumJSONRPCRequest(t,this.jsonRpcUrl));case 25:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_handleAsynchronousFilterMethods",value:function(e){var t=e.method,n=e.params||[];switch(t){case A.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case A.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case A.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case A.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case A.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}},{key:"_handleSubscriptionMethods",value:function(e){switch(e.method){case A.JSONRPCMethod.eth_subscribe:case A.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}},{key:"_isKnownAddress",value:function(e){try{var t=(0,w.ensureAddressString)(e);return this._addresses.map((function(e){return(0,w.ensureAddressString)(e)})).includes(t)}catch(n){}return!1}},{key:"_ensureKnownAddress",value:function(e){var t;if(!this._isKnownAddress(e))throw null===(t=this.diagnostic)||void 0===t||t.log(h.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}},{key:"_prepareTransactionParams",value:function(e){var t=e.from?(0,w.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");return this._ensureKnownAddress(t),{fromAddress:t,toAddress:e.to?(0,w.ensureAddressString)(e.to):null,weiValue:null!=e.value?(0,w.ensureBN)(e.value):new p.default(0),data:e.data?(0,w.ensureBuffer)(e.data):Buffer.alloc(0),nonce:null!=e.nonce?(0,w.ensureIntNumber)(e.nonce):null,gasPriceInWei:null!=e.gasPrice?(0,w.ensureBN)(e.gasPrice):null,maxFeePerGas:null!=e.maxFeePerGas?(0,w.ensureBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?(0,w.ensureBN)(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?(0,w.ensureBN)(e.gas):null,chainId:this.getChainId()}}},{key:"_isAuthorized",value:function(){return this._addresses.length>0}},{key:"_requireAuthorization",value:function(){if(!this._isAuthorized())throw m.standardErrors.provider.unauthorized({})}},{key:"_throwUnsupportedMethodError",value:function(){throw m.standardErrors.provider.unsupportedMethod({})}},{key:"_signEthereumMessage",value:function(){var e=a(i().mark((function e(t,n,r,a){var o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._ensureKnownAddress(n),e.prev=1,e.next=4,this.initializeRelay();case 4:return o=e.sent,e.next=7,o.signEthereumMessage(t,n,r,a).promise;case 7:return s=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:s.result});case 11:if(e.prev=11,e.t0=e.catch(1),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=15;break}throw m.standardErrors.provider.userRejectedRequest("User denied message signature");case 15:throw e.t0;case 16:case"end":return e.stop()}}),e,this,[[1,11]])})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"_ethereumAddressFromSignedMessage",value:function(){var e=a(i().mark((function e(t,n,r){var a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return a=e.sent,e.next=5,a.ethereumAddressFromSignedMessage(t,n,r).promise;case 5:return o=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:o.result});case 7:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"_eth_accounts",value:function(){return r(this._addresses)}},{key:"_eth_coinbase",value:function(){return this.selectedAddress||null}},{key:"_net_version",value:function(){return this.getChainId().toString(10)}},{key:"_eth_chainId",value:function(){return(0,w.hexStringFromIntNumber)(this.getChainId())}},{key:"getChainId",value:function(){var e=this._storage.getItem(_);if(!e)return(0,w.ensureIntNumber)(this._chainIdFromOpts);var t=parseInt(e,10);return(0,w.ensureIntNumber)(t)}},{key:"_eth_requestAccounts",value:function(){var e=a(i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this.diagnostic)||void 0===t||t.log(h.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?v.Session.hash(this._relay.session.id):void 0}),!(this._addresses.length>0)){e.next=3;break}return e.abrupt("return",Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses}));case 3:return e.prev=3,e.next=6,this.initializeRelay();case 6:return r=e.sent,e.next=9,r.requestEthereumAccounts().promise;case 9:n=e.sent,e.next=17;break;case 12:if(e.prev=12,e.t0=e.catch(3),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=16;break}throw m.standardErrors.provider.userRejectedRequest("User denied account authorization");case 16:throw e.t0;case 17:if(n.result){e.next=19;break}throw new Error("accounts received is empty");case 19:if(this._setAddresses(n.result),this.isLedger||this.isCoinbaseBrowser){e.next=23;break}return e.next=23,this.switchEthereumChain(this.getChainId());case 23:return e.abrupt("return",{jsonrpc:"2.0",id:0,result:this._addresses});case 24:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"_eth_sign",value:function(e){this._requireAuthorization();var t=(0,w.ensureAddressString)(e[0]),n=(0,w.ensureBuffer)(e[1]);return this._signEthereumMessage(n,t,!1)}},{key:"_eth_ecRecover",value:function(e){var t=(0,w.ensureBuffer)(e[0]),n=(0,w.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!1)}},{key:"_personal_sign",value:function(e){this._requireAuthorization();var t=(0,w.ensureBuffer)(e[0]),n=(0,w.ensureAddressString)(e[1]);return this._signEthereumMessage(t,n,!0)}},{key:"_personal_ecRecover",value:function(e){var t=(0,w.ensureBuffer)(e[0]),n=(0,w.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!0)}},{key:"_eth_signTransaction",value:function(){var e=a(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=this._prepareTransactionParams(t[0]||{}),e.prev=2,e.next=5,this.initializeRelay();case 5:return r=e.sent,e.next=8,r.signEthereumTransaction(n).promise;case 8:return a=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:a.result});case 12:if(e.prev=12,e.t0=e.catch(2),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=16;break}throw m.standardErrors.provider.userRejectedRequest("User denied transaction signature");case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,this,[[2,12]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_sendRawTransaction",value:function(){var e=a(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,w.ensureBuffer)(t[0]),e.next=3,this.initializeRelay();case 3:return r=e.sent,e.next=6,r.submitEthereumTransaction(n,this.getChainId()).promise;case 6:return a=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:a.result});case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_sendTransaction",value:function(){var e=a(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=this._prepareTransactionParams(t[0]||{}),e.prev=2,e.next=5,this.initializeRelay();case 5:return r=e.sent,e.next=8,r.signAndSubmitEthereumTransaction(n).promise;case 8:return a=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:a.result});case 12:if(e.prev=12,e.t0=e.catch(2),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=16;break}throw m.standardErrors.provider.userRejectedRequest("User denied transaction signature");case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,this,[[2,12]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_signTypedData_v1",value:function(){var e=a(i().mark((function e(t){var n,r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=(0,w.ensureParsedJSONObject)(t[0]),r=(0,w.ensureAddressString)(t[1]),this._ensureKnownAddress(r),a=x.default.hashForSignTypedDataLegacy({data:n}),o=JSON.stringify(n,null,2),e.abrupt("return",this._signEthereumMessage(a,r,!1,o));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_signTypedData_v3",value:function(){var e=a(i().mark((function e(t){var n,r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=(0,w.ensureAddressString)(t[0]),r=(0,w.ensureParsedJSONObject)(t[1]),this._ensureKnownAddress(n),a=x.default.hashForSignTypedData_v3({data:r}),o=JSON.stringify(r,null,2),e.abrupt("return",this._signEthereumMessage(a,n,!1,o));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_signTypedData_v4",value:function(){var e=a(i().mark((function e(t){var n,r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=(0,w.ensureAddressString)(t[0]),r=(0,w.ensureParsedJSONObject)(t[1]),this._ensureKnownAddress(n),a=x.default.hashForSignTypedData_v4({data:r}),o=JSON.stringify(r,null,2),e.abrupt("return",this._signEthereumMessage(a,n,!1,o));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_cbwallet_arbitrary",value:function(){var e=a(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t[0],"string"===typeof(r=t[1])){e.next=4;break}throw new Error("parameter must be a string");case 4:if("object"===typeof n&&null!==n){e.next=6;break}throw new Error("parameter must be an object");case 6:return e.next=8,this.genericRequest(n,r);case 8:return a=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:a});case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wallet_addEthereumChain",value:function(){var e=a(i().mark((function e(t){var n,r,a,o,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=t[0],0!==(null===(n=s.rpcUrls)||void 0===n?void 0:n.length)){e.next=3;break}return e.abrupt("return",{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}});case 3:if(s.chainName&&""!==s.chainName.trim()){e.next=5;break}throw m.standardErrors.rpc.invalidParams("chainName is a required field");case 5:if(s.nativeCurrency){e.next=7;break}throw m.standardErrors.rpc.invalidParams("nativeCurrency is a required field");case 7:return u=parseInt(s.chainId,16),e.next=10,this.addEthereumChain(u,null!==(r=s.rpcUrls)&&void 0!==r?r:[],null!==(a=s.blockExplorerUrls)&&void 0!==a?a:[],s.chainName,null!==(o=s.iconUrls)&&void 0!==o?o:[],s.nativeCurrency);case 10:if(!e.sent){e.next=15;break}return e.abrupt("return",{jsonrpc:"2.0",id:0,result:null});case 15:return e.abrupt("return",{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}});case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wallet_switchEthereumChain",value:function(){var e=a(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t[0],e.next=3,this.switchEthereumChain(parseInt(n.chainId,16));case 3:return e.abrupt("return",{jsonrpc:"2.0",id:0,result:null});case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wallet_watchAsset",value:function(){var e=a(i().mark((function e(t){var n,r,a,o,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=Array.isArray(t)?t[0]:t).type){e.next=3;break}throw m.standardErrors.rpc.invalidParams("Type is required");case 3:if("ERC20"===(null===n||void 0===n?void 0:n.type)){e.next=5;break}throw m.standardErrors.rpc.invalidParams("Asset of type '".concat(n.type,"' is not supported"));case 5:if(null===n||void 0===n?void 0:n.options){e.next=7;break}throw m.standardErrors.rpc.invalidParams("Options are required");case 7:if(null===n||void 0===n?void 0:n.options.address){e.next=9;break}throw m.standardErrors.rpc.invalidParams("Address is required");case 9:return r=this.getChainId(),a=n.options,o=a.address,s=a.symbol,u=a.image,c=a.decimals,e.next=13,this.watchAsset(n.type,o,s,c,u,r);case 13:return l=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:l});case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_uninstallFilter",value:function(e){var t=(0,w.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(t)}},{key:"_eth_newFilter",value:function(){var e=a(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t[0],e.next=3,this._filterPolyfill.newFilter(n);case 3:return r=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:r});case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_newBlockFilter",value:function(){var e=a(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._filterPolyfill.newBlockFilter();case 2:return t=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:t});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_eth_newPendingTransactionFilter",value:function(){var e=a(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._filterPolyfill.newPendingTransactionFilter();case 2:return t=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:t});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_eth_getFilterChanges",value:function(e){var t=(0,w.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(t)}},{key:"_eth_getFilterLogs",value:function(e){var t=(0,w.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(t)}},{key:"initializeRelay",value:function(){var e=this;return this._relay?Promise.resolve(this._relay):this._relayProvider().then((function(t){return t.setAccountsCallback((function(t,n){return e._setAddresses(t,n)})),t.setChainCallback((function(t,n){e.updateProviderInfo(n,parseInt(t,10))})),t.setDappDefaultChainCallback(e._chainIdFromOpts),e._relay=t,t}))}}]),n}(d.default);t.CoinbaseWalletProvider=S},43122:function(e,t,n){"use strict";var r=n(861).default,i=n(17061).default,a=n(17156).default,o=n(56690).default,s=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.filterFromParam=t.FilterPolyfill=void 0;var u=n(99306),c=n(81107),l={jsonrpc:"2.0",id:0},f=function(){function e(t){o(this,e),this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,u.IntNumber)(1),this.provider=t}return s(e,[{key:"newFilter",value:function(){var e=a(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d(t),r=this.makeFilterId(),e.next=4,this.setInitialCursorPosition(r,n.fromBlock);case 4:return a=e.sent,console.log("Installing new log filter(".concat(r,"):"),n,"initial cursor position:",a),this.logFilters.set(r,n),this.setFilterTimeout(r),e.abrupt("return",(0,c.hexStringFromIntNumber)(r));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"newBlockFilter",value:function(){var e=a(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.makeFilterId(),e.next=3,this.setInitialCursorPosition(t,"latest");case 3:return n=e.sent,console.log("Installing new block filter (".concat(t,") with initial cursor position:"),n),this.blockFilters.add(t),this.setFilterTimeout(t),e.abrupt("return",(0,c.hexStringFromIntNumber)(t));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"newPendingTransactionFilter",value:function(){var e=a(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.makeFilterId(),e.next=3,this.setInitialCursorPosition(t,"latest");case 3:return n=e.sent,console.log("Installing new block filter (".concat(t,") with initial cursor position:"),n),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),e.abrupt("return",(0,c.hexStringFromIntNumber)(t));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"uninstallFilter",value:function(e){var t=(0,c.intNumberFromHexString)(e);return console.log("Uninstalling filter (".concat(t,")")),this.deleteFilter(t),!0}},{key:"getFilterChanges",value:function(e){var t=(0,c.intNumberFromHexString)(e);return this.timeouts.has(t)&&this.setFilterTimeout(t),this.logFilters.has(t)?this.getLogFilterChanges(t):this.blockFilters.has(t)?this.getBlockFilterChanges(t):this.pendingTransactionFilters.has(t)?this.getPendingTransactionFilterChanges(t):Promise.resolve(v())}},{key:"getFilterLogs",value:function(){var e=a(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(0,c.intNumberFromHexString)(t),r=this.logFilters.get(n)){e.next=4;break}return e.abrupt("return",v());case 4:return e.abrupt("return",this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_getLogs",params:[p(r)]})));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"makeFilterId",value:function(){return(0,u.IntNumber)(++this.nextFilterId)}},{key:"sendAsyncPromise",value:function(e){var t=this;return new Promise((function(n,r){t.provider.sendAsync(e,(function(e,t){return e?r(e):Array.isArray(t)||null==t?r(new Error("unexpected response received: ".concat(JSON.stringify(t)))):void n(t)}))}))}},{key:"deleteFilter",value:function(e){console.log("Deleting filter (".concat(e,")")),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}},{key:"getLogFilterChanges",value:function(){var e=a(i().mark((function e(t){var n,a,o,s,f,d,h,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.logFilters.get(t),(a=this.cursors.get(t))&&n){e.next=4;break}return e.abrupt("return",v());case 4:return e.next=6,this.getCurrentBlockHeight();case 6:if(o=e.sent,s="latest"===n.toBlock?o:n.toBlock,!(a>o)){e.next=10;break}return e.abrupt("return",y());case 10:if(!(a>n.toBlock)){e.next=12;break}return e.abrupt("return",y());case 12:return console.log("Fetching logs from ".concat(a," to ").concat(s," for filter ").concat(t)),e.next=15,this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_getLogs",params:[p(Object.assign(Object.assign({},n),{fromBlock:a,toBlock:s}))]}));case 15:return f=e.sent,Array.isArray(f.result)&&(d=f.result.map((function(e){return(0,c.intNumberFromHexString)(e.blockNumber||"0x0")})),(h=Math.max.apply(Math,r(d)))&&h>a&&(m=(0,u.IntNumber)(h+1),console.log("Moving cursor position for filter (".concat(t,") from ").concat(a," to ").concat(m)),this.cursors.set(t,m))),e.abrupt("return",f);case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getBlockFilterChanges",value:function(){var e=a(i().mark((function e(t){var n,r,a,o,s=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.cursors.get(t)){e.next=3;break}return e.abrupt("return",v());case 3:return e.next=5,this.getCurrentBlockHeight();case 5:if(r=e.sent,!(n>r)){e.next=8;break}return e.abrupt("return",y());case 8:return console.log("Fetching blocks from ".concat(n," to ").concat(r," for filter (").concat(t,")")),e.next=11,Promise.all((0,c.range)(n,r+1).map((function(e){return s.getBlockHashByNumber((0,u.IntNumber)(e))})));case 11:return a=e.sent.filter((function(e){return!!e})),o=(0,u.IntNumber)(n+a.length),console.log("Moving cursor position for filter (".concat(t,") from ").concat(n," to ").concat(o)),this.cursors.set(t,o),e.abrupt("return",Object.assign(Object.assign({},l),{result:a}));case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPendingTransactionFilterChanges",value:function(){var e=a(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve(y()));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"setInitialCursorPosition",value:function(){var e=a(i().mark((function e(t,n){var r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCurrentBlockHeight();case 2:return r=e.sent,a="number"===typeof n&&n>r?n:r,this.cursors.set(t,a),e.abrupt("return",a);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setFilterTimeout",value:function(e){var t=this,n=this.timeouts.get(e);n&&window.clearTimeout(n);var r=window.setTimeout((function(){console.log("Filter (".concat(e,") timed out")),t.deleteFilter(e)}),3e5);this.timeouts.set(e,r)}},{key:"getCurrentBlockHeight",value:function(){var e=a(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_blockNumber",params:[]}));case 2:return t=e.sent,n=t.result,e.abrupt("return",(0,c.intNumberFromHexString)((0,c.ensureHexString)(n)));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getBlockHashByNumber",value:function(){var e=a(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_getBlockByNumber",params:[(0,c.hexStringFromIntNumber)(t),!1]}));case 2:if(!(n=e.sent).result||"string"!==typeof n.result.hash){e.next=5;break}return e.abrupt("return",(0,c.ensureHexString)(n.result.hash));case 5:return e.abrupt("return",null);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function d(e){return{fromBlock:h(e.fromBlock),toBlock:h(e.toBlock),addresses:void 0===e.address?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}function p(e){var t={fromBlock:m(e.fromBlock),toBlock:m(e.toBlock),topics:e.topics};return null!==e.addresses&&(t.address=e.addresses),t}function h(e){if(void 0===e||"latest"===e||"pending"===e)return"latest";if("earliest"===e)return(0,u.IntNumber)(0);if((0,c.isHexString)(e))return(0,c.intNumberFromHexString)(e);throw new Error("Invalid block option: ".concat(String(e)))}function m(e){return"latest"===e?e:(0,c.hexStringFromIntNumber)(e)}function v(){return Object.assign(Object.assign({},l),{error:{code:-32e3,message:"filter not found"}})}function y(){return Object.assign(Object.assign({},l),{result:[]})}t.FilterPolyfill=f,t.filterFromParam=d},27566:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))},49023:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,a=n(56690).default,o=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionManager=void 0;var s=n(28371),u=n(68286),c=function(){},l=function(){function e(t){a(this,e);var n=new s.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),r=u({blockTracker:n,provider:t}),i=r.events,o=r.middleware;this.events=i,this.subscriptionMiddleware=o}return o(e,[{key:"handleRequest",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},e.next=3,this.subscriptionMiddleware(t,n,c,c);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"destroy",value:function(){this.subscriptionMiddleware.destroy()}}]),e}();t.SubscriptionManager=l},34405:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKUI=void 0;var a=n(247),o=n(64620),s=n(31665),u=function(){function e(t){r(this,e),this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new o.Snackbar({darkMode:t.darkMode}),this.linkFlow=new a.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,connected$:t.connected$,chainId$:t.chainId$,isParentConnection:!1})}return i(e,[{key:"attach",value:function(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");var e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.linkFlow.attach(t),this.snackbar.attach(t),this.attached=!0,(0,s.injectCssReset)()}},{key:"setConnectDisabled",value:function(e){this.linkFlow.setConnectDisabled(e)}},{key:"addEthereumChain",value:function(e){}},{key:"watchAsset",value:function(e){}},{key:"switchEthereumChain",value:function(e){}},{key:"requestEthereumAccounts",value:function(e){this.linkFlow.open({onCancel:e.onCancel})}},{key:"hideRequestEthereumAccounts",value:function(){this.linkFlow.close()}},{key:"signEthereumMessage",value:function(e){}},{key:"signEthereumTransaction",value:function(e){}},{key:"submitEthereumTransaction",value:function(e){}},{key:"ethereumAddressFromSignedMessage",value:function(e){}},{key:"showConnecting",value:function(e){var t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:{message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}},{key:"setAppSrc",value:function(e){this.appSrc=e}},{key:"reloadUI",value:function(){document.location.reload()}},{key:"inlineAccountsResponse",value:function(){return!1}},{key:"inlineAddEthereumChain",value:function(e){return!1}},{key:"inlineWatchAsset",value:function(){return!1}},{key:"inlineSwitchEthereumChain",value:function(){return!1}},{key:"setStandalone",value:function(e){this.standalone=e}},{key:"isStandalone",value:function(){var e;return null!==(e=this.standalone)&&void 0!==e&&e}}]),e}();t.WalletSDKUI=u},94100:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))},35836:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;var a=n(90590),o=n(81107),s="session:id",u="session:secret",c="session:linked",l=function(){function e(t,n,i,s){r(this,e),this._storage=t,this._id=n||(0,o.randomBytesHex)(16),this._secret=i||(0,o.randomBytesHex)(32),this._key=(new a.sha256).update("".concat(this._id,", ").concat(this._secret," WalletLink")).digest("hex"),this._linked=!!s}return i(e,[{key:"id",get:function(){return this._id}},{key:"secret",get:function(){return this._secret}},{key:"key",get:function(){return this._key}},{key:"linked",get:function(){return this._linked},set:function(e){this._linked=e,this.persistLinked()}},{key:"save",value:function(){return this._storage.setItem(s,this._id),this._storage.setItem(u,this._secret),this.persistLinked(),this}},{key:"persistLinked",value:function(){this._storage.setItem(c,this._linked?"1":"0")}}],[{key:"load",value:function(t){var n=t.getItem(s),r=t.getItem(c),i=t.getItem(u);return n&&i?new e(t,n,i,"1"===r):null}},{key:"hash",value:function(e){return(new a.sha256).update(e).digest("hex")}}]),e}();t.Session=l},47993:function(e,t,n){"use strict";var r=n(27424).default,i=n(56690).default,a=n(89728).default,o=n(61655).default,s=n(26389).default,u=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&u(t,e,n);return c(t,e),t},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelay=void 0;var p=d(n(45590)),h=n(40623),m=n(21807),v=n(56171),y=n(62569),b=n(27312),g=n(99306),w=n(81107),x=f(n(71572)),k=n(35836),A=n(731),E=n(50194),_=n(90429),T=n(14107),S=n(87734),C=n(12202),O=function(e){o(n,e);var t=s(n);function n(e){var r,a;i(this,n),(r=t.call(this)).accountsCallback=null,r.chainCallback=null,r.dappDefaultChainSubject=new h.BehaviorSubject(1),r.dappDefaultChain=1,r.appName="",r.appLogoUrl=null,r.subscriptions=new h.Subscription,r.linkAPIUrl=e.linkAPIUrl,r.storage=e.storage,r.options=e;var o=r.subscribe(),s=o.session,u=o.ui,c=o.connection;if(r._session=s,r.connection=c,r.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");return e.eventListener?r.diagnostic={log:e.eventListener.onEvent}:r.diagnostic=e.diagnosticLogger,r._reloadOnDisconnect=null===(a=e.reloadOnDisconnect)||void 0===a||a,r.ui=u,r}return a(n,[{key:"subscribe",value:function(){var e=this;this.subscriptions.add(this.dappDefaultChainSubject.subscribe((function(t){e.dappDefaultChain!==t&&(e.dappDefaultChain=t)})));var t=k.Session.load(this.storage)||new k.Session(this.storage).save(),i=new y.WalletSDKConnection(t.id,t.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(i.sessionConfig$.subscribe({next:function(t){e.onSessionConfigChanged(t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(v.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(i.incomingEvent$.pipe((0,m.filter)((function(e){return"Web3Response"===e.event}))).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(i.linked$.pipe((0,m.skip)(1),(0,m.tap)((function(t){var n;e.isLinked=t;var r=e.storage.getItem(A.LOCAL_STORAGE_ADDRESSES_KEY);if(t&&(e.session.linked=t),e.isUnlinkedErrorState=!1,r){var i=r.split(" "),a="true"===e.storage.getItem("IsStandaloneSigning");if(""!==i[0]&&!t&&e.session.linked&&!a){e.isUnlinkedErrorState=!0;var o=e.getSessionIdHash();null===(n=e.diagnostic)||void 0===n||n.log(v.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:o})}}}))).subscribe()),this.subscriptions.add(i.sessionConfig$.pipe((0,m.filter)((function(e){return!!e.metadata&&"1"===e.metadata.__destroyed}))).subscribe((function(){var t,n=i.isDestroyed;return null===(t=e.diagnostic)||void 0===t||t.log(v.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:n,sessionIdHash:e.getSessionIdHash()}),e.resetAndReload()}))),this.subscriptions.add(i.sessionConfig$.pipe((0,m.filter)((function(e){return e.metadata&&void 0!==e.metadata.WalletUsername}))).pipe((0,m.mergeMap)((function(e){return x.decrypt(e.metadata.WalletUsername,t.secret)}))).subscribe({next:function(t){e.storage.setItem(A.WALLET_USER_NAME_KEY,t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(v.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,m.filter)((function(e){return e.metadata&&void 0!==e.metadata.AppVersion}))).pipe((0,m.mergeMap)((function(e){return x.decrypt(e.metadata.AppVersion,t.secret)}))).subscribe({next:function(t){e.storage.setItem(A.APP_VERSION_KEY,t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(v.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,m.filter)((function(e){return e.metadata&&void 0!==e.metadata.ChainId&&void 0!==e.metadata.JsonRpcUrl}))).pipe((0,m.mergeMap)((function(e){return(0,h.zip)(x.decrypt(e.metadata.ChainId,t.secret),x.decrypt(e.metadata.JsonRpcUrl,t.secret))}))).pipe((0,m.distinctUntilChanged)()).subscribe({next:function(t){var n=r(t,2),i=n[0],a=n[1];e.chainCallback&&e.chainCallback(i,a)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(v.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,m.filter)((function(e){return e.metadata&&void 0!==e.metadata.EthereumAddress}))).pipe((0,m.mergeMap)((function(e){return x.decrypt(e.metadata.EthereumAddress,t.secret)}))).subscribe({next:function(t){e.accountsCallback&&e.accountsCallback([t]),n.accountRequestCallbackIds.size>0&&(Array.from(n.accountRequestCallbackIds.values()).forEach((function(n){var r=(0,C.Web3ResponseMessage)({id:n,response:(0,S.RequestEthereumAccountsResponse)([t])});e.invokeCallback(Object.assign(Object.assign({},r),{id:n}))})),n.accountRequestCallbackIds.clear())},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(v.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,m.filter)((function(e){return e.metadata&&void 0!==e.metadata.AppSrc}))).pipe((0,m.mergeMap)((function(e){return x.decrypt(e.metadata.AppSrc,t.secret)}))).subscribe({next:function(t){e.ui.setAppSrc(t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(v.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));var a=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:t,connected$:i.connected$,chainId$:this.dappDefaultChainSubject});return i.connect(),{session:t,ui:a,connection:i}}},{key:"attachUI",value:function(){this.ui.attach()}},{key:"resetAndReload",value:function(){var e=this;this.connection.setSessionMetadata("__destroyed","1").pipe((0,m.timeout)(1e3),(0,m.catchError)((function(e){return(0,h.of)(null)}))).subscribe((function(t){var n,r,i,a=e.ui.isStandalone();try{e.subscriptions.unsubscribe()}catch(f){null===(n=e.diagnostic)||void 0===n||n.log(v.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}null===(r=e.diagnostic)||void 0===r||r.log(v.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:e.getSessionIdHash()}),e.connection.destroy();var o=k.Session.load(e.storage);if((null===o||void 0===o?void 0:o.id)===e._session.id?e.storage.clear():o&&(null===(i=e.diagnostic)||void 0===i||i.log(v.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:e.getSessionIdHash(),storedSessionIdHash:k.Session.hash(o.id)})),e._reloadOnDisconnect)e.ui.reloadUI();else{e.accountsCallback&&e.accountsCallback([],!0),e.subscriptions=new h.Subscription;var s=e.subscribe(),u=s.session,c=s.ui,l=s.connection;e._session=u,e.connection=l,e.ui=c,a&&e.ui.setStandalone&&e.ui.setStandalone(!0),e.attachUI()}}),(function(t){var n;null===(n=e.diagnostic)||void 0===n||n.log(v.EVENTS.FAILURE,{method:"relay::resetAndReload",message:"failed to reset and reload with ".concat(t),sessionIdHash:e.getSessionIdHash()})}))}},{key:"setAppInfo",value:function(e,t){this.appName=e,this.appLogoUrl=t}},{key:"getStorageItem",value:function(e){return this.storage.getItem(e)}},{key:"session",get:function(){return this._session}},{key:"setStorageItem",value:function(e,t){this.storage.setItem(e,t)}},{key:"signEthereumMessage",value:function(e,t,n,r){return this.sendRequest({method:E.Web3Method.signEthereumMessage,params:{message:(0,w.hexStringFromBuffer)(e,!0),address:t,addPrefix:n,typedDataJson:r||null}})}},{key:"ethereumAddressFromSignedMessage",value:function(e,t,n){return this.sendRequest({method:E.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,w.hexStringFromBuffer)(e,!0),signature:(0,w.hexStringFromBuffer)(t,!0),addPrefix:n}})}},{key:"signEthereumTransaction",value:function(e){return this.sendRequest({method:E.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,w.bigIntStringFromBN)(e.weiValue),data:(0,w.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,w.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}},{key:"signAndSubmitEthereumTransaction",value:function(e){return this.sendRequest({method:E.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,w.bigIntStringFromBN)(e.weiValue),data:(0,w.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,w.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,w.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,w.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}},{key:"submitEthereumTransaction",value:function(e,t){return this.sendRequest({method:E.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,w.hexStringFromBuffer)(e,!0),chainId:t}})}},{key:"scanQRCode",value:function(e){return this.sendRequest({method:E.Web3Method.scanQRCode,params:{regExp:e}})}},{key:"getQRCodeUrl",value:function(){return(0,w.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}},{key:"genericRequest",value:function(e,t){return this.sendRequest({method:E.Web3Method.generic,params:{action:t,data:e}})}},{key:"sendGenericMessage",value:function(e){return this.sendRequest(e)}},{key:"sendRequest",value:function(e){var t=this,n=null,r=(0,w.randomBytesHex)(8),i=function(i){t.publishWeb3RequestCanceledEvent(r),t.handleErrorResponse(r,e.method,i),null===n||void 0===n||n()};return{promise:new Promise((function(a,o){t.ui.isStandalone()||(n=t.ui.showConnecting({isUnlinkedErrorState:t.isUnlinkedErrorState,onCancel:i,onResetConnection:t.resetAndReload})),t.relayEventManager.callbacks.set(r,(function(e){if(null===n||void 0===n||n(),e.errorMessage)return o(new Error(e.errorMessage));a(e)})),t.ui.isStandalone()?t.sendRequestStandalone(r,e):t.publishWeb3RequestEvent(r,e)})),cancel:i}}},{key:"setConnectDisabled",value:function(e){this.ui.setConnectDisabled(e)}},{key:"setAccountsCallback",value:function(e){this.accountsCallback=e}},{key:"setChainCallback",value:function(e){this.chainCallback=e}},{key:"setDappDefaultChainCallback",value:function(e){this.dappDefaultChainSubject.next(e)}},{key:"publishWeb3RequestEvent",value:function(e,t){var n,r=this,i=(0,T.Web3RequestMessage)({id:e,request:t}),a=k.Session.load(this.storage);null===(n=this.diagnostic)||void 0===n||n.log(v.EVENTS.WEB3_REQUEST,{eventId:i.id,method:"relay::".concat(i.request.method),sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:a?k.Session.hash(a.id):"",isSessionMismatched:((null===a||void 0===a?void 0:a.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:function(e){var t;null===(t=r.diagnostic)||void 0===t||t.log(v.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:"relay::".concat(i.request.method),sessionIdHash:r.getSessionIdHash(),storedSessionIdHash:a?k.Session.hash(a.id):"",isSessionMismatched:((null===a||void 0===a?void 0:a.id)!==r._session.id).toString()})},error:function(e){r.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:e.message}}))}}))}},{key:"publishWeb3RequestCanceledEvent",value:function(e){var t=(0,_.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",t,!1).subscribe())}},{key:"publishEvent",value:function(e,t,n){var r=this,i=this.session.secret;return new h.Observable((function(e){x.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin})),i).then((function(t){e.next(t),e.complete()}))})).pipe((0,m.mergeMap)((function(t){return r.connection.publishEvent(e,t,n)})))}},{key:"handleIncomingEvent",value:function(e){var t=this;try{this.subscriptions.add((0,h.from)(x.decrypt(e.data,this.session.secret)).pipe((0,m.map)((function(e){return JSON.parse(e)}))).subscribe({next:function(e){var n=(0,C.isWeb3ResponseMessage)(e)?e:null;n&&t.handleWeb3ResponseMessage(n)},error:function(){var e;null===(e=t.diagnostic)||void 0===e||e.log(v.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch(n){return}}},{key:"handleWeb3ResponseMessage",value:function(e){var t,r=this,i=e.response;if(null===(t=this.diagnostic)||void 0===t||t.log(v.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:"relay::".concat(i.method),sessionIdHash:this.getSessionIdHash()}),(0,S.isRequestEthereumAccountsResponse)(i))return n.accountRequestCallbackIds.forEach((function(t){return r.invokeCallback(Object.assign(Object.assign({},e),{id:t}))})),void n.accountRequestCallbackIds.clear();this.invokeCallback(e)}},{key:"handleErrorResponse",value:function(e,t,n,r){var i,a=null!==(i=null===n||void 0===n?void 0:n.message)&&void 0!==i?i:(0,b.standardErrorMessage)(r);this.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:e,response:{method:t,errorMessage:a,errorCode:r}}))}},{key:"invokeCallback",value:function(e){var t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}},{key:"requestEthereumAccounts",value:function(){var e=this,t={method:E.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,w.randomBytesHex)(8),i=function(n){e.publishWeb3RequestCanceledEvent(r),e.handleErrorResponse(r,t.method,n)};return{promise:new Promise((function(a,o){var s;e.relayEventManager.callbacks.set(r,(function(t){if(e.ui.hideRequestEthereumAccounts(),t.errorMessage)return o(new Error(t.errorMessage));a(t)}));var u=(null===(s=null===window||void 0===window?void 0:window.navigator)||void 0===s?void 0:s.userAgent)||null;if(u&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(u)){var c;try{c=(0,w.isInIFrame)()&&window.top?window.top.location:window.location}catch(f){c=window.location}c.href="https://www.coinbase.com/connect-dapp?uri=".concat(encodeURIComponent(c.href))}else{if(e.ui.inlineAccountsResponse()){e.ui.requestEthereumAccounts({onCancel:i,onAccounts:function(t){e.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:r,response:(0,S.RequestEthereumAccountsResponse)(t)}))}})}else{var l=b.standardErrors.provider.userRejectedRequest("User denied account authorization");e.ui.requestEthereumAccounts({onCancel:function(){return i(l)}})}n.accountRequestCallbackIds.add(r),e.ui.inlineAccountsResponse()||e.ui.isStandalone()||e.publishWeb3RequestEvent(r,t)}})),cancel:i}}},{key:"selectProvider",value:function(e){var t=this,n={method:E.Web3Method.selectProvider,params:{providerOptions:e}},r=(0,w.randomBytesHex)(8);return{cancel:function(e){t.publishWeb3RequestCanceledEvent(r),t.handleErrorResponse(r,n.method,e)},promise:new Promise((function(n,i){t.relayEventManager.callbacks.set(r,(function(e){if(e.errorMessage)return i(new Error(e.errorMessage));n(e)}));t.ui.selectProvider&&t.ui.selectProvider({onApprove:function(e){t.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:r,response:(0,S.SelectProviderResponse)(e)}))},onCancel:function(e){t.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:r,response:(0,S.SelectProviderResponse)(g.ProviderType.Unselected)}))},providerOptions:e})}))}}},{key:"watchAsset",value:function(e,t,n,r,i,a){var o=this,s={method:E.Web3Method.watchAsset,params:{type:e,options:{address:t,symbol:n,decimals:r,image:i},chainId:a}},u=null,c=(0,w.randomBytesHex)(8),l=function(e){o.publishWeb3RequestCanceledEvent(c),o.handleErrorResponse(c,s.method,e),null===u||void 0===u||u()};return this.ui.inlineWatchAsset()||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{cancel:l,promise:new Promise((function(l,f){o.relayEventManager.callbacks.set(c,(function(e){if(null===u||void 0===u||u(),e.errorMessage)return f(new Error(e.errorMessage));l(e)}));o.ui.inlineWatchAsset()&&o.ui.watchAsset({onApprove:function(){o.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:c,response:(0,S.WatchAssetReponse)(!0)}))},onCancel:function(e){o.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:c,response:(0,S.WatchAssetReponse)(!1)}))},type:e,address:t,symbol:n,decimals:r,image:i,chainId:a}),o.ui.inlineWatchAsset()||o.ui.isStandalone()||o.publishWeb3RequestEvent(c,s)}))}}},{key:"addEthereumChain",value:function(e,t,n,r,i,a){var o=this,s={method:E.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:t,blockExplorerUrls:r,chainName:i,iconUrls:n,nativeCurrency:a}},u=null,c=(0,w.randomBytesHex)(8),l=function(e){o.publishWeb3RequestCanceledEvent(c),o.handleErrorResponse(c,s.method,e),null===u||void 0===u||u()};return this.ui.inlineAddEthereumChain(e)||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{promise:new Promise((function(t,n){o.relayEventManager.callbacks.set(c,(function(e){if(null===u||void 0===u||u(),e.errorMessage)return n(new Error(e.errorMessage));t(e)}));o.ui.inlineAddEthereumChain(e)&&o.ui.addEthereumChain({onCancel:function(e){o.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:c,response:(0,S.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:function(e){o.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:c,response:(0,S.AddEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))},chainId:s.params.chainId,rpcUrls:s.params.rpcUrls,blockExplorerUrls:s.params.blockExplorerUrls,chainName:s.params.chainName,iconUrls:s.params.iconUrls,nativeCurrency:s.params.nativeCurrency}),o.ui.inlineAddEthereumChain(e)||o.ui.isStandalone()||o.publishWeb3RequestEvent(c,s)})),cancel:l}}},{key:"switchEthereumChain",value:function(e,t){var n=this,r={method:E.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:t})},i=(0,w.randomBytesHex)(8);return{promise:new Promise((function(t,a){n.relayEventManager.callbacks.set(i,(function(e){return(0,S.isErrorResponse)(e)&&e.errorCode?a(b.standardErrors.provider.custom({code:e.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):e.errorMessage?a(new Error(e.errorMessage)):void t(e)}));n.ui.switchEthereumChain({onCancel:function(t){var r;if(t){var a=null!==(r=(0,b.getErrorCode)(t))&&void 0!==r?r:b.standardErrorCodes.provider.unsupportedChain;n.handleErrorResponse(i,E.Web3Method.switchEthereumChain,t instanceof Error?t:b.standardErrors.provider.unsupportedChain(e),a)}else n.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:i,response:(0,S.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:function(e){n.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:i,response:(0,S.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))},chainId:r.params.chainId,address:r.params.address}),n.ui.inlineSwitchEthereumChain()||n.ui.isStandalone()||n.publishWeb3RequestEvent(i,r)})),cancel:function(e){n.publishWeb3RequestCanceledEvent(i),n.handleErrorResponse(i,r.method,e)}}}},{key:"inlineAddEthereumChain",value:function(e){return this.ui.inlineAddEthereumChain(e)}},{key:"getSessionIdHash",value:function(){return k.Session.hash(this._session.id)}},{key:"sendRequestStandalone",value:function(e,t){var n=this,r=function(r){n.handleErrorResponse(e,t.method,r)},i=function(t){n.handleWeb3ResponseMessage((0,C.Web3ResponseMessage)({id:e,response:t}))};switch(t.method){case E.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:t,onSuccess:i,onCancel:r});break;case E.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:t,onSuccess:i,onCancel:r});break;case E.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:t,onSuccess:i,onCancel:r});break;case E.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:t,onSuccess:i});break;default:r()}}},{key:"onSessionConfigChanged",value:function(e){}}]),n}(A.WalletSDKRelayAbstract);O.accountRequestCallbackIds=new Set,l([p.default],O.prototype,"resetAndReload",null),l([p.default],O.prototype,"handleIncomingEvent",null),t.WalletSDKRelay=O},731:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,a=n(56690).default,o=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelayAbstract=t.APP_VERSION_KEY=t.LOCAL_STORAGE_ADDRESSES_KEY=t.WALLET_USER_NAME_KEY=void 0;var s=n(27312);t.WALLET_USER_NAME_KEY="walletUsername",t.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",t.APP_VERSION_KEY="AppVersion";var u=function(){function e(){a(this,e)}return o(e,[{key:"makeEthereumJSONRPCRequest",value:function(){var e=i(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Error: No jsonRpcUrl provided");case 2:return e.abrupt("return",window.fetch(n,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then((function(e){return e.json()})).then((function(e){if(!e)throw s.standardErrors.rpc.parse({});var n=e,r=n.error;if(r)throw(0,s.serializeError)(r,t.method);return n})));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),e}();t.WalletSDKRelayAbstract=u},16642:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelayEventManager=void 0;var a=n(81107),o=function(){function e(){r(this,e),this._nextRequestId=0,this.callbacks=new Map}return i(e,[{key:"makeRequestId",value:function(){this._nextRequestId=(this._nextRequestId+1)%2147483647;var e=this._nextRequestId,t=(0,a.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}]),e}();t.WalletSDKRelayEventManager=o},50194:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))},90429:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Web3RequestCanceledMessage=void 0;var r=n(94100);t.Web3RequestCanceledMessage=function(e){return{type:r.RelayMessageType.WEB3_REQUEST_CANCELED,id:e}}},14107:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Web3RequestMessage=void 0;var r=n(94100);t.Web3RequestMessage=function(e){return Object.assign({type:r.RelayMessageType.WEB3_REQUEST},e)}},87734:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumAddressFromSignedMessageResponse=t.SubmitEthereumTransactionResponse=t.SignEthereumTransactionResponse=t.SignEthereumMessageResponse=t.isRequestEthereumAccountsResponse=t.SelectProviderResponse=t.WatchAssetReponse=t.RequestEthereumAccountsResponse=t.SwitchEthereumChainResponse=t.AddEthereumChainResponse=t.isErrorResponse=void 0;var r=n(50194);t.isErrorResponse=function(e){var t,n;return void 0!==(null===(t=e)||void 0===t?void 0:t.method)&&void 0!==(null===(n=e)||void 0===n?void 0:n.errorMessage)},t.AddEthereumChainResponse=function(e){return{method:r.Web3Method.addEthereumChain,result:e}},t.SwitchEthereumChainResponse=function(e){return{method:r.Web3Method.switchEthereumChain,result:e}},t.RequestEthereumAccountsResponse=function(e){return{method:r.Web3Method.requestEthereumAccounts,result:e}},t.WatchAssetReponse=function(e){return{method:r.Web3Method.watchAsset,result:e}},t.SelectProviderResponse=function(e){return{method:r.Web3Method.selectProvider,result:e}},t.isRequestEthereumAccountsResponse=function(e){return e&&e.method===r.Web3Method.requestEthereumAccounts},t.SignEthereumMessageResponse=function(e){return{method:r.Web3Method.signEthereumMessage,result:e}},t.SignEthereumTransactionResponse=function(e){return{method:r.Web3Method.signEthereumTransaction,result:e}},t.SubmitEthereumTransactionResponse=function(e){return{method:r.Web3Method.submitEthereumTransaction,result:e}},t.EthereumAddressFromSignedMessageResponse=function(e){return{method:r.Web3Method.ethereumAddressFromSignedMessage,result:e}}},12202:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWeb3ResponseMessage=t.Web3ResponseMessage=void 0;var r=n(94100);t.Web3ResponseMessage=function(e){return Object.assign({type:r.RelayMessageType.WEB3_RESPONSE},e)},t.isWeb3ResponseMessage=function(e){return e&&e.type===r.RelayMessageType.WEB3_RESPONSE}},71572:function(e,t,n){"use strict";var r=n(17061).default,i=n(861).default,a=n(17156).default;Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;var o=n(81107);function s(){return(s=a(r().mark((function e(t,n){var a,s,u,c,l,f,d,p,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(64===n.length){e.next=2;break}throw Error("secret must be 256 bits");case 2:return a=crypto.getRandomValues(new Uint8Array(12)),e.next=5,crypto.subtle.importKey("raw",(0,o.hexStringToUint8Array)(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]);case 5:return s=e.sent,u=new TextEncoder,e.next=9,window.crypto.subtle.encrypt({name:"AES-GCM",iv:a},s,u.encode(t));case 9:return c=e.sent,16,l=c.slice(c.byteLength-16),f=c.slice(0,c.byteLength-16),d=new Uint8Array(l),p=new Uint8Array(f),h=new Uint8Array([].concat(i(a),i(d),i(p))),e.abrupt("return",(0,o.uint8ArrayToHex)(h));case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.encrypt=function(e,t){return s.apply(this,arguments)},t.decrypt=function(e,t){if(64!==t.length)throw Error("secret must be 256 bits");return new Promise((function(n,s){a(r().mark((function a(){var u,c,l,f,d,p,h,m,v;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,crypto.subtle.importKey("raw",(0,o.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]);case 2:return u=r.sent,c=(0,o.hexStringToUint8Array)(e),l=c.slice(0,12),f=c.slice(12,28),d=c.slice(28),p=new Uint8Array([].concat(i(d),i(f))),h={name:"AES-GCM",iv:new Uint8Array(l)},r.prev=9,r.next=12,window.crypto.subtle.decrypt(h,u,p);case 12:m=r.sent,v=new TextDecoder,n(v.decode(m)),r.next=20;break;case 17:r.prev=17,r.t0=r.catch(9),s(r.t0);case 20:case"end":return r.stop()}}),a,null,[[9,17]])})))()}))}},99306:function(e,t){"use strict";function n(){return function(e){return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0,t.OpaqueType=n,t.HexString=function(e){return e},t.AddressString=function(e){return e},t.BigIntString=function(e){return e},t.IntNumber=function(e){return Math.floor(e)},t.RegExpString=function(e){return e},function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""}(t.ProviderType||(t.ProviderType={}))},81107:function(e,t,n){"use strict";var r=n(38416).default,i=n(861).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isInIFrame=t.createQrUrl=t.getFavicon=t.range=t.isBigNumber=t.ensureParsedJSONObject=t.ensureBN=t.ensureRegExpString=t.ensureIntNumber=t.ensureBuffer=t.ensureAddressString=t.ensureEvenLengthHexString=t.ensureHexString=t.isHexString=t.prepend0x=t.strip0x=t.has0xPrefix=t.hexStringFromIntNumber=t.intNumberFromHexString=t.bigIntStringFromBN=t.hexStringFromBuffer=t.hexStringToUint8Array=t.uint8ArrayToHex=t.randomBytesHex=void 0;var o=a(n(7465)),s=n(74776),u=n(27312),c=n(99306),l=/^[0-9]*$/,f=/^[a-f0-9]*$/;function d(e){return i(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}function p(e){return e.startsWith("0x")||e.startsWith("0X")}function h(e){return p(e)?e.slice(2):e}function m(e){return p(e)?"0x"+e.slice(2):"0x"+e}function v(e){if("string"!==typeof e)return!1;var t=h(e).toLowerCase();return f.test(t)}function y(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"===typeof e){var n=h(e).toLowerCase();if(f.test(n))return(0,c.HexString)(t?"0x"+n:n)}throw u.standardErrors.rpc.invalidParams('"'.concat(String(e),'" is not a hexadecimal string'))}function b(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=y(e,!1);return n.length%2===1&&(n=(0,c.HexString)("0"+n)),t?(0,c.HexString)("0x"+n):n}function g(e){if("number"===typeof e&&Number.isInteger(e))return(0,c.IntNumber)(e);if("string"===typeof e){if(l.test(e))return(0,c.IntNumber)(Number(e));if(v(e))return(0,c.IntNumber)(new o.default(b(e,!1),16).toNumber())}throw u.standardErrors.rpc.invalidParams("Not an integer: ".concat(String(e)))}function w(e){if(null==e||"function"!==typeof e.constructor)return!1;var t=e.constructor;return"function"===typeof t.config&&"number"===typeof t.EUCLID}t.randomBytesHex=function(e){return d(crypto.getRandomValues(new Uint8Array(e)))},t.uint8ArrayToHex=d,t.hexStringToUint8Array=function(e){return new Uint8Array(e.match(/.{1,2}/g).map((function(e){return parseInt(e,16)})))},t.hexStringFromBuffer=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.toString("hex");return(0,c.HexString)(t?"0x"+n:n)},t.bigIntStringFromBN=function(e){return(0,c.BigIntString)(e.toString(10))},t.intNumberFromHexString=function(e){return(0,c.IntNumber)(new o.default(b(e,!1),16).toNumber())},t.hexStringFromIntNumber=function(e){return(0,c.HexString)("0x"+new o.default(e).toString(16))},t.has0xPrefix=p,t.strip0x=h,t.prepend0x=m,t.isHexString=v,t.ensureHexString=y,t.ensureEvenLengthHexString=b,t.ensureAddressString=function(e){if("string"===typeof e){var t=h(e).toLowerCase();if(v(t)&&40===t.length)return(0,c.AddressString)(m(t))}throw u.standardErrors.rpc.invalidParams("Invalid Ethereum address: ".concat(String(e)))},t.ensureBuffer=function(e){if(Buffer.isBuffer(e))return e;if("string"===typeof e){if(v(e)){var t=b(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw u.standardErrors.rpc.invalidParams("Not binary data: ".concat(String(e)))},t.ensureIntNumber=g,t.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,c.RegExpString)(e.toString());throw u.standardErrors.rpc.invalidParams("Not a RegExp: ".concat(String(e)))},t.ensureBN=function(e){if(null!==e&&(o.default.isBN(e)||w(e)))return new o.default(e.toString(10),10);if("number"===typeof e)return new o.default(g(e));if("string"===typeof e){if(l.test(e))return new o.default(e,10);if(v(e))return new o.default(b(e,!1),16)}throw u.standardErrors.rpc.invalidParams("Not an integer: ".concat(String(e)))},t.ensureParsedJSONObject=function(e){if("string"===typeof e)return JSON.parse(e);if("object"===typeof e)return e;throw u.standardErrors.rpc.invalidParams("Not a JSON string or an object: ".concat(String(e)))},t.isBigNumber=w,t.range=function(e,t){return Array.from({length:t-e},(function(t,n){return e+n}))},t.getFavicon=function(){var e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),t=document.location,n=t.protocol,r=t.host,i=e?e.getAttribute("href"):null;return!i||i.startsWith("javascript:")?null:i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")?i:i.startsWith("//")?n+i:"".concat(n,"//").concat(r).concat(i)},t.createQrUrl=function(e,t,n,i,a,o){var u,c=i?"parent-id":"id",l=(0,s.stringify)((r(u={},c,e),r(u,"secret",t),r(u,"server",n),r(u,"v",a),r(u,"chainId",o),u));return"".concat(n,"/#/link?").concat(l)},t.isInIFrame=function(){try{return null!==window.frameElement}catch(e){return!1}}},65396:function(e,t,n){var r=n(55313),i=n(7465);function a(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}function o(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function s(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function u(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function c(e){var t=typeof e;if("string"===t)return r.isHexString(e)?new i(r.stripHexPrefix(e),16):new i(e,10);if("number"===t)return new i(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function l(e,t){var n,a,f,d;if("address"===e)return l("uint160",c(t));if("bool"===e)return l("uint8",t?1:0);if("string"===e)return l("bytes",new Buffer(t,"utf8"));if(function(e){return e.lastIndexOf("]")===e.length-1}(e)){if("undefined"===typeof t.length)throw new Error("Not an array?");if("dynamic"!==(n=u(e))&&0!==n&&t.length>n)throw new Error("Elements exceed array size: "+n);for(d in f=[],e=e.slice(0,e.lastIndexOf("[")),"string"===typeof t&&(t=JSON.parse(t)),t)f.push(l(e,t[d]));if("dynamic"===n){var p=l("uint256",t.length);f.unshift(p)}return Buffer.concat(f)}if("bytes"===e)return t=new Buffer(t),f=Buffer.concat([l("uint256",t.length),t]),t.length%32!==0&&(f=Buffer.concat([f,r.zeros(32-t.length%32)])),f;if(e.startsWith("bytes")){if((n=o(e))<1||n>32)throw new Error("Invalid bytes width: "+n);return r.setLengthRight(t,32)}if(e.startsWith("uint")){if((n=o(e))%8||n<8||n>256)throw new Error("Invalid uint width: "+n);if((a=c(t)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+a.bitLength());if(a<0)throw new Error("Supplied uint is negative");return a.toArrayLike(Buffer,"be",32)}if(e.startsWith("int")){if((n=o(e))%8||n<8||n>256)throw new Error("Invalid int width: "+n);if((a=c(t)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+a.bitLength());return a.toTwos(256).toArrayLike(Buffer,"be",32)}if(e.startsWith("ufixed")){if(n=s(e),(a=c(t))<0)throw new Error("Supplied ufixed is negative");return l("uint256",a.mul(new i(2).pow(new i(n[1]))))}if(e.startsWith("fixed"))return n=s(e),l("int256",c(t).mul(new i(2).pow(new i(n[1]))));throw new Error("Unsupported or invalid type: "+e)}function f(e){return"string"===e||"bytes"===e||"dynamic"===u(e)}function d(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var n,i,s=[],u=0;u32)throw new Error("Invalid bytes width: "+n);s.push(r.setLengthRight(f,n))}else if(l.startsWith("uint")){if((n=o(l))%8||n<8||n>256)throw new Error("Invalid uint width: "+n);if((i=c(f)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());s.push(i.toArrayLike(Buffer,"be",n/8))}else{if(!l.startsWith("int"))throw new Error("Unsupported or invalid type: "+l);if((n=o(l))%8||n<8||n>256)throw new Error("Invalid int width: "+n);if((i=c(f)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());s.push(i.toTwos(n).toArrayLike(Buffer,"be",n/8))}}return Buffer.concat(s)}e.exports={rawEncode:function(e,t){var n=[],r=[],i=32*e.length;for(var o in e){var s=a(e[o]),u=l(s,t[o]);f(s)?(n.push(l("uint256",i)),r.push(u),i+=u.length):n.push(u)}return Buffer.concat(n.concat(r))},solidityPack:d,soliditySHA3:function(e,t){return r.keccak(d(e,t))}}},36810:function(e,t,n){var r=n(74704).default,i=n(27424).default,a=n(55313),o=n(65396),s={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},u={encodeData:function(e,t,n){var s=this,u=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],c=["bytes32"],l=[this.hashType(e,n)];if(u){var f,d=function e(t,r,c){if(void 0!==n[r])return["bytes32",null==c?"0x0000000000000000000000000000000000000000000000000000000000000000":a.keccak(s.encodeData(r,c,n,u))];if(void 0===c)throw new Error("missing value for field ".concat(t," of type ").concat(r));if("bytes"===r)return["bytes32",a.keccak(c)];if("string"===r)return"string"===typeof c&&(c=Buffer.from(c,"utf8")),["bytes32",a.keccak(c)];if(r.lastIndexOf("]")===r.length-1){var l=r.slice(0,r.lastIndexOf("[")),f=c.map((function(n){return e(t,l,n)}));return["bytes32",a.keccak(o.rawEncode(f.map((function(e){return i(e,1)[0]})),f.map((function(e){return i(e,2)[1]}))))]}return[r,c]},p=r(n[e]);try{for(p.s();!(f=p.n()).done;){var h=f.value,m=d(h.name,h.type,t[h.name]),v=i(m,2),y=v[0],b=v[1];c.push(y),l.push(b)}}catch(A){p.e(A)}finally{p.f()}}else{var g,w=r(n[e]);try{for(w.s();!(g=w.n()).done;){var x=g.value,k=t[x.name];if(void 0!==k)if("bytes"===x.type)c.push("bytes32"),k=a.keccak(k),l.push(k);else if("string"===x.type)c.push("bytes32"),"string"===typeof k&&(k=Buffer.from(k,"utf8")),k=a.keccak(k),l.push(k);else if(void 0!==n[x.type])c.push("bytes32"),k=a.keccak(this.encodeData(x.type,k,n,u)),l.push(k);else{if(x.type.lastIndexOf("]")===x.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");c.push(x.type),l.push(k)}}}catch(A){w.e(A)}finally{w.f()}}return o.rawEncode(c,l)},encodeType:function(e,t){var n="",i=this.findTypeDependencies(e,t).filter((function(t){return t!==e}));i=[e].concat(i.sort());var a,o=r(i);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(!t[s])throw new Error("No type definition specified: "+s);n+=s+"("+t[s].map((function(e){var t=e.name;return e.type+" "+t})).join(",")+")"}}catch(u){o.e(u)}finally{o.f()}return n},findTypeDependencies:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e=e.match(/^\w*/)[0],n.includes(e)||void 0===t[e])return n;n.push(e);var i,a=r(t[e]);try{for(a.s();!(i=a.n()).done;){var o,s=i.value,u=r(this.findTypeDependencies(s.type,t,n));try{for(u.s();!(o=u.n()).done;){var c=o.value;!n.includes(c)&&n.push(c)}}catch(l){u.e(l)}finally{u.f()}}}catch(l){a.e(l)}finally{a.f()}return n},hashStruct:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return a.keccak(this.encodeData(e,t,n,r))},hashType:function(e,t){return a.keccak(this.encodeType(e,t))},sanitizeData:function(e){var t={};for(var n in s.properties)e[n]&&(t[n]=e[n]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.sanitizeData(e),r=[Buffer.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,t)),"EIP712Domain"!==n.primaryType&&r.push(this.hashStruct(n.primaryType,n.message,n.types,t)),a.keccak(Buffer.concat(r))}};e.exports={TYPED_MESSAGE_SCHEMA:s,TypedDataUtils:u,hashForSignTypedDataLegacy:function(e){return function(e){var t=new Error("Expect argument to be non-empty array");if("object"!==typeof e||!e.length)throw t;var n=e.map((function(e){return"bytes"===e.type?a.toBuffer(e.value):e.value})),r=e.map((function(e){return e.type})),i=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return o.soliditySHA3(["bytes32","bytes32"],[o.soliditySHA3(new Array(e.length).fill("string"),i),o.soliditySHA3(r,n)])}(e.data)},hashForSignTypedData_v3:function(e){return u.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return u.hash(e.data)}}},55313:function(e,t,n){var r=n(98094),i=n(7465);function a(e){return Buffer.allocUnsafe(e).fill(0)}function o(e,t,n){var r=a(t);return e=s(e),n?e.length65536?(i[0]=240|(1835008&a)>>>18,i[1]=128|(258048&a)>>>12,i[2]=128|(4032&a)>>>6,i[3]=128|63&a):a>2048?(i[0]=224|(61440&a)>>>12,i[1]=128|(4032&a)>>>6,i[2]=128|63&a):a>128?(i[0]=192|(1984&a)>>>6,i[1]=128|63&a):i[0]=a,this.parsedData.push(i)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function n(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}t.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,n=this.parsedData.length;t=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(this.modules[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=v.getLostPoint(this);(0==n||e>r)&&(e=r,t=n)}return t},createMovieClip:function(e,t,n){var r=e.createEmptyMovieClip(t,n);this.make();for(var i=0;i>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++){r=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=v.getBCHTypeInfo(n),i=0;i<15;i++){var a=!e&&1==(r>>i&1);i<6?this.modules[i][8]=a:i<8?this.modules[i+1][8]=a:this.modules[this.moduleCount-15+i][8]=a}for(i=0;i<15;i++){a=!e&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=a:i<9?this.modules[8][15-i-1+1]=a:this.modules[8][15-i-1]=a}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,r=this.moduleCount-1,i=7,a=0,o=this.moduleCount-1;o>0;o-=2)for(6==o&&o--;;){for(var s=0;s<2;s++)if(null==this.modules[r][o-s]){var u=!1;a>>i&1)),v.getMask(t,r,o-s)&&(u=!u),this.modules[r][o-s]=u,-1==--i&&(a++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(e,t,r){for(var i=w.getRSBlocks(e,t),a=new x,o=0;o8*u)throw new Error("code length overflow. ("+a.getLengthInBits()+">"+8*u+")");for(a.getLengthInBits()+4<=8*u&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(!1);for(;!(a.getLengthInBits()>=8*u)&&(a.put(n.PAD0,8),!(a.getLengthInBits()>=8*u));)a.put(n.PAD1,8);return n.createBytes(a,i)},n.createBytes=function(e,t){for(var n=0,r=0,i=0,a=new Array(t.length),o=new Array(t.length),s=0;s=0?d.get(p):0}}var h=0;for(l=0;l=0;)t^=v.G15<=0;)t^=v.G18<>>=1;return t},getPatternPosition:function(e){return v.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case u:return(t+n)%2==0;case c:return t%2==0;case l:return n%3==0;case f:return(t+n)%3==0;case d:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case p:return t*n%2+t*n%3==0;case h:return(t*n%2+t*n%3)%2==0;case m:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new g([1],0),n=0;n5&&(n+=3+a-5)}for(r=0;r=256;)e-=255;return y.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},b=0;b<8;b++)y.EXP_TABLE[b]=1<>>7-e%8&1)},put:function(e,t){for(var n=0;n>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var k=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function A(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},"string"===typeof e&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if("string"!==typeof this.options.content)throw new Error("Expected 'content' as string!");if(0===this.options.content.length)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");var r=this.options.content,u=function(e,t){for(var n=function(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}(e),r=1,i=0,a=0,o=k.length;a<=o;a++){var s=k[a];if(!s)throw new Error("Content too long: expected "+i+" but got "+n);switch(t){case"L":i=s[0];break;case"M":i=s[1];break;case"Q":i=s[2];break;case"H":i=s[3];break;default:throw new Error("Unknwon error correction level: "+t)}if(n<=i)break;r++}if(r>k.length)throw new Error("Content too long");return r}(r,this.options.ecl),c=function(e){switch(e){case"L":return i;case"M":return a;case"Q":return o;case"H":return s;default:throw new Error("Unknwon error correction level: "+e)}}(this.options.ecl);this.qrcode=new n(u,c),this.qrcode.addData(r),this.qrcode.make()}A.prototype.svg=function(e){var t=this.options||{},n=this.qrcode.modules;"undefined"==typeof e&&(e={container:t.container||"svg"});for(var r="undefined"==typeof t.pretty||!!t.pretty,i=r?" ":"",a=r?"\r\n":"",o=t.width,s=t.height,u=n.length,c=o/(u+2*t.padding),l=s/(u+2*t.padding),f="undefined"!=typeof t.join&&!!t.join,d="undefined"!=typeof t.swap&&!!t.swap,p="undefined"==typeof t.xmlDeclaration||!!t.xmlDeclaration,h="undefined"!=typeof t.predefined&&!!t.predefined,m=h?i+''+a:"",v=i+''+a,y="",b="",g=0;g'+a:i+''+a}}f&&(y=i+'');var T="";if(void 0!==this.options.image&&this.options.image.svg){var S=o*this.options.image.width/100,C=s*this.options.image.height/100,O=s/2-C/2;T+=''),T+=this.options.image.svg+a,T+=""}var I="";switch(e.container){case"svg":p&&(I+=''+a),I+=''+a,I+=m+v+y,I+=T,I+="";break;case"svg-viewbox":p&&(I+=''+a),I+=''+a,I+=m+v+y,I+=T,I+="";break;case"g":I+=''+a,I+=m+v+y,I+=T,I+="";break;default:I+=(m+v+y+T).replace(/^\s+/,"")}return I},e.exports=A},27865:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LIB_VERSION=void 0,t.LIB_VERSION="3.7.1"},7465:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(12769).Buffer}catch(C){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var a=0,o=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&o0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===n)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(C){a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),n=0!==a||o!==this.length-1?d[6-u.length]+u+n:u+n}for(0!==a&&(n=a.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=h[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(e);n=(f=f.idivn(l)).isZero()?m+n:d[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var h=c-p|0;l+=(o=(i=0|e.words[h])*(a=0|t.words[p])+f)/67108864|0,f=67108863&o}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}a.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,i),o},a.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i>8&255),n>16&255),6===a?(n>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),6===a?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,p=0|o[1],h=8191&p,m=p>>>13,v=0|o[2],y=8191&v,b=v>>>13,g=0|o[3],w=8191&g,x=g>>>13,k=0|o[4],A=8191&k,E=k>>>13,_=0|o[5],T=8191&_,S=_>>>13,C=0|o[6],O=8191&C,I=C>>>13,P=0|o[7],R=8191&P,M=P>>>13,N=0|o[8],j=8191&N,L=N>>>13,D=0|o[9],B=8191&D,U=D>>>13,F=0|s[0],Z=8191&F,z=F>>>13,H=0|s[1],q=8191&H,V=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,K=0|s[3],J=8191&K,Q=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,pe=0|s[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ve=(c+(r=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(d,Z)|0))<<13)|0;c=((a=Math.imul(d,z))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,z))+Math.imul(m,Z)|0,a=Math.imul(m,z);var ye=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((a=a+Math.imul(d,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,z))+Math.imul(b,Z)|0,a=Math.imul(b,z),r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,V)|0;var be=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,z))+Math.imul(x,Z)|0,a=Math.imul(x,z),r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,q)|0,a=a+Math.imul(b,V)|0,r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,Y)|0;var ge=(c+(r=r+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;c=((a=a+Math.imul(d,Q)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(A,Z),i=(i=Math.imul(A,z))+Math.imul(E,Z)|0,a=Math.imul(E,z),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,q)|0,a=a+Math.imul(x,V)|0,r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,Y)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Q)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,Q)|0;var we=(c+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,z))+Math.imul(S,Z)|0,a=Math.imul(S,z),r=r+Math.imul(A,q)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(E,q)|0,a=a+Math.imul(E,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Q)|0,r=r+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(d,ne)|0))<<13)|0;c=((a=a+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(O,Z),i=(i=Math.imul(O,z))+Math.imul(I,Z)|0,a=Math.imul(I,z),r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,V)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,Y)|0)+Math.imul(E,G)|0,a=a+Math.imul(E,Y)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Q)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,a=a+Math.imul(m,re)|0;var ke=(c+(r=r+Math.imul(f,ae)|0)|0)+((8191&(i=(i=i+Math.imul(f,oe)|0)+Math.imul(d,ae)|0))<<13)|0;c=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,Z),i=(i=Math.imul(R,z))+Math.imul(M,Z)|0,a=Math.imul(M,z),r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(I,q)|0,a=a+Math.imul(I,V)|0,r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(S,G)|0,a=a+Math.imul(S,Y)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,a=a+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0,r=r+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var Ae=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((a=a+Math.imul(d,ce)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,Z),i=(i=Math.imul(j,z))+Math.imul(L,Z)|0,a=Math.imul(L,z),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(M,q)|0,a=a+Math.imul(M,V)|0,r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(I,G)|0,a=a+Math.imul(I,Y)|0,r=r+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,Q)|0,r=r+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,a=a+Math.imul(x,re)|0,r=r+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(m,ue)|0,a=a+Math.imul(m,ce)|0;var Ee=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(B,Z),i=(i=Math.imul(B,z))+Math.imul(U,Z)|0,a=Math.imul(U,z),r=r+Math.imul(j,q)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(L,q)|0,a=a+Math.imul(L,V)|0,r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(M,G)|0,a=a+Math.imul(M,Y)|0,r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,Q)|0,r=r+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(E,ne)|0,a=a+Math.imul(E,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,r=r+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,a=a+Math.imul(b,ce)|0,r=r+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(m,fe)|0,a=a+Math.imul(m,de)|0;var _e=(c+(r=r+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,he)|0))<<13)|0;c=((a=a+Math.imul(d,me)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,V))+Math.imul(U,q)|0,a=Math.imul(U,V),r=r+Math.imul(j,G)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(L,G)|0,a=a+Math.imul(L,Y)|0,r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Q)|0,r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,a=a+Math.imul(S,re)|0,r=r+Math.imul(A,ae)|0,i=(i=i+Math.imul(A,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,a=a+Math.imul(x,ce)|0,r=r+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,fe)|0,a=a+Math.imul(b,de)|0;var Te=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,Y))+Math.imul(U,G)|0,a=Math.imul(U,Y),r=r+Math.imul(j,J)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,Q)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(I,ne)|0,a=a+Math.imul(I,re)|0,r=r+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,r=r+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,fe)|0,a=a+Math.imul(x,de)|0;var Se=(c+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;c=((a=a+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,Q))+Math.imul(U,J)|0,a=Math.imul(U,Q),r=r+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(M,ne)|0,a=a+Math.imul(M,re)|0,r=r+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,oe)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,oe)|0,r=r+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(S,ue)|0,a=a+Math.imul(S,ce)|0,r=r+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(E,fe)|0,a=a+Math.imul(E,de)|0;var Ce=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;c=((a=a+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,ee))+Math.imul(U,$)|0,a=Math.imul(U,ee),r=r+Math.imul(j,ne)|0,i=(i=i+Math.imul(j,re)|0)+Math.imul(L,ne)|0,a=a+Math.imul(L,re)|0,r=r+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,r=r+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(I,ue)|0,a=a+Math.imul(I,ce)|0,r=r+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(S,fe)|0,a=a+Math.imul(S,de)|0;var Oe=(c+(r=r+Math.imul(A,he)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(E,he)|0))<<13)|0;c=((a=a+Math.imul(E,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(B,ne),i=(i=Math.imul(B,re))+Math.imul(U,ne)|0,a=Math.imul(U,re),r=r+Math.imul(j,ae)|0,i=(i=i+Math.imul(j,oe)|0)+Math.imul(L,ae)|0,a=a+Math.imul(L,oe)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(M,ue)|0,a=a+Math.imul(M,ce)|0,r=r+Math.imul(O,fe)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(I,fe)|0,a=a+Math.imul(I,de)|0;var Ie=(c+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;c=((a=a+Math.imul(S,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,ae),i=(i=Math.imul(B,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),r=r+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(L,ue)|0,a=a+Math.imul(L,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(M,fe)|0,a=a+Math.imul(M,de)|0;var Pe=(c+(r=r+Math.imul(O,he)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(I,he)|0))<<13)|0;c=((a=a+Math.imul(I,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(U,ue)|0,a=Math.imul(U,ce),r=r+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,de)|0)+Math.imul(L,fe)|0,a=a+Math.imul(L,de)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(M,he)|0))<<13)|0;c=((a=a+Math.imul(M,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(B,fe),i=(i=Math.imul(B,de))+Math.imul(U,fe)|0,a=Math.imul(U,de);var Me=(c+(r=r+Math.imul(j,he)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(L,he)|0))<<13)|0;c=((a=a+Math.imul(L,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Ne=(c+(r=Math.imul(B,he))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(U,he)|0))<<13)|0;return c=((a=Math.imul(U,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=xe,u[6]=ke,u[7]=Ae,u[8]=Ee,u[9]=_e,u[10]=Te,u[11]=Se,u[12]=Ce,u[13]=Oe,u[14]=Ie,u[15]=Pe,u[16]=Re,u[17]=Me,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n._strip()}function b(e,t,n){return y(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(v=m),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?v(this,e,t):n<63?m(this,e,t):n<1024?y(this,e,t):b(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,n+=a/67108864|0,n+=o>>>26,this.words[i]=67108863&o}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new a(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-a|f>>>a,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];0!==(n=26-this._countBits(o))&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(i,d,f);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(n*i+(0|this.words[a]))%e;return t?-i:i},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*n;this.words[i]=a/e|0,n=a%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(l),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(u)):(n.isub(t),s.isub(i),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},a.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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)}x.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(k,x),k.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new A;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return w[e]=t,t},T.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=o;0!==p.cmp(s);){for(var m=p,v=0;0!==m.cmp(s);v++)m=m.redSqr();r(v=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new S(e)},i(S,T),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},9872:function(e,t,n){"use strict";var r=n(4230),i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,a=(0,r.Z)((function(e){return i.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.Z=a},4230:function(e,t){"use strict";t.Z=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}},93399:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Z}});var r=n(4942),i=n(47313),a=n(9872);var o=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)===0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},m=n(62017),v=n(4230),y=/[A-Z]|^ms/g,b=/_EMO_([^_]+?)_([^]*?)_EMO_/g,g=function(e){return 45===e.charCodeAt(1)},w=function(e){return null!=e&&"boolean"!==typeof e},x=(0,v.Z)((function(e){return g(e)?e:e.replace(y,"-$&").toLowerCase()})),k=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(b,(function(e,t,n){return E={name:t,styles:n,next:E},t}))}return 1===m.Z[e]||g(e)||"number"!==typeof t||0===t?t:t+"px"};function A(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return E={name:n.name,styles:n.styles,next:E},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)E={name:i.name,styles:i.styles,next:E},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i96?N:j};function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var B=function(){return null},U=function e(t,n){var a,o,s;void 0!==n&&(a=n.label,s=n.target,o=t.__emotion_forwardProp&&n.shouldForwardProp?function(e){return t.__emotion_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var u=t.__emotion_real===t,c=u&&t.__emotion_base||t;"function"!==typeof o&&u&&(o=t.__emotion_forwardProp);var l=o||L(c),f=!l("as");return function(){var d=arguments,p=u&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==a&&p.push("label:"+a+";"),null==d[0]||void 0===d[0].raw)p.push.apply(p,d);else{0,p.push(d[0][0]);for(var h=d.length,m=1;mp)&&(U=(z=z.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(v,"$1"+e.trim());case 58:return e.trim()+t.replace(v,"$1"+e.trim());default:if(0<1*n&&0u.charCodeAt(8))break;case 115:o=o.replace(u,"-webkit-"+u)+";"+o;break;case 207:case 102:o=o.replace(u,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],0=0?i:"")+"]",u=-1===i||e.dynamic;return(o=t.call(this,"array",s,a,u)).coder=e,o.length=i,o}return(0,i.Z)(n,[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],n=0;ne._data.length&&m.throwError("insufficient data length",s.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var n=[],r=0;r256||r%8!==0)&&M.throwArgumentError("invalid "+n[1]+" bit length","param",e),new C(r/8,"int"===n[1],e.name)}if(n=e.type.match(N)){var i=parseInt(n[1]);return(0===i||i>32)&&M.throwArgumentError("invalid bytes length","param",e),new E(i,e.name)}return M.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new c.Ej(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new c.QV(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,n=e.map((function(e){return t._getCoder(R._R.from(e))}));return new P(n,"_").defaultValue()}},{key:"encode",value:function(e,t){var n=this;e.length!==t.length&&M.throwError("types/values length mismatch",s.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=e.map((function(e){return n._getCoder(R._R.from(e))})),i=new P(r,"_"),a=this._getWriter();return i.encode(a,t),a.data}},{key:"decode",value:function(e,t,n){var r=this,i=e.map((function(e){return r._getCoder(R._R.from(e))}));return new P(i,"_").decode(this._getReader((0,a.arrayify)(t),n))}}]),e}(),D=new L},62:function(e,t,n){"use strict";n.d(t,{BR:function(){return f},Ej:function(){return h},QV:function(){return p},XI:function(){return d}});var r=n(15671),i=n(43144),a=n(52009),o=n(19560),s=n(54812),u=n(2735),c=n(50773),l=new u.Logger(c.i);function f(e){var t=[];return function e(n,r){if(Array.isArray(r))for(var i in r){var a=n.slice();a.push(i);try{e(a,r[i])}catch(o){t.push({path:a,error:o})}}}([],e),t}var d=function(){function e(t,n,i,a){(0,r.Z)(this,e),this.name=t,this.type=n,this.localName=i,this.dynamic=a}return(0,i.Z)(e,[{key:"_throwError",value:function(e,t){l.throwArgumentError(e,this.localName,t)}}]),e}(),p=function(){function e(t){(0,r.Z)(this,e),(0,s.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return(0,i.Z)(e,[{key:"data",get:function(){return(0,a.hexConcat)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(e){return this._data.push(e),this._dataLength+=e.length,e.length}},{key:"appendWriter",value:function(e){return this._writeData((0,a.concat)(e._data))}},{key:"writeBytes",value:function(e){var t=(0,a.arrayify)(e),n=t.length%this.wordSize;return n&&(t=(0,a.concat)([t,this._padding.slice(n)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=(0,a.arrayify)(o.O$.from(e));return t.length>this.wordSize&&l.throwError("value out-of-bounds",u.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,a.concat)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(n){e._data[t]=e._getValue(n)}}}]),e}(),h=function(){function e(t,n,i,o){(0,r.Z)(this,e),(0,s.defineReadOnly)(this,"_data",(0,a.arrayify)(t)),(0,s.defineReadOnly)(this,"wordSize",n||32),(0,s.defineReadOnly)(this,"_coerceFunc",i),(0,s.defineReadOnly)(this,"allowLoose",o),this._offset=0}return(0,i.Z)(e,[{key:"data",get:function(){return(0,a.hexlify)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,n){return this._coerceFunc?this._coerceFunc(t,n):e.coerce(t,n)}},{key:"_peekBytes",value:function(e,t,n){var r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&n&&this._offset+t<=this._data.length?r=t:l.throwError("data out-of-bounds",u.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var n=this._peekBytes(0,e,!!t);return this._offset+=n.length,n.slice(0,e)}},{key:"readValue",value:function(){return o.O$.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(t=t.toNumber()),t}}]),e}()},7550:function(e,t,n){"use strict";n.d(t,{HY:function(){return x},IC:function(){return O},QV:function(){return k},Xg:function(){return T},YW:function(){return S},_R:function(){return g},pc:function(){return y}});var r=n(60136),i=n(29388),a=n(15671),o=n(43144),s=n(19560),u=n(54812),c=n(2735),l=n(50773),f=new c.Logger(l.i),d={},p={calldata:!0,memory:!0,storage:!0},h={calldata:!0,memory:!0};function m(e,t){if("bytes"===e||"string"===e){if(p[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&h[t])return!0;return(p[t]||"payable"===t)&&f.throwArgumentError("invalid modifier","name",t),!1}function v(e,t){for(var n in t)(0,u.defineReadOnly)(e,n,t[n])}var y=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),b=new RegExp(/^(.*)\[([0-9]*)\]$/),g=function(){function e(t,n){(0,a.Z)(this,e),t!==d&&f.throwError("use fromString",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),v(this,n);var r=this.type.match(b);v(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:e.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return(0,o.Z)(e,[{key:"format",value:function(e){if(e||(e=y.sighash),y[e]||f.throwArgumentError("invalid format type","format",e),e===y.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var n="";return"array"===this.baseType?(n+=this.arrayChildren.format(e),n+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==y.sighash&&(n+=this.type),n+="("+this.components.map((function(t){return t.format(e)})).join(e===y.full?", ":",")+")"):n+=this.type,e!==y.sighash&&(!0===this.indexed&&(n+=" indexed"),e===y.full&&this.name&&(n+=" "+this.name)),n}}],[{key:"from",value:function(t,n){return"string"===typeof t?e.fromString(t,n):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(d,{name:t.name||null,type:I(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,n){return r=function(e,t){var n=e;function r(t){f.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function i(e){var n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");for(var a={type:"",name:"",state:{allowType:!0}},o=a,s=0;s2&&f.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||f.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=s.O$.from(n[1]),n[0]):e}function E(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function _(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&f.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&f.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||f.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&f.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&f.throwArgumentError("unable to determine stateMutability","value",e),t}var T=function(e){(0,r.Z)(n,e);var t=(0,i.Z)(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"format",value:function(e){if(e||(e=y.sighash),y[e]||f.throwArgumentError("invalid format type","format",e),e===y.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===y.sighash&&f.throwError("cannot format a constructor for sighash",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===y.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?n.fromString(e):n.fromObject(e)}},{key:"fromObject",value:function(e){if(n.isConstructorFragment(e))return e;"constructor"!==e.type&&f.throwArgumentError("invalid constructor object","value",e);var t=_(e);t.constant&&f.throwArgumentError("constructor cannot be constant","value",e);var r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(g.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?s.O$.from(e.gas):null};return new n(d,r)}},{key:"fromString",value:function(e){var t={type:"constructor"},r=(e=A(e,t)).match(M);return r&&"constructor"===r[1].trim()||f.throwArgumentError("invalid constructor string","value",e),t.inputs=w(r[2].trim(),!1),E(r[3].trim(),t),n.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),n}(x),S=function(e){(0,r.Z)(n,e);var t=(0,i.Z)(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"format",value:function(e){if(e||(e=y.sighash),y[e]||f.throwArgumentError("invalid format type","format",e),e===y.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==y.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===y.full?", ":",")+") ",e!==y.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?n.fromString(e):n.fromObject(e)}},{key:"fromObject",value:function(e){if(n.isFunctionFragment(e))return e;"function"!==e.type&&f.throwArgumentError("invalid function object","value",e);var t=_(e),r={type:e.type,name:R(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(g.fromObject):[],outputs:e.outputs?e.outputs.map(g.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?s.O$.from(e.gas):null};return new n(d,r)}},{key:"fromString",value:function(e){var t={type:"function"},r=(e=A(e,t)).split(" returns ");r.length>2&&f.throwArgumentError("invalid function string","value",e);var i=r[0].match(M);if(i||f.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&R(t.name),t.inputs=w(i[2],!1),E(i[3].trim(),t),r.length>1){var a=r[1].match(M);""==a[1].trim()&&""==a[3].trim()||f.throwArgumentError("unexpected tokens","value",e),t.outputs=w(a[2],!1)}else t.outputs=[];return n.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),n}(T);function C(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||f.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var O=function(e){(0,r.Z)(n,e);var t=(0,i.Z)(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"format",value:function(e){if(e||(e=y.sighash),y[e]||f.throwArgumentError("invalid format type","format",e),e===y.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==y.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===y.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"===typeof e?n.fromString(e):n.fromObject(e)}},{key:"fromObject",value:function(e){if(n.isErrorFragment(e))return e;"error"!==e.type&&f.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:R(e.name),inputs:e.inputs?e.inputs.map(g.fromObject):[]};return C(new n(d,t))}},{key:"fromString",value:function(e){var t={type:"error"},r=e.match(M);return r||f.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&R(t.name),t.inputs=w(r[2],!1),C(n.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),n}(x);function I(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var P=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function R(e){return e&&e.match(P)||f.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var M=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},93487:function(e,t,n){"use strict";n.r(t),n.d(t,{AbiCoder:function(){return i.R},ConstructorFragment:function(){return r.Xg},ErrorFragment:function(){return r.IC},EventFragment:function(){return r.QV},FormatTypes:function(){return r.pc},Fragment:function(){return r.HY},FunctionFragment:function(){return r.YW},Indexed:function(){return a.Hk},Interface:function(){return a.vU},LogDescription:function(){return a.CC},ParamType:function(){return r._R},TransactionDescription:function(){return a.vk},checkResultErrors:function(){return o.BR},defaultAbiCoder:function(){return i.$}});var r=n(7550),i=n(86388),a=n(99456),o=n(62)},99456:function(e,t,n){"use strict";n.d(t,{CC:function(){return b},Hk:function(){return x},vU:function(){return E},vk:function(){return g}});var r=n(43144),i=n(15671),a=n(60136),o=n(29388),s=n(28552),u=n(19560),c=n(52009),l=n(93358),f=n(11291),d=n(54812),p=n(86388),h=n(7550),m=n(2735),v=n(50773),y=new m.Logger(v.i),b=function(e){(0,a.Z)(n,e);var t=(0,o.Z)(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n)}(d.Description),g=function(e){(0,a.Z)(n,e);var t=(0,o.Z)(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n)}(d.Description),w=function(e){(0,a.Z)(n,e);var t=(0,o.Z)(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n)}(d.Description),x=function(e){(0,a.Z)(n,e);var t=(0,o.Z)(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),n}(d.Description),k={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function A(e,t){var n=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return n.error=t,n}var E=function(){function e(t){var n=this;(0,i.Z)(this,e);var r=[];r="string"===typeof t?JSON.parse(t):t,(0,d.defineReadOnly)(this,"fragments",r.map((function(e){return h.HY.from(e)})).filter((function(e){return null!=e}))),(0,d.defineReadOnly)(this,"_abiCoder",(0,d.getStatic)(this instanceof e?this.constructor:void 0,"getAbiCoder")()),(0,d.defineReadOnly)(this,"functions",{}),(0,d.defineReadOnly)(this,"errors",{}),(0,d.defineReadOnly)(this,"events",{}),(0,d.defineReadOnly)(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return n.deploy?void y.warn("duplicate definition - constructor"):void(0,d.defineReadOnly)(n,"deploy",e);case"function":t=n.functions;break;case"event":t=n.events;break;case"error":t=n.errors;break;default:return}var r=e.format();t[r]?y.warn("duplicate definition - "+r):t[r]=e})),this.deploy||(0,d.defineReadOnly)(this,"deploy",h.Xg.from({payable:!1,type:"constructor"})),(0,d.defineReadOnly)(this,"_isInterface",!0)}return(0,r.Z)(e,[{key:"format",value:function(e){e||(e=h.pc.full),e===h.pc.sighash&&y.throwArgumentError("interface does not support formatting sighash","format",e);var t=this.fragments.map((function(t){return t.format(e)}));return e===h.pc.json?JSON.stringify(t.map((function(e){return JSON.parse(e)}))):t}},{key:"getFunction",value:function(e){if((0,c.isHexString)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];y.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),r=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===n}));return 0===r.length?y.throwArgumentError("no matching function","name",n):r.length>1&&y.throwArgumentError("multiple matching functions","name",n),this.functions[r[0]]}var i=this.functions[h.YW.fromString(e).format()];return i||y.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if((0,c.isHexString)(e)){var t=e.toLowerCase();for(var n in this.events)if(t===this.getEventTopic(n))return this.events[n];y.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var r=e.trim(),i=Object.keys(this.events).filter((function(e){return e.split("(")[0]===r}));return 0===i.length?y.throwArgumentError("no matching event","name",r):i.length>1&&y.throwArgumentError("multiple matching events","name",r),this.events[i[0]]}var a=this.events[h.QV.fromString(e).format()];return a||y.throwArgumentError("no matching event","signature",e),a}},{key:"getError",value:function(e){if((0,c.isHexString)(e)){var t=(0,d.getStatic)(this.constructor,"getSighash");for(var n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}y.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===r}));return 0===i.length?y.throwArgumentError("no matching error","name",r):i.length>1&&y.throwArgumentError("multiple matching errors","name",r),this.errors[i[0]]}var a=this.errors[h.YW.fromString(e).format()];return a||y.throwArgumentError("no matching error","signature",e),a}},{key:"getSighash",value:function(e){if("string"===typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(n){throw t}}return(0,d.getStatic)(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"===typeof e&&(e=this.getEvent(e)),(0,d.getStatic)(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"===typeof e&&(e=this.getError(e));var n=(0,c.arrayify)(t);return(0,c.hexlify)(n.slice(0,4))!==this.getSighash(e)&&y.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",(0,c.hexlify)(n)),this._decodeParams(e.inputs,n.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"===typeof e&&(e=this.getError(e)),(0,c.hexlify)((0,c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var n=(0,c.arrayify)(t);return(0,c.hexlify)(n.slice(0,4))!==this.getSighash(e)&&y.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",(0,c.hexlify)(n)),this._decodeParams(e.inputs,n.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,c.hexlify)((0,c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var n=(0,c.arrayify)(t),r=null,i="",a=null,o=null,s=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch(f){}break;case 4:var u=(0,c.hexlify)(n.slice(0,4)),l=k[u];if(l)a=this._abiCoder.decode(l.inputs,n.slice(4)),o=l.name,s=l.signature,l.reason&&(r=a[0]),"Error"===o?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(a[0])):"Panic"===o&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(a[0]));else try{var f=this.getError(u);a=this._abiCoder.decode(f.inputs,n.slice(4)),o=f.name,s=f.format()}catch(f){}}return y.throwError("call revert exception"+i,m.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,c.hexlify)(t),errorArgs:a,errorName:o,errorSignature:s,reason:r})}},{key:"encodeFunctionResult",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,c.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var n=this;"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&y.throwError("too many arguments for "+e.format(),m.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var r=[];e.anonymous||r.push(this.getEventTopic(e));var i=function(e,t){return"string"===e.type?(0,l.id)(t):"bytes"===e.type?(0,f.keccak256)((0,c.hexlify)(t)):("bool"===e.type&&"boolean"===typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=u.O$.from(t).toHexString()),"address"===e.type&&n._abiCoder.encode(["address"],[t]),(0,c.hexZeroPad)((0,c.hexlify)(t),32))};for(t.forEach((function(t,n){var a=e.inputs[n];a.indexed?null==t?r.push(null):"array"===a.baseType||"tuple"===a.baseType?y.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,t):Array.isArray(t)?r.push(t.map((function(e){return i(a,e)}))):r.push(i(a,t)):null!=t&&y.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}},{key:"encodeEventLog",value:function(e,t){var n=this;"string"===typeof e&&(e=this.getEvent(e));var r=[],i=[],a=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&y.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,o){var s=t[o];if(e.indexed)if("string"===e.type)r.push((0,l.id)(s));else if("bytes"===e.type)r.push((0,f.keccak256)(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(n._abiCoder.encode([e.type],[s]))}else i.push(e),a.push(s)})),{data:this._abiCoder.encode(i,a),topics:r}}},{key:"decodeEventLog",value:function(e,t,n){if("string"===typeof e&&(e=this.getEvent(e)),null!=n&&!e.anonymous){var r=this.getEventTopic(e);(0,c.isHexString)(n[0],32)&&n[0].toLowerCase()===r||y.throwError("fragment/topic mismatch",m.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:r,value:n[0]}),n=n.slice(1)}var i=[],a=[],o=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(h._R.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(i.push(e),o.push(!1)):(a.push(e),o.push(!1))}));var s=null!=n?this._abiCoder.decode(i,(0,c.concat)(n)):null,u=this._abiCoder.decode(a,t,!0),l=[],f=0,d=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)l[t]=new x({_isIndexed:!0,hash:null});else if(o[t])l[t]=new x({_isIndexed:!0,hash:s[d++]});else try{l[t]=s[d++]}catch(r){l[t]=r}else try{l[t]=u[f++]}catch(r){l[t]=r}if(e.name&&null==l[e.name]){var n=l[t];n instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:function(){throw A("property ".concat(JSON.stringify(e.name)),n)}}):l[e.name]=n}}));for(var p=function(e){var t=l[e];t instanceof Error&&Object.defineProperty(l,e,{enumerable:!0,get:function(){throw A("index ".concat(e),t)}})},v=0;v=0)throw e;return d.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",l.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:n})}))),null==n.chainId?n.chainId=this.getChainId():n.chainId=Promise.all([Promise.resolve(n.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&d.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,(0,c.resolveProperties)(n);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||d.throwError("missing provider",l.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),v=function(e){(0,i.Z)(n,e);var t=(0,a.Z)(n);function n(e,i){var a;return(0,s.Z)(this,n),a=t.call(this),(0,c.defineReadOnly)((0,r.Z)(a),"address",e),(0,c.defineReadOnly)((0,r.Z)(a),"provider",i||null),a}return(0,u.Z)(n,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){d.throwError(e,l.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new n(this.address,e)}}]),n}(m)},28552:function(e,t,n){"use strict";n.r(t),n.d(t,{getAddress:function(){return m},getContractAddress:function(){return b},getCreate2Address:function(){return g},getIcapAddress:function(){return y},isAddress:function(){return v}});var r=n(52009),i=n(19560),a=n(11291),o=n(80807),s=new(n(2735).Logger)("address/5.7.0");function u(e){(0,r.isHexString)(e,20)||s.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40),i=0;i<40;i++)n[i]=t[i].charCodeAt(0);for(var o=(0,r.arrayify)((0,a.keccak256)(n)),u=0;u<40;u+=2)o[u>>1]>>4>=8&&(t[u]=t[u].toUpperCase()),(15&o[u>>1])>=8&&(t[u+1]=t[u+1].toUpperCase());return"0x"+t.join("")}for(var c={},l=0;l<10;l++)c[String(l)]=String(l);for(var f=0;f<26;f++)c[String.fromCharCode(65+f)]=String(10+f);var d,p=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/Math.LN10));function h(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return c[e]})).join("");t.length>=p;){var n=t.substring(0,p);t=parseInt(n,10)%97+t.substring(n.length)}for(var r=String(98-parseInt(t,10)%97);r.length<2;)r="0"+r;return r}function m(e){var t=null;if("string"!==typeof e&&s.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=u(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&s.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==h(e)&&s.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=u("0x"+t)}else s.throwArgumentError("invalid address","address",e);return t}function v(e){try{return m(e),!0}catch(t){}return!1}function y(e){for(var t=(0,i.t2)(m(e).substring(2)).toUpperCase();t.length<30;)t="0"+t;return"XE"+h("XE00"+t)+t}function b(e){var t=null;try{t=m(e.from)}catch(u){s.throwArgumentError("missing from address","transaction",e)}var n=(0,r.stripZeros)((0,r.arrayify)(i.O$.from(e.nonce).toHexString()));return m((0,r.hexDataSlice)((0,a.keccak256)((0,o.encode)([t,n])),12))}function g(e,t,n){return 32!==(0,r.hexDataLength)(t)&&s.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,r.hexDataLength)(n)&&s.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",n),m((0,r.hexDataSlice)((0,a.keccak256)((0,r.concat)(["0xff",m(e),t,n])),12))}},48853:function(e,t,n){"use strict";n.d(t,{J:function(){return i},c:function(){return a}});var r=n(52009);function i(e){e=atob(e);for(var t=[],n=0;n0;)n.push(i%this.base),i=i/this.base|0}for(var s="",u=0;0===t[u]&&u=0;--c)s+=this.alphabet[n[c]];return s}},{key:"decode",value:function(e){if("string"!==typeof e)throw new TypeError("Expected String");var t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(var n=0;n>=8;for(;i>0;)t.push(255&i),i>>=8}for(var s=0;e[s]===this._leader&&s0&&(10===arguments[0]?m||(m=!0,f.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?f.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",u.Logger.errors.UNEXPECTED_ARGUMENT,{}):f.throwError("BigNumber.toString does not accept parameters",u.Logger.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(t){if(t instanceof e)return t;if("string"===typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(d,y(t)):t.match(/^-?[0-9]+$/)?new e(d,y(new l(t))):f.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&w("underflow","BigNumber.from",t),(t>=p||t<=-p)&&w("overflow","BigNumber.from",t),e.from(String(t));var n=t;if("bigint"===typeof n)return e.from(n.toString());if((0,s.isBytes)(n))return e.from((0,s.hexlify)(n));if(n)if(n.toHexString){var r=n.toHexString();if("string"===typeof r)return e.from(r)}else{var i=n._hex;if(null==i&&"BigNumber"===n.type&&(i=n.hex),"string"===typeof i&&((0,s.isHexString)(i)||"-"===i[0]&&(0,s.isHexString)(i.substring(1))))return e.from(i)}return f.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function y(e){if("string"!==typeof e)return y(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&f.throwArgumentError("invalid hex","value",e),"0x00"===(e=y(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function b(e){return v.from(y(e))}function g(e){var t=v.from(e).toHexString();return"-"===t[0]?new l("-"+t.substring(3),16):new l(t.substring(2),16)}function w(e,t,n){var r={fault:e,operation:t};return null!=n&&(r.value=n),f.throwError(e,u.Logger.errors.NUMERIC_FAULT,r)}function x(e){return new l(e,36).toString(16)}function k(e){return new l(e,16).toString(36)}},57042:function(e,t,n){"use strict";n.d(t,{Ox:function(){return y},S5:function(){return v},xs:function(){return g}});var r=n(15671),i=n(43144),a=n(52009),o=n(2735),s=n(44227),u=n(19560),c=new o.Logger(s.i),l={},f=u.O$.from(0),d=u.O$.from(-1);function p(e,t,n,r){var i={fault:t,operation:n};return void 0!==r&&(i.value=r),c.throwError(e,o.Logger.errors.NUMERIC_FAULT,i)}for(var h="0";h.length<256;)h+=h;function m(e){if("number"!==typeof e)try{e=u.O$.from(e).toNumber()}catch(t){}return"number"===typeof e&&e>=0&&e<=256&&!(e%1)?"1"+h.substring(0,e):c.throwArgumentError("invalid decimal size","decimals",e)}function v(e,t){null==t&&(t=0);var n=m(t),r=(e=u.O$.from(e)).lt(f);r&&(e=e.mul(d));for(var i=e.mod(n).toString();i.length2&&c.throwArgumentError("too many decimal points","value",e);var a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>n.length-1&&p("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length80&&c.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(l,n,r,i)}}]),e}(),g=function(){function e(t,n,i,a){(0,r.Z)(this,e),t!==l&&c.throwError("cannot use FixedNumber constructor; use FixedNumber.from",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=a,this._hex=n,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}return(0,i.Z)(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&c.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t);var n=y(this._value,this.format.decimals),r=y(t._value,t.format.decimals);return e.fromValue(n.add(r),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t);var n=y(this._value,this.format.decimals),r=y(t._value,t.format.decimals);return e.fromValue(n.sub(r),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t);var n=y(this._value,this.format.decimals),r=y(t._value,t.format.decimals);return e.fromValue(n.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t);var n=y(this._value,this.format.decimals),r=y(t._value,t.format.decimals);return e.fromValue(n.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var n=e.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(n=n.subUnsafe(w.toFormat(n.format))),n}},{key:"ceiling",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var n=e.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(n=n.addUnsafe(w.toFormat(n.format))),n}},{key:"round",value:function(t){null==t&&(t=0);var n=this.toString().split(".");if(1===n.length&&n.push("0"),(t<0||t>80||t%1)&&c.throwArgumentError("invalid decimal count","decimals",t),n[1].length<=t)return this;var r=e.from("1"+h.substring(0,t),this.format),i=x.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex;e%8&&c.throwArgumentError("invalid byte width","width",e);var t=u.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,a.hexZeroPad)(t,e/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(t){return e.fromString(this._value,t)}}],[{key:"fromValue",value:function(t,n,r){return null!=r||null==n||(0,u.Zm)(n)||(r=n,n=null),null==n&&(n=0),null==r&&(r="fixed"),e.fromString(v(t,n),b.from(r))}},{key:"fromString",value:function(t,n){null==n&&(n="fixed");var r=b.from(n),i=y(t,r.decimals);!r.signed&&i.lt(f)&&p("unsigned value cannot be negative","overflow","value",t);var o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=(0,a.hexZeroPad)(o,r.width/8));var s=v(i,r.decimals);return new e(l,o,s,r)}},{key:"fromBytes",value:function(t,n){null==n&&(n="fixed");var r=b.from(n);if((0,a.arrayify)(t).length>r.width/8)throw new Error("overflow");var i=u.O$.from(t);r.signed&&(i=i.fromTwos(r.width));var o=i.toTwos((r.signed?0:1)+r.width).toHexString(),s=v(i,r.decimals);return new e(l,o,s,r)}},{key:"from",value:function(t,n){if("string"===typeof t)return e.fromString(t,n);if((0,a.isBytes)(t))return e.fromBytes(t,n);try{return e.fromValue(t,0,n)}catch(r){if(r.code!==o.Logger.errors.INVALID_ARGUMENT)throw r}return c.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),w=g.from(1),x=g.from("0.5")},48725:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(88677).Buffer}catch(C){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var a=0,o=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&o0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===n)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(C){a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),n=0!==a||o!==this.length-1?d[6-u.length]+u+n:u+n}for(0!==a&&(n=a.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=h[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(e);n=(f=f.idivn(l)).isZero()?m+n:d[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var h=c-p|0;l+=(o=(i=0|e.words[h])*(a=0|t.words[p])+f)/67108864|0,f=67108863&o}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}a.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,i),o},a.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i>8&255),n>16&255),6===a?(n>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),6===a?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,p=0|o[1],h=8191&p,m=p>>>13,v=0|o[2],y=8191&v,b=v>>>13,g=0|o[3],w=8191&g,x=g>>>13,k=0|o[4],A=8191&k,E=k>>>13,_=0|o[5],T=8191&_,S=_>>>13,C=0|o[6],O=8191&C,I=C>>>13,P=0|o[7],R=8191&P,M=P>>>13,N=0|o[8],j=8191&N,L=N>>>13,D=0|o[9],B=8191&D,U=D>>>13,F=0|s[0],Z=8191&F,z=F>>>13,H=0|s[1],q=8191&H,V=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,K=0|s[3],J=8191&K,Q=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,pe=0|s[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ve=(c+(r=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(d,Z)|0))<<13)|0;c=((a=Math.imul(d,z))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,z))+Math.imul(m,Z)|0,a=Math.imul(m,z);var ye=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((a=a+Math.imul(d,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,z))+Math.imul(b,Z)|0,a=Math.imul(b,z),r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,V)|0;var be=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,z))+Math.imul(x,Z)|0,a=Math.imul(x,z),r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,q)|0,a=a+Math.imul(b,V)|0,r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,Y)|0;var ge=(c+(r=r+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;c=((a=a+Math.imul(d,Q)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(A,Z),i=(i=Math.imul(A,z))+Math.imul(E,Z)|0,a=Math.imul(E,z),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,q)|0,a=a+Math.imul(x,V)|0,r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,Y)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Q)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,Q)|0;var we=(c+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,z))+Math.imul(S,Z)|0,a=Math.imul(S,z),r=r+Math.imul(A,q)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(E,q)|0,a=a+Math.imul(E,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Q)|0,r=r+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(d,ne)|0))<<13)|0;c=((a=a+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(O,Z),i=(i=Math.imul(O,z))+Math.imul(I,Z)|0,a=Math.imul(I,z),r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,V)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,Y)|0)+Math.imul(E,G)|0,a=a+Math.imul(E,Y)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Q)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,a=a+Math.imul(m,re)|0;var ke=(c+(r=r+Math.imul(f,ae)|0)|0)+((8191&(i=(i=i+Math.imul(f,oe)|0)+Math.imul(d,ae)|0))<<13)|0;c=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,Z),i=(i=Math.imul(R,z))+Math.imul(M,Z)|0,a=Math.imul(M,z),r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(I,q)|0,a=a+Math.imul(I,V)|0,r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(S,G)|0,a=a+Math.imul(S,Y)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,a=a+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0,r=r+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var Ae=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((a=a+Math.imul(d,ce)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,Z),i=(i=Math.imul(j,z))+Math.imul(L,Z)|0,a=Math.imul(L,z),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(M,q)|0,a=a+Math.imul(M,V)|0,r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(I,G)|0,a=a+Math.imul(I,Y)|0,r=r+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,Q)|0,r=r+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,a=a+Math.imul(x,re)|0,r=r+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(m,ue)|0,a=a+Math.imul(m,ce)|0;var Ee=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(B,Z),i=(i=Math.imul(B,z))+Math.imul(U,Z)|0,a=Math.imul(U,z),r=r+Math.imul(j,q)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(L,q)|0,a=a+Math.imul(L,V)|0,r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(M,G)|0,a=a+Math.imul(M,Y)|0,r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,Q)|0,r=r+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(E,ne)|0,a=a+Math.imul(E,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,r=r+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,a=a+Math.imul(b,ce)|0,r=r+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(m,fe)|0,a=a+Math.imul(m,de)|0;var _e=(c+(r=r+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,he)|0))<<13)|0;c=((a=a+Math.imul(d,me)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,V))+Math.imul(U,q)|0,a=Math.imul(U,V),r=r+Math.imul(j,G)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(L,G)|0,a=a+Math.imul(L,Y)|0,r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Q)|0,r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,a=a+Math.imul(S,re)|0,r=r+Math.imul(A,ae)|0,i=(i=i+Math.imul(A,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,a=a+Math.imul(x,ce)|0,r=r+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,fe)|0,a=a+Math.imul(b,de)|0;var Te=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,Y))+Math.imul(U,G)|0,a=Math.imul(U,Y),r=r+Math.imul(j,J)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,Q)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(I,ne)|0,a=a+Math.imul(I,re)|0,r=r+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,r=r+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,fe)|0,a=a+Math.imul(x,de)|0;var Se=(c+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;c=((a=a+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,Q))+Math.imul(U,J)|0,a=Math.imul(U,Q),r=r+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(M,ne)|0,a=a+Math.imul(M,re)|0,r=r+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,oe)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,oe)|0,r=r+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(S,ue)|0,a=a+Math.imul(S,ce)|0,r=r+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(E,fe)|0,a=a+Math.imul(E,de)|0;var Ce=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;c=((a=a+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,ee))+Math.imul(U,$)|0,a=Math.imul(U,ee),r=r+Math.imul(j,ne)|0,i=(i=i+Math.imul(j,re)|0)+Math.imul(L,ne)|0,a=a+Math.imul(L,re)|0,r=r+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,r=r+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(I,ue)|0,a=a+Math.imul(I,ce)|0,r=r+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(S,fe)|0,a=a+Math.imul(S,de)|0;var Oe=(c+(r=r+Math.imul(A,he)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(E,he)|0))<<13)|0;c=((a=a+Math.imul(E,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(B,ne),i=(i=Math.imul(B,re))+Math.imul(U,ne)|0,a=Math.imul(U,re),r=r+Math.imul(j,ae)|0,i=(i=i+Math.imul(j,oe)|0)+Math.imul(L,ae)|0,a=a+Math.imul(L,oe)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(M,ue)|0,a=a+Math.imul(M,ce)|0,r=r+Math.imul(O,fe)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(I,fe)|0,a=a+Math.imul(I,de)|0;var Ie=(c+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;c=((a=a+Math.imul(S,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,ae),i=(i=Math.imul(B,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),r=r+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(L,ue)|0,a=a+Math.imul(L,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(M,fe)|0,a=a+Math.imul(M,de)|0;var Pe=(c+(r=r+Math.imul(O,he)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(I,he)|0))<<13)|0;c=((a=a+Math.imul(I,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(U,ue)|0,a=Math.imul(U,ce),r=r+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,de)|0)+Math.imul(L,fe)|0,a=a+Math.imul(L,de)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(M,he)|0))<<13)|0;c=((a=a+Math.imul(M,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(B,fe),i=(i=Math.imul(B,de))+Math.imul(U,fe)|0,a=Math.imul(U,de);var Me=(c+(r=r+Math.imul(j,he)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(L,he)|0))<<13)|0;c=((a=a+Math.imul(L,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Ne=(c+(r=Math.imul(B,he))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(U,he)|0))<<13)|0;return c=((a=Math.imul(U,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=xe,u[6]=ke,u[7]=Ae,u[8]=Ee,u[9]=_e,u[10]=Te,u[11]=Se,u[12]=Ce,u[13]=Oe,u[14]=Ie,u[15]=Pe,u[16]=Re,u[17]=Me,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n._strip()}function b(e,t,n){return y(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(v=m),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?v(this,e,t):n<63?m(this,e,t):n<1024?y(this,e,t):b(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,n+=a/67108864|0,n+=o>>>26,this.words[i]=67108863&o}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new a(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-a|f>>>a,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];0!==(n=26-this._countBits(o))&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(i,d,f);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(n*i+(0|this.words[a]))%e;return t?-i:i},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*n;this.words[i]=a/e|0,n=a%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(l),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(u)):(n.isub(t),s.isub(i),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},a.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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)}x.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(k,x),k.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new A;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return w[e]=t,t},T.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=o;0!==p.cmp(s);){for(var m=p,v=0;0!==m.cmp(s);v++)m=m.redSqr();r(v=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new S(e)},i(S,T),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},52009:function(e,t,n){"use strict";n.r(t),n.d(t,{arrayify:function(){return c},concat:function(){return l},hexConcat:function(){return b},hexDataLength:function(){return v},hexDataSlice:function(){return y},hexStripZeros:function(){return w},hexValue:function(){return g},hexZeroPad:function(){return x},hexlify:function(){return m},isBytes:function(){return u},isBytesLike:function(){return o},isHexString:function(){return p},joinSignature:function(){return A},splitSignature:function(){return k},stripZeros:function(){return f},zeroPad:function(){return d}});var r=new(n(2735).Logger)("bytes/5.7.0");function i(e){return!!e.toHexString}function a(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return a(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function o(e){return p(e)&&!(e.length%2)||u(e)}function s(e){return"number"===typeof e&&e==e&&e%1===0}function u(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!s(e.length)||e.length<0)return!1;for(var t=0;t=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid arrayify value");for(var n=[];e;)n.unshift(255&e),e=parseInt(String(e/256));return 0===n.length&&n.push(0),a(new Uint8Array(n))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),p(e)){var o=e.substring(2);o.length%2&&("left"===t.hexPad?o="0"+o:"right"===t.hexPad?o+="0":r.throwArgumentError("hex data is odd-length","value",e));for(var s=[],c=0;ct&&r.throwArgumentError("value out of range","value",arguments[0]);var n=new Uint8Array(t);return n.set(e,t-e.length),a(n)}function p(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var h="0123456789abcdef";function m(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid hexlify value");for(var n="";e;)n=h[15&e]+n,e=Math.floor(e/16);return n.length?(n.length%2&&(n="0"+n),"0x"+n):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(p(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":r.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(u(e)){for(var a="0x",o=0;o>4]+h[15&s]}return a}return r.throwArgumentError("invalid hexlify value","value",e)}function v(e){if("string"!==typeof e)e=m(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function y(e,t,n){return"string"!==typeof e?e=m(e):(!p(e)||e.length%2)&&r.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function b(e){var t="0x";return e.forEach((function(e){t+=m(e).substring(2)})),t}function g(e){var t=w(m(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function w(e){"string"!==typeof e&&(e=m(e)),p(e)||r.throwArgumentError("invalid hex string","value",e),e=e.substring(2);for(var t=0;t2*t+2&&r.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function k(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(o(e)){var n=c(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=m(n.slice(0,32)),t.s=m(n.slice(32,64))):65===n.length?(t.r=m(n.slice(0,32)),t.s=m(n.slice(32,64)),t.v=n[64]):r.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:r.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=m(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var i=d(c(t._vs),32);t._vs=m(i);var a=i[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=a:t.recoveryParam!==a&&r.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127;var s=m(i);null==t.s?t.s=s:t.s!==s&&r.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?r.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{var u=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==u&&r.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&p(t.r)?t.r=x(t.r,32):r.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&p(t.s)?t.s=x(t.s,32):r.throwArgumentError("signature missing or invalid s","signature",e);var l=c(t.s);l[0]>=128&&r.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(l[0]|=128);var f=m(l);t._vs&&(p(t._vs)||r.throwArgumentError("signature invalid _vs","signature",e),t._vs=x(t._vs,32)),null==t._vs?t._vs=f:t._vs!==f&&r.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function A(e){return m(l([(e=k(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},81895:function(e,t,n){"use strict";n.d(t,{d:function(){return r}});var r="0x0000000000000000000000000000000000000000"},6321:function(e,t,n){"use strict";n.d(t,{$B:function(){return l},Bz:function(){return c},Ce:function(){return u},PS:function(){return f},Py:function(){return s},_Y:function(){return a},fh:function(){return o},tL:function(){return i}});var r=n(19560),i=r.O$.from(-1),a=r.O$.from(0),o=r.O$.from(1),s=r.O$.from(2),u=r.O$.from("1000000000000000000"),c=r.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),l=r.O$.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),f=r.O$.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},44160:function(e,t,n){"use strict";n.d(t,{R:function(){return r}});var r="0x0000000000000000000000000000000000000000000000000000000000000000"},39707:function(e,t,n){"use strict";n.d(t,{VZ:function(){return L},CH:function(){return D},lV:function(){return B}});var r=n(93433),i=n(97326),a=n(11752),o=n(61120),s=n(60136),u=n(29388),c=n(15671),l=n(43144),f=n(74165),d=n(62),p=n(99456),h=n(15157),m=n(72388),v=n(28552),y=n(19560),b=n(52009),g=n(54812),w=n(65958),x=n(2735),k=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},A=new x.Logger("contracts/5.7.0"),E={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function _(e,t){return k(this,void 0,void 0,(0,f.Z)().mark((function n(){var r,i;return(0,f.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t;case 2:return"string"!==typeof(r=n.sent)&&A.throwArgumentError("invalid address or ENS name","name",r),n.prev=4,n.abrupt("return",(0,v.getAddress)(r));case 8:n.prev=8,n.t0=n.catch(4);case 10:return e||A.throwError("a provider or signer is needed to resolve ENS names",x.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),n.next=13,e.resolveName(r);case 13:return null==(i=n.sent)&&A.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n.abrupt("return",i);case 16:case"end":return n.stop()}}),n,null,[[4,8]])})))}function T(e,t,n){return k(this,void 0,void 0,(0,f.Z)().mark((function r(){return(0,f.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!Array.isArray(n)){r.next=4;break}return r.next=3,Promise.all(n.map((function(n,r){return T(e,Array.isArray(t)?t[r]:t[n.name],n)})));case 3:case 7:case 11:case 17:return r.abrupt("return",r.sent);case 4:if("address"!==n.type){r.next=8;break}return r.next=7,_(e,t);case 8:if("tuple"!==n.type){r.next=12;break}return r.next=11,T(e,t,n.components);case 12:if("array"!==n.baseType){r.next=18;break}if(Array.isArray(t)){r.next=15;break}return r.abrupt("return",Promise.reject(A.makeError("invalid value for array",x.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})));case 15:return r.next=17,Promise.all(t.map((function(t){return T(e,t,n.arrayChildren)})));case 18:return r.abrupt("return",t);case 19:case"end":return r.stop()}}),r)})))}function S(e,t,n){return k(this,void 0,void 0,(0,f.Z)().mark((function r(){var i,a,o,s,u,c,l,d,p,h,m=this;return(0,f.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i={},n.length===t.inputs.length+1&&"object"===typeof n[n.length-1]&&(i=(0,g.shallowCopy)(n.pop())),A.checkArgumentCount(n.length,t.inputs.length,"passed to contract"),e.signer?i.from?i.from=(0,g.resolveProperties)({override:_(e.signer,i.from),signer:e.signer.getAddress()}).then((function(e){return k(m,void 0,void 0,(0,f.Z)().mark((function t(){return(0,f.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(0,v.getAddress)(e.signer)!==e.override&&A.throwError("Contract with a Signer cannot override from",x.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.abrupt("return",e.override);case 2:case"end":return t.stop()}}),t)})))})):i.from=e.signer.getAddress():i.from&&(i.from=_(e.provider,i.from)),r.next=6,(0,g.resolveProperties)({args:T(e.signer||e.provider,n,t.inputs),address:e.resolvedAddress,overrides:(0,g.resolveProperties)(i)||{}});case 6:if(a=r.sent,o=e.interface.encodeFunctionData(t,a.args),s={data:o,to:a.address},null!=(u=a.overrides).nonce&&(s.nonce=y.O$.from(u.nonce).toNumber()),null!=u.gasLimit&&(s.gasLimit=y.O$.from(u.gasLimit)),null!=u.gasPrice&&(s.gasPrice=y.O$.from(u.gasPrice)),null!=u.maxFeePerGas&&(s.maxFeePerGas=y.O$.from(u.maxFeePerGas)),null!=u.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=y.O$.from(u.maxPriorityFeePerGas)),null!=u.from&&(s.from=u.from),null!=u.type&&(s.type=u.type),null!=u.accessList&&(s.accessList=(0,w.accessListify)(u.accessList)),null==s.gasLimit&&null!=t.gas){for(c=21e3,l=(0,b.arrayify)(o),d=0;d1)){e=e.substring(1);var n=t[0];try{null==i[e]&&(0,g.defineReadOnly)(i,e,i[n])}catch(r){}null==i.functions[e]&&(0,g.defineReadOnly)(i.functions,e,i.functions[n]),null==i.callStatic[e]&&(0,g.defineReadOnly)(i.callStatic,e,i.callStatic[n]),null==i.populateTransaction[e]&&(0,g.defineReadOnly)(i.populateTransaction,e,i.populateTransaction[n]),null==i.estimateGas[e]&&(0,g.defineReadOnly)(i.estimateGas,e,i.estimateGas[n])}}))}return(0,l.Z)(e,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(e){var t=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return t})):this._deployedPromise=this.provider.getCode(this.address,e).then((function(e){return"0x"===e&&A.throwError("contract not deployed",x.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:t.address,operation:"getDeployed"}),t}))),this._deployedPromise}},{key:"fallback",value:function(e){var t=this;this.signer||A.throwError("sending a transactions require a signer",x.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var n=(0,g.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=n[e]&&A.throwError("cannot override "+e,x.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),n.to=this.resolvedAddress,this.deployed().then((function(){return t.signer.sendTransaction(n)}))}},{key:"connect",value:function(e){"string"===typeof e&&(e=new m.b(e,this.provider));var t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,g.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}},{key:"attach",value:function(e){return new this.constructor(e,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}},{key:"_getRunningEvent",value:function(e){if("string"===typeof e){if("error"===e)return this._normalizeRunningEvent(new M);if("event"===e)return this._normalizeRunningEvent(new R("event",null));if("*"===e)return this._normalizeRunningEvent(new j(this.address,this.interface));var t=this.interface.getEvent(e);return this._normalizeRunningEvent(new N(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{var n=e.topics[0];if("string"!==typeof n)throw new Error("invalid topic");var r=this.interface.getEvent(n);return this._normalizeRunningEvent(new N(this.address,this.interface,r,e.topics))}catch(a){}var i={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new R(P(i),i))}return this._normalizeRunningEvent(new j(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];var t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}},{key:"_wrapEvent",value:function(e,t,n){var r=this,i=(0,g.deepCopy)(t);return i.removeListener=function(){n&&(e.removeListener(n),r._checkRunningEvents(e))},i.getBlock=function(){return r.provider.getBlock(t.blockHash)},i.getTransaction=function(){return r.provider.getTransaction(t.transactionHash)},i.getTransactionReceipt=function(){return r.provider.getTransactionReceipt(t.transactionHash)},e.prepareEvent(i),i}},{key:"_addEventListener",value:function(e,t,n){var i=this;if(this.provider||A.throwError("events require a provider or a signer with a provider",x.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){var a=function(n){var a=i._wrapEvent(e,n,t);if(null==a.decodeError)try{var o=e.getEmit(a);i.emit.apply(i,[e.filter].concat((0,r.Z)(o)))}catch(s){a.decodeError=s.error}null!=e.filter&&i.emit("event",a),null!=a.decodeError&&i.emit("error",a.decodeError,a)};this._wrappedEmits[e.tag]=a,null!=e.filter&&this.provider.on(e.filter,a)}}},{key:"queryFilter",value:function(e,t,n){var r=this,i=this._getRunningEvent(e),a=(0,g.shallowCopy)(i.filter);return"string"===typeof t&&(0,b.isHexString)(t,32)?(null!=n&&A.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),a.blockHash=t):(a.fromBlock=null!=t?t:0,a.toBlock=null!=n?n:"latest"),this.provider.getLogs(a).then((function(e){return e.map((function(e){return r._wrapEvent(i,e,null)}))}))}},{key:"on",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}},{key:"once",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}},{key:"emit",value:function(e){if(!this.provider)return!1;for(var t=this._getRunningEvent(e),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0;return this._checkRunningEvents(t),a}},{key:"listenerCount",value:function(e){var t=this;return this.provider?null==e?Object.keys(this._runningEvents).reduce((function(e,n){return e+t._runningEvents[n].listenerCount()}),0):this._getRunningEvent(e).listenerCount():0}},{key:"listeners",value:function(e){if(!this.provider)return[];if(null==e){var t=[];for(var n in this._runningEvents)this._runningEvents[n].listeners().forEach((function(e){t.push(e)}));return t}return this._getRunningEvent(e).listeners()}},{key:"removeAllListeners",value:function(e){if(!this.provider)return this;if(null==e){for(var t in this._runningEvents){var n=this._runningEvents[t];n.removeAllListeners(),this._checkRunningEvents(n)}return this}var r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}},{key:"off",value:function(e,t){if(!this.provider)return this;var n=this._getRunningEvent(e);return n.removeListener(t),this._checkRunningEvents(n),this}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"getContractAddress",value:function(e){return(0,v.getContractAddress)(e)}},{key:"getInterface",value:function(e){return p.vU.isInterface(e)?e:new p.vU(e)}},{key:"isIndexed",value:function(e){return p.Hk.isIndexed(e)}}]),e}(),D=function(e){(0,s.Z)(n,e);var t=(0,u.Z)(n);function n(){return(0,c.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n)}(L),B=function(){function e(t,n,r){(0,c.Z)(this,e);var i=null;"0x"!==(i="string"===typeof n?n:(0,b.isBytes)(n)?(0,b.hexlify)(n):n&&"string"===typeof n.object?n.object:"!").substring(0,2)&&(i="0x"+i),(!(0,b.isHexString)(i)||i.length%2)&&A.throwArgumentError("invalid bytecode","bytecode",n),r&&!m.E.isSigner(r)&&A.throwArgumentError("invalid signer","signer",r),(0,g.defineReadOnly)(this,"bytecode",i),(0,g.defineReadOnly)(this,"interface",(0,g.getStatic)(this instanceof e?this.constructor:void 0,"getInterface")(t)),(0,g.defineReadOnly)(this,"signer",r||null)}return(0,l.Z)(e,[{key:"getDeployTransaction",value:function(){for(var e={},t=arguments.length,n=new Array(t),r=0;r0&&Array.isArray(t)?e(t,i-1):n.push(t)}))}(e,t),n}function f(e){return function(e){var t=0;return function(){return e[t++]}}(function(e){var t=0;function n(){return e[t++]<<8|e[t++]}for(var r=n(),i=1,a=[0,1],o=1;o>--c&1}for(var d=Math.pow(2,31),p=d>>>1,h=p>>1,m=d-1,v=0,y=0;y<31;y++)v=v<<1|f();for(var b=[],g=0,w=d;;){for(var x=Math.floor(((v-g+1)*i-1)/w),k=0,A=r;A-k>1;){var E=k+A>>>1;x>>1|f(),_=_<<1^p,T=(T^p)<<1|p|1;g=_,w=1+T-_}var S=r-4;return b.map((function(t){switch(t-S){case 3:return S+65792+(e[u++]<<16|e[u++]<<8|e[u++]);case 2:return S+256+(e[u++]<<8|e[u++]);case 1:return S+e[u++];default:return t-1}}))}(e))}function d(e){return 1&e?~e>>1:e>>1}function p(e,t){for(var n=Array(e),r=0,i=-1;r>=1),check:2==a}}()}(g),E=45,_=95;function T(e){return(0,i.XL)(e)}function S(e){return e.filter((function(e){return 65039!=e}))}function C(e){var t,n=(0,c.Z)(e.split("."));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=T(r);try{for(var a=i.lastIndexOf(_)-1;a>=0;a--)if(i[a]!==_)throw new Error("underscore only allowed at start");if(i.length>=4&&i.every((function(e){return e<128}))&&i[2]===E&&i[3]===E)throw new Error("invalid label extension")}catch(o){throw new Error('Invalid label "'.concat(r,'": ').concat(o.message))}}}catch(o){n.e(o)}finally{n.f()}return e}function O(e){return C(function(e,t){var n=T(e).reverse(),r=[];for(;n.length;){var i=I(n);if(i)r.push.apply(r,(0,u.Z)(t(i)));else{var a=n.pop();if(w.has(a))r.push(a);else if(!x.has(a)){var o=k[a];if(!o)throw new Error("Disallowed codepoint: 0x".concat(a.toString(16).toUpperCase()));r.push.apply(r,(0,u.Z)(o))}}}return C(function(e){return e.normalize("NFC")}(String.fromCodePoint.apply(String,r)))}(e,S))}function I(e,t){var n,r,i,a=A,o=[],s=e.length;t&&(t.length=0);for(var c=function(){var c=e[--s];if(!(a=null===(n=a.branches.find((function(e){return e.set.has(c)})))||void 0===n?void 0:n.node))return"break";if(a.save)i=c;else if(a.check&&c===i)return"break";o.push(c),a.fe0f&&(o.push(65039),s>0&&65039==e[s-1]&&s--),a.valid&&(r=o.slice(),2==a.valid&&r.splice(1,1),t&&t.push.apply(t,(0,u.Z)(e.slice(s).reverse())),e.length=s)};s;){if("break"===c())break}return r}var P=new o.Logger(s.i),R=new Uint8Array(32);function M(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function N(e){var t=(0,i.Y0)(O(e)),n=[];if(0===e.length)return n;for(var r=0,a=0;a=t.length)throw new Error("invalid ENS name; empty component");return n.push(M(t.slice(r))),n}function j(e){return N(e).map((function(e){return(0,i.ZN)(e)})).join(".")}function L(e){try{return 0!==N(e).length}catch(t){}return!1}function D(e){"string"!==typeof e&&P.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=R,n=N(e);n.length;)t=(0,a.keccak256)((0,r.concat)([t,(0,a.keccak256)(n.pop())]));return(0,r.hexlify)(t)}function B(e){return(0,r.hexlify)((0,r.concat)(N(e).map((function(e){if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}R.fill(0)},26454:function(e,t,n){"use strict";n.d(t,{E:function(){return O}});var r=n(74165),i=n(15671),a=n(43144),o=n(28552),s=n(19560),u=n(52009),c=n(11291),l=n(54812),f=n(2735),d=n(22069),p=n(93358),h=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},m=new f.Logger(d.i),v=new Uint8Array(32);v.fill(0);var y=s.O$.from(-1),b=s.O$.from(0),g=s.O$.from(1),w=s.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var x=(0,u.hexZeroPad)(g.toHexString(),32),k=(0,u.hexZeroPad)(b.toHexString(),32),A={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},E=["name","version","chainId","verifyingContract","salt"];function _(e){return function(t){return"string"!==typeof t&&m.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}var T={name:_("name"),version:_("version"),chainId:function(e){try{return s.O$.from(e).toString()}catch(t){}return m.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,o.getAddress)(e).toLowerCase()}catch(t){}return m.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{var t=(0,u.arrayify)(e);if(32!==t.length)throw new Error("bad length");return(0,u.hexlify)(t)}catch(n){}return m.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function S(e){var t=e.match(/^(u?)int(\d*)$/);if(t){var n=""===t[1],r=parseInt(t[2]||"256");(r%8!==0||r>256||t[2]&&t[2]!==String(r))&&m.throwArgumentError("invalid numeric width","type",e);var i=w.mask(n?r-1:r),a=n?i.add(g).mul(y):b;return function(t){var n=s.O$.from(t);return(n.lt(a)||n.gt(i))&&m.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),(0,u.hexZeroPad)(n.toTwos(256).toHexString(),32)}}var l=e.match(/^bytes(\d+)$/);if(l){var f=parseInt(l[1]);return(0===f||f>32||l[1]!==String(f))&&m.throwArgumentError("invalid bytes width","type",e),function(t){return(0,u.arrayify)(t).length!==f&&m.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=(0,u.arrayify)(e),n=t.length%32;return n?(0,u.hexConcat)([t,v.slice(n)]):(0,u.hexlify)(t)}(t)}}switch(e){case"address":return function(e){return(0,u.hexZeroPad)((0,o.getAddress)(e),32)};case"bool":return function(e){return e?x:k};case"bytes":return function(e){return(0,c.keccak256)(e)};case"string":return function(e){return(0,p.id)(e)}}return null}function C(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var O=function(){function e(t){(0,i.Z)(this,e),(0,l.defineReadOnly)(this,"types",Object.freeze((0,l.deepCopy)(t))),(0,l.defineReadOnly)(this,"_encoderCache",{}),(0,l.defineReadOnly)(this,"_types",{});var n={},r={},a={};Object.keys(t).forEach((function(e){n[e]={},r[e]=[],a[e]={}}));var o=function(e){var i={};t[e].forEach((function(a){i[a.name]&&m.throwArgumentError("duplicate variable name ".concat(JSON.stringify(a.name)," in ").concat(JSON.stringify(e)),"types",t),i[a.name]=!0;var o=a.type.match(/^([^\x5b]*)(\x5b|$)/)[1];o===e&&m.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),S(o)||(r[o]||m.throwArgumentError("unknown type ".concat(JSON.stringify(o)),"types",t),r[o].push(e),n[e][o]=!0)}))};for(var s in t)o(s);var u=Object.keys(r).filter((function(e){return 0===r[e].length}));for(var c in 0===u.length?m.throwArgumentError("missing primary type","types",t):u.length>1&&m.throwArgumentError("ambiguous primary types or unused types: ".concat(u.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),(0,l.defineReadOnly)(this,"primaryType",u[0]),function e(i,o){o[i]&&m.throwArgumentError("circular type reference to ".concat(JSON.stringify(i)),"types",t),o[i]=!0,Object.keys(n[i]).forEach((function(t){r[t]&&(e(t,o),Object.keys(o).forEach((function(e){a[e][t]=!0})))})),delete o[i]}(this.primaryType,{}),a){var f=Object.keys(a[c]);f.sort(),this._types[c]=C(c,t[c])+f.map((function(e){return C(e,t[e])})).join("")}}return(0,a.Z)(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,n=S(e);if(n)return n;var r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){var i=r[1],a=this.getEncoder(i),o=parseInt(r[3]);return function(e){o>=0&&e.length!==o&&m.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var n=e.map(a);return t._types[i]&&(n=n.map(c.keccak256)),(0,c.keccak256)((0,u.hexConcat)(n))}}var s=this.types[e];if(s){var l=(0,p.id)(this._types[e]);return function(e){var n=s.map((function(n){var r=n.name,i=n.type,a=t.getEncoder(i)(e[r]);return t._types[i]?(0,c.keccak256)(a):a}));return n.unshift(l),(0,u.hexConcat)(n)}}return m.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||m.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return(0,c.keccak256)(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,n){var r=this;if(S(e))return n(e,t);var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var a=i[1],o=parseInt(i[3]);return o>=0&&t.length!==o&&m.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return r._visit(a,e,n)}))}var s=this.types[e];return s?s.reduce((function(e,i){var a=i.name,o=i.type;return e[a]=r._visit(o,t[a],n),e}),{}):m.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,n,r){return e.from(n).hashStruct(t,r)}},{key:"hashDomain",value:function(t){var n=[];for(var r in t){var i=A[r];i||m.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(r)),"domain",t),n.push({name:r,type:i})}return n.sort((function(e,t){return E.indexOf(e.name)-E.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:n},t)}},{key:"encode",value:function(t,n,r){return(0,u.hexConcat)(["0x1901",e.hashDomain(t),e.from(n).hash(r)])}},{key:"hash",value:function(t,n,r){return(0,c.keccak256)(e.encode(t,n,r))}},{key:"resolveNames",value:function(t,n,i,a){return h(this,void 0,void 0,(0,r.Z)().mark((function o(){var s,c,f;return(0,r.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=(0,l.shallowCopy)(t),s={},t.verifyingContract&&!(0,u.isHexString)(t.verifyingContract,20)&&(s[t.verifyingContract]="0x"),(c=e.from(n)).visit(i,(function(e,t){return"address"!==e||(0,u.isHexString)(t,20)||(s[t]="0x"),t})),o.t0=(0,r.Z)().keys(s);case 6:if((o.t1=o.t0()).done){o.next=13;break}return f=o.t1.value,o.next=10,a(f);case 10:s[f]=o.sent,o.next=6;break;case 13:return t.verifyingContract&&s[t.verifyingContract]&&(t.verifyingContract=s[t.verifyingContract]),i=c.visit(i,(function(e,t){return"address"===e&&s[t]?s[t]:t})),o.abrupt("return",{domain:t,value:i});case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(t,n,r){e.hashDomain(t);var i={},a=[];E.forEach((function(e){var n=t[e];null!=n&&(i[e]=T[e](n),a.push({name:e,type:A[e]}))}));var o=e.from(n),c=(0,l.shallowCopy)(n);return c.EIP712Domain?m.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",n):c.EIP712Domain=a,o.encode(r),{types:c,domain:i,primaryType:o.primaryType,message:o.visit(r,(function(e,t){if(e.match(/^bytes(\d*)/))return(0,u.hexlify)((0,u.arrayify)(t));if(e.match(/^u?int/))return s.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&m.throwArgumentError("invalid string","value",t),t}return m.throwArgumentError("unsupported type","type",e)}))}}}]),e}()},42989:function(e,t,n){"use strict";n.r(t),n.d(t,{HDNode:function(){return T},defaultPath:function(){return _},entropyToMnemonic:function(){return O},getAccountPath:function(){return P},isValidMnemonic:function(){return I},mnemonicToEntropy:function(){return C},mnemonicToSeed:function(){return S}});var r=n(15671),i=n(43144),a=n(44247),o=n(52009),s=n(19560),u=n(91953),c=n(79716),l=n(54812),f=n(64760),d=n(43984),p=n(8427),h=n(65958),m=n(53771),v=new(n(2735).Logger)("hdnode/5.7.0"),y=s.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),b=(0,u.Y0)("Bitcoin seed"),g=2147483648;function w(e){return(1<=256)throw new Error("Depth too large!");return k((0,o.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,o.hexlify)(this.depth),this.parentFingerprint,(0,o.hexZeroPad)((0,o.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,o.concat)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(E,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t));var n=this.path;n&&(n+="/"+(t&~g));var r=new Uint8Array(37);if(t&g){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set((0,o.arrayify)(this.privateKey),1),n&&(n+="'")}else r.set((0,o.arrayify)(this.publicKey));for(var i=24;i>=0;i-=8)r[33+(i>>3)]=t>>24-i&255;var a=(0,o.arrayify)((0,d.Gy)(p.p.sha512,this.chainCode,r)),u=a.slice(0,32),c=a.slice(32),l=null,h=null;this.privateKey?l=x(s.O$.from(u).add(this.privateKey).mod(y)):h=new f.SigningKey((0,o.hexlify)(u))._addPoint(this.publicKey);var m=n,v=this.mnemonic;return v&&(m=Object.freeze({phrase:v.phrase,path:n,locale:v.locale||"en"})),new e(E,l,h,this.fingerprint,x(c),t,this.depth+1,m)}},{key:"derivePath",value:function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var n=this,r=0;r=g)throw new Error("invalid path index - "+i);n=n._derive(g+a)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);var o=parseInt(i);if(o>=g)throw new Error("invalid path index - "+i);n=n._derive(o)}}return n}}],[{key:"_fromSeed",value:function(t,n){var r=(0,o.arrayify)(t);if(r.length<16||r.length>64)throw new Error("invalid seed");var i=(0,o.arrayify)((0,d.Gy)(p.p.sha512,b,r));return new e(E,x(i.slice(0,32)),null,"0x00000000",x(i.slice(32)),0,0,n)}},{key:"fromMnemonic",value:function(t,n,r){return t=O(C(t,r=A(r)),r),e._fromSeed(S(t,n),{phrase:t,path:"m",locale:r.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var n=a.Base58.decode(t);82===n.length&&k(n.slice(0,78))===t||v.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var r=n[4],i=(0,o.hexlify)(n.slice(5,9)),s=parseInt((0,o.hexlify)(n.slice(9,13)).substring(2),16),u=(0,o.hexlify)(n.slice(13,45)),c=n.slice(45,78);switch((0,o.hexlify)(n.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(E,null,(0,o.hexlify)(c),i,u,s,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new e(E,(0,o.hexlify)(c.slice(1)),null,i,u,s,r,null)}return v.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}]),e}();function S(e,t){t||(t="");var n=(0,u.Y0)("mnemonic"+t,u.Uj.NFKD);return(0,c.n)((0,u.Y0)(e,u.Uj.NFKD),n,2048,64,"sha512")}function C(e,t){t=A(t),v.checkNormalize();var n=t.split(e);if(n.length%3!==0)throw new Error("invalid mnemonic");for(var r=(0,o.arrayify)(new Uint8Array(Math.ceil(11*n.length/8))),i=0,a=0;a>3]|=1<<7-i%8),i++}var c=32*n.length/3,l=w(n.length/3);if(((0,o.arrayify)((0,d.JQ)(r.slice(0,c/8)))[0]&l)!==(r[r.length-1]&l))throw new Error("invalid checksum");return(0,o.hexlify)(r.slice(0,c/8))}function O(e,t){if(t=A(t),(e=(0,o.arrayify)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");for(var n=[0],r=11,i=0;i8?(n[n.length-1]<<=8,n[n.length-1]|=e[i],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[i]>>8-r,n.push(e[i]&(1<<8-r)-1),r+=3);var a=e.length/4,s=(0,o.arrayify)((0,d.JQ)(e))[0]&w(a);return n[n.length-1]<<=a,n[n.length-1]|=s>>8-a,t.join(n.map((function(e){return t.getWord(e)})))}function I(e,t){try{return C(e,t),!0}catch(n){}return!1}function P(e){return("number"!==typeof e||e<0||e>=g||e%1)&&v.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}},25779:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});var r="json-wallets/5.7.0"},56216:function(e,t,n){"use strict";n.r(t),n.d(t,{decryptCrowdsale:function(){return w},decryptJsonWallet:function(){return A},decryptJsonWalletSync:function(){return E},decryptKeystore:function(){return k.pe},decryptKeystoreSync:function(){return k.hb},encryptKeystore:function(){return k.HI},getJsonWalletAddress:function(){return x.Rb},isCrowdsaleWallet:function(){return x.LW},isKeystoreWallet:function(){return x.aO}});var r=n(15671),i=n(43144),a=n(60136),o=n(29388),s=n(37532),u=n.n(s),c=n(28552),l=n(52009),f=n(11291),d=n(79716),p=n(91953),h=n(54812),m=n(2735),v=n(25779),y=n(27211),b=new m.Logger(v.i),g=function(e){(0,a.Z)(n,e);var t=(0,o.Z)(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,i.Z)(n,[{key:"isCrowdsaleAccount",value:function(e){return!(!e||!e._isCrowdsaleAccount)}}]),n}(h.Description);function w(e,t){var n=JSON.parse(e);t=(0,y.Ij)(t);var r=(0,c.getAddress)((0,y.gx)(n,"ethaddr")),i=(0,y.p3)((0,y.gx)(n,"encseed"));i&&i.length%16===0||b.throwArgumentError("invalid encseed","json",e);for(var a=(0,l.arrayify)((0,d.n)(t,t,2e3,32,"sha256")).slice(0,16),o=i.slice(0,16),s=i.slice(16),h=new(u().ModeOfOperation.cbc)(a,o),m=u().padding.pkcs7.strip((0,l.arrayify)(h.decrypt(s))),v="",w=0;ws[n]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r>4],n+=p[15&t[a]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(c){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push("code=".concat(n)),i.push("version=".concat(this.version));var a=t,s="";switch(n){case f.NUMERIC_FAULT:s="NUMERIC_FAULT";var u=t;switch(u){case"overflow":case"underflow":case"division-by-zero":s+="-"+u;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break;case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:s=n}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");var c=new Error(t);return c.reason=a,c.code=n,Object.keys(r).forEach((function(e){c[e]=r[e]})),c}},{key:"throwError",value:function(e,t,n){throw this.makeError(e,t,n)}},{key:"throwArgumentError",value:function(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}},{key:"assert",value:function(e,t,n,r){e||this.throwError(t,n,r)}},{key:"assertArgument",value:function(e,t,n,r){e||this.throwArgumentError(t,n,r)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),d&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:d})}},{key:"checkSafeUint53",value:function(t,n){"number"===typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,n,r){r=r?": "+r:"",tn&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}},{key:"checkNew",value:function(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}},{key:"checkAbstract",value:function(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}}],[{key:"globalLogger",value:function(){return c||(c=new e("logger/5.7.0")),c}},{key:"setCensorship",value:function(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),a){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}o=!!t,a=!!n}},{key:"setLogLevel",value:function(t){var n=s[t.toLowerCase()];null!=n?u=n:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();h.errors=f,h.levels=l},88133:function(e,t,n){"use strict";n.d(t,{H:function(){return l}});var r=new(n(2735).Logger)("networks/5.7.1");function i(e){var t=function(t,n){null==n&&(n={});var r=[];if(t.InfuraProvider&&"-"!==n.infura)try{r.push(new t.InfuraProvider(e,n.infura))}catch(s){}if(t.EtherscanProvider&&"-"!==n.etherscan)try{r.push(new t.EtherscanProvider(e,n.etherscan))}catch(s){}if(t.AlchemyProvider&&"-"!==n.alchemy)try{r.push(new t.AlchemyProvider(e,n.alchemy))}catch(s){}if(t.PocketProvider&&"-"!==n.pocket){try{var i=new t.PocketProvider(e,n.pocket);i.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(i.network.name)&&r.push(i)}catch(s){}}if(t.CloudflareProvider&&"-"!==n.cloudflare)try{r.push(new t.CloudflareProvider(e))}catch(s){}if(t.AnkrProvider&&"-"!==n.ankr)try{var a=new t.AnkrProvider(e,n.ankr);a.network&&-1===["ropsten"].indexOf(a.network.name)&&r.push(a)}catch(s){}if(0===r.length)return null;if(t.FallbackProvider){var o=1;return null!=n.quorum?o=n.quorum:"homestead"===e&&(o=2),new t.FallbackProvider(r,o)}return r[0]};return t.renetwork=function(e){return i(e)},t}function a(e,t){var n=function(n,r){return n.JsonRpcProvider?new n.JsonRpcProvider(e,t):null};return n.renetwork=function(t){return a(e,t)},n}var o={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:i("homestead")},s={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:i("ropsten")},u={chainId:63,name:"classicMordor",_defaultProvider:a("https://www.ethercluster.com/mordor","classicMordor")},c={unspecified:{chainId:0,name:"unspecified"},homestead:o,mainnet:o,morden:{chainId:2,name:"morden"},ropsten:s,testnet:s,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:i("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:i("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:i("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:i("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:a("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:u,classicTestnet:u,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:a("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:i("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:i("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function l(e){if(null==e)return null;if("number"===typeof e){for(var t in c){var n=c[t];if(n.chainId===e)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"===typeof e){var i=c[e];return null==i?null:{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress,_defaultProvider:i._defaultProvider||null}}var a=c[e.name];if(!a)return"number"!==typeof e.chainId&&r.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==a.chainId&&r.throwArgumentError("network chainId mismatch","network",e);var o,s=e._defaultProvider||null;return null==s&&a._defaultProvider&&(s=(o=a._defaultProvider)&&"function"===typeof o.renetwork?a._defaultProvider.renetwork(e):a._defaultProvider),{name:e.name,chainId:a.chainId,ensAddress:e.ensAddress||a.ensAddress||null,_defaultProvider:s}}},79716:function(e,t,n){"use strict";n.d(t,{n:function(){return a}});var r=n(52009),i=n(43984);function a(e,t,n,a,o){var s;e=(0,r.arrayify)(e),t=(0,r.arrayify)(t);var u,c,l=1,f=new Uint8Array(a),d=new Uint8Array(t.length+4);d.set(t);for(var p=1;p<=l;p++){d[t.length]=p>>24&255,d[t.length+1]=p>>16&255,d[t.length+2]=p>>8&255,d[t.length+3]=255&p;var h=(0,r.arrayify)((0,i.Gy)(o,e,d));s||(s=h.length,c=new Uint8Array(s),u=a-((l=Math.ceil(a/s))-1)*s),c.set(h);for(var m=1;m0&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[C(e)]=!0}));var n=Object.keys(t);return n.sort(),n.join("|")}return C(e)})).join("&")}function I(e){if("string"===typeof e){if(e=e.toLowerCase(),32===(0,p.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+O(e);if(c.Sg.isForkEvent(e))throw S.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+O(e.topics||[])}throw new Error("invalid event - "+e)}function P(){return(new Date).getTime()}function R(e){return new Promise((function(t){setTimeout(t,e)}))}var M=["block","network","pending","poll"],N=function(){function e(t,n,r){(0,s.Z)(this,e),(0,y.defineReadOnly)(this,"tag",t),(0,y.defineReadOnly)(this,"listener",n),(0,y.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}return(0,u.Z)(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":");if("filter"!==e[0])return null;var t,n=e[1],r=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[];var t=e.split("|").map((function(e){return"null"===e?null:e}));return 1===t.length?t[0]:t})),i={};return r.length>0&&(i.topics=r),n&&"*"!==n&&(i.address=n),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||M.indexOf(this.tag)>=0}}]),e}(),j={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function L(e){return(0,p.hexZeroPad)(d.O$.from(e).toHexString(),32)}function D(e){return f.Base58.encode((0,p.concat)([e,(0,p.hexDataSlice)((0,b.JQ)((0,b.JQ)(e)),0,4)]))}var B=new RegExp("^(ipfs)://(.*)$","i"),U=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),B,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function F(e,t){try{return(0,g.ZN)(Z(e,t))}catch(n){}return null}function Z(e,t){if("0x"===e)return null;var n=d.O$.from((0,p.hexDataSlice)(e,t,t+32)).toNumber(),r=d.O$.from((0,p.hexDataSlice)(e,n,n+32)).toNumber();return(0,p.hexDataSlice)(e,n+32,n+32+r)}function z(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):S.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function H(e){var t=(0,p.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");var n=new Uint8Array(32);return n.set(t,32-t.length),n}function q(e){if(e.length%32===0)return e;var t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function V(e){for(var t=[],n=0,r=0;r=1&&a<=75)return D((0,p.concat)([[n.p2pkh],"0x"+i[2]]))}}if(null!=n.p2sh){var o=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(o){var s=parseInt(o[1],16);if(o[2].length===2*s&&s>=1&&s<=75)return D((0,p.concat)([[n.p2sh],"0x"+o[2]]))}}if(null!=n.prefix){var u=r[1],c=r[0];if(0===c?20!==u&&32!==u&&(c=-1):c=-1,c>=0&&r.length===2+u&&u>=1&&u<=75){var l=k().toWords(r.slice(2));return l.unshift(c),k().encode(n.prefix,l)}}return null}},{key:"getAddress",value:function(e){return T(this,void 0,void 0,(0,o.Z)().mark((function t(){var n,r,i;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=16;break}return t.prev=2,t.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(n=t.sent)&&n!==h.R){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",this.provider.formatter.callAddress(n));case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==A.Logger.errors.CALL_EXCEPTION){t.next=15;break}return t.abrupt("return",null);case 15:throw t.t0;case 16:return t.next=18,this._fetchBytes("0xf1cb7e06",L(e));case 18:if(null!=(r=t.sent)&&"0x"!==r){t.next=21;break}return t.abrupt("return",null);case 21:return null==(i=this._getAddress(e,r))&&S.throwError("invalid or unsupported coin data",A.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:r}),t.abrupt("return",i);case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return T(this,void 0,void 0,(0,o.Z)().mark((function e(){var t,n,r,i,a,s,u,c,l,f,h,m,v,y,b,g;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar");case 4:if(null!=(n=e.sent)){e.next=7;break}return e.abrupt("return",null);case 7:r=0;case 8:if(!(r=0?null:JSON.stringify({data:a,sender:i}),r.next=12,(0,w.fetchJson)({url:l,errorPassThrough:!0},f,(function(e,t){return e.status=t.statusCode,e}));case 12:if(!(d=r.sent).data){r.next=15;break}return r.abrupt("return",d.data);case 15:if(p=d.message||"unknown error",!(d.status>=400&&d.status<500)){r.next=18;break}return r.abrupt("return",S.throwError("response not found during CCIP fetch: ".concat(p),A.Logger.errors.SERVER_ERROR,{url:c,errorMessage:p}));case 18:s.push(p);case 19:u++,r.next=6;break;case 22:return r.abrupt("return",S.throwError("error encountered during CCIP fetch: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),A.Logger.errors.SERVER_ERROR,{urls:n,errorMessages:s}));case 23:case"end":return r.stop()}}),r,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return T(this,void 0,void 0,(0,o.Z)().mark((function t(){var n,r,i,a,s=this;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:if(!(e>0)){t.next=20;break}case 3:if(!this._internalBlockNumber){t.next=20;break}return n=this._internalBlockNumber,t.prev=5,t.next=8,n;case 8:if(r=t.sent,!(P()-r.respTime<=e)){t.next=11;break}return t.abrupt("return",r.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==n){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return i=P(),a=(0,y.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,n=e.networkError;if(n)throw s._internalBlockNumber===a&&(s._internalBlockNumber=null),n;var r=P();return(t=d.O$.from(t).toNumber())1e3)S.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(r,")")),this.emit("error",S.makeError("network block skew detected",A.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(i=this._emitted.block+1;i<=r;i++)this.emit("block",i);return this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=a._emitted[e];"pending"!==t&&r-t>12&&delete a._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,i=a.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(a._emitted["t:"+t]=e.blockNumber,a.emit(t,e),null):null})).catch((function(e){a.emit("error",e)}));n.push(i);break;case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);var o=e.filter;o.fromBlock=e._lastBlockNumber+1,o.toBlock=r;var s=o.toBlock-a._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);var u=a.getLogs(o).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),a._emitted["b:"+t.blockHash]=t.blockNumber,a._emitted["t:"+t.transactionHash]=t.blockNumber,a.emit(o,t)}))})).catch((function(t){a.emit("error",t),e._inflight=!1}));n.push(u)}}})),this._lastBlockNumber=r,Promise.all(n).then((function(){a.emit("didPoll",t)})).catch((function(e){a.emit("error",e)})),e.abrupt("return");case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return T(this,void 0,void 0,(0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",S.throwError("provider does not support network detection",A.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return T(this,void 0,void 0,(0,o.Z)().mark((function e(){var t,n,r;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:return t=e.sent,e.next=5,this.detectNetwork();case 5:if(n=e.sent,t.chainId===n.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=n,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",n,t),e.next=19,R(0);case 19:return e.abrupt("return",this._network);case 20:throw r=S.makeError("underlying network changed",A.Logger.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:n}),this.emit("error",r),r;case 23:return e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this;e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this;if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=P();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,n){return T(this,void 0,void 0,(0,o.Z)().mark((function r(){return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._waitForTransaction(e,null==t?1:t,n||0,null));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"_waitForTransaction",value:function(e,t,n,r){return T(this,void 0,void 0,(0,o.Z)().mark((function i(){var a,s=this;return(0,o.Z)().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getTransactionReceipt(e);case 2:if(!(((a=i.sent)?a.confirmations:0)>=t)){i.next=5;break}return i.abrupt("return",a);case 5:return i.abrupt("return",new Promise((function(i,a){var u=[],c=!1,l=function(){return!!c||(c=!0,u.forEach((function(e){e()})),!1)},f=function(e){e.confirmations0){var m=setTimeout((function(){l()||a(S.makeError("timeout exceeded",A.Logger.errors.TIMEOUT,{timeout:n}))}),n);m.unref&&m.unref(),u.push((function(){clearTimeout(m)}))}})));case 6:case"end":return i.stop()}}),i,this)})))}},{key:"getBlockNumber",value:function(){return T(this,void 0,void 0,(0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return T(this,void 0,void 0,(0,o.Z)().mark((function e(){var t;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,this.perform("getGasPrice",{});case 4:return t=e.sent,e.prev=5,e.abrupt("return",d.O$.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",S.throwError("bad result from backend",A.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0}));case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return T(this,void 0,void 0,(0,o.Z)().mark((function n(){var r,i;return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,(0,y.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getBalance",r);case 7:return i=n.sent,n.prev=8,n.abrupt("return",d.O$.from(i));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",S.throwError("bad result from backend",A.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:i,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return T(this,void 0,void 0,(0,o.Z)().mark((function n(){var r,i;return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,(0,y.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getTransactionCount",r);case 7:return i=n.sent,n.prev=8,n.abrupt("return",d.O$.from(i).toNumber());case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",S.throwError("bad result from backend",A.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:i,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return T(this,void 0,void 0,(0,o.Z)().mark((function n(){var r,i;return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,(0,y.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getCode",r);case 7:return i=n.sent,n.prev=8,n.abrupt("return",(0,p.hexlify)(i));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",S.throwError("bad result from backend",A.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:i,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,n){return T(this,void 0,void 0,(0,o.Z)().mark((function r(){var i,a;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,(0,y.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then((function(e){return(0,p.hexValue)(e)}))});case 4:return i=r.sent,r.next=7,this.perform("getStorageAt",i);case 7:return a=r.sent,r.prev=8,r.abrupt("return",(0,p.hexlify)(a));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",S.throwError("bad result from backend",A.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:a,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,n){var r=this;if(null!=t&&32!==(0,p.hexDataLength)(t))throw new Error("invalid response - sendTransaction");var i=e;return null!=t&&e.hash!==t&&S.throwError("Transaction hash mismatch from Provider.sendTransaction.",A.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=function(t,i){return T(r,void 0,void 0,(0,o.Z)().mark((function r(){var a,s;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t=1),null==i&&(i=0),a=void 0,0!==t&&null!=n&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n}),r.next=6,this._waitForTransaction(e.hash,t,i,a);case 6:if(null!=(s=r.sent)||0!==t){r.next=9;break}return r.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=s.blockNumber,0===s.status&&S.throwError("transaction failed",A.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:s}),r.abrupt("return",s);case 12:case"end":return r.stop()}}),r,this)})))},i}},{key:"sendTransaction",value:function(e){return T(this,void 0,void 0,(0,o.Z)().mark((function t(){var n,r,i,a;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,Promise.resolve(e).then((function(e){return(0,p.hexlify)(e)}));case 4:return n=t.sent,null==(r=this.formatter.transaction(e)).confirmations&&(r.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return i=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:n});case 13:return a=t.sent,t.abrupt("return",this._wrapTransaction(r,a,i));case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=r,t.t0.transactionHash=r.hash,t.t0;case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return T(this,void 0,void 0,(0,o.Z)().mark((function t(){var n,r,i=this;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return n=t.sent,r={},["from","to"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?i._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?d.O$.from(e):null})))})),["type"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return null!=e?e:null})))})),n.accessList&&(r.accessList=this.formatter.accessList(n.accessList)),["data"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?(0,p.hexlify)(e):null})))})),t.t0=this.formatter,t.next=12,(0,y.resolveProperties)(r);case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return T(this,void 0,void 0,(0,o.Z)().mark((function t(){var n,r=this;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,n={},null!=e.address&&(n.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(n[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(n[t]=r._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,(0,y.resolveProperties)(n);case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"_call",value:function(e,t,n){return T(this,void 0,void 0,(0,o.Z)().mark((function r(){var i,a,s,u,c,l,f,h,m,v,y,b,g,w,x;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n>=10&&S.throwError("CCIP read exceeded maximum redirections",A.Logger.errors.SERVER_ERROR,{redirects:n,transaction:e}),i=e.to,r.next=4,this.perform("call",{transaction:e,blockTag:t});case 4:if(a=r.sent,!(n>=0&&"latest"===t&&null!=i&&"0x556f1830"===a.substring(0,10)&&(0,p.hexDataLength)(a)%32===4)){r.next=31;break}for(r.prev=6,s=(0,p.hexDataSlice)(a,4),u=(0,p.hexDataSlice)(s,0,32),d.O$.from(u).eq(i)||S.throwError("CCIP Read sender did not match",A.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:a}),c=[],l=d.O$.from((0,p.hexDataSlice)(s,32,64)).toNumber(),f=d.O$.from((0,p.hexDataSlice)(s,l,l+32)).toNumber(),h=(0,p.hexDataSlice)(s,l+32),m=0;mthis._emitted.block)){e.next=10;break}return e.abrupt("return",null);case 10:return e.abrupt("return",void 0);case 11:if(!t){e.next=34;break}a=null,s=0;case 14:if(!(s0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,n){var r=new N(I(e),t,n);return this._events.push(r),this._startEvent(r),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i=0&&(t.throttleRetry=!0),t}return e.result}function K(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){var t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){var n=new Error("invalid response");throw n.result=JSON.stringify(e),n}if(e.error){var r=new Error(e.error.message||"unknown error");throw e.error.code&&(r.code=e.error.code),e.error.data&&(r.data=e.error.data),r}return e.result}function J(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function Q(e,t,n){if("call"===e&&t.code===g.Logger.errors.SERVER_ERROR){var r=t.error;if(r&&(r.message.match(/reverted/i)||r.message.match(/VM execution error/i))){var i=r.data;if(i&&(i="0x"+i.replace(/^.*0x/i,"")),(0,z.isHexString)(i))return i;W.throwError("missing revert data in call exception",g.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var a=t.message;throw t.code===g.Logger.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?a=t.error.message:"string"===typeof t.body?a=t.body:"string"===typeof t.responseText&&(a=t.responseText)),(a=(a||"").toLowerCase()).match(/insufficient funds/)&&W.throwError("insufficient funds for intrinsic transaction cost",g.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),a.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&W.throwError("nonce has already been used",g.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),a.match(/another transaction with same nonce/)&&W.throwError("replacement fee too low",g.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),a.match(/execution failed due to an exception|execution reverted/)&&W.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}var X=function(e){(0,c.Z)(n,e);var t=(0,l.Z)(n);function n(e,r){var i;return(0,o.Z)(this,n),i=t.call(this,e),(0,f.defineReadOnly)((0,u.Z)(i),"baseUrl",i.getBaseUrl()),(0,f.defineReadOnly)((0,u.Z)(i),"apiKey",r||null),i}return(0,s.Z)(n,[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return W.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(e,t){var n=Object.keys(t).reduce((function(e,n){var r=t[n];return null!=r&&(e+="&".concat(n,"=").concat(r)),e}),""),r=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(n).concat(r)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(e,t){return t.module=e,t.apikey=this.apiKey,t}},{key:"fetch",value:function(e,t,n){return V(this,void 0,void 0,(0,p.Z)().mark((function r(){var i,a,o,s,u,c,l=this;return(0,p.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=n?this.getPostUrl():this.getUrl(e,t),a=n?this.getPostData(e,t):null,o="proxy"===e?K:Y,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return l.isCommunityResource()&&(0,d.vh)(),Promise.resolve(!0)}},u=null,a&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},u=Object.keys(a).map((function(e){return"".concat(e,"=").concat(a[e])})).join("&")),r.next=9,(0,q.fetchJson)(s,u,o||K);case 9:return c=r.sent,this.emit("debug",{action:"response",request:i,response:(0,f.deepCopy)(c),provider:this}),r.abrupt("return",c);case 12:case"end":return r.stop()}}),r,this)})))}},{key:"detectNetwork",value:function(){return V(this,void 0,void 0,(0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.network);case 1:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){var r=this,i=Object.create(null,{perform:{get:function(){return(0,m.Z)((0,v.Z)(n.prototype),"perform",r)}}});return V(this,void 0,void 0,(0,p.Z)().mark((function n(){var r,a,o,s,u,c,l,f,d;return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=e,n.next="getBlockNumber"===n.t0?3:"getGasPrice"===n.t0?4:"getBalance"===n.t0?5:"getTransactionCount"===n.t0?6:"getCode"===n.t0?7:"getStorageAt"===n.t0?8:"sendTransaction"===n.t0?9:"getBlock"===n.t0?10:"getTransaction"===n.t0?13:"getTransactionReceipt"===n.t0?14:"call"===n.t0?15:"estimateGas"===n.t0?29:"getLogs"===n.t0?41:"getEtherPrice"===n.t0?65:72;break;case 3:return n.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return n.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return n.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag}));case 6:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag}));case 7:return n.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag}));case 8:return n.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag}));case 9:return n.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return Q("sendTransaction",e,t.signedTransaction)})));case 10:if(!t.blockTag){n.next=12;break}return n.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash}));case 14:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash}));case 15:if("latest"===t.blockTag){n.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(r=G(t.transaction)).module="proxy",r.action="eth_call",n.prev=20,n.next=23,this.fetch("proxy",r,!0);case 23:return n.abrupt("return",n.sent);case 26:return n.prev=26,n.t1=n.catch(20),n.abrupt("return",Q("call",n.t1,t.transaction));case 29:return(a=G(t.transaction)).module="proxy",a.action="eth_estimateGas",n.prev=32,n.next=35,this.fetch("proxy",a,!0);case 35:return n.abrupt("return",n.sent);case 38:return n.prev=38,n.t2=n.catch(32),n.abrupt("return",Q("estimateGas",n.t2,t.transaction));case 41:return o={action:"getLogs"},t.filter.fromBlock&&(o.fromBlock=J(t.filter.fromBlock)),t.filter.toBlock&&(o.toBlock=J(t.filter.toBlock)),t.filter.address&&(o.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&W.throwError("unsupported topic count",g.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"===typeof(s=t.filter.topics[0])&&66===s.length||W.throwError("unsupported topic format",g.Logger.errors.UNSUPPORTED_OPERATION,{topic0:s}),o.topic0=s)),n.next=48,this.fetch("logs",o);case 48:u=n.sent,c={},l=0;case 51:if(!(lt?null:(r+i)/2}function ae(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(y.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return ae(e)})));if("object"===typeof e){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var n=e[t];return n="function"===typeof n?"[function]":ae(n),JSON.stringify(t)+":"+n})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}var oe=1;function se(e){var t=null,n=null,r=new Promise((function(r){t=function(){n&&(clearTimeout(n),n=null),r()},n=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return r},wait:function(e){return r=r.then(e)}}}var ue=[g.Logger.errors.CALL_EXCEPTION,g.Logger.errors.INSUFFICIENT_FUNDS,g.Logger.errors.NONCE_EXPIRED,g.Logger.errors.REPLACEMENT_UNDERPRICED,g.Logger.errors.UNPREDICTABLE_GAS_LIMIT],ce=["address","args","errorArgs","errorSignature","method","transaction"];function le(e,t){var n={weight:e.weight};return Object.defineProperty(n,"provider",{get:function(){return e.provider}}),e.start&&(n.start=e.start),t&&(n.duration=t-e.start),e.done&&(e.error?n.error=e.error:n.result=e.result||null),n}function fe(e,t,n){var r=ae;switch(t){case"getBlockNumber":return function(t){var n=t.map((function(e){return e.result})),r=ie(t.map((function(e){return e.result})),2);if(null!=r)return r=Math.ceil(r),n.indexOf(r+1)>=0&&r++,r>=e._highestBlockNumber&&(e._highestBlockNumber=r),e._highestBlockNumber};case"getGasPrice":return function(e){var t=e.map((function(e){return e.result}));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return ie(e.map((function(e){return e.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":r=function(e){return null==e?null:((e=(0,f.shallowCopy)(e)).confirmations=-1,ae(e))};break;case"getBlock":r=n.includeTransactions?function(e){return null==e?null:((e=(0,f.shallowCopy)(e)).transactions=e.transactions.map((function(e){return(e=(0,f.shallowCopy)(e)).confirmations=-1,e})),ae(e))}:function(e){return null==e?null:ae(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(n){var r={};n.forEach((function(t){var n=e(t.result);r[n]||(r[n]={count:0,result:t.result}),r[n].count++}));for(var i=Object.keys(r),a=0;a=t)return o.result}}}(r,e.quorum)}function de(e,t){return ee(this,void 0,void 0,(0,p.Z)().mark((function n(){var r;return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(null!=(r=e.provider).blockNumber&&r.blockNumber>=t||-1===t)){n.next=3;break}return n.abrupt("return",r);case 3:return n.abrupt("return",(0,q.poll)((function(){return new Promise((function(n,i){setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))}),{oncePoll:r}));case 4:case"end":return n.stop()}}),n)})))}function pe(e,t,n,r){return ee(this,void 0,void 0,(0,p.Z)().mark((function i(){var a,o;return(0,p.Z)().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:a=e.provider,i.t0=n,i.next="getBlockNumber"===i.t0||"getGasPrice"===i.t0?4:"getEtherPrice"===i.t0?5:"getBalance"===i.t0||"getTransactionCount"===i.t0||"getCode"===i.t0?8:"getStorageAt"===i.t0?13:"getBlock"===i.t0?18:"call"===i.t0||"estimateGas"===i.t0?23:"getTransaction"===i.t0||"getTransactionReceipt"===i.t0?30:"getLogs"===i.t0?31:37;break;case 4:return i.abrupt("return",a[n]());case 5:if(!a.getEtherPrice){i.next=7;break}return i.abrupt("return",a.getEtherPrice());case 7:return i.abrupt("break",37);case 8:if(!r.blockTag||!(0,z.isHexString)(r.blockTag)){i.next=12;break}return i.next=11,de(e,t);case 11:a=i.sent;case 12:return i.abrupt("return",a[n](r.address,r.blockTag||"latest"));case 13:if(!r.blockTag||!(0,z.isHexString)(r.blockTag)){i.next=17;break}return i.next=16,de(e,t);case 16:a=i.sent;case 17:return i.abrupt("return",a.getStorageAt(r.address,r.position,r.blockTag||"latest"));case 18:if(!r.blockTag||!(0,z.isHexString)(r.blockTag)){i.next=22;break}return i.next=21,de(e,t);case 21:a=i.sent;case 22:return i.abrupt("return",a[r.includeTransactions?"getBlockWithTransactions":"getBlock"](r.blockTag||r.blockHash));case 23:if(!r.blockTag||!(0,z.isHexString)(r.blockTag)){i.next=27;break}return i.next=26,de(e,t);case 26:a=i.sent;case 27:if("call"!==n||!r.blockTag){i.next=29;break}return i.abrupt("return",a[n](r.transaction,r.blockTag));case 29:return i.abrupt("return",a[n](r.transaction));case 30:return i.abrupt("return",a[n](r.transactionHash));case 31:if(!((o=r.filter).fromBlock&&(0,z.isHexString)(o.fromBlock)||o.toBlock&&(0,z.isHexString)(o.toBlock))){i.next=36;break}return i.next=35,de(e,t);case 35:a=i.sent;case 36:return i.abrupt("return",a.getLogs(o));case 37:return i.abrupt("return",te.throwError("unknown method error",g.Logger.errors.UNKNOWN_ERROR,{method:n,params:r}));case 38:case"end":return i.stop()}}),i)})))}var he=function(e){(0,c.Z)(n,e);var t=(0,l.Z)(n);function n(e,i){var a;(0,o.Z)(this,n),0===e.length&&te.throwArgumentError("missing providers","providers",e);var s=e.map((function(e,t){if(r.zt.isProvider(e)){var n=(0,d.Gp)(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:n,priority:1})}var i=(0,f.shallowCopy)(e);null==i.priority&&(i.priority=1),null==i.stallTimeout&&(i.stallTimeout=(0,d.Gp)(e)?2e3:750),null==i.weight&&(i.weight=1);var a=i.weight;return(a%1||a>512||a<1)&&te.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),a),Object.freeze(i)})),c=s.reduce((function(e,t){return e+t.weight}),0);null==i?i=c/2:i>c&&te.throwArgumentError("quorum will always fail; larger than total weight","quorum",i);var l=re(s.map((function(e){return e.provider.network})));return null==l&&(l=new Promise((function(e,t){setTimeout((function(){a.detectNetwork().then(e,t)}),0)}))),a=t.call(this,l),(0,f.defineReadOnly)((0,u.Z)(a),"providerConfigs",Object.freeze(s)),(0,f.defineReadOnly)((0,u.Z)(a),"quorum",i),a._highestBlockNumber=-1,a}return(0,s.Z)(n,[{key:"detectNetwork",value:function(){return ee(this,void 0,void 0,(0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providerConfigs.map((function(e){return e.provider.getNetwork()})));case 2:return t=e.sent,e.abrupt("return",re(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return ee(this,void 0,void 0,(0,p.Z)().mark((function n(){var r,i,a,o,s,u,c,l,d,h,m=this;return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("sendTransaction"!==e){n.next=13;break}return n.next=3,Promise.all(this.providerConfigs.map((function(e){return e.provider.sendTransaction(t.signedTransaction).then((function(e){return e.hash}),(function(e){return e}))})));case 3:r=n.sent,i=0;case 5:if(!(i=m.quorum)){n.next=22;break}if(void 0===(v=o(h))){n.next=18;break}return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),n.abrupt("return",{v:v});case 18:if(l){n.next=21;break}return n.next=21,se(100).getPromise();case 21:l=!1;case 22:if(y=s.reduce((function(e,t){if(!t.done||null==t.error)return e;var n=t.error.code;return ue.indexOf(n)>=0&&(e[n]||(e[n]={error:t.error,weight:0}),e[n].weight+=t.weight),e}),{}),Object.keys(y).forEach((function(e){var t=y[e];if(!(t.weight=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&A.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}function S(e){return new Promise((function(t){setTimeout(t,e)}))}function C(e){if(e.error){var t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function O(e){return e?e.toLowerCase():e}var I={},P=function(e){(0,c.Z)(n,e);var t=(0,l.Z)(n);function n(e,r,i){var a;if((0,o.Z)(this,n),a=t.call(this),e!==I)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return(0,m.defineReadOnly)((0,u.Z)(a),"provider",r),null==i&&(i=0),"string"===typeof i?((0,m.defineReadOnly)((0,u.Z)(a),"_address",a.provider.formatter.address(i)),(0,m.defineReadOnly)((0,u.Z)(a),"_index",null)):"number"===typeof i?((0,m.defineReadOnly)((0,u.Z)(a),"_index",i),(0,m.defineReadOnly)((0,u.Z)(a),"_address",null)):A.throwArgumentError("invalid address or index","addressOrIndex",i),a}return(0,s.Z)(n,[{key:"connect",value:function(e){return A.throwError("cannot alter JSON-RPC Signer connection",g.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new R(I,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&A.throwError("unknown account #"+e._index,g.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=(0,m.shallowCopy)(e);var n=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var r=(0,m.shallowCopy)(e);r.from=n,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return k(t,void 0,void 0,(0,a.Z)().mark((function t(){var n;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.provider.resolveName(e);case 4:return null==(n=t.sent)&&A.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t,this)})))}))),(0,m.resolveProperties)({tx:(0,m.resolveProperties)(e),sender:n}).then((function(n){var r=n.tx,i=n.sender;null!=r.from?r.from.toLowerCase()!==i&&A.throwArgumentError("from address mismatch","transaction",e):r.from=i;var a=t.provider.constructor.hexlifyTransaction(r,{from:!0});return t.provider.send("eth_sendTransaction",[a]).then((function(e){return e}),(function(e){return"string"===typeof e.message&&e.message.match(/user denied/i)&&A.throwError("user rejected transaction",g.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:r}),T("sendTransaction",e,a)}))}))}},{key:"signTransaction",value:function(e){return A.throwError("signing transactions is unsupported",g.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return k(this,void 0,void 0,(0,a.Z)().mark((function t(){var n,r,i=this;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return n=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return r=t.sent,t.prev=6,t.next=9,(0,b.poll)((function(){return k(i,void 0,void 0,(0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(r);case 2:if(null!==(t=e.sent)){e.next=5;break}return e.abrupt("return",void 0);case 5:return e.abrupt("return",this.provider._wrapTransaction(t,r,n));case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider});case 9:return t.abrupt("return",t.sent);case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=r,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return k(this,void 0,void 0,(0,a.Z)().mark((function t(){var n,r;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="string"===typeof e?(0,v.Y0)(e):e,t.next=3,this.getAddress();case 3:return r=t.sent,t.prev=4,t.next=7,this.provider.send("personal_sign",[(0,p.hexlify)(n),r.toLowerCase()]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&A.throwError("user rejected signing",g.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(e){return k(this,void 0,void 0,(0,a.Z)().mark((function t(){var n,r;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="string"===typeof e?(0,v.Y0)(e):e,t.next=3,this.getAddress();case 3:return r=t.sent,t.prev=4,t.next=7,this.provider.send("eth_sign",[r.toLowerCase(),(0,p.hexlify)(n)]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&A.throwError("user rejected signing",g.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_signTypedData",value:function(e,t,n){return k(this,void 0,void 0,(0,a.Z)().mark((function r(){var i,o,s=this;return(0,a.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,h.E.resolveNames(e,t,n,(function(e){return s.provider.resolveName(e)}));case 2:return i=r.sent,r.next=5,this.getAddress();case 5:return o=r.sent,r.prev=6,r.next=9,this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(h.E.getPayload(i.domain,t,i.value))]);case 9:return r.abrupt("return",r.sent);case 12:throw r.prev=12,r.t0=r.catch(6),"string"===typeof r.t0.message&&r.t0.message.match(/user denied/i)&&A.throwError("user rejected signing",g.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:i.domain,types:t,value:i.value}}),r.t0;case 16:case"end":return r.stop()}}),r,this,[[6,12]])})))}},{key:"unlock",value:function(e){return k(this,void 0,void 0,(0,a.Z)().mark((function t(){var n,r;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.provider,t.next=3,this.getAddress();case 3:return r=t.sent,t.abrupt("return",n.send("personal_unlockAccount",[r.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),n}(f.E),R=function(e){(0,c.Z)(n,e);var t=(0,l.Z)(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"sendTransaction",value:function(e){var t=this;return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(n){return t.provider.waitForTransaction(e,n)}}}))}}]),n}(P),M={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},N=function(e){(0,c.Z)(n,e);var t=(0,l.Z)(n);function n(e,r){var i;(0,o.Z)(this,n);var a=r;return null==a&&(a=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),i=t.call(this,a),e||(e=(0,m.getStatic)(i.constructor,"defaultUrl")()),"string"===typeof e?(0,m.defineReadOnly)((0,u.Z)(i),"connection",Object.freeze({url:e})):(0,m.defineReadOnly)((0,u.Z)(i),"connection",Object.freeze((0,m.shallowCopy)(e))),i._nextId=42,i}return(0,s.Z)(n,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return k(this,void 0,void 0,(0,a.Z)().mark((function e(){var t,n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(0);case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]);case 6:t=e.sent,e.next=19;break;case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]);case 14:t=e.sent,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(11);case 19:if(null==t){e.next=28;break}return n=(0,m.getStatic)(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",n(d.O$.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",A.throwError("could not detect network",g.Logger.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",A.throwError("could not detect network",g.Logger.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new P(I,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this;return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var n=this,r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,m.deepCopy)(r),provider:this});var i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];var a=(0,b.fetchJson)(this.connection,JSON.stringify(r),C).then((function(e){return n.emit("debug",{action:"response",request:r,response:e,provider:n}),e}),(function(e){throw n.emit("debug",{action:"response",error:e,request:r,provider:n}),e}));return i&&(this._cache[e]=a,setTimeout((function(){n._cache[e]=null}),0)),a}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[O(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[O(t.address),t.blockTag]];case"getCode":return["eth_getCode",[O(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[O(t.address),(0,p.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,m.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,m.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=O(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return k(this,void 0,void 0,(0,a.Z)().mark((function n(){var r,i,o;return(0,a.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("call"!==e&&"estimateGas"!==e){n.next=8;break}if(!(r=t.transaction)||null==r.type||!d.O$.from(r.type).isZero()){n.next=8;break}if(null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas){n.next=8;break}return n.next=6,this.getFeeData();case 6:null==(i=n.sent).maxFeePerGas&&null==i.maxPriorityFeePerGas&&((t=(0,m.shallowCopy)(t)).transaction=(0,m.shallowCopy)(r),delete t.transaction.type);case 8:return null==(o=this.prepareRequest(e,t))&&A.throwError(e+" not implemented",g.Logger.errors.NOT_IMPLEMENTED,{operation:e}),n.prev=10,n.next=13,this.send(o[0],o[1]);case 13:return n.abrupt("return",n.sent);case 16:return n.prev=16,n.t0=n.catch(10),n.abrupt("return",T(e,n.t0,t));case 19:case"end":return n.stop()}}),n,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),(0,r.Z)((0,i.Z)(n.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(n){return function r(){e.send("eth_getFilterChanges",[n]).then((function(n){if(e._pendingFilter!=t)return null;var r=Promise.resolve();return n.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return S(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[n])})).catch((function(e){}))}(),n})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),(0,r.Z)((0,i.Z)(n.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var n=(0,m.shallowCopy)(M);if(t)for(var r in t)t[r]&&(n[r]=!0);(0,m.checkProperties)(e,n);var i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var n=(0,p.hexValue)(d.O$.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=n}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=(0,p.hexlify)(e[t]))})),e.accessList&&(i.accessList=(0,y.accessListify)(e.accessList)),i}}]),n}(x.Zk)},65683:function(e,t,n){"use strict";n.r(t),n.d(t,{randomBytes:function(){return r.O},shuffled:function(){return i.y}});var r=n(75722),i=n(54327)},75722:function(e,t,n){"use strict";n.d(t,{O:function(){return u}});var r=n(52009),i=n(2735),a=new i.Logger("random/5.7.0");var o=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof n.g)return n.g;throw new Error("unable to locate global object")}(),s=o.crypto||o.msCrypto;function u(e){(e<=0||e>1024||e%1||e!=e)&&a.throwArgumentError("invalid length","length",e);var t=new Uint8Array(e);return s.getRandomValues(t),(0,r.arrayify)(t)}s&&s.getRandomValues||(a.warn("WARNING: Missing strong random number source"),s={getRandomValues:function(e){return a.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},54327:function(e,t,n){"use strict";function r(e){for(var t=(e=e.slice()).length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}n.d(t,{y:function(){return r}})},80807:function(e,t,n){"use strict";n.r(t),n.d(t,{decode:function(){return d},encode:function(){return c}});var r=n(52009),i=n(2735),a=new i.Logger("rlp/5.7.0");function o(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function s(e,t,n){for(var r=0,i=0;it+1+r&&a.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:o}}function f(e,t){if(0===e.length&&a.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){var n=e[t]-247;t+1+n>e.length&&a.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});var o=s(e,t+1,n);return t+1+n+o>e.length&&a.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1+n,n+o)}if(e[t]>=192){var u=e[t]-192;return t+1+u>e.length&&a.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1,u)}if(e[t]>=184){var c=e[t]-183;t+1+c>e.length&&a.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});var f=s(e,t+1,c);return t+1+c+f>e.length&&a.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+c+f,result:(0,r.hexlify)(e.slice(t+1+c,t+1+c+f))}}if(e[t]>=128){var d=e[t]-128;return t+1+d>e.length&&a.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+d,result:(0,r.hexlify)(e.slice(t+1,t+1+d))}}return{consumed:1,result:(0,r.hexlify)(e[t])}}function d(e){var t=(0,r.arrayify)(e),n=f(t,0);return n.consumed!==t.length&&a.throwArgumentError("invalid rlp data","data",e),n.result}},24517:function(e,t,n){"use strict";n.r(t),n.d(t,{SupportedAlgorithm:function(){return i.p},computeHmac:function(){return r.Gy},ripemd160:function(){return r.bP},sha256:function(){return r.JQ},sha512:function(){return r.o}});var r=n(43984),i=n(8427)},43984:function(e,t,n){"use strict";n.d(t,{Gy:function(){return d},bP:function(){return c},JQ:function(){return l},o:function(){return f}});var r=n(37553),i=n.n(r),a=n(52009),o=n(8427),s=n(2735),u=new s.Logger("sha2/5.7.0");function c(e){return"0x"+i().ripemd160().update((0,a.arrayify)(e)).digest("hex")}function l(e){return"0x"+i().sha256().update((0,a.arrayify)(e)).digest("hex")}function f(e){return"0x"+i().sha512().update((0,a.arrayify)(e)).digest("hex")}function d(e,t,n){return o.p[e]||u.throwError("unsupported algorithm "+e,s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+i().hmac(i()[e],(0,a.arrayify)(t)).update((0,a.arrayify)(n)).digest("hex")}},8427:function(e,t,n){"use strict";var r;n.d(t,{p:function(){return r}}),function(e){e.sha256="sha256",e.sha512="sha512"}(r||(r={}))},64760:function(e,t,n){"use strict";n.r(t),n.d(t,{SigningKey:function(){return J},computePublicKey:function(){return X},recoverPublicKey:function(){return Q}});var r=n(15671),i=n(43144),a=n(83431),o=n.n(a),s=n(37553),u=n.n(s);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self&&self;function c(e,t,n){return n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&n.path)}},e(n,n.exports),n.exports}var l=f;function f(e,t){if(!e)throw new Error(t||"Assertion failed")}f.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var d=c((function(e,t){var n=t;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",n=0;n>8,o=255&i;a?n.push(a,o):n.push(o)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}})),p=c((function(e,t){var n=t;n.assert=l,n.toArray=d.toArray,n.zero2=d.zero2,n.toHex=d.toHex,n.encode=d.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,a.isubn(s)):s=0,r[o]=s,a.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var o,s,u=e.andln(3)+i&3,c=t.andln(3)+a&3;3===u&&(u=-1),3===c&&(c=-1),o=0===(1&u)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==c?u:-u,n[0].push(o),s=0===(1&c)?0:3!==(r=t.andln(7)+a&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*i===o+1&&(i=1-i),2*a===s+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new(o())(e,"hex","le")}})),h=p.getNAF,m=p.getJSF,v=p.assert;function y(e,t){this.type=e,this.p=new(o())(t.p,16),this.red=t.prime?o().red(t.prime):o().mont(this.p),this.zero=new(o())(0).toRed(this.red),this.one=new(o())(1).toRed(this.red),this.two=new(o())(2).toRed(this.red),this.n=t.n&&new(o())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var b=y;function g(e,t){this.curve=e,this.type=t,this.precomputed=null}y.prototype.point=function(){throw new Error("Not implemented")},y.prototype.validate=function(){throw new Error("Not implemented")},y.prototype._fixedNafMul=function(e,t){v(e.precomputed);var n=e._getDoubles(),r=h(t,1,this._bitLength),i=(1<=a;u--)o=(o<<1)+r[u];s.push(o)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(a=0;a=0;s--){for(var u=0;s>=0&&0===a[s];s--)u++;if(s>=0&&u++,o=o.dblp(u),s<0)break;var c=a[s];v(0!==c),o="affine"===e.type?c>0?o.mixedAdd(i[c-1>>1]):o.mixedAdd(i[-c-1>>1].neg()):c>0?o.add(i[c-1>>1]):o.add(i[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},y.prototype._wnafMulAdd=function(e,t,n,r,i){var a,o,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0;for(a=0;a=1;a-=2){var p=a-1,v=a;if(1===u[p]&&1===u[v]){var y=[t[p],null,null,t[v]];0===t[p].y.cmp(t[v].y)?(y[1]=t[p].add(t[v]),y[2]=t[p].toJ().mixedAdd(t[v].neg())):0===t[p].y.cmp(t[v].y.redNeg())?(y[1]=t[p].toJ().mixedAdd(t[v]),y[2]=t[p].add(t[v].neg())):(y[1]=t[p].toJ().mixedAdd(t[v]),y[2]=t[p].toJ().mixedAdd(t[v].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],g=m(n[p],n[v]);for(f=Math.max(g[0].length,f),l[p]=new Array(f),l[v]=new Array(f),o=0;o=0;a--){for(var E=0;a>=0;){var _=!0;for(o=0;o=0&&E++,k=k.dblp(E),a<0)break;for(o=0;o0?s=c[o][T-1>>1]:T<0&&(s=c[o][-T-1>>1].neg()),k="affine"===s.type?k.mixedAdd(s):k.add(s))}}for(a=0;a=Math.ceil((e.bitLength()+1)/t.step)},g.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i=0&&(a=t,s=n),r.negative&&(r=r.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:r,b:i},{a:a,b:s}]},k.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=i.mul(n.a),s=a.mul(r.a),u=i.mul(n.b),c=a.mul(r.b);return{k1:e.sub(o).sub(s),k2:u.add(c).neg()}},k.prototype.pointFromX=function(e,t){(e=new(o())(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},k.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},k.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},E.prototype.isInfinity=function(){return this.inf},E.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},E.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},E.prototype.getX=function(){return this.x.fromRed()},E.prototype.getY=function(){return this.y.fromRed()},E.prototype.mul=function(e){return e=new(o())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},E.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},E.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},E.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},E.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},E.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},w(_,b.BasePoint),k.prototype.jpoint=function(e,t,n){return new _(this,e,t,n)},_.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},_.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},_.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=a.redSub(o);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=r.redMul(c),d=u.redSqr().redIAdd(l).redISub(f).redISub(f),p=u.redMul(f.redISub(d)).redISub(a.redMul(l)),h=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,p,h)},_.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=n.redSub(r),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),c=u.redMul(o),l=n.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),d=s.redMul(l.redISub(f)).redISub(i.redMul(c)),p=this.z.redMul(o);return this.curve.jpoint(f,d,p)},_.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},_.prototype.inspect=function(){return this.isInfinity()?"":""},_.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var T=c((function(e,t){var n=t;n.base=b,n.short=A,n.mont=null,n.edwards=null})),S=c((function(e,t){var n,r=t,i=p.assert;function a(e){"short"===e.type?this.curve=new T.short(e):"edwards"===e.type?this.curve=new T.edwards(e):this.curve=new T.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new a(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=a,o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:u().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:u().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:u().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:u().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:u().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u().sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(s){n=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:u().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function C(e){if(!(this instanceof C))return new C(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=d.toArray(e.entropy,e.entropyEnc||"hex"),n=d.toArray(e.nonce,e.nonceEnc||"hex"),r=d.toArray(e.pers,e.persEnc||"hex");l(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var O=C;C.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},C.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=n,n=t,t=null),n&&(n=d.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"};var M=p.assert;function N(e,t){if(e instanceof N)return e;this._importDER(e,t)||(M(e.r&&e.s,"Signature without r or s"),this.r=new(o())(e.r,16),this.s=new(o())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var j=N;function L(){this.place=0}function D(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,a=0,o=t.place;a>>=0;return!(i<=127)&&(t.place=o,i)}function B(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}N.prototype._importDER=function(e,t){e=p.toArray(e,t);var n=new L;if(48!==e[n.place++])return!1;var r=D(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var i=D(e,n);if(!1===i)return!1;var a=e.slice(n.place,i+n.place);if(n.place+=i,2!==e[n.place++])return!1;var s=D(e,n);if(!1===s)return!1;if(e.length!==s+n.place)return!1;var u=e.slice(n.place,s+n.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new(o())(a),this.s=new(o())(u),this.recoveryParam=null,!0},N.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=B(t),n=B(n);!n[0]&&!(128&n[1]);)n=n.slice(1);var r=[2];U(r,t.length),(r=r.concat(t)).push(2),U(r,n.length);var i=r.concat(n),a=[48];return U(a,i.length),a=a.concat(i),p.encode(a,e)};var F=function(){throw new Error("unsupported")},Z=p.assert;function z(e){if(!(this instanceof z))return new z(e);"string"===typeof e&&(Z(Object.prototype.hasOwnProperty.call(S,e),"Unknown curve "+e),e=S[e]),e instanceof S.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var H=z;z.prototype.keyPair=function(e){return new R(this,e)},z.prototype.keyFromPrivate=function(e,t){return R.fromPrivate(this,e,t)},z.prototype.keyFromPublic=function(e,t){return R.fromPublic(this,e,t)},z.prototype.genKeyPair=function(e){e||(e={});for(var t=new O({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||F(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new(o())(2));;){var i=new(o())(t.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},z.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},z.prototype.sign=function(e,t,n,r){"object"===typeof n&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new(o())(e,16));for(var i=this.n.byteLength(),a=t.getPrivate().toArray("be",i),s=e.toArray("be",i),u=new O({hash:this.hash,entropy:a,nonce:s,pers:r.pers,persEnc:r.persEnc||"utf8"}),c=this.n.sub(new(o())(1)),l=0;;l++){var f=r.k?r.k(l):new(o())(u.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var p=d.getX(),h=p.umod(this.n);if(0!==h.cmpn(0)){var m=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var v=(d.getY().isOdd()?1:0)|(0!==p.cmp(h)?2:0);return r.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),v^=1),new j({r:h,s:m,recoveryParam:v})}}}}}},z.prototype.verify=function(e,t,n,r){e=this._truncateToN(new(o())(e,16)),n=this.keyFromPublic(n,r);var i=(t=new j(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,n.getPublic(),l)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(c,n.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},z.prototype.recoverPubKey=function(e,t,n,r){Z((3&n)===n,"The recovery param is more than two bits"),t=new j(t,r);var i=this.n,a=new(o())(e),s=t.r,u=t.s,c=1&n,l=n>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var f=t.r.invm(i),d=i.sub(a).mul(f).umod(i),p=u.mul(f).umod(i);return this.g.mulAdd(d,s,p)},z.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new j(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var q=c((function(e,t){var n=t;n.version="6.5.4",n.utils=p,n.rand=function(){throw new Error("unsupported")},n.curve=T,n.curves=S,n.ec=H,n.eddsa=null})).ec,V=n(52009),W=n(54812),G=new(n(2735).Logger)("signing-key/5.7.0"),Y=null;function K(){return Y||(Y=new q("secp256k1")),Y}var J=function(){function e(t){(0,r.Z)(this,e),(0,W.defineReadOnly)(this,"curve","secp256k1"),(0,W.defineReadOnly)(this,"privateKey",(0,V.hexlify)(t)),32!==(0,V.hexDataLength)(this.privateKey)&&G.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var n=K().keyFromPrivate((0,V.arrayify)(this.privateKey));(0,W.defineReadOnly)(this,"publicKey","0x"+n.getPublic(!1,"hex")),(0,W.defineReadOnly)(this,"compressedPublicKey","0x"+n.getPublic(!0,"hex")),(0,W.defineReadOnly)(this,"_isSigningKey",!0)}return(0,i.Z)(e,[{key:"_addPoint",value:function(e){var t=K().keyFromPublic((0,V.arrayify)(this.publicKey)),n=K().keyFromPublic((0,V.arrayify)(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=K().keyFromPrivate((0,V.arrayify)(this.privateKey)),n=(0,V.arrayify)(e);32!==n.length&&G.throwArgumentError("bad digest length","digest",e);var r=t.sign(n,{canonical:!0});return(0,V.splitSignature)({recoveryParam:r.recoveryParam,r:(0,V.hexZeroPad)("0x"+r.r.toString(16),32),s:(0,V.hexZeroPad)("0x"+r.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=K().keyFromPrivate((0,V.arrayify)(this.privateKey)),n=K().keyFromPublic((0,V.arrayify)(X(e)));return(0,V.hexZeroPad)("0x"+t.derive(n.getPublic()).toString(16),32)}}],[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}]),e}();function Q(e,t){var n=(0,V.splitSignature)(t),r={r:(0,V.arrayify)(n.r),s:(0,V.arrayify)(n.s)};return"0x"+K().recoverPubKey((0,V.arrayify)(e),r,n.recoveryParam).encode("hex",!1)}function X(e,t){var n=(0,V.arrayify)(e);if(32===n.length){var r=new J(n);return t?"0x"+K().keyFromPrivate(n).getPublic(!0,"hex"):r.publicKey}return 33===n.length?t?(0,V.hexlify)(n):"0x"+K().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?t?"0x"+K().keyFromPublic(n).getPublic(!0,"hex"):(0,V.hexlify)(n):G.throwArgumentError("invalid public or private key","key","[REDACTED]")}},83431:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(62808).Buffer}catch(C){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var a=0,o=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&o0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===n)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(C){a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),n=0!==a||o!==this.length-1?d[6-u.length]+u+n:u+n}for(0!==a&&(n=a.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=h[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(e);n=(f=f.idivn(l)).isZero()?m+n:d[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var h=c-p|0;l+=(o=(i=0|e.words[h])*(a=0|t.words[p])+f)/67108864|0,f=67108863&o}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}a.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,i),o},a.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i>8&255),n>16&255),6===a?(n>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),6===a?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,p=0|o[1],h=8191&p,m=p>>>13,v=0|o[2],y=8191&v,b=v>>>13,g=0|o[3],w=8191&g,x=g>>>13,k=0|o[4],A=8191&k,E=k>>>13,_=0|o[5],T=8191&_,S=_>>>13,C=0|o[6],O=8191&C,I=C>>>13,P=0|o[7],R=8191&P,M=P>>>13,N=0|o[8],j=8191&N,L=N>>>13,D=0|o[9],B=8191&D,U=D>>>13,F=0|s[0],Z=8191&F,z=F>>>13,H=0|s[1],q=8191&H,V=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,K=0|s[3],J=8191&K,Q=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,pe=0|s[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ve=(c+(r=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(d,Z)|0))<<13)|0;c=((a=Math.imul(d,z))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,z))+Math.imul(m,Z)|0,a=Math.imul(m,z);var ye=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((a=a+Math.imul(d,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,z))+Math.imul(b,Z)|0,a=Math.imul(b,z),r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,V)|0;var be=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,z))+Math.imul(x,Z)|0,a=Math.imul(x,z),r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,q)|0,a=a+Math.imul(b,V)|0,r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,Y)|0;var ge=(c+(r=r+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;c=((a=a+Math.imul(d,Q)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(A,Z),i=(i=Math.imul(A,z))+Math.imul(E,Z)|0,a=Math.imul(E,z),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,q)|0,a=a+Math.imul(x,V)|0,r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,Y)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Q)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,Q)|0;var we=(c+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,z))+Math.imul(S,Z)|0,a=Math.imul(S,z),r=r+Math.imul(A,q)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(E,q)|0,a=a+Math.imul(E,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Q)|0,r=r+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(d,ne)|0))<<13)|0;c=((a=a+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(O,Z),i=(i=Math.imul(O,z))+Math.imul(I,Z)|0,a=Math.imul(I,z),r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,V)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,Y)|0)+Math.imul(E,G)|0,a=a+Math.imul(E,Y)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Q)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,a=a+Math.imul(m,re)|0;var ke=(c+(r=r+Math.imul(f,ae)|0)|0)+((8191&(i=(i=i+Math.imul(f,oe)|0)+Math.imul(d,ae)|0))<<13)|0;c=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,Z),i=(i=Math.imul(R,z))+Math.imul(M,Z)|0,a=Math.imul(M,z),r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(I,q)|0,a=a+Math.imul(I,V)|0,r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(S,G)|0,a=a+Math.imul(S,Y)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,a=a+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0,r=r+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var Ae=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((a=a+Math.imul(d,ce)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,Z),i=(i=Math.imul(j,z))+Math.imul(L,Z)|0,a=Math.imul(L,z),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(M,q)|0,a=a+Math.imul(M,V)|0,r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(I,G)|0,a=a+Math.imul(I,Y)|0,r=r+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,Q)|0,r=r+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,a=a+Math.imul(x,re)|0,r=r+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(m,ue)|0,a=a+Math.imul(m,ce)|0;var Ee=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(B,Z),i=(i=Math.imul(B,z))+Math.imul(U,Z)|0,a=Math.imul(U,z),r=r+Math.imul(j,q)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(L,q)|0,a=a+Math.imul(L,V)|0,r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(M,G)|0,a=a+Math.imul(M,Y)|0,r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,Q)|0,r=r+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(E,ne)|0,a=a+Math.imul(E,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,r=r+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,a=a+Math.imul(b,ce)|0,r=r+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(m,fe)|0,a=a+Math.imul(m,de)|0;var _e=(c+(r=r+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,he)|0))<<13)|0;c=((a=a+Math.imul(d,me)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,V))+Math.imul(U,q)|0,a=Math.imul(U,V),r=r+Math.imul(j,G)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(L,G)|0,a=a+Math.imul(L,Y)|0,r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Q)|0,r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,a=a+Math.imul(S,re)|0,r=r+Math.imul(A,ae)|0,i=(i=i+Math.imul(A,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,a=a+Math.imul(x,ce)|0,r=r+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,fe)|0,a=a+Math.imul(b,de)|0;var Te=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,Y))+Math.imul(U,G)|0,a=Math.imul(U,Y),r=r+Math.imul(j,J)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,Q)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(I,ne)|0,a=a+Math.imul(I,re)|0,r=r+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,r=r+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,fe)|0,a=a+Math.imul(x,de)|0;var Se=(c+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;c=((a=a+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,Q))+Math.imul(U,J)|0,a=Math.imul(U,Q),r=r+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(M,ne)|0,a=a+Math.imul(M,re)|0,r=r+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,oe)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,oe)|0,r=r+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(S,ue)|0,a=a+Math.imul(S,ce)|0,r=r+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(E,fe)|0,a=a+Math.imul(E,de)|0;var Ce=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;c=((a=a+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,ee))+Math.imul(U,$)|0,a=Math.imul(U,ee),r=r+Math.imul(j,ne)|0,i=(i=i+Math.imul(j,re)|0)+Math.imul(L,ne)|0,a=a+Math.imul(L,re)|0,r=r+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,r=r+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(I,ue)|0,a=a+Math.imul(I,ce)|0,r=r+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(S,fe)|0,a=a+Math.imul(S,de)|0;var Oe=(c+(r=r+Math.imul(A,he)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(E,he)|0))<<13)|0;c=((a=a+Math.imul(E,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(B,ne),i=(i=Math.imul(B,re))+Math.imul(U,ne)|0,a=Math.imul(U,re),r=r+Math.imul(j,ae)|0,i=(i=i+Math.imul(j,oe)|0)+Math.imul(L,ae)|0,a=a+Math.imul(L,oe)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(M,ue)|0,a=a+Math.imul(M,ce)|0,r=r+Math.imul(O,fe)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(I,fe)|0,a=a+Math.imul(I,de)|0;var Ie=(c+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;c=((a=a+Math.imul(S,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,ae),i=(i=Math.imul(B,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),r=r+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(L,ue)|0,a=a+Math.imul(L,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(M,fe)|0,a=a+Math.imul(M,de)|0;var Pe=(c+(r=r+Math.imul(O,he)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(I,he)|0))<<13)|0;c=((a=a+Math.imul(I,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(U,ue)|0,a=Math.imul(U,ce),r=r+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,de)|0)+Math.imul(L,fe)|0,a=a+Math.imul(L,de)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(M,he)|0))<<13)|0;c=((a=a+Math.imul(M,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(B,fe),i=(i=Math.imul(B,de))+Math.imul(U,fe)|0,a=Math.imul(U,de);var Me=(c+(r=r+Math.imul(j,he)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(L,he)|0))<<13)|0;c=((a=a+Math.imul(L,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Ne=(c+(r=Math.imul(B,he))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(U,he)|0))<<13)|0;return c=((a=Math.imul(U,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=xe,u[6]=ke,u[7]=Ae,u[8]=Ee,u[9]=_e,u[10]=Te,u[11]=Se,u[12]=Ce,u[13]=Oe,u[14]=Ie,u[15]=Pe,u[16]=Re,u[17]=Me,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n._strip()}function b(e,t,n){return y(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(v=m),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?v(this,e,t):n<63?m(this,e,t):n<1024?y(this,e,t):b(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,n+=a/67108864|0,n+=o>>>26,this.words[i]=67108863&o}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new a(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-a|f>>>a,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];0!==(n=26-this._countBits(o))&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(i,d,f);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(n*i+(0|this.words[a]))%e;return t?-i:i},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*n;this.words[i]=a/e|0,n=a%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(l),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(u)):(n.isub(t),s.isub(i),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},a.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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)}x.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(k,x),k.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new A;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return w[e]=t,t},T.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=o;0!==p.cmp(s);){for(var m=p,v=0;0!==m.cmp(s);v++)m=m.redSqr();r(v=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new S(e)},i(S,T),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},46684:function(e,t,n){"use strict";n.r(t),n.d(t,{keccak256:function(){return v},pack:function(){return m},sha256:function(){return y}});var r=n(19560),i=n(52009),a=n(11291),o=n(43984),s=n(91953),u=n(2735),c=new RegExp("^bytes([0-9]+)$"),l=new RegExp("^(u?int)([0-9]*)$"),f=new RegExp("^(.*)\\[([0-9]*)\\]$"),d="0000000000000000000000000000000000000000000000000000000000000000",p=new u.Logger("solidity/5.7.0");function h(e,t,n){switch(e){case"address":return n?(0,i.zeroPad)(t,32):(0,i.arrayify)(t);case"string":return(0,s.Y0)(t);case"bytes":return(0,i.arrayify)(t);case"bool":return t=t?"0x01":"0x00",n?(0,i.zeroPad)(t,32):(0,i.arrayify)(t)}var a=e.match(l);if(a){var o=parseInt(a[2]||"256");return(a[2]&&String(o)!==a[2]||o%8!==0||0===o||o>256)&&p.throwArgumentError("invalid number type","type",e),n&&(o=256),t=r.O$.from(t).toTwos(o),(0,i.zeroPad)(t,o/8)}if(a=e.match(c)){var u=parseInt(a[1]);return(String(u)!==a[1]||0===u||u>32)&&p.throwArgumentError("invalid bytes type","type",e),(0,i.arrayify)(t).byteLength!==u&&p.throwArgumentError("invalid value for ".concat(e),"value",t),n?(0,i.arrayify)((t+d).substring(0,66)):t}if((a=e.match(f))&&Array.isArray(t)){var m=a[1];parseInt(a[2]||String(t.length))!=t.length&&p.throwArgumentError("invalid array length for ".concat(e),"value",t);var v=[];return t.forEach((function(e){v.push(h(m,e,!0))})),(0,i.concat)(v)}return p.throwArgumentError("invalid type","type",e)}function m(e,t){e.length!=t.length&&p.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);var n=[];return e.forEach((function(e,r){n.push(h(e,t[r]))})),(0,i.hexlify)((0,i.concat)(n))}function v(e,t){return(0,a.keccak256)(m(e,t))}function y(e,t){return(0,o.JQ)(m(e,t))}},18825:function(e,t,n){"use strict";n.d(t,{F:function(){return s},s:function(){return o}});var r=n(44160),i=n(52009),a=n(91953);function o(e){var t=(0,a.Y0)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([t,r.R]).slice(0,32))}function s(e){var t=(0,i.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var n=31;0===t[n-1];)n--;return(0,a.ZN)(t.slice(0,n))}},4491:function(e,t,n){"use strict";n.d(t,{Ll:function(){return h}});var r=n(91953);function i(e,t){t||(t=function(e){return[parseInt(e,16)]});var n=0,r={};return e.split(",").forEach((function(e){var i=e.split(":");n+=parseInt(i[0],16),r[n]=t(i[1])})),r}function a(e){var t=0;return e.split(",").map((function(e){var n=e.split("-");return 1===n.length?n[1]="0":""===n[1]&&(n[1]="1"),{l:t+parseInt(n[0],16),h:t=parseInt(n[1],16)}}))}function o(e,t){for(var n=0,r=0;r=(n+=i.l)&&e<=n+i.h&&(e-n)%(i.d||1)===0){if(i.e&&-1!==i.e.indexOf(e-n))continue;return i}}return null}var s=a("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),u="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),c=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],l=i("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),f=i("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),d=i("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!==0)throw new Error("bad data");for(var t=[],n=0;n=0)return[];if(e>=65024&&e<=65039)return[];var t=function(e){var t=o(e,c);if(t)return[e+t.s];var n=l[e];if(n)return n;var r=f[e];return r?[e+r[0]]:d[e]||null}(e);return t||[e]})),n=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[]),(n=(0,r.XL)((0,r.uu)(n),r.Uj.NFKC)).forEach((function(e){if(o(e,p))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),n.forEach((function(e){if(o(e,s))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var i=(0,r.uu)(n);if("-"===i.substring(0,1)||"--"===i.substring(2,4)||"-"===i.substring(i.length-1))throw new Error("invalid hyphen");return i}},52185:function(e,t,n){"use strict";n.r(t),n.d(t,{UnicodeNormalizationForm:function(){return a.Uj},Utf8ErrorFuncs:function(){return a.te},Utf8ErrorReason:function(){return a.Uw},_toEscapedUtf8String:function(){return a.U$},formatBytes32String:function(){return r.s},nameprep:function(){return i.Ll},parseBytes32String:function(){return r.F},toUtf8Bytes:function(){return a.Y0},toUtf8CodePoints:function(){return a.XL},toUtf8String:function(){return a.ZN}});var r=n(18825),i=n(4491),a=n(91953)},91953:function(e,t,n){"use strict";n.d(t,{Uj:function(){return r},te:function(){return u},Uw:function(){return i},U$:function(){return d},uu:function(){return p},Y0:function(){return l},XL:function(){return m},ZN:function(){return h}});var r,i,a=n(52009),o=new(n(2735).Logger)("strings/5.7.0");function s(e,t,n,r,a){if(e===i.BAD_PREFIX||e===i.UNEXPECTED_CONTINUE){for(var o=0,s=t+1;s>6===2;s++)o++;return o}return e===i.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(r||(r={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(i||(i={}));var u=Object.freeze({error:function(e,t,n,r,i){return o.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",n)},ignore:s,replace:function(e,t,n,r,a){return e===i.OVERLONG?(r.push(a),0):(r.push(65533),s(e,t,n))}});function c(e,t){null==t&&(t=u.error),e=(0,a.arrayify)(e);for(var n=[],r=0;r>7!==0){var s=null,c=null;if(192===(224&o))s=1,c=127;else if(224===(240&o))s=2,c=2047;else{if(240!==(248&o)){r+=t(128===(192&o)?i.UNEXPECTED_CONTINUE:i.BAD_PREFIX,r-1,e,n);continue}s=3,c=65535}if(r-1+s>=e.length)r+=t(i.OVERRUN,r-1,e,n);else{for(var l=o&(1<<8-s-1)-1,f=0;f1114111?r+=t(i.OUT_OF_RANGE,r-1-s,e,n,l):l>=55296&&l<=57343?r+=t(i.UTF16_SURROGATE,r-1-s,e,n,l):l<=c?r+=t(i.OVERLONG,r-1-s,e,n,l):n.push(l))}}else n.push(o)}return n}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.current;t!=r.current&&(o.checkNormalize(),e=e.normalize(t));for(var n=[],i=0;i>6|192),n.push(63&s|128);else if(55296==(64512&s)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!==(64512&u))throw new Error("invalid utf-8 string");var c=65536+((1023&s)<<10)+(1023&u);n.push(c>>18|240),n.push(c>>12&63|128),n.push(c>>6&63|128),n.push(63&c|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(63&s|128)}return(0,a.arrayify)(n)}function f(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function d(e,t){return'"'+c(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?f(e):f(55296+((e-=65536)>>10&1023))+f(56320+(1023&e))})).join("")+'"'}function p(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function h(e,t){return p(c(e,t))}function m(e){return c(l(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.current))}},65958:function(e,t,n){"use strict";n.r(t),n.d(t,{TransactionTypes:function(){return r},accessListify:function(){return k},computeAddress:function(){return b},parse:function(){return C},recoverAddress:function(){return g},serialize:function(){return T}});var r,i=n(28552),a=n(19560),o=n(52009),s=n(6321),u=n(11291),c=n(54812),l=n(80807),f=n(64760),d=n(2735),p=new d.Logger("transactions/5.7.0");function h(e){return"0x"===e?null:(0,i.getAddress)(e)}function m(e){return"0x"===e?s._Y:a.O$.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(r||(r={}));var v=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],y={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function b(e){var t=(0,f.computePublicKey)(e);return(0,i.getAddress)((0,o.hexDataSlice)((0,u.keccak256)((0,o.hexDataSlice)(t,1)),12))}function g(e,t){return b((0,f.recoverPublicKey)((0,o.arrayify)(e),t))}function w(e,t){var n=(0,o.stripZeros)(a.O$.from(e).toHexString());return n.length>32&&p.throwArgumentError("invalid length for "+t,"transaction:"+t,e),n}function x(e,t){return{address:(0,i.getAddress)(e),storageKeys:(t||[]).map((function(t,n){return 32!==(0,o.hexDataLength)(t)&&p.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(n,"]"),t),t.toLowerCase()}))}}function k(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&p.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),x(e[0],e[1])):x(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var n=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return x(t,Object.keys(n).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function A(e){return k(e).map((function(e){return[e.address,e.storageKeys]}))}function E(e,t){if(null!=e.gasPrice){var n=a.O$.from(e.gasPrice),r=a.O$.from(e.maxFeePerGas||0);n.eq(r)||p.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:r})}var s=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),w(e.maxFeePerGas||0,"maxFeePerGas"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,i.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",A(e.accessList||[])];if(t){var u=(0,o.splitSignature)(t);s.push(w(u.recoveryParam,"recoveryParam")),s.push((0,o.stripZeros)(u.r)),s.push((0,o.stripZeros)(u.s))}return(0,o.hexConcat)(["0x02",l.encode(s)])}function _(e,t){var n=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.gasPrice||0,"gasPrice"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,i.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",A(e.accessList||[])];if(t){var r=(0,o.splitSignature)(t);n.push(w(r.recoveryParam,"recoveryParam")),n.push((0,o.stripZeros)(r.r)),n.push((0,o.stripZeros)(r.s))}return(0,o.hexConcat)(["0x01",l.encode(n)])}function T(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&p.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,c.checkProperties)(e,y);var n=[];v.forEach((function(t){var r=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),r=(0,o.arrayify)((0,o.hexlify)(r,i)),t.length&&r.length!==t.length&&r.length>0&&p.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),t.maxLength&&(r=(0,o.stripZeros)(r)).length>t.maxLength&&p.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),n.push((0,o.hexlify)(r))}));var r=0;if(null!=e.chainId?"number"!==typeof(r=e.chainId)&&p.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!(0,o.isBytesLike)(t)&&t.v>28&&(r=Math.floor((t.v-35)/2)),0!==r&&(n.push((0,o.hexlify)(r)),n.push("0x"),n.push("0x")),!t)return l.encode(n);var i=(0,o.splitSignature)(t),a=27+i.recoveryParam;return 0!==r?(n.pop(),n.pop(),n.pop(),a+=2*r+8,i.v>28&&i.v!==a&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==a&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),n.push((0,o.hexlify)(a)),n.push((0,o.stripZeros)((0,o.arrayify)(i.r))),n.push((0,o.stripZeros)((0,o.arrayify)(i.s))),l.encode(n)}(e,t);switch(e.type){case 1:return _(e,t);case 2:return E(e,t)}return p.throwError("unsupported transaction type: ".concat(e.type),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function S(e,t,n){try{var r=m(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(a){p.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,o.hexZeroPad)(t[1],32),e.s=(0,o.hexZeroPad)(t[2],32);try{var i=(0,u.keccak256)(n(e));e.from=g(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(a){}}function C(e){var t=(0,o.arrayify)(e);if(t[0]>127)return function(e){var t=l.decode(e);9!==t.length&&6!==t.length&&p.throwArgumentError("invalid raw transaction","rawTransaction",e);var n={nonce:m(t[0]).toNumber(),gasPrice:m(t[1]),gasLimit:m(t[2]),to:h(t[3]),value:m(t[4]),data:t[5],chainId:0};if(6===t.length)return n;try{n.v=a.O$.from(t[6]).toNumber()}catch(c){return n}if(n.r=(0,o.hexZeroPad)(t[7],32),n.s=(0,o.hexZeroPad)(t[8],32),a.O$.from(n.r).isZero()&&a.O$.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);var r=n.v-27,i=t.slice(0,6);0!==n.chainId&&(i.push((0,o.hexlify)(n.chainId)),i.push("0x"),i.push("0x"),r-=2*n.chainId+8);var s=(0,u.keccak256)(l.encode(i));try{n.from=g(s,{r:(0,o.hexlify)(n.r),s:(0,o.hexlify)(n.s),recoveryParam:r})}catch(c){}n.hash=(0,u.keccak256)(e)}return n.type=null,n}(t);switch(t[0]){case 1:return function(e){var t=l.decode(e.slice(1));8!==t.length&&11!==t.length&&p.throwArgumentError("invalid component count for transaction type: 1","payload",(0,o.hexlify)(e));var n={type:1,chainId:m(t[0]).toNumber(),nonce:m(t[1]).toNumber(),gasPrice:m(t[2]),gasLimit:m(t[3]),to:h(t[4]),value:m(t[5]),data:t[6],accessList:k(t[7])};return 8===t.length||(n.hash=(0,u.keccak256)(e),S(n,t.slice(8),_)),n}(t);case 2:return function(e){var t=l.decode(e.slice(1));9!==t.length&&12!==t.length&&p.throwArgumentError("invalid component count for transaction type: 2","payload",(0,o.hexlify)(e));var n=m(t[2]),r=m(t[3]),i={type:2,chainId:m(t[0]).toNumber(),nonce:m(t[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:m(t[4]),to:h(t[5]),value:m(t[6]),data:t[7],accessList:k(t[8])};return 9===t.length||(i.hash=(0,u.keccak256)(e),S(i,t.slice(9),E)),i}(t)}return p.throwError("unsupported transaction type: ".concat(t[0]),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},18383:function(e,t,n){"use strict";n.r(t),n.d(t,{commify:function(){return o},formatEther:function(){return c},formatUnits:function(){return s},parseEther:function(){return l},parseUnits:function(){return u}});var r=n(57042),i=new(n(2735).Logger)("units/5.7.0"),a=["wei","kwei","mwei","gwei","szabo","finney","ether"];function o(e){var t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&i.throwArgumentError("invalid value","value",e);var n=t[0],r="";for("-"===n.substring(0,1)&&(r="-",n=n.substring(1));"0"===n.substring(0,1);)n=n.substring(1);""===n&&(n="0");var a="";for(2===t.length&&(a="."+(t[1]||"0"));a.length>2&&"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(var o=[];n.length;){if(n.length<=3){o.unshift(n);break}var s=n.length-3;o.unshift(n.substring(s)),n=n.substring(0,s)}return r+o.join(",")+a}function s(e,t){if("string"===typeof t){var n=a.indexOf(t);-1!==n&&(t=3*n)}return(0,r.S5)(e,null!=t?t:18)}function u(e,t){if("string"!==typeof e&&i.throwArgumentError("value must be a string","value",e),"string"===typeof t){var n=a.indexOf(t);-1!==n&&(t=3*n)}return(0,r.Ox)(e,null!=t?t:18)}function c(e){return s(e,18)}function l(e){return u(e,18)}},56204:function(e,t,n){"use strict";n.r(t),n.d(t,{Wallet:function(){return T},verifyMessage:function(){return S},verifyTypedData:function(){return C}});var r=n(74165),i=n(15671),a=n(43144),o=n(97326),s=n(60136),u=n(29388),c=n(28552),l=n(15157),f=n(72388),d=n(52009),p=n(88836),h=n(26454),m=n(42989),v=n(11291),y=n(54812),b=n(75722),g=n(64760),w=n(2691),x=n(56216),k=n(65958),A=n(2735),E=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},_=new A.Logger("wallet/5.7.0");var T=function(e){(0,s.Z)(n,e);var t=(0,u.Z)(n);function n(e,r){var a,s;if((0,i.Z)(this,n),a=t.call(this),null!=(s=e)&&(0,d.isHexString)(s.privateKey,32)&&null!=s.address){var u=new g.SigningKey(e.privateKey);if((0,y.defineReadOnly)((0,o.Z)(a),"_signingKey",(function(){return u})),(0,y.defineReadOnly)((0,o.Z)(a),"address",(0,k.computeAddress)(a.publicKey)),a.address!==(0,c.getAddress)(e.address)&&_.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){var t=e.mnemonic;return t&&t.phrase}(e)){var f=e.mnemonic;(0,y.defineReadOnly)((0,o.Z)(a),"_mnemonic",(function(){return{phrase:f.phrase,path:f.path||m.defaultPath,locale:f.locale||"en"}}));var p=a.mnemonic,h=m.HDNode.fromMnemonic(p.phrase,null,p.locale).derivePath(p.path);(0,k.computeAddress)(h.privateKey)!==a.address&&_.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,y.defineReadOnly)((0,o.Z)(a),"_mnemonic",(function(){return null}))}else{if(g.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&_.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,y.defineReadOnly)((0,o.Z)(a),"_signingKey",(function(){return e}));else{"string"===typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);var v=new g.SigningKey(e);(0,y.defineReadOnly)((0,o.Z)(a),"_signingKey",(function(){return v}))}(0,y.defineReadOnly)((0,o.Z)(a),"_mnemonic",(function(){return null})),(0,y.defineReadOnly)((0,o.Z)(a),"address",(0,k.computeAddress)(a.publicKey))}return r&&!l.zt.isProvider(r)&&_.throwArgumentError("invalid provider","provider",r),(0,y.defineReadOnly)((0,o.Z)(a),"provider",r||null),a}return(0,a.Z)(n,[{key:"mnemonic",get:function(){return this._mnemonic()}},{key:"privateKey",get:function(){return this._signingKey().privateKey}},{key:"publicKey",get:function(){return this._signingKey().publicKey}},{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"connect",value:function(e){return new n(this,e)}},{key:"signTransaction",value:function(e){var t=this;return(0,y.resolveProperties)(e).then((function(n){null!=n.from&&((0,c.getAddress)(n.from)!==t.address&&_.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete n.from);var r=t._signingKey().signDigest((0,v.keccak256)((0,k.serialize)(n)));return(0,k.serialize)(n,r)}))}},{key:"signMessage",value:function(e){return E(this,void 0,void 0,(0,r.Z)().mark((function t(){return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,d.joinSignature)(this._signingKey().signDigest((0,p.r)(e))));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"_signTypedData",value:function(e,t,n){return E(this,void 0,void 0,(0,r.Z)().mark((function i(){var a,o=this;return(0,r.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,h.E.resolveNames(e,t,n,(function(e){return null==o.provider&&_.throwError("cannot resolve ENS names without a provider",A.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),o.provider.resolveName(e)}));case 2:return a=r.sent,r.abrupt("return",(0,d.joinSignature)(this._signingKey().signDigest(h.E.hash(a.domain,t,a.value))));case 4:case"end":return r.stop()}}),i,this)})))}},{key:"encrypt",value:function(e,t,n){if("function"!==typeof t||n||(n=t,t={}),n&&"function"!==typeof n)throw new Error("invalid callback");return t||(t={}),(0,w.HI)(this,e,t,n)}}],[{key:"createRandom",value:function(e){var t=(0,b.O)(16);e||(e={}),e.extraEntropy&&(t=(0,d.arrayify)((0,d.hexDataSlice)((0,v.keccak256)((0,d.concat)([t,e.extraEntropy])),0,16)));var r=(0,m.entropyToMnemonic)(t,e.locale);return n.fromMnemonic(r,e.path,e.locale)}},{key:"fromEncryptedJson",value:function(e,t,r){return(0,x.decryptJsonWallet)(e,t,r).then((function(e){return new n(e)}))}},{key:"fromEncryptedJsonSync",value:function(e,t){return new n((0,x.decryptJsonWalletSync)(e,t))}},{key:"fromMnemonic",value:function(e,t,r){return t||(t=m.defaultPath),new n(m.HDNode.fromMnemonic(e,null,r).derivePath(t))}}]),n}(f.E);function S(e,t){return(0,k.recoverAddress)((0,p.r)(e),t)}function C(e,t,n,r){return(0,k.recoverAddress)(h.E.hash(e,t,n),r)}},28786:function(e,t,n){"use strict";n.r(t),n.d(t,{_fetchData:function(){return m},fetchJson:function(){return v},poll:function(){return y}});var r=n(74165),i=n(48853),a=n(52009),o=n(54812),s=n(91953),u=n(2735),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};function l(e,t){return c(this,void 0,void 0,(0,r.Z)().mark((function n(){var i,o,s,u,c;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t={}),i={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(i.mode="cors",i.cache="no-cache",i.credentials="same-origin",i.redirect="follow",i.referrer="client"),null!=t.fetchOptions&&((o=t.fetchOptions).mode&&(i.mode=o.mode),o.cache&&(i.cache=o.cache),o.credentials&&(i.credentials=o.credentials),o.redirect&&(i.redirect=o.redirect),o.referrer&&(i.referrer=o.referrer)),n.next=7,fetch(e,i);case 7:return s=n.sent,n.next=10,s.arrayBuffer();case 10:return u=n.sent,c={},s.headers.forEach?s.headers.forEach((function(e,t){c[t.toLowerCase()]=e})):s.headers.keys().forEach((function(e){c[e.toLowerCase()]=s.headers.get(e)})),n.abrupt("return",{headers:c,statusCode:s.status,statusMessage:s.statusText,body:(0,a.arrayify)(new Uint8Array(u))});case 14:case"end":return n.stop()}}),n)})))}var f=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},d=new u.Logger("web/5.7.1");function p(e){return new Promise((function(t){setTimeout(t,e)}))}function h(e,t){if(null==e)return null;if("string"===typeof e)return e;if((0,a.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,s.ZN)(e)}catch(n){}return(0,a.hexlify)(e)}return e}function m(e,t,n){var a="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;d.assertArgument(a>0&&a%1===0,"invalid connection throttle limit","connection.throttleLimit",a);var c="object"===typeof e?e.throttleCallback:null,m="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;d.assertArgument(m>0&&m%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",m);var v="object"===typeof e&&!!e.errorPassThrough,y={},b=null,g={method:"GET"},w=!1,x=12e4;if("string"===typeof e)b=e;else if("object"===typeof e){if(null!=e&&null!=e.url||d.throwArgumentError("missing URL","connection.url",e),b=e.url,"number"===typeof e.timeout&&e.timeout>0&&(x=e.timeout),e.headers)for(var k in e.headers)y[k.toLowerCase()]={key:k,value:String(e.headers[k])},["if-none-match","if-modified-since"].indexOf(k.toLowerCase())>=0&&(w=!0);if(g.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==b.substring(0,6)&&!0!==e.allowInsecureAuthentication&&d.throwError("basic authentication requires a secure https url",u.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:b,user:e.user,password:"[REDACTED]"});var A=e.user+":"+e.password;y.authorization={key:"Authorization",value:"Basic "+(0,i.c)((0,s.Y0)(A))}}null!=e.skipFetchSetup&&(g.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(g.fetchOptions=(0,o.shallowCopy)(e.fetchOptions))}var E,_=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),T=b?b.match(_):null;if(T)try{var S={statusCode:200,statusMessage:"OK",headers:{"content-type":T[1]||"text/plain"},body:T[2]?(0,i.J)(T[3]):(E=T[3],(0,s.Y0)(E.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},C=S.body;return n&&(C=n(S.body,S)),Promise.resolve(C)}catch(R){d.throwError("processing response error",u.Logger.errors.SERVER_ERROR,{body:h(T[1],T[2]),error:R,requestBody:null,requestMethod:"GET",url:b})}t&&(g.method="POST",g.body=t,null==y["content-type"]&&(y["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==y["content-length"]&&(y["content-length"]={key:"Content-Length",value:String(t.length)}));var O={};Object.keys(y).forEach((function(e){var t=y[e];O[t.key]=t.value})),g.headers=O;var I=function(){var e=null;return{promise:new Promise((function(t,n){x&&(e=setTimeout((function(){null!=e&&(e=null,n(d.makeError("timeout",u.Logger.errors.TIMEOUT,{requestBody:h(g.body,O["content-type"]),requestMethod:g.method,timeout:x,url:b})))}),x))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),P=function(){return f(this,void 0,void 0,(0,r.Z)().mark((function e(){var t,i,o,s,f,y,x,k,A,E;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t=300)&&(I.cancel(),d.throwError("bad response",u.Logger.errors.SERVER_ERROR,{status:i.statusCode,headers:i.headers,body:h(x,i.headers?i.headers["content-type"]:null),requestBody:h(g.body,O["content-type"]),requestMethod:g.method,url:b})),!n){e.next=60;break}return e.prev=37,e.next=40,n(x,i);case 40:return k=e.sent,I.cancel(),e.abrupt("return",k);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&ts)return void(o()&&r(new Error("retry limit reached")));var c=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));ct.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){o()&&r(e)}))}()}))}},10581:function(e,t,n){"use strict";n.d(t,{D:function(){return c}});var r=n(15671),i=n(43144),a=n(93358),o=n(54812),s=n(2735),u=new s.Logger("wordlists/5.7.0"),c=function(){function e(t){(0,r.Z)(this,e),u.checkAbstract(this instanceof e?this.constructor:void 0,e),(0,o.defineReadOnly)(this,"locale",t)}return(0,i.Z)(e,[{key:"split",value:function(e){return e.toLowerCase().split(/ +/g)}},{key:"join",value:function(e){return e.join(" ")}}],[{key:"check",value:function(e){for(var t=[],n=0;n<2048;n++){var r=e.getWord(n);if(n!==e.getWordIndex(r))return"0x";t.push(r)}return(0,a.id)(t.join("\n")+"\n")}},{key:"register",value:function(e,t){t||(t=e.locale)}}]),e}()},53771:function(e,t,n){"use strict";n.d(t,{E:function(){return f}});var r=n(15671),i=n(43144),a=n(60136),o=n(29388),s=n(10581),u=null;function c(e){if(null==u&&(u="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==s.D.check(e)))throw u=null,new Error("BIP39 Wordlist for en (English) FAILED")}var l=new(function(e){(0,a.Z)(n,e);var t=(0,o.Z)(n);function n(){return(0,r.Z)(this,n),t.call(this,"en")}return(0,i.Z)(n,[{key:"getWord",value:function(e){return c(this),u[e]}},{key:"getWordIndex",value:function(e){return c(this),u.indexOf(e)}}]),n}(s.D));s.D.register(l);var f={en:l}},63811:function(e){"use strict";e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mustBeMetaMask,n=void 0!==t&&t,r=e.silent,i=void 0!==r&&r,a=e.timeout,o=void 0===a?3e3:a;!function(){if("boolean"!==typeof n)throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if("boolean"!==typeof i)throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if("number"!==typeof o)throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}();var s=!1;return new Promise((function(e){function t(){if(!s){s=!0,window.removeEventListener("ethereum#initialized",t);var r=window.ethereum;if(!r||n&&!r.isMetaMask){var a=n&&r?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum.";!i&&console.error("@metamask/detect-provider:",a),e(null)}else e(r)}}window.ethereum?t():(window.addEventListener("ethereum#initialized",t,{once:!0}),setTimeout((function(){t()}),o))}))}},4609:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default,a=n(61655).default,o=n(26389).default;function s(e,t,n){try{Reflect.apply(e,t,n)}catch(r){setTimeout((function(){throw r}))}}Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){a(n,e);var t=o(n);function n(){return r(this,n),t.apply(this,arguments)}return i(n,[{key:"emit",value:function(e){var t="error"===e,n=this._events;if(void 0!==n)t=t&&void 0===n.error;else if(!t)return!1;for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a0&&(o=i[0]),o instanceof Error)throw o;var u=new Error("Unhandled error.".concat(o?" (".concat(o.message,")"):""));throw u.context=o,u}var c=n[e];if(void 0===c)return!1;if("function"===typeof c)s(c,this,i);else for(var l=c.length,f=function(e){for(var t=e.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:"Assertion failed.";if(!e){if(t instanceof Error)throw t;throw c(arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,t)}},t.assertStruct=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Assertion failed",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l;try{(0,u.assert)(e,t)}catch(i){throw c(r,"".concat(n,": ").concat(function(e){var t=function(e){return"object"===typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(i),"."))}},t.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},12802:function(e,t,n){"use strict";var r,i,a=n(59400).default;Object.defineProperty(t,"__esModule",{value:!0}),t.base64=void 0;var o=n(62746),s=n(35517);t.base64=function(e){var t,n,u,c,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=null!==(t=l.paddingRequired)&&void 0!==t&&t,d=null!==(n=l.characterSet)&&void 0!==n?n:"base64";return"base64"===d?u=String.raw(r||(r=a(["[A-Za-z0-9+/]"],["[A-Za-z0-9+\\/]"]))):((0,s.assert)("base64url"===d),u=String.raw(i||(i=a(["[-_A-Za-z0-9]"])))),c=f?new RegExp("^(?:".concat(u,"{4})*(?:").concat(u,"{3}=|").concat(u,"{2}==)?$"),"u"):new RegExp("^(?:".concat(u,"{4})*(?:").concat(u,"{2,3}|").concat(u,"{3}=|").concat(u,"{2}==)?$"),"u"),(0,o.pattern)(e,c)}},53310:function(e,t,n){"use strict";var r=n(74704).default;Object.defineProperty(t,"__esModule",{value:!0}),t.createDataView=t.concatBytes=t.valueToBytes=t.stringToBytes=t.numberToBytes=t.signedBigIntToBytes=t.bigIntToBytes=t.hexToBytes=t.bytesToString=t.bytesToNumber=t.bytesToSignedBigInt=t.bytesToBigInt=t.bytesToHex=t.assertIsBytes=t.isBytes=void 0;var i=n(35517),a=n(26135),o=48,s=58,u=87;var c=function(){var e=[];return function(){if(0===e.length)for(var t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function l(e){return e instanceof Uint8Array}function f(e){(0,i.assert)(l(e),"Value must be a Uint8Array.")}function d(e){if(f(e),0===e.length)return"0x";for(var t=c(),n=new Array(e.length),r=0;r=BigInt(0),"Value must be a non-negative bigint."),h(e.toString(16))}function v(e){return(0,i.assert)("number"===typeof e,"Value must be a number."),(0,i.assert)(e>=0,"Value must be a non-negative number."),(0,i.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),h(e.toString(16))}function y(e){return(0,i.assert)("string"===typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function b(e){if("bigint"===typeof e)return m(e);if("number"===typeof e)return v(e);if("string"===typeof e)return e.startsWith("0x")?h(e):y(e);if(l(e))return e;throw new TypeError('Unsupported value type: "'.concat(typeof e,'".'))}t.isBytes=l,t.assertIsBytes=f,t.bytesToHex=d,t.bytesToBigInt=p,t.bytesToSignedBigInt=function(e){f(e);var t,n=BigInt(0),i=r(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;n=(n<0,"Byte length must be greater than 0."),(0,i.assert)(function(e,t){(0,i.assert)(t>0);var n=e>>BigInt(31);return!((~e&n)+(e&~n)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");for(var n=e,r=new Uint8Array(t),a=0;a>=BigInt(8);return r.reverse()},t.numberToBytes=v,t.stringToBytes=y,t.valueToBytes=b,t.concatBytes=function(e){for(var t=new Array(e.length),n=0,r=0;r0?" ".concat(o(this.entries()).map((function(e){var t=a(e,2),n=t[0],r=t[1];return"".concat(String(n)," => ").concat(String(r))})).join(", ")," "):"","}")}}]),t}((r=new WeakMap,Symbol.iterator));t.FrozenMap=f;var d=function(e){function t(e){s(this,t),i.set(this,void 0),c(this,i,new Set(e),"f"),Object.freeze(this)}return u(t,[{key:"size",get:function(){return l(this,i,"f").size}},{key:e,value:function(){return l(this,i,"f")[Symbol.iterator]()}},{key:"entries",value:function(){return l(this,i,"f").entries()}},{key:"forEach",value:function(e,t){var n=this;return l(this,i,"f").forEach((function(r,i,a){return e.call(t,r,i,n)}))}},{key:"has",value:function(e){return l(this,i,"f").has(e)}},{key:"keys",value:function(){return l(this,i,"f").keys()}},{key:"values",value:function(){return l(this,i,"f").values()}},{key:"toString",value:function(){return"FrozenSet(".concat(this.size,") {").concat(this.size>0?" ".concat(o(this.values()).map((function(e){return String(e)})).join(", ")," "):"","}")}}]),t}((i=new WeakMap,Symbol.iterator));t.FrozenSet=d,Object.freeze(f),Object.freeze(f.prototype),Object.freeze(d),Object.freeze(d.prototype)},26135:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;var r=n(62746),i=n(35517);function a(e){return(0,r.is)(e,t.HexStruct)}function o(e){return(0,r.is)(e,t.StrictHexStruct)}t.HexStruct=(0,r.pattern)((0,r.string)(),/^(?:0x)?[0-9a-f]+$/i),t.StrictHexStruct=(0,r.pattern)((0,r.string)(),/^0x[0-9a-f]+$/i),t.isHexString=a,t.isStrictHexString=o,t.assertIsHexString=function(e){(0,i.assert)(a(e),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(e){(0,i.assert)(o(e),'Value must be a hexadecimal string, starting with "0x".')},t.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?"0x".concat(e.substring(2)):"0x".concat(e)},t.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}},95533:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35517),t),i(n(12802),t),i(n(53310),t),i(n(78531),t),i(n(70854),t),i(n(72465),t),i(n(26135),t),i(n(18420),t),i(n(88859),t),i(n(96013),t),i(n(3913),t),i(n(70304),t),i(n(57519),t),i(n(81482),t)},18420:function(e,t,n){"use strict";var r=n(27424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;var i=n(62746),a=n(35517),o=n(96013);function s(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Set;return function e(t,i){if(void 0===t)return[!1,0];if(null===t)return[!0,i?0:o.JsonSize.Null];var a=typeof t;try{if("function"===a)return[!1,0];if("string"===a||t instanceof String)return[!0,i?0:(0,o.calculateStringSize)(t)+2*o.JsonSize.Quote];if("boolean"===a||t instanceof Boolean)return i?[!0,0]:[!0,1==t?o.JsonSize.True:o.JsonSize.False];if("number"===a||t instanceof Number)return i?[!0,0]:[!0,(0,o.calculateNumberSize)(t)];if(t instanceof Date)return i?[!0,0]:[!0,isNaN(t.getDate())?o.JsonSize.Null:o.JsonSize.Date+2*o.JsonSize.Quote]}catch(s){return[!1,0]}if(!(0,o.isPlainObject)(t)&&!Array.isArray(t))return[!1,0];if(n.has(t))return[!1,0];n.add(t);try{return[!0,Object.entries(t).reduce((function(a,s,u,c){var l=r(s,2),f=l[0],d=e(l[1],i),p=r(d,2),h=p[0],m=p[1];if(!h)throw new Error("JSON validation did not pass. Validation process stopped.");return n.delete(t),i?0:a+(Array.isArray(t)?0:f.length+o.JsonSize.Comma+2*o.JsonSize.Colon)+m+(u0)||i&&null===e)}},t.validateJsonAndGetSize=s},88859:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.createProjectLogger=void 0;var i=(0,r(n(44054)).default)("metamask");t.createProjectLogger=function(e){return i.extend(e)},t.createModuleLogger=function(e,t){return e.extend(t)}},96013:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0,t.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},t.isNullOrUndefined=function(e){return null===e||void 0===e},t.isObject=function(e){return Boolean(e)&&"object"===typeof e&&!Array.isArray(e)};function n(e){return e.charCodeAt(0)<=127}t.hasProperty=function(e,t){return Object.hasOwnProperty.call(e,t)},function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/g,t.isPlainObject=function(e){if("object"!==typeof e||null===e)return!1;try{for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(n){return!1}},t.isASCII=n,t.calculateStringSize=function(e){var r;return e.split("").reduce((function(e,t){return n(t)?e+1:e+2}),0)+(null!==(r=e.match(t.ESCAPE_CHARACTERS_REGEXP))&&void 0!==r?r:[]).length},t.calculateNumberSize=function(e){return e.toString().length}},3913:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBigInt=t.hexToNumber=t.bigIntToHex=t.numberToHex=void 0;var r=n(35517),i=n(26135);t.numberToHex=function(e){return(0,r.assert)("number"===typeof e,"Value must be a number."),(0,r.assert)(e>=0,"Value must be a non-negative number."),(0,r.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,i.add0x)(e.toString(16))};t.bigIntToHex=function(e){return(0,r.assert)("bigint"===typeof e,"Value must be a bigint."),(0,r.assert)(e>=0,"Value must be a non-negative bigint."),(0,i.add0x)(e.toString(16))};t.hexToNumber=function(e){(0,i.assertIsHexString)(e);var t=parseInt(e,16);return(0,r.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};t.hexToBigInt=function(e){return(0,i.assertIsHexString)(e),BigInt((0,i.add0x)(e))}},70304:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},57519:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));var n=function(e,t){if(!function(e){return Number.isInteger(e)&&e>=0}(e))throw new Error('"'.concat(t,'" must be a non-negative integer. Received: "').concat(e,'".'))};t.inMilliseconds=function(e,t){return n(e,"count"),e*t},t.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}},81482:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;var r=n(26931),i=n(62746),a=n(35517);t.VersionStruct=(0,i.refine)((0,i.string)(),"Version",(function(e){return null!==(0,r.valid)(e)||'Expected SemVer version, got "'.concat(e,'"')})),t.VersionRangeStruct=(0,i.refine)((0,i.string)(),"Version range",(function(e){return null!==(0,r.validRange)(e)||'Expected SemVer range, got "'.concat(e,'"')})),t.isValidSemVerVersion=function(e){return(0,i.is)(e,t.VersionStruct)},t.isValidSemVerRange=function(e){return(0,i.is)(e,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(e){(0,a.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,a.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(e,t){return(0,r.gt)(e,t)},t.gtRange=function(e,t){return(0,r.gtr)(e,t)},t.satisfiesVersionRange=function(e,t){return(0,r.satisfies)(e,t,{includePrerelease:!0})}},76756:function(e,t,n){var r=n(56690).default,i=n(89728).default,a=Symbol("SemVer ANY"),o=function(){"use strict";function e(t,n){if(r(this,e),n=s(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}d("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===a?this.value="":this.value=this.operator+this.semver.version,d("comp",this)}return i(e,[{key:"parse",value:function(e){var t=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new p(n[2],this.options.loose):this.semver=a}},{key:"toString",value:function(){return this.value}},{key:"test",value:function(e){if(d("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"===typeof e)try{e=new p(e,this.options)}catch(t){return!1}return f(e,this.operator,this.semver,this.options)}},{key:"intersects",value:function(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new h(t.value,n).test(this.value):""===t.operator?""===t.value||new h(this.value,n).test(t.semver):(!(n=s(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==t.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!t.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!t.operator.startsWith("<"))||(!(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))||(!!(f(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))||!!(f(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))))))}}],[{key:"ANY",get:function(){return a}}]),e}();e.exports=o;var s=n(45505),u=n(60997),c=u.re,l=u.t,f=n(24671),d=n(91050),p=n(95210),h=n(84999)},84999:function(e,t,n){var r=n(861).default,i=n(74704).default,a=n(56690).default,o=n(89728).default,s=function(){"use strict";function e(t,n){var r=this;if(a(this,e),n=c(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof l)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t,this.set=t.split("||").map((function(e){return r.parseRange(e.trim())})).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(t));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(e){return!k(e[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var s,u=i(this.set);try{for(u.s();!(s=u.n()).done;){var f=s.value;if(1===f.length&&A(f[0])){this.set=[f];break}}}catch(d){u.e(d)}finally{u.f()}}}this.format()}return o(e,[{key:"format",value:function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(e){var t=this;e=e.trim();var n=((this.options.includePrerelease&&w)|(this.options.loose&&x))+":"+e,a=u.get(n);if(a)return a;var o=this.options.loose,s=o?h[m.HYPHENRANGELOOSE]:h[m.HYPHENRANGE];e=e.replace(s,j(this.options.includePrerelease)),f("hyphen replace",e),e=e.replace(h[m.COMPARATORTRIM],v),f("comparator trim",e);var c=(e=(e=(e=e.replace(h[m.TILDETRIM],y)).replace(h[m.CARETTRIM],b)).split(/\s+/).join(" ")).split(" ").map((function(e){return _(e,t.options)})).join(" ").split(/\s+/).map((function(e){return N(e,t.options)}));o&&(c=c.filter((function(e){return f("loose invalid filter",e,t.options),!!e.match(h[m.COMPARATORLOOSE])}))),f("range list",c);var d,p=new Map,g=c.map((function(e){return new l(e,t.options)})),A=i(g);try{for(A.s();!(d=A.n()).done;){var E=d.value;if(k(E))return[E];p.set(E.value,E)}}catch(S){A.e(S)}finally{A.f()}p.size>1&&p.has("")&&p.delete("");var T=r(p.values());return u.set(n,T),T}},{key:"intersects",value:function(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((function(e){return E(e,n)&&t.set.some((function(t){return E(t,n)&&e.every((function(e){return t.every((function(t){return e.intersects(t,n)}))}))}))}))}},{key:"test",value:function(e){if(!e)return!1;if("string"===typeof e)try{e=new d(e,this.options)}catch(n){return!1}for(var t=0;t=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):o?(f("replaceCaret pr",o),s="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(a,"-").concat(o," <").concat(n,".").concat(i,".").concat(+a+1,"-0"):">=".concat(n,".").concat(i,".").concat(a,"-").concat(o," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(a,"-").concat(o," <").concat(+n+1,".0.0-0")):(f("no pr"),s="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(a).concat(r," <").concat(n,".").concat(i,".").concat(+a+1,"-0"):">=".concat(n,".").concat(i,".").concat(a).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(a," <").concat(+n+1,".0.0-0")),f("caret return",s),s}))},P=function(e,t){return f("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return R(e,t)})).join(" ")},R=function(e,t){e=e.trim();var n=t.loose?h[m.XRANGELOOSE]:h[m.XRANGE];return e.replace(n,(function(n,r,i,a,o,s){f("xRange",e,n,r,i,a,o,s);var u=T(i),c=u||T(a),l=c||T(o),d=l;return"="===r&&d&&(r=""),s=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),o=0,">"===r?(r=">=",c?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(s="-0"),n="".concat(r+i,".").concat(a,".").concat(o).concat(s)):c?n=">=".concat(i,".0.0").concat(s," <").concat(+i+1,".0.0-0"):l&&(n=">=".concat(i,".").concat(a,".0").concat(s," <").concat(i,".").concat(+a+1,".0-0")),f("xRange return",n),n}))},M=function(e,t){return f("replaceStars",e,t),e.trim().replace(h[m.STAR],"")},N=function(e,t){return f("replaceGTE0",e,t),e.trim().replace(h[t.includePrerelease?m.GTE0PRE:m.GTE0],"")},j=function(e){return function(t,n,r,i,a,o,s,u,c,l,f,d,p){return n=T(r)?"":T(i)?">=".concat(r,".0.0").concat(e?"-0":""):T(a)?">=".concat(r,".").concat(i,".0").concat(e?"-0":""):o?">=".concat(n):">=".concat(n).concat(e?"-0":""),u=T(c)?"":T(l)?"<".concat(+c+1,".0.0-0"):T(f)?"<".concat(c,".").concat(+l+1,".0-0"):d?"<=".concat(c,".").concat(l,".").concat(f,"-").concat(d):e?"<".concat(c,".").concat(l,".").concat(+f+1,"-0"):"<=".concat(u),"".concat(n," ").concat(u).trim()}},L=function(e,t,n){for(var r=0;r0){var a=e[i].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},95210:function(e,t,n){var r=n(56690).default,i=n(89728).default,a=n(91050),o=n(12319),s=o.MAX_LENGTH,u=o.MAX_SAFE_INTEGER,c=n(60997),l=c.re,f=c.t,d=n(45505),p=n(61068).compareIdentifiers,h=function(){"use strict";function e(t,n){if(r(this,e),n=d(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!==typeof t)throw new TypeError('Invalid version. Must be a string. Got type "'.concat(typeof t,'".'));if(t.length>s)throw new TypeError("version is longer than ".concat(s," characters"));a("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var i=t.trim().match(n.loose?l[f.LOOSE]:l[f.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(t));if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>u||this.major<0)throw new TypeError("Invalid major version");if(this.minor>u||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>u||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"===typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(t){var a=[t,r];!1===n&&(a=[t]),0===p(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}}]),e}();e.exports=h},51976:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},24671:function(e,t,n){var r=n(90416),i=n(33962),a=n(18930),o=n(50316),s=n(93991),u=n(94838);e.exports=function(e,t,n,c){switch(t){case"===":return"object"===typeof e&&(e=e.version),"object"===typeof n&&(n=n.version),e===n;case"!==":return"object"===typeof e&&(e=e.version),"object"===typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,c);case"!=":return i(e,n,c);case">":return a(e,n,c);case">=":return o(e,n,c);case"<":return s(e,n,c);case"<=":return u(e,n,c);default:throw new TypeError("Invalid operator: ".concat(t))}}},47021:function(e,t,n){var r=n(95210),i=n(84342),a=n(60997),o=a.re,s=a.t;e.exports=function(e,t){if(e instanceof r)return e;if("number"===typeof e&&(e=String(e)),"string"!==typeof e)return null;var n=null;if((t=t||{}).rtl){for(var a;(a=o[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&a.index+a[0].length===n.index+n[0].length||(n=a),o[s.COERCERTL].lastIndex=a.index+a[1].length+a[2].length;o[s.COERCERTL].lastIndex=-1}else n=e.match(o[s.COERCE]);return null===n?null:i("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),t)}},24046:function(e,t,n){var r=n(95210);e.exports=function(e,t,n){var i=new r(e,n),a=new r(t,n);return i.compare(a)||i.compareBuild(a)}},76858:function(e,t,n){var r=n(34324);e.exports=function(e,t){return r(e,t,!0)}},34324:function(e,t,n){var r=n(95210);e.exports=function(e,t,n){return new r(e,n).compare(new r(t,n))}},82190:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e,null,!0),i=r(t,null,!0),a=n.compare(i);if(0===a)return null;var o=a>0,s=o?i:n,u=!!(o?n:i).prerelease.length,c=u?"pre":"";return n.major!==i.major?c+"major":n.minor!==i.minor?c+"minor":n.patch!==i.patch?c+"patch":u?"prerelease":s.patch?"patch":s.minor?"minor":"major"}},90416:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return 0===r(e,t,n)}},18930:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)>0}},50316:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)>=0}},75950:function(e,t,n){var r=n(95210);e.exports=function(e,t,n,i,a){"string"===typeof n&&(a=i,i=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,i,a).version}catch(o){return null}}},93991:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)<0}},94838:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)<=0}},99881:function(e,t,n){var r=n(95210);e.exports=function(e,t){return new r(e,t).major}},36925:function(e,t,n){var r=n(95210);e.exports=function(e,t){return new r(e,t).minor}},33962:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return 0!==r(e,t,n)}},84342:function(e,t,n){var r=n(95210);e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e instanceof r)return e;try{return new r(e,t)}catch(i){if(!n)return null;throw i}}},99149:function(e,t,n){var r=n(95210);e.exports=function(e,t){return new r(e,t).patch}},36090:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},35008:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(t,e,n)}},13536:function(e,t,n){var r=n(24046);e.exports=function(e,t){return e.sort((function(e,n){return r(n,e,t)}))}},25656:function(e,t,n){var r=n(84999);e.exports=function(e,t,n){try{t=new r(t,n)}catch(i){return!1}return t.test(e)}},9210:function(e,t,n){var r=n(24046);e.exports=function(e,t){return e.sort((function(e,n){return r(e,n,t)}))}},16038:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e,t);return n?n.version:null}},26931:function(e,t,n){var r=n(60997),i=n(12319),a=n(95210),o=n(61068),s=n(84342),u=n(16038),c=n(51976),l=n(75950),f=n(82190),d=n(99881),p=n(36925),h=n(99149),m=n(36090),v=n(34324),y=n(35008),b=n(76858),g=n(24046),w=n(9210),x=n(13536),k=n(18930),A=n(93991),E=n(90416),_=n(33962),T=n(50316),S=n(94838),C=n(24671),O=n(47021),I=n(76756),P=n(84999),R=n(25656),M=n(32212),N=n(46395),j=n(80213),L=n(34869),D=n(40857),B=n(65704),U=n(7566),F=n(52928),Z=n(22480),z=n(50772),H=n(99180);e.exports={parse:s,valid:u,clean:c,inc:l,diff:f,major:d,minor:p,patch:h,prerelease:m,compare:v,rcompare:y,compareLoose:b,compareBuild:g,sort:w,rsort:x,gt:k,lt:A,eq:E,neq:_,gte:T,lte:S,cmp:C,coerce:O,Comparator:I,Range:P,satisfies:R,toComparators:M,maxSatisfying:N,minSatisfying:j,minVersion:L,validRange:D,outside:B,gtr:U,ltr:F,intersects:Z,simplifyRange:z,subset:H,SemVer:a,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},12319:function(e){var t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},91050:function(e){var t="object"===typeof process&&{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/6hnvSmry5GBrjanXK4WTHbqjFKTqBwcodwY8QnQU3ojt",REACT_APP_PORTIS_ID:"",REACT_APP_FORTMATIC_KEY:"",REACT_APP_GOOGLE_ANALYTICS_ID:"G-8RHNLJ21N1"}.NODE_DEBUG&&/\bsemver\b/i.test({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/6hnvSmry5GBrjanXK4WTHbqjFKTqBwcodwY8QnQU3ojt",REACT_APP_PORTIS_ID:"",REACT_APP_FORTMATIC_KEY:"",REACT_APP_GOOGLE_ANALYTICS_ID:"G-8RHNLJ21N1"}.NODE_DEBUG)?function(){for(var e,t=arguments.length,n=new Array(t),r=0;r)?=?)"),c("XRANGEIDENTIFIERLOOSE","".concat(o[s.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),c("XRANGEIDENTIFIER","".concat(o[s.NUMERICIDENTIFIER],"|x|X|\\*")),c("XRANGEPLAIN","[v=\\s]*(".concat(o[s.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(o[s.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(o[s.XRANGEIDENTIFIER],")")+"(?:".concat(o[s.PRERELEASE],")?").concat(o[s.BUILD],"?")+")?)?"),c("XRANGEPLAINLOOSE","[v=\\s]*(".concat(o[s.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(o[s.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(o[s.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(o[s.PRERELEASELOOSE],")?").concat(o[s.BUILD],"?")+")?)?"),c("XRANGE","^".concat(o[s.GTLT],"\\s*").concat(o[s.XRANGEPLAIN],"$")),c("XRANGELOOSE","^".concat(o[s.GTLT],"\\s*").concat(o[s.XRANGEPLAINLOOSE],"$")),c("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(r,"})")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:$|[^\\d])"),c("COERCERTL",o[s.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM","(\\s*)".concat(o[s.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",c("TILDE","^".concat(o[s.LONETILDE]).concat(o[s.XRANGEPLAIN],"$")),c("TILDELOOSE","^".concat(o[s.LONETILDE]).concat(o[s.XRANGEPLAINLOOSE],"$")),c("LONECARET","(?:\\^)"),c("CARETTRIM","(\\s*)".concat(o[s.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",c("CARET","^".concat(o[s.LONECARET]).concat(o[s.XRANGEPLAIN],"$")),c("CARETLOOSE","^".concat(o[s.LONECARET]).concat(o[s.XRANGEPLAINLOOSE],"$")),c("COMPARATORLOOSE","^".concat(o[s.GTLT],"\\s*(").concat(o[s.LOOSEPLAIN],")$|^$")),c("COMPARATOR","^".concat(o[s.GTLT],"\\s*(").concat(o[s.FULLPLAIN],")$|^$")),c("COMPARATORTRIM","(\\s*)".concat(o[s.GTLT],"\\s*(").concat(o[s.LOOSEPLAIN],"|").concat(o[s.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE","^\\s*(".concat(o[s.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(o[s.XRANGEPLAIN],")")+"\\s*$"),c("HYPHENRANGELOOSE","^\\s*(".concat(o[s.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(o[s.XRANGEPLAINLOOSE],")")+"\\s*$"),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7566:function(e,t,n){var r=n(65704);e.exports=function(e,t,n){return r(e,t,">",n)}},22480:function(e,t,n){var r=n(84999);e.exports=function(e,t,n){return e=new r(e,n),t=new r(t,n),e.intersects(t,n)}},52928:function(e,t,n){var r=n(65704);e.exports=function(e,t,n){return r(e,t,"<",n)}},46395:function(e,t,n){var r=n(95210),i=n(84999);e.exports=function(e,t,n){var a=null,o=null,s=null;try{s=new i(t,n)}catch(u){return null}return e.forEach((function(e){s.test(e)&&(a&&-1!==o.compare(e)||(o=new r(a=e,n)))})),a}},80213:function(e,t,n){var r=n(95210),i=n(84999);e.exports=function(e,t,n){var a=null,o=null,s=null;try{s=new i(t,n)}catch(u){return null}return e.forEach((function(e){s.test(e)&&(a&&1!==o.compare(e)||(o=new r(a=e,n)))})),a}},34869:function(e,t,n){var r=n(95210),i=n(84999),a=n(18930);e.exports=function(e,t){e=new i(e,t);var n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(var o=function(){var t=e.set[s],i=null;t.forEach((function(e){var t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!a(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(e.operator))}})),!i||n&&!a(n,i)||(n=i)},s=0;s":p=u,h=l,m=c,v=">",y=">=";break;case"<":p=c,h=f,m=u,v="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,d))return!1;for(var b=function(){var n=t.set[g],r=null,o=null;return n.forEach((function(e){e.semver===a&&(e=new i(">=0.0.0")),r=r||e,o=o||e,p(e.semver,r.semver,d)?r=e:m(e.semver,o.semver,d)&&(o=e)})),r.operator===v||r.operator===y?{v:!1}:o.operator&&o.operator!==v||!h(e,o.semver)?o.operator===y&&m(e,o.semver)?{v:!1}:void 0:{v:!1}},g=0;g=".concat(b)):h.push("*")}var w=h.join(" || "),x="string"===typeof t.raw?t.raw:String(t);return w.length=0.0.0-0")],l=[new a(">=0.0.0")],f=function(e,t,n){if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=n.includePrerelease?c:l}if(1===t.length&&t[0].semver===o){if(n.includePrerelease)return!0;t=l}var i,a,f,h,m=new Set,v=r(e);try{for(v.s();!(f=v.n()).done;){var y=f.value;">"===y.operator||">="===y.operator?i=d(i,y,n):"<"===y.operator||"<="===y.operator?a=p(a,y,n):m.add(y.semver)}}catch(M){v.e(M)}finally{v.f()}if(m.size>1)return null;if(i&&a){if((h=u(i.semver,a.semver,n))>0)return null;if(0===h&&(">="!==i.operator||"<="!==a.operator))return null}var b,g,w,x,k,A=r(m);try{for(A.s();!(b=A.n()).done;){var E=b.value;if(i&&!s(E,String(i),n))return null;if(a&&!s(E,String(a),n))return null;var _,T=r(t);try{for(T.s();!(_=T.n()).done;){var S=_.value;if(!s(E,String(S),n))return!1}}catch(M){T.e(M)}finally{T.f()}return!0}}catch(M){A.e(M)}finally{A.f()}var C=!(!a||n.includePrerelease||!a.semver.prerelease.length)&&a.semver,O=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;C&&1===C.prerelease.length&&"<"===a.operator&&0===C.prerelease[0]&&(C=!1);var I,P=r(t);try{for(P.s();!(I=P.n()).done;){var R=I.value;if(k=k||">"===R.operator||">="===R.operator,x=x||"<"===R.operator||"<="===R.operator,i)if(O&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===O.major&&R.semver.minor===O.minor&&R.semver.patch===O.patch&&(O=!1),">"===R.operator||">="===R.operator){if((g=d(i,R,n))===R&&g!==i)return!1}else if(">="===i.operator&&!s(i.semver,String(R),n))return!1;if(a)if(C&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===C.major&&R.semver.minor===C.minor&&R.semver.patch===C.patch&&(C=!1),"<"===R.operator||"<="===R.operator){if((w=p(a,R,n))===R&&w!==a)return!1}else if("<="===a.operator&&!s(a.semver,String(R),n))return!1;if(!R.operator&&(a||i)&&0!==h)return!1}}catch(M){P.e(M)}finally{P.f()}return!(i&&x&&!a&&0!==h)&&(!(a&&k&&!i&&0!==h)&&(!O&&!C))},d=function(e,t,n){if(!e)return t;var r=u(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},p=function(e,t,n){if(!e)return t;var r=u(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e===t)return!0;e=new i(e,n),t=new i(t,n);var a,o=!1,s=r(e.set);try{e:for(s.s();!(a=s.n()).done;){var u,c=a.value,l=r(t.set);try{for(l.s();!(u=l.n()).done;){var d=u.value,p=f(c,d,n);if(o=o||null!==p,p)continue e}}catch(h){l.e(h)}finally{l.f()}if(o)return!1}}catch(h){s.e(h)}finally{s.f()}return!0}},32212:function(e,t,n){var r=n(84999);e.exports=function(e,t){return new r(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))}},40857:function(e,t,n){var r=n(84999);e.exports=function(e,t){try{return new r(e,t).range||"*"}catch(n){return null}}},17391:function(e){"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,c=new Uint8Array(a);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var f=0,d=a-1;(0!==l||f>>0,c[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,n++}if(" "!==e[n]){for(var p=a-i;p!==a&&0===c[p];)p++;for(var h=new Uint8Array(r+(a-p)),m=r;p!==a;)h[m++]=c[p++];return h}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,a=t.length;i!==a&&0===t[i];)i++,n++;for(var u=(a-i)*c+1>>>0,l=new Uint8Array(u);i!==a;){for(var f=t[i],d=0,p=u-1;(0!==f||d>>0,l[p]=f%o>>>0,f=f/o>>>0;if(0!==f)throw new Error("Non-zero carry");r=d,i++}for(var h=u-r;h!==u&&0===l[h];)h++;for(var m=s.repeat(n);h1?n-1:0),o=1;oo;)n&s&&(r=r.add(i)),i=i.double(),n>>=s;return r},precomputeWindow:function(e,t){for(var n=r(t),i=n.windows,a=n.windowSize,o=[],s=e,u=s,c=0;c>=h,y>c&&(y-=p,a+=s);var b=v,g=v+Math.abs(y)-1,w=m%2!==0,x=y<0;0===y?f=f.add(n(w,i[b])):l=l.add(n(x,i[g]))}return{p:l,f:f}},wNAFCached:function(e,t,n,r){var i=e._WINDOW_SIZE||1,a=t.get(e);return a||(a=this.precomputeWindow(e,i),1!==i&&t.set(e,r(a))),this.wNAF(i,a,n)}}},t.validateBasic=function(e){return(0,i.validateField)(e.Fp),(0,a.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze(r(r(r({},(0,i.nLength)(e.n,e.nBitLength)),e),{p:e.Fp.ORDER}))}},59496:function(e,t,n){"use strict";var r=n(42122).default,i=n(27424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.createHasher=t.isogenyMap=t.hash_to_field=t.expand_message_xof=t.expand_message_xmd=void 0;var a=n(22818),o=n(47308);var s=o.bytesToNumberBE;function u(e,t){if(e<0||e>=1<<8*t)throw new Error("bad I2OSP call: value=".concat(e," length=").concat(t));for(var n=Array.from({length:t}).fill(0),r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function c(e,t){for(var n=new Uint8Array(e.length),r=0;r255&&(t=r((0,o.concatBytes)((0,o.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));var i=r.outputLen,a=r.blockLen,s=Math.ceil(n/i);if(s>255)throw new Error("Invalid xmd length");var d=(0,o.concatBytes)(t,u(t.length,1)),p=u(0,a),h=u(n,2),m=new Array(s),v=r((0,o.concatBytes)(p,e,h,u(0,1),d));m[0]=r((0,o.concatBytes)(v,u(1,1),d));for(var y=1;y<=s;y++){var b=[c(v,m[y-1]),u(y+1,1),d];m[y]=r(o.concatBytes.apply(void 0,b))}return o.concatBytes.apply(void 0,m).slice(0,n)}function p(e,t,n,r,i){if(l(e),l(t),f(n),t.length>255){var a=Math.ceil(2*r/8);t=i.create({dkLen:a}).update((0,o.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:n}).update(e).update(u(n,2)).update(t).update(u(t.length,1)).digest()}function h(e,t,n){(0,o.validateObject)(n,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});var r=n.p,i=n.k,u=n.m,c=n.hash,h=n.expand,m=n.DST;l(e),f(t);var v,y=function(e){if(e instanceof Uint8Array)return e;if("string"===typeof e)return(0,o.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}(m),b=r.toString(2).length,g=Math.ceil((b+i)/8),w=t*u*g;if("xmd"===h)v=d(e,y,w,c);else if("xof"===h)v=p(e,y,w,i,c);else{if("_internal_pass"!==h)throw new Error('expand must be "xmd" or "xof"');v=e}for(var x=new Array(t),k=0;k=i?n:t+n}function d(e,t,n){if(n<=i||t 0");if(n===a)return i;for(var r=a;t>i;)t&a&&(r=r*e%n),e=e*e%n,t>>=a;return r}function p(e,t){if(e===i||t<=i)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var n=f(e,t),r=t,o=i,s=a,u=a,c=i;n!==i;){var l=r/n,d=r%n,p=o-u*l,h=s-c*l;r=n,n=d,o=u,s=c,u=p,c=h}if(r!==a)throw new Error("invert: does not exist");return f(o,t)}function h(e){var t,n,r,s=(e-a)/o;for(t=e-a,n=0;t%o===i;t/=o,n++);for(r=o;ri;)r*=r,r%=n;return r},t.invert=p,t.tonelliShanks=h,t.FpSqrt=m;t.isNegativeLE=function(e,t){return(f(e,t)&a)===a};var v=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function y(e,t,n){if(n 0");if(n===i)return e.ONE;if(n===a)return t;for(var r=e.ONE,o=t;n>i;)n&a&&(r=e.mul(r,o)),o=e.sqr(o),n>>=a;return r}function b(e,t){var n=new Array(t.length),r=t.reduce((function(t,r,i){return e.is0(r)?t:(n[i]=t,e.mul(t,r))}),e.ONE),i=e.inv(r);return t.reduceRight((function(t,r,i){return e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r))}),i),n}function g(e,t){var n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}t.validateField=function(e){var t=v.reduce((function(e,t){return e[t]="function",e}),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,r.validateObject)(e,t)},t.FpPow=y,t.FpInvertBatch=b,t.FpDiv=function(e,t,n){return e.mul(t,"bigint"===typeof n?p(n,e.ORDER):e.inv(n))},t.FpIsSquare=function(e){var t=(e.ORDER-a)/o;return function(n){var r=e.pow(n,t);return e.eql(r,e.ZERO)||e.eql(r,e.ONE)}},t.nLength=g,t.Field=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e<=i)throw new Error("Expected Fp ORDER > 0, got ".concat(e));var s=g(e,t),u=s.nBitLength,c=s.nByteLength;if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");var l=m(e),d=Object.freeze({ORDER:e,BITS:u,BYTES:c,MASK:(0,r.bitMask)(u),ZERO:i,ONE:a,create:function(t){return f(t,e)},isValid:function(t){if("bigint"!==typeof t)throw new Error("Invalid field element: expected bigint, got ".concat(typeof t));return i<=t&&t2&&void 0!==arguments[2]&&arguments[2],i=(e=(0,r.ensureBytes)("privateHash",e)).length,o=g(t).nByteLength+8;if(o<24||i1024)throw new Error("hashToPrivateScalar: expected ".concat(o,"-1024 bytes of input, got ").concat(i));return f(n?(0,r.bytesToNumberLE)(e):(0,r.bytesToNumberBE)(e),t-a)+a}},47308:function(e,t,n){"use strict";var r=n(27424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.validateObject=t.createHmacDrbg=t.bitMask=t.bitSet=t.bitGet=t.bitLen=t.utf8ToBytes=t.equalBytes=t.concatBytes=t.ensureBytes=t.numberToVarBytesBE=t.numberToBytesLE=t.numberToBytesBE=t.bytesToNumberLE=t.bytesToNumberBE=t.hexToBytes=t.hexToNumber=t.numberToHexUnpadded=t.bytesToHex=void 0;var i=BigInt(0),a=BigInt(1),o=BigInt(2),s=function(e){return e instanceof Uint8Array},u=Array.from({length:256},(function(e,t){return t.toString(16).padStart(2,"0")}));function c(e){if(!s(e))throw new Error("Uint8Array expected");for(var t="",n=0;ni;e>>=a,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&a};t.bitSet=function(e,t,n){return e|(n?a:i)<0&&void 0!==arguments[0]?arguments[0]:m();i=s(v([0]),e),r=s(),0!==e.length&&(i=s(v([1]),e),r=s())},c=function(){if(a++>=1e3)throw new Error("drbg: tried 1000 values");for(var e=0,n=[];e2&&void 0!==arguments[2]?arguments[2]:{},i=function(t,n,r){var i=y[n];if("function"!==typeof i)throw new Error('Invalid validator "'.concat(n,'", expected function'));var a=e[t];if((!r||void 0!==a)&&!i(a,e))throw new Error("Invalid param ".concat(String(t),"=").concat(a," (").concat(typeof a,"), expected ").concat(n))},a=0,o=Object.entries(t);a0&&void 0!==arguments[0]?arguments[0]:"";return i(this,n),t.call(this,e)}return r(n)}(s(Error)),_parseInt:function(e){var n=t.DER.Err;if(e.length<2||2!==e[0])throw new n("Invalid signature integer tag");var r=e[1],i=e.subarray(2,r+2);if(!r||i.length!==r)throw new n("Invalid signature integer: wrong length");if(128&i[0])throw new n("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new n("Invalid signature integer: unnecessary leading zero");return{d:p(i),l:e.subarray(r+2)}},toSig:function(e){var n=t.DER.Err,r="string"===typeof e?h(e):e;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");var i=r.length;if(i<2||48!=r[0])throw new n("Invalid signature tag");if(r[1]!==i-2)throw new n("Invalid signature: incorrect length");var a=t.DER._parseInt(r.subarray(2)),o=a.d,s=a.l,u=t.DER._parseInt(s),c=u.d;if(u.l.length)throw new n("Invalid signature: left bytes after parsing");return{r:o,s:c}},hexFromSig:function(e){var t=function(e){return 8&Number.parseInt(e[0],16)?"00"+e:e},n=function(e){var t=e.toString(16);return 1&t.length?"0".concat(t):t},r=t(n(e.s)),i=t(n(e.r)),a=r.length/2,o=i.length/2,s=n(a),u=n(o);return"30".concat(n(o+a+4),"02").concat(u).concat(i,"02").concat(s).concat(r)}};var m=BigInt(0),v=BigInt(1),y=BigInt(2),b=BigInt(3),g=BigInt(4);function w(e){var t=function(e){var t=(0,d.validateBasic)(e);l.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});var n=t.endo,r=t.Fp,i=t.a;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!==typeof n||"bigint"!==typeof n.beta||"function"!==typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze(u({},t))}(e),n=t.Fp,a=t.toBytes||function(e,t,r){var i=t.toAffine();return l.concatBytes(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))},o=t.fromBytes||function(e){var t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}};function s(e){var r=t.a,i=t.b,a=n.sqr(e),o=n.mul(a,e);return n.add(n.add(o,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function p(e){return"bigint"===typeof e&&mm||l>m;)u&v&&(f=f.add(p)),l&v&&(d=d.add(p)),p=p.double(),u>>=v,l>>=v;return s&&(f=f.negate()),c&&(d=d.negate()),d=new e(n.mul(d.px,a.beta),d.py,d.pz),f.add(d)}},{key:"multiply",value:function(r){h(r);var i,a,o=r,s=t.endo;if(s){var u=s.splitScalar(o),c=u.k1neg,l=u.k1,f=u.k2neg,d=u.k2,p=this.wNAF(l),m=p.p,v=p.f,y=this.wNAF(d),b=y.p,g=y.f;m=A.constTimeNegate(c,m),b=A.constTimeNegate(f,b),b=new e(n.mul(b.px,s.beta),b.py,b.pz),i=m.add(b),a=v.add(g)}else{var w=this.wNAF(o);i=w.p,a=w.f}return e.normalizeZ([i,a])[0]}},{key:"multiplyAndAddUnsafe",value:function(t,n,r){var i=e.BASE,a=function(e,t){return t!==m&&t!==v&&e.equals(i)?e.multiply(t):e.multiplyUnsafe(t)},o=a(this,n).add(a(t,r));return o.is0()?void 0:o}},{key:"toAffine",value:function(e){var t=this.px,r=this.py,i=this.pz,a=this.is0();null==e&&(e=a?n.ONE:n.inv(i));var o=n.mul(t,e),s=n.mul(r,e),u=n.mul(i,e);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:o,y:s}}},{key:"isTorsionFree",value:function(){var n=t.h,r=t.isTorsionFree;if(n===v)return!0;if(r)return r(e,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}},{key:"clearCofactor",value:function(){var n=t.h,r=t.clearCofactor;return n===v?this:r?r(e,this):this.multiplyUnsafe(t.h)}},{key:"toRawBytes",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.assertValidity(),a(e,this,t)}},{key:"toHex",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return l.bytesToHex(this.toRawBytes(e))}}],[{key:"fromAffine",value:function(t){var r=t||{},i=r.x,a=r.y;if(!t||!n.isValid(i)||!n.isValid(a))throw new Error("invalid affine point");if(t instanceof e)throw new Error("projective point not allowed");var o=function(e){return n.eql(e,n.ZERO)};return o(i)&&o(a)?e.ZERO:new e(i,a,n.ONE)}},{key:"normalizeZ",value:function(t){var r=n.invertBatch(t.map((function(e){return e.pz})));return t.map((function(e,t){return e.toAffine(r[t])})).map(e.fromAffine)}},{key:"fromHex",value:function(t){var n=e.fromAffine(o((0,f.ensureBytes)("pointHex",t)));return n.assertValidity(),n}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(y(t))}}]),e}();x.BASE=new x(t.Gx,t.Gy,n.ONE),x.ZERO=new x(n.ZERO,n.ONE,n.ZERO);var k=t.nBitLength,A=(0,d.wNAF)(x,t.endo?Math.ceil(k/2):k);return{CURVE:t,ProjectivePoint:x,normPrivateKeyToScalar:y,weierstrassEquation:s,isWithinCurveOrder:p}}function x(e,t){for(var n=e.ORDER,r=m,i=n-v;i%y===m;i/=y)r+=v;var a=r,o=y<v;m--){var b=m-y;b=y<o>>v}var T=function(e,t,n){return l.bytesToNumberBE(e.slice(t,n))},S=function(){function e(t,n,r){i(this,e),this.r=t,this.s=n,this.recovery=r,this.assertValidity()}return r(e,[{key:"assertValidity",value:function(){if(!A(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!A(this.s))throw new Error("s must be 0 < s < CURVE.n")}},{key:"addRecoveryBit",value:function(t){return new e(this.r,this.s,t)}},{key:"recoverPublicKey",value:function(e){var t=this.r,r=this.s,i=this.recovery,o=P((0,f.ensureBytes)("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");var s=2===i||3===i?t+n.n:t;if(s>=a.ORDER)throw new Error("recovery id 2 or 3 invalid");var u=0===(1&i)?"02":"03",c=g.fromHex(u+E(s)),l=y(s),d=h(-o*l),p=h(r*l),m=g.BASE.multiplyAndAddUnsafe(c,d,p);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}},{key:"hasHighS",value:function(){return _(this.s)}},{key:"normalizeS",value:function(){return this.hasHighS()?new e(this.r,h(-this.s),this.recovery):this}},{key:"toDERRawBytes",value:function(){return l.hexToBytes(this.toDERHex())}},{key:"toDERHex",value:function(){return t.DER.hexFromSig({r:this.r,s:this.s})}},{key:"toCompactRawBytes",value:function(){return l.hexToBytes(this.toCompactHex())}},{key:"toCompactHex",value:function(){return E(this.r)+E(this.s)}}],[{key:"fromCompact",value:function(t){var r=n.nByteLength;return t=(0,f.ensureBytes)("compactSignature",t,2*r),new e(T(t,0,r),T(t,r,2*r))}},{key:"fromDER",value:function(n){var r=t.DER.toSig((0,f.ensureBytes)("DER",n));return new e(r.r,r.s)}}]),e}(),C={isValidPrivateKey:function(e){try{return x(e),!0}catch(t){return!1}},normPrivateKeyToScalar:x,randomPrivateKey:function(){var e=n.randomBytes(a.BYTES+8),t=c.hashToPrivateScalar(e,o);return l.numberToBytesBE(t,n.nByteLength)},precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.BASE;return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function O(e){var t=e instanceof Uint8Array,n="string"===typeof e,r=(t||n)&&e.length;return t?r===s||r===p:n?r===2*s||r===2*p:e instanceof g}var I=n.bits2int||function(e){var t=l.bytesToNumberBE(e),r=8*e.length-n.nBitLength;return r>0?t>>BigInt(r):t},P=n.bits2int_modN||function(e){return h(I(e))},R=l.bitMask(n.nBitLength);function M(e){if("bigint"!==typeof e)throw new Error("bigint expected");if(!(m<=e&&e2&&void 0!==arguments[2]?arguments[2]:j;if(["recovered","canonical"].some((function(e){return e in r})))throw new Error("sign() legacy options not supported");var i=n.hash,o=n.randomBytes,s=r.lowS,u=r.prehash,c=r.extraEntropy;null==s&&(s=!0),e=(0,f.ensureBytes)("msgHash",e),u&&(e=(0,f.ensureBytes)("prehashed msgHash",i(e)));var d=P(e),p=x(t),b=[M(p),M(d)];if(null!=c){var w=!0===c?o(a.BYTES):c;b.push((0,f.ensureBytes)("extraEntropy",w,a.BYTES))}var k=l.concatBytes.apply(l,b),E=d;return{seed:k,k2sig:function(e){var t=I(e);if(A(t)){var n=y(t),r=g.BASE.multiply(t).toAffine(),i=h(r.x);if(i!==m){var a=h(n*h(E+i*p));if(a!==m){var o=(r.x===i?0:2)|Number(r.y&v),u=a;return s&&_(a)&&(u=function(e){return _(e)?h(-e):e}(a),o^=1),new S(i,u,o)}}}}}}var j={lowS:n.lowS,prehash:!1},L={lowS:n.lowS,prehash:!1};return g.BASE._setWindowSize(8),{CURVE:n,getPublicKey:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return g.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(O(e))throw new Error("first arg must be private key");if(!O(t))throw new Error("second arg must be public key");return g.fromHex(t).multiply(x(e)).toRawBytes(n)},sign:function(e,t){var r=N(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:j),i=r.seed,a=r.k2sig,o=n;return l.createHmacDrbg(o.hash.outputLen,o.nByteLength,o.hmac)(i,a)},verify:function(e,r,i){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:L,s=e;if(r=(0,f.ensureBytes)("msgHash",r),i=(0,f.ensureBytes)("publicKey",i),"strict"in o)throw new Error("options.strict was renamed to lowS");var u,c=o.lowS,l=o.prehash,d=void 0;try{if("string"===typeof s||s instanceof Uint8Array)try{d=S.fromDER(s)}catch(T){if(!(T instanceof t.DER.Err))throw T;d=S.fromCompact(s)}else{if("object"!==typeof s||"bigint"!==typeof s.r||"bigint"!==typeof s.s)throw new Error("PARSE");var p=s.r,m=s.s;d=new S(p,m)}u=g.fromHex(i)}catch(C){if("PARSE"===C.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(c&&d.hasHighS())return!1;l&&(r=n.hash(r));var v=d,b=v.r,w=v.s,x=P(r),k=y(w),A=h(x*k),E=h(b*k),_=null===(a=g.BASE.multiplyAndAddUnsafe(u,A,E))||void 0===a?void 0:a.toAffine();return!!_&&h(_.x)===b},ProjectivePoint:g,Signature:S,utils:C}},t.SWUFpSqrtRatio=x,t.mapToCurveSimpleSWU=function(e,t){if(c.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");var n=x(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return function(r){var i,a,o,s,u,c,l,f;i=e.sqr(r),i=e.mul(i,t.Z),a=e.sqr(i),a=e.add(a,i),o=e.add(a,e.ONE),o=e.mul(o,t.B),s=e.cmov(t.Z,e.neg(a),!e.eql(a,e.ZERO)),s=e.mul(s,t.A),a=e.sqr(o),c=e.sqr(s),u=e.mul(c,t.A),a=e.add(a,u),a=e.mul(a,o),c=e.mul(c,s),u=e.mul(c,t.B),a=e.add(a,u),l=e.mul(i,o);var d=n(a,c),p=d.isValid,h=d.value;f=e.mul(i,r),f=e.mul(f,h),l=e.cmov(l,o,p),f=e.cmov(f,h,p);var m=e.isOdd(r)===e.isOdd(f);return f=e.cmov(e.neg(f),f,m),{x:l=e.div(l,s),y:f}}}},55033:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.schnorr=t.secp256k1=void 0;var r=n(15925),i=n(54242),a=n(22818),o=n(86983),s=n(47308),u=n(59496),c=n(50132),l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),f=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),d=BigInt(1),p=BigInt(2),h=function(e,t){return(e+t/p)/t};function m(e){var t=l,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),u=BigInt(44),c=BigInt(88),f=e*e*e%t,d=f*f*e%t,h=(0,a.pow2)(d,n,t)*d%t,m=(0,a.pow2)(h,n,t)*d%t,y=(0,a.pow2)(m,p,t)*f%t,b=(0,a.pow2)(y,i,t)*y%t,g=(0,a.pow2)(b,o,t)*b%t,w=(0,a.pow2)(g,u,t)*g%t,x=(0,a.pow2)(w,c,t)*w%t,k=(0,a.pow2)(x,u,t)*g%t,A=(0,a.pow2)(k,n,t)*d%t,E=(0,a.pow2)(A,s,t)*b%t,_=(0,a.pow2)(E,r,t)*f%t,T=(0,a.pow2)(_,p,t);if(!v.eql(v.sqr(T),e))throw new Error("Cannot find square root");return T}var v=(0,a.Field)(l,void 0,void 0,{sqrt:m});t.secp256k1=(0,c.createCurve)({a:BigInt(0),b:BigInt(7),Fp:v,n:f,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:function(e){var t=f,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-d*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,s=BigInt("0x100000000000000000000000000000000"),u=h(o*e,t),c=h(-r*e,t),l=(0,a.mod)(e-u*n-c*i,t),p=(0,a.mod)(-u*r-c*o,t),m=l>s,v=p>s;if(m&&(l=t-l),v&&(p=t-p),l>s||p>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:m,k1:l,k2neg:v,k2:p}}}},r.sha256);var y=BigInt(0),b=function(e){return"bigint"===typeof e&&y1?i-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:(0,i.randomBytes)(32),r=(0,s.ensureBytes)("message",e),a=C(t),o=a.bytes,u=a.scalar,c=(0,s.ensureBytes)("auxRand",n,32),l=A(u^(0,s.bytesToNumberBE)(x("BIP0340/aux",c))),f=x("BIP0340/nonce",l,o,r),d=_((0,s.bytesToNumberBE)(f));if(d===y)throw new Error("sign failed: k is zero");var p=C(d),h=p.bytes,m=p.scalar,v=I(h,o,r),b=new Uint8Array(64);if(b.set(h,0),b.set(A(_(m+v*u)),32),!M(b,r,o))throw new Error("sign: Invalid signature produced");return b}function M(e,t,n){var r=(0,s.ensureBytes)("signature",e,64),i=(0,s.ensureBytes)("message",t),a=(0,s.ensureBytes)("publicKey",n,32);try{var o=O((0,s.bytesToNumberBE)(a)),u=(0,s.bytesToNumberBE)(r.subarray(0,32));if(!b(u))return!1;var c=(0,s.bytesToNumberBE)(r.subarray(32,64));if(!g(c))return!1;var l=I(A(u),k(o),i),f=S(o,c,_(-l));return!(!f||!f.hasEvenY()||f.toAffine().x!==u)}catch(d){return!1}}t.schnorr={getPublicKey:P,sign:R,verify:M,utils:{randomPrivateKey:t.secp256k1.utils.randomPrivateKey,lift_x:O,pointToBytes:k,numberToBytesBE:s.numberToBytesBE,bytesToNumberBE:s.bytesToNumberBE,taggedHash:x,mod:a.mod}};var N=function(){return(0,u.isogenyMap)(v,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((function(e){return e.map((function(e){return BigInt(e)}))})))}(),j=function(){return(0,o.mapToCurveSimpleSWU)(v,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:v.create(BigInt("-11"))})}(),L=function(){return(0,u.createHasher)(t.secp256k1.ProjectivePoint,(function(e){var t=j(v.create(e[0])),n=t.x,r=t.y;return N(n,r)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:v.ORDER,m:1,k:128,expand:"xmd",hash:r.sha256})}();t.hashToCurve=L.hashToCurve,t.encodeToCurve=L.encodeToCurve},28583:function(e,t){"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Wrong positive integer: ".concat(e))}function r(e){if("boolean"!==typeof e)throw new Error("Expected boolean, not ".concat(e))}function i(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&!n.includes(e.length))throw new Error("Expected Uint8Array of length ".concat(n,", not of length=").concat(e.length))}function a(e){if("function"!==typeof e||"function"!==typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}function o(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function s(e,t){i(e);var n=t.outputLen;if(e.lengthr-a&&(this.process(n,0),a=0);for(var o=a;o>i&a),s=Number(n&a),u=r?4:0,c=r?0:4;e.setUint32(t+u,o,r),e.setUint32(t+c,s,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);var s=(0,c.createView)(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");var f=l/4,d=this.get();if(f>d.length)throw new Error("_sha2: outputLen bigger than state");for(var p=0;pc?e.create().update(o).digest():o);for(var f=0;f>>3,s=(0,u.rotr)(a,17)^(0,u.rotr)(a,19)^a>>>10;p[r]=s+p[r-7]+o+p[r-16]|0}for(var d=this.A,h=this.B,m=this.C,v=this.D,y=this.E,b=this.F,g=this.G,w=this.H,x=0;x<64;x++){var k=w+((0,u.rotr)(y,6)^(0,u.rotr)(y,11)^(0,u.rotr)(y,25))+c(y,b,g)+f[x]+p[x]|0,A=((0,u.rotr)(d,2)^(0,u.rotr)(d,13)^(0,u.rotr)(d,22))+l(d,h,m)|0;w=g,g=b,b=y,y=v+k|0,v=m,m=h,h=d,d=k+A|0}d=d+this.A|0,h=h+this.B|0,m=m+this.C|0,v=v+this.D|0,y=y+this.E|0,b=b+this.F|0,g=g+this.G|0,w=w+this.H|0,this.set(d,h,m,v,y,b,g,w)}},{key:"roundClean",value:function(){p.fill(0)}},{key:"destroy",value:function(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}]),n}(s.SHA2),m=function(e){a(n,e);var t=o(n);function n(){var e;return r(this,n),(e=t.call(this)).A=-1056596264,e.B=914150663,e.C=812702999,e.D=-150054599,e.E=-4191439,e.F=1750603025,e.G=1694076839,e.H=-1090891868,e.outputLen=28,e}return i(n)}(h);t.sha256=(0,u.wrapConstructor)((function(){return new h})),t.sha224=(0,u.wrapConstructor)((function(){return new m}))},54242:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default,a=n(17061).default,o=n(17156).default;Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;var s=n(87580),u=function(e){return e instanceof Uint8Array};t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)};t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))};t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)};if(t.rotr=function(e,t){return e<<32-t|e>>>t},t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");var c=Array.from({length:256},(function(e,t){return t.toString(16).padStart(2,"0")}));t.bytesToHex=function(e){if(!u(e))throw new Error("Uint8Array expected");for(var t="",n=0;n=0&&u0&&void 0!==arguments[0]?arguments[0]:32;if(s.crypto&&"function"===typeof s.crypto.getRandomValues)return s.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},78489:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeAppProvider=void 0;var r=n(71769);Object.defineProperty(t,"SafeAppProvider",{enumerable:!0,get:function(){return r.SafeAppProvider}})},71769:function(e,t,n){"use strict";var r=n(27424).default,i=n(17061).default,a=n(17156).default,o=n(56690).default,s=n(89728).default,u=n(61655).default,c=n(26389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.SafeAppProvider=void 0;var l=n(68041),f=n(26869),d=function(e){u(n,e);var t=c(n);function n(e,r){var i;return o(this,n),(i=t.call(this)).submittedTxs=new Map,i.safe=e,i.sdk=r,i}return s(n,[{key:"connect",value:function(){var e=a(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.emit("connect",{chainId:this.chainId}),e.abrupt("return");case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=a(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"chainId",get:function(){return this.safe.chainId}},{key:"request",value:function(){var e=a(i().mark((function e(t){var n,a,o,s,u,c,l,d,p,h,m,v,y,b,g,w,x,k,A,E,_,T,S,C,O,I;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.method,a=t.params,o=void 0===a?[]:a,e.t0=n,e.next="eth_accounts"===e.t0?4:"net_version"===e.t0||"eth_chainId"===e.t0?5:"personal_sign"===e.t0?6:"eth_sign"===e.t0?14:"eth_signTypedData"===e.t0||"eth_signTypedData_v4"===e.t0?22:"eth_sendTransaction"===e.t0?31:"eth_blockNumber"===e.t0?38:"eth_getBalance"===e.t0?42:"eth_getCode"===e.t0?43:"eth_getTransactionCount"===e.t0?44:"eth_getStorageAt"===e.t0?45:"eth_getBlockByNumber"===e.t0?46:"eth_getBlockByHash"===e.t0?47:"eth_getTransactionByHash"===e.t0?48:"eth_getTransactionReceipt"===e.t0?61:"eth_estimateGas"===e.t0?72:"eth_call"===e.t0?73:"eth_getLogs"===e.t0?74:"eth_gasPrice"===e.t0?75:"wallet_getPermissions"===e.t0?76:"wallet_requestPermissions"===e.t0?77:"safe_setSettings"===e.t0?78:79;break;case 4:return e.abrupt("return",[this.safe.safeAddress]);case 5:return e.abrupt("return","0x".concat(this.chainId.toString(16)));case 6:if(s=r(o,2),u=s[0],c=s[1],this.safe.safeAddress.toLowerCase()===c.toLowerCase()){e.next=9;break}throw new Error("The address or message hash is invalid");case 9:return e.next=11,this.sdk.txs.signMessage(u);case 11:return l=e.sent,d="signature"in l?l.signature:void 0,e.abrupt("return",d||"0x");case 14:if(p=r(o,2),h=p[0],m=p[1],this.safe.safeAddress.toLowerCase()===h.toLowerCase()&&m.startsWith("0x")){e.next=17;break}throw new Error("The address or message hash is invalid");case 17:return e.next=19,this.sdk.txs.signMessage(m);case 19:return v=e.sent,y="signature"in v?v.signature:void 0,e.abrupt("return",y||"0x");case 22:if(b=r(o,2),g=b[0],w=b[1],x="string"===typeof w?JSON.parse(w):w,this.safe.safeAddress.toLowerCase()===g.toLowerCase()){e.next=26;break}throw new Error("The address is invalid");case 26:return e.next=28,this.sdk.txs.signTypedMessage(x);case 28:return k=e.sent,A="signature"in k?k.signature:void 0,e.abrupt("return",A||"0x");case 31:return"string"===typeof(E=Object.assign({value:"0",data:"0x"},o[0])).gas&&E.gas.startsWith("0x")&&(E.gas=parseInt(E.gas,16)),e.next=35,this.sdk.txs.send({txs:[E],params:{safeTxGas:E.gas}});case 35:return _=e.sent,this.submittedTxs.set(_.safeTxHash,{from:this.safe.safeAddress,hash:_.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:E.data,value:E.value,to:E.to,blockHash:null,blockNumber:null,transactionIndex:null}),e.abrupt("return",_.safeTxHash);case 38:return e.next=40,this.sdk.eth.getBlockByNumber(["latest"]);case 40:return T=e.sent,e.abrupt("return",T.number);case 42:return e.abrupt("return",this.sdk.eth.getBalance([(0,f.getLowerCase)(o[0]),o[1]]));case 43:return e.abrupt("return",this.sdk.eth.getCode([(0,f.getLowerCase)(o[0]),o[1]]));case 44:return e.abrupt("return",this.sdk.eth.getTransactionCount([(0,f.getLowerCase)(o[0]),o[1]]));case 45:return e.abrupt("return",this.sdk.eth.getStorageAt([(0,f.getLowerCase)(o[0]),o[1],o[2]]));case 46:return e.abrupt("return",this.sdk.eth.getBlockByNumber([o[0],o[1]]));case 47:return e.abrupt("return",this.sdk.eth.getBlockByHash([o[0],o[1]]));case 48:return S=o[0],e.prev=49,e.next=52,this.sdk.txs.getBySafeTxHash(S);case 52:C=e.sent,S=C.txHash||S,e.next=58;break;case 56:e.prev=56,e.t1=e.catch(49);case 58:if(!this.submittedTxs.has(S)){e.next=60;break}return e.abrupt("return",this.submittedTxs.get(S));case 60:return e.abrupt("return",this.sdk.eth.getTransactionByHash([S]).then((function(e){return e&&(e.hash=o[0]),e})));case 61:return O=o[0],e.prev=62,e.next=65,this.sdk.txs.getBySafeTxHash(O);case 65:I=e.sent,O=I.txHash||O,e.next=71;break;case 69:e.prev=69,e.t2=e.catch(62);case 71:return e.abrupt("return",this.sdk.eth.getTransactionReceipt([O]).then((function(e){return e&&(e.transactionHash=o[0]),e})));case 72:return e.abrupt("return",this.sdk.eth.getEstimateGas(o[0]));case 73:return e.abrupt("return",this.sdk.eth.call([o[0],o[1]]));case 74:return e.abrupt("return",this.sdk.eth.getPastLogs([o[0]]));case 75:return e.abrupt("return",this.sdk.eth.getGasPrice());case 76:return e.abrupt("return",this.sdk.wallet.getPermissions());case 77:return e.abrupt("return",this.sdk.wallet.requestPermissions(o[0]));case 78:return e.abrupt("return",this.sdk.eth.setSafeSettings([o[0]]));case 79:throw Error('"'.concat(t.method,'" not implemented'));case 80:case"end":return e.stop()}}),e,this,[[49,56],[62,69]])})));return function(t){return e.apply(this,arguments)}}()},{key:"send",value:function(e,t){e||t("Undefined request"),this.request(e).then((function(n){return t(null,{jsonrpc:"2.0",id:e.id,result:n})})).catch((function(e){return t(e,null)}))}}]),n}(l.EventEmitter);t.SafeAppProvider=d},26869:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLowerCase=void 0,t.getLowerCase=function(e){return e?e.toLowerCase():e}},59103:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default,a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0});var s=n(62321),u=r((function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];i(this,e),this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer="undefined"===typeof window,this.isValidMessage=function(e){var n=e.origin,r=e.data,i=e.source,a=!r,o=!t.isServer&&i===window.parent,s=("undefined"!==typeof r.version&&parseInt(r.version.split(".")[0]))>=1,u=!0;return Array.isArray(t.allowedOrigins)&&(u=void 0!==t.allowedOrigins.find((function(e){return e.test(n)}))),!a&&o&&s&&u},this.logIncomingMessage=function(e){console.info("Safe Apps SDK v1: A message was received from origin ".concat(e.origin,". "),e.data)},this.onParentMessage=function(e){t.isValidMessage(e)&&(t.debugMode&&t.logIncomingMessage(e),t.handleIncomingMessage(e.data))},this.handleIncomingMessage=function(e){var n=e.id,r=t.callbacks.get(n);r&&(r(e),t.callbacks.delete(n))},this.send=function(e,n){var r=s.MessageFormatter.makeRequest(e,n);if(t.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(r,"*"),new Promise((function(e,n){t.callbacks.set(r.id,(function(t){t.success?e(t):n(new Error(t.error))}))}))},this.allowedOrigins=n,this.debugMode=r,this.isServer||window.addEventListener("message",this.onParentMessage)}));t.default=u,o(n(29117),t)},62321:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default;Object.defineProperty(t,"__esModule",{value:!0}),t.MessageFormatter=void 0;var a=n(72605),o=n(46773),s=r((function e(){i(this,e)}));t.MessageFormatter=s,s.makeRequest=function(e,t){return{id:(0,o.generateRequestId)(),method:e,params:t,env:{sdkVersion:(0,a.getSDKVersion)()}}},s.makeResponse=function(e,t,n){return{id:e,success:!0,version:n,data:t}},s.makeErrorResponse=function(e,t,n){return{id:e,success:!1,error:t,version:n}}},29117:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RestrictedMethods=t.Methods=void 0,function(e){e.sendTransactions="sendTransactions",e.rpcCall="rpcCall",e.getChainInfo="getChainInfo",e.getSafeInfo="getSafeInfo",e.getTxBySafeTxHash="getTxBySafeTxHash",e.getSafeBalances="getSafeBalances",e.signMessage="signMessage",e.signTypedMessage="signTypedMessage",e.getEnvironmentInfo="getEnvironmentInfo",e.getOffChainSignature="getOffChainSignature",e.requestAddressBook="requestAddressBook",e.wallet_getPermissions="wallet_getPermissions",e.wallet_requestPermissions="wallet_requestPermissions"}(t.Methods||(t.Methods={})),function(e){e.requestAddressBook="requestAddressBook"}(t.RestrictedMethods||(t.RestrictedMethods={}))},46773:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateRequestId=void 0;var n=function(e){return e.toString(16).padStart(2,"0")};t.generateRequestId=function(){return"undefined"!==typeof window?function(e){var t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,n).join("")}(10):(new Date).getTime().toString(36)}},53477:function(e,t,n){"use strict";var r=n(17061).default,i=n(38416).default,a=n(17156).default;Object.defineProperty(t,"__esModule",{value:!0});var o=n(54330),s=n(78953),u=function(e,t){return t.some((function(t){return t.parentCapability===e}))};t.default=function(){return function(e,t,n){var c=n.value;return n.value=a(r().mark((function e(){var n,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new o.Wallet(this.communicator),e.next=3,n.getPermissions();case 3:if(a=e.sent,u(t,a)){e.next=8;break}return e.next=7,n.requestPermissions([i({},t,{})]);case 7:a=e.sent;case 8:if(u(t,a)){e.next=10;break}throw new s.PermissionsError("Permissions rejected",s.PERMISSIONS_REQUEST_REJECTED);case 10:return e.abrupt("return",c.apply(this));case 11:case"end":return e.stop()}}),e,this)}))),n}}},78729:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RPC_CALLS=void 0,t.RPC_CALLS={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"}},7226:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,a=n(56690).default,o=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Eth=void 0;var s=n(78729),u=n(29117),c={defaultBlockParam:function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"latest"},returnFullTxObjectParam:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]},blockNumberToHex:function(e){return Number.isInteger(e)?"0x".concat(e.toString(16)):e}},l=function(){function e(t){var n=this;a(this,e),this.communicator=t,this.call=this.buildRequest({call:s.RPC_CALLS.eth_call,formatters:[null,c.defaultBlockParam]}),this.getBalance=this.buildRequest({call:s.RPC_CALLS.eth_getBalance,formatters:[null,c.defaultBlockParam]}),this.getCode=this.buildRequest({call:s.RPC_CALLS.eth_getCode,formatters:[null,c.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:s.RPC_CALLS.eth_getStorageAt,formatters:[null,c.blockNumberToHex,c.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:s.RPC_CALLS.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:s.RPC_CALLS.eth_getBlockByHash,formatters:[null,c.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:s.RPC_CALLS.eth_getBlockByNumber,formatters:[c.blockNumberToHex,c.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:s.RPC_CALLS.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:s.RPC_CALLS.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:s.RPC_CALLS.eth_getTransactionCount,formatters:[null,c.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:s.RPC_CALLS.eth_gasPrice}),this.getEstimateGas=function(e){return n.buildRequest({call:s.RPC_CALLS.eth_estimateGas})([e])},this.setSafeSettings=this.buildRequest({call:s.RPC_CALLS.safe_setSettings})}return o(e,[{key:"buildRequest",value:function(e){var t=this,n=e.call,a=e.formatters;return function(){var e=i(r().mark((function e(i){var o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a&&Array.isArray(i)&&a.forEach((function(e,t){e&&(i[t]=e(i[t]))})),o={call:n,params:i||[]},e.next=4,t.communicator.send(u.Methods.rpcCall,o);case 4:return s=e.sent,e.abrupt("return",s.data);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}]),e}();t.Eth=l},38290:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getSDKVersion=void 0;var o=a(n(44597));t.default=o.default,i(n(44597),t),i(n(20951),t),i(n(29117),t),i(n(62321),t);var s=n(72605);Object.defineProperty(t,"getSDKVersion",{enumerable:!0,get:function(){return s.getSDKVersion}})},11112:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,a=n(56690).default,o=n(89728).default,s=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Safe=void 0;var c=n(4590),l=n(82436),f=n(29117),d=n(78729),p=n(20951),h=u(n(53477)),m=function(){function e(t){a(this,e),this.communicator=t}return o(e,[{key:"getChainInfo",value:function(){var e=i(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.communicator.send(f.Methods.getChainInfo,void 0);case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getInfo",value:function(){var e=i(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.communicator.send(f.Methods.getSafeInfo,void 0);case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"experimental_getBalances",value:function(){var e=i(r().mark((function e(){var t,n,i,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(a.length>0&&void 0!==a[0]?a[0]:{}).currency,n=void 0===t?"usd":t,e.next=3,this.communicator.send(f.Methods.getSafeBalances,{currency:n});case 3:return i=e.sent,e.abrupt("return",i.data);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"check1271Signature",value:function(){var e=i(r().mark((function e(t){var n,i,a,o,s,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:"0x",e.next=3,this.getInfo();case 3:return i=e.sent,a=(0,c.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[t,n]}),o={call:d.RPC_CALLS.eth_call,params:[{to:i.safeAddress,data:a},"latest"]},e.prev=6,e.next=9,this.communicator.send(f.Methods.rpcCall,o);case 9:return s=e.sent,e.abrupt("return",s.data.slice(0,10).toLowerCase()===l.MAGIC_VALUE);case 13:return e.prev=13,e.t0=e.catch(6),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,this,[[6,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"check1271SignatureBytes",value:function(){var e=i(r().mark((function e(t){var n,i,a,o,s,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:"0x",e.next=3,this.getInfo();case 3:return i=e.sent,a=(0,c.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[t,n]}),o={call:d.RPC_CALLS.eth_call,params:[{to:i.safeAddress,data:a},"latest"]},e.prev=6,e.next=9,this.communicator.send(f.Methods.rpcCall,o);case 9:return s=e.sent,e.abrupt("return",s.data.slice(0,10).toLowerCase()===l.MAGIC_VALUE_BYTES);case 13:return e.prev=13,e.t0=e.catch(6),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,this,[[6,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"calculateMessageHash",value:function(e){return(0,c.hashMessage)(e)}},{key:"calculateTypedMessageHash",value:function(e){var t="object"===typeof e.domain.chainId?e.domain.chainId.toNumber():Number(e.domain.chainId),n=e.primaryType;if(!n){var r=Object.values(e.types),i=Object.keys(e.types).filter((function(e){return r.every((function(t){return t.every((function(t){return t.type.replace("[","").replace("]","")!==e}))}))}));if(0===i.length||i.length>1)throw new Error("Please specify primaryType");n=i[0]}return(0,c.hashTypedData)({message:e.message,domain:Object.assign(Object.assign({},e.domain),{chainId:t,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt}),types:e.types,primaryType:n})}},{key:"getOffChainSignature",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.communicator.send(f.Methods.getOffChainSignature,t);case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isMessageSigned",value:function(){var e=i(r().mark((function e(t){var n,a,o,s=this,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>1&&void 0!==u[1]?u[1]:"0x","string"===typeof t&&(a=function(){var e=i(r().mark((function e(){var i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.calculateMessageHash(t),e.next=3,s.isMessageHashSigned(i,n);case 3:return a=e.sent,e.abrupt("return",a);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),(0,p.isObjectEIP712TypedData)(t)&&(a=function(){var e=i(r().mark((function e(){var i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.calculateTypedMessageHash(t),e.next=3,s.isMessageHashSigned(i,n);case 3:return a=e.sent,e.abrupt("return",a);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),!a){e.next=8;break}return e.next=6,a();case 6:return o=e.sent,e.abrupt("return",o);case 8:throw new Error("Invalid message type");case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"isMessageHashSigned",value:function(){var e=i(r().mark((function e(t){var n,i,a,o,s,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=u.length>1&&void 0!==u[1]?u[1]:"0x",i=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)],a=0,o=i;case 3:if(!(a0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=t.allowedDomains,r=void 0===n?null:n,a=t.debug,f=void 0!==a&&a;this.communicator=new o.default(r,f),this.eth=new u.Eth(this.communicator),this.txs=new s.TXs(this.communicator),this.safe=new c.Safe(this.communicator),this.wallet=new l.Wallet(this.communicator)}));t.default=f},75284:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,a=n(56690).default,o=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.TXs=void 0;var s=n(29117),u=n(20951),c=function(){function e(t){a(this,e),this.communicator=t}return o(e,[{key:"getBySafeTxHash",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new Error("Invalid safeTxHash");case 2:return e.next=4,this.communicator.send(s.Methods.getTxBySafeTxHash,{safeTxHash:t});case 4:return n=e.sent,e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"signMessage",value:function(){var e=i(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={message:t},e.next=3,this.communicator.send(s.Methods.signMessage,n);case 3:return i=e.sent,e.abrupt("return",i.data);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"signTypedMessage",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,u.isObjectEIP712TypedData)(t)){e.next=2;break}throw new Error("Invalid typed data");case 2:return e.next=4,this.communicator.send(s.Methods.signTypedMessage,{typedData:t});case 4:return n=e.sent,e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=i(r().mark((function e(t){var n,i,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.txs,i=t.params,n&&n.length){e.next=3;break}throw new Error("No transactions were passed");case 3:return a={txs:n,params:i},e.next=6,this.communicator.send(s.Methods.sendTransactions,a);case 6:return o=e.sent,e.abrupt("return",o.data);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();t.TXs=c},77906:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransferDirection=t.TransactionStatus=t.TokenType=t.Operation=void 0;var r=n(23422);Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return r.Operation}}),Object.defineProperty(t,"TokenType",{enumerable:!0,get:function(){return r.TokenType}}),Object.defineProperty(t,"TransactionStatus",{enumerable:!0,get:function(){return r.TransactionStatus}}),Object.defineProperty(t,"TransferDirection",{enumerable:!0,get:function(){return r.TransferDirection}})},20951:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(11947),t),i(n(67740),t),i(n(77906),t),i(n(49453),t)},49453:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(29117)},78953:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default,a=n(66115).default,o=n(61655).default,s=n(26389).default,u=n(33496).default;Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionsError=t.PERMISSIONS_REQUEST_REJECTED=void 0,t.PERMISSIONS_REQUEST_REJECTED=4001;var c=function(e){o(n,e);var t=s(n);function n(e,r,o){var s;return i(this,n),(s=t.call(this,e)).code=r,s.data=o,Object.setPrototypeOf(a(s),n.prototype),s}return r(n)}(u(Error));t.PermissionsError=c},67740:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},11947:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectEIP712TypedData=void 0;t.isObjectEIP712TypedData=function(e){return"object"===typeof e&&null!=e&&"domain"in e&&"types"in e&&"message"in e}},72605:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getSDKVersion=void 0;var i=r(n(29242));t.getSDKVersion=function(){return i.default.version.split("-")[0]}},54330:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,a=n(56690).default,o=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=void 0;var s=n(29117),u=n(78953),c=function(){function e(t){a(this,e),this.communicator=t}return o(e,[{key:"getPermissions",value:function(){var e=i(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.communicator.send(s.Methods.wallet_getPermissions,void 0);case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"requestPermissions",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isPermissionRequestValid(t)){e.next=2;break}throw new u.PermissionsError("Permissions request is invalid",u.PERMISSIONS_REQUEST_REJECTED);case 2:return e.prev=2,e.next=5,this.communicator.send(s.Methods.wallet_requestPermissions,t);case 5:return n=e.sent,e.abrupt("return",n.data);case 9:throw e.prev=9,e.t0=e.catch(2),new u.PermissionsError("Permissions rejected",u.PERMISSIONS_REQUEST_REJECTED);case 12:case"end":return e.stop()}}),e,this,[[2,9]])})));return function(t){return e.apply(this,arguments)}}()},{key:"isPermissionRequestValid",value:function(e){return e.every((function(e){return"object"===typeof e&&Object.keys(e).every((function(e){return!!Object.values(s.RestrictedMethods).includes(e)}))}))}}]),e}();t.Wallet=c},31883:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BASE_URL=void 0,t.DEFAULT_BASE_URL="https://safe-client.safe.global"},80042:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEndpoint=t.postEndpoint=void 0;var r=n(26301);function i(e,t,n,i){var a=(0,r.insertParams)(t,n),o=(0,r.stringifyQuery)(i);return"".concat(e).concat(a).concat(o)}t.postEndpoint=function(e,t,n){var a=i(e,t,null===n||void 0===n?void 0:n.path,null===n||void 0===n?void 0:n.query);return(0,r.fetchData)(a,null===n||void 0===n?void 0:n.body)},t.getEndpoint=function(e,t,n,a){if(a)return(0,r.fetchData)(a);var o=i(e,t,null===n||void 0===n?void 0:n.path,null===n||void 0===n?void 0:n.query);return(0,r.fetchData)(o)}},23422:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.getDelegates=t.confirmSafeMessage=t.proposeSafeMessage=t.getSafeMessage=t.getSafeMessages=t.getDecodedData=t.getMasterCopies=t.getSafeApps=t.getChainConfig=t.getChainsConfig=t.proposeTransaction=t.postSafeGasEstimation=t.getTransactionDetails=t.getTransactionQueue=t.getTransactionHistory=t.getCollectiblesPage=t.getCollectibles=t.getOwnedSafes=t.getFiatCurrencies=t.getBalances=t.getMultisigTransactions=t.getModuleTransactions=t.getIncomingTransfers=t.getSafeInfo=t.setBaseUrl=void 0;var a=n(80042),o=n(31883);i(n(80641),t),i(n(68496),t),i(n(52498),t),i(n(47413),t),i(n(67874),t),i(n(20691),t),i(n(71309),t),i(n(17542),t);var s=o.DEFAULT_BASE_URL;t.setBaseUrl=function(e){s=e},t.getSafeInfo=function(e,t){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}",{path:{chainId:e,address:t}})},t.getIncomingTransfers=function(e,t,n,r){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/incoming-transfers/",{path:{chainId:e,address:t},query:n},r)},t.getModuleTransactions=function(e,t,n,r){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/module-transactions/",{path:{chainId:e,address:t},query:n},r)},t.getMultisigTransactions=function(e,t,n,r){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/multisig-transactions/",{path:{chainId:e,address:t},query:n},r)},t.getBalances=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"usd",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/balances/{currency}",{path:{chainId:e,address:t,currency:n},query:r})},t.getFiatCurrencies=function(){return(0,a.getEndpoint)(s,"/v1/balances/supported-fiat-codes")},t.getOwnedSafes=function(e,t){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/owners/{address}/safes",{path:{chainId:e,address:t}})},t.getCollectibles=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:e,address:t},query:n})},t.getCollectiblesPage=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;return(0,a.getEndpoint)(s,"/v2/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:e,address:t},query:n},r)},t.getTransactionHistory=function(e,t,n){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/transactions/history",{path:{chainId:e,safe_address:t},query:{}},n)},t.getTransactionQueue=function(e,t,n,r){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/transactions/queued",{path:{chainId:e,safe_address:t},query:{trusted:r}},n)},t.getTransactionDetails=function(e,t){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/transactions/{transactionId}",{path:{chainId:e,transactionId:t}})},t.postSafeGasEstimation=function(e,t,n){return(0,a.postEndpoint)(s,"/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations",{path:{chainId:e,safe_address:t},body:n})},t.proposeTransaction=function(e,t,n){return(0,a.postEndpoint)(s,"/v1/chains/{chainId}/transactions/{safe_address}/propose",{path:{chainId:e,safe_address:t},body:n})},t.getChainsConfig=function(e){return(0,a.getEndpoint)(s,"/v1/chains",{query:e})},t.getChainConfig=function(e){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}",{path:{chainId:e}})},t.getSafeApps=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/safe-apps",{path:{chainId:e},query:t})},t.getMasterCopies=function(e){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/about/master-copies",{path:{chainId:e}})},t.getDecodedData=function(e,t,n){return(0,a.postEndpoint)(s,"/v1/chains/{chainId}/data-decoder",{path:{chainId:e},body:{data:t,to:n}})},t.getSafeMessages=function(e,t,n){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:e,safe_address:t},query:{}},n)},t.getSafeMessage=function(e,t){return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/messages/{message_hash}",{path:{chainId:e,message_hash:t}})},t.proposeSafeMessage=function(e,t,n){return(0,a.postEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:e,safe_address:t},body:n})},t.confirmSafeMessage=function(e,t,n){return(0,a.postEndpoint)(s,"/v1/chains/{chainId}/messages/{message_hash}/signatures",{path:{chainId:e,message_hash:t},body:n})},t.getDelegates=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.getEndpoint)(s,"/v1/chains/{chainId}/delegates",{path:{chainId:e},query:t})}},47413:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FEATURES=t.GAS_PRICE_TYPE=t.RPC_AUTHENTICATION=void 0,function(e){e.API_KEY_PATH="API_KEY_PATH",e.NO_AUTHENTICATION="NO_AUTHENTICATION",e.UNKNOWN="UNKNOWN"}(t.RPC_AUTHENTICATION||(t.RPC_AUTHENTICATION={})),function(e){e.ORACLE="ORACLE",e.FIXED="FIXED",e.FIXED_1559="FIXED1559",e.UNKNOWN="UNKNOWN"}(t.GAS_PRICE_TYPE||(t.GAS_PRICE_TYPE={})),function(e){e.ERC721="ERC721",e.SAFE_APPS="SAFE_APPS",e.CONTRACT_INTERACTION="CONTRACT_INTERACTION",e.DOMAIN_LOOKUP="DOMAIN_LOOKUP",e.SPENDING_LIMIT="SPENDING_LIMIT",e.EIP1559="EIP1559",e.SAFE_TX_GAS_OPTIONAL="SAFE_TX_GAS_OPTIONAL",e.TX_SIMULATION="TX_SIMULATION",e.EIP1271="EIP1271"}(t.FEATURES||(t.FEATURES={}))},67874:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenType=void 0,function(e){e.ERC20="ERC20",e.ERC721="ERC721",e.NATIVE_TOKEN="NATIVE_TOKEN"}(t.TokenType||(t.TokenType={}))},71309:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},20691:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68496:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeAppSocialPlatforms=t.SafeAppFeatures=t.SafeAppAccessPolicyTypes=void 0,function(e){e.NoRestrictions="NO_RESTRICTIONS",e.DomainAllowlist="DOMAIN_ALLOWLIST"}(t.SafeAppAccessPolicyTypes||(t.SafeAppAccessPolicyTypes={})),function(e){e.BATCHED_TRANSACTIONS="BATCHED_TRANSACTIONS"}(t.SafeAppFeatures||(t.SafeAppFeatures={})),function(e){e.TWITTER="TWITTER",e.GITHUB="GITHUB",e.DISCORD="DISCORD"}(t.SafeAppSocialPlatforms||(t.SafeAppSocialPlatforms={}))},80641:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationVersionState=void 0,function(e){e.UP_TO_DATE="UP_TO_DATE",e.OUTDATED="OUTDATED",e.UNKNOWN="UNKNOWN"}(t.ImplementationVersionState||(t.ImplementationVersionState={}))},17542:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeMessageStatus=t.SafeMessageListItemType=void 0,function(e){e.DATE_LABEL="DATE_LABEL",e.MESSAGE="MESSAGE"}(t.SafeMessageListItemType||(t.SafeMessageListItemType={})),function(e){e.NEEDS_CONFIRMATION="NEEDS_CONFIRMATION",e.CONFIRMED="CONFIRMED"}(t.SafeMessageStatus||(t.SafeMessageStatus={}))},52498:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LabelValue=t.DetailedExecutionInfoType=t.TransactionListItemType=t.ConflictType=t.TransactionInfoType=t.SettingsInfoType=t.TransactionTokenType=t.TransferDirection=t.TransactionStatus=t.Operation=void 0,function(e){e[e.CALL=0]="CALL",e[e.DELEGATE=1]="DELEGATE"}(t.Operation||(t.Operation={})),function(e){e.AWAITING_CONFIRMATIONS="AWAITING_CONFIRMATIONS",e.AWAITING_EXECUTION="AWAITING_EXECUTION",e.CANCELLED="CANCELLED",e.FAILED="FAILED",e.SUCCESS="SUCCESS"}(t.TransactionStatus||(t.TransactionStatus={})),function(e){e.INCOMING="INCOMING",e.OUTGOING="OUTGOING",e.UNKNOWN="UNKNOWN"}(t.TransferDirection||(t.TransferDirection={})),function(e){e.ERC20="ERC20",e.ERC721="ERC721",e.NATIVE_COIN="NATIVE_COIN"}(t.TransactionTokenType||(t.TransactionTokenType={})),function(e){e.SET_FALLBACK_HANDLER="SET_FALLBACK_HANDLER",e.ADD_OWNER="ADD_OWNER",e.REMOVE_OWNER="REMOVE_OWNER",e.SWAP_OWNER="SWAP_OWNER",e.CHANGE_THRESHOLD="CHANGE_THRESHOLD",e.CHANGE_IMPLEMENTATION="CHANGE_IMPLEMENTATION",e.ENABLE_MODULE="ENABLE_MODULE",e.DISABLE_MODULE="DISABLE_MODULE",e.SET_GUARD="SET_GUARD",e.DELETE_GUARD="DELETE_GUARD"}(t.SettingsInfoType||(t.SettingsInfoType={})),function(e){e.TRANSFER="Transfer",e.SETTINGS_CHANGE="SettingsChange",e.CUSTOM="Custom",e.CREATION="Creation"}(t.TransactionInfoType||(t.TransactionInfoType={})),function(e){e.NONE="None",e.HAS_NEXT="HasNext",e.END="End"}(t.ConflictType||(t.ConflictType={})),function(e){e.TRANSACTION="TRANSACTION",e.LABEL="LABEL",e.CONFLICT_HEADER="CONFLICT_HEADER",e.DATE_LABEL="DATE_LABEL"}(t.TransactionListItemType||(t.TransactionListItemType={})),function(e){e.MULTISIG="MULTISIG",e.MODULE="MODULE"}(t.DetailedExecutionInfoType||(t.DetailedExecutionInfoType={})),function(e){e.Queued="Queued",e.Next="Next"}(t.LabelValue||(t.LabelValue={}))},26301:function(e,t,n){"use strict";var r=n(17061).default,i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchData=t.stringifyQuery=t.insertParams=void 0;var o=a(n(71652));t.insertParams=function(e,t){return t?Object.keys(t).reduce((function(e,n){return function(e,t,n){return e.replace(new RegExp("\\{".concat(t,"\\}"),"g"),n)}(e,n,String(t[n]))}),e):e},t.stringifyQuery=function(e){if(!e)return"";var t=new URLSearchParams;Object.keys(e).forEach((function(n){null!=e[n]&&t.append(n,String(e[n]))}));var n=t.toString();return n?"?".concat(n):""},t.fetchData=function(e,t){return i(this,void 0,void 0,r().mark((function n(){var i,a,s,u;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null!=t&&(i={method:"POST",body:"string"===typeof t?t:JSON.stringify(t),headers:{"Content-Type":"application/json"}}),n.next=3,(0,o.default)(e,i);case 3:return a=n.sent,n.prev=4,n.next=7,a.json();case 7:s=n.sent,n.next=14;break;case 10:if(n.prev=10,n.t0=n.catch(4),!a.headers||"0"===a.headers.get("content-length")){n.next=14;break}throw new Error("Invalid response content: ".concat(a.statusText));case 14:if(a.ok){n.next=17;break}throw u="object"===typeof(r=s)&&null!==r&&"code"in r&&"message"in r?"".concat(s.code,": ").concat(s.message):a.statusText,new Error(u);case 17:return n.abrupt("return",s);case 18:case"end":return n.stop()}var r}),n,null,[[4,10]])})))}},71652:function(e,t){var n="undefined"!==typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,o="ArrayBuffer"in e;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!==typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!==typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function m(e){var t=new FileReader,n=h(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"===typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"===typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;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?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=h(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function x(e){var t=new d;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t}function k(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},y.call(g.prototype),y.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},k.error=function(){var e=new k(null,{status:0,statusText:""});return e.type="error",e};var A=[301,302,303,307,308];k.redirect=function(e,t){if(-1===A.indexOf(t))throw new RangeError("Invalid status code");return new k(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(_){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new Promise((function(r,a){var o=new g(e,n);if(o.signal&&o.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:x(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;r(new k(t,e))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",u)}),s.send("undefined"===typeof o._bodyInit?null:o._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=d,e.Request=g,e.Response=k),t.Headers=d,t.Request=g,t.Response=k,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},79734:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(44654);function i(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>8,t[n+1]=e>>>0,t}function a(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t}function o(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function s(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function u(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function c(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function l(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>24,t[n+1]=e>>>16,t[n+2]=e>>>8,t[n+3]=e>>>0,t}function f(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24,t}function d(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),l(e/4294967296>>>0,t,n),l(e>>>0,t,n+4),t}function p(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),f(e>>>0,t,n),f(e/4294967296>>>0,t,n+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=a,t.writeInt16LE=a,t.readInt32BE=o,t.readUint32BE=s,t.readInt32LE=u,t.readUint32LE=c,t.writeUint32BE=l,t.writeInt32BE=l,t.writeUint32LE=f,t.writeInt32LE=f,t.readInt64BE=function(e,t){void 0===t&&(t=0);var n=o(e,t),r=o(e,t+4);return 4294967296*n+r-4294967296*(r>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*s(e,t)+s(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var n=u(e,t);return 4294967296*u(e,t+4)+n-4294967296*(n>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var n=c(e,t);return 4294967296*c(e,t+4)+n},t.writeUint64BE=d,t.writeInt64BE=d,t.writeUint64LE=p,t.writeInt64LE=p,t.readUintBE=function(e,t,n){if(void 0===n&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var r=0,i=1,a=e/8+n-1;a>=n;a--)r+=t[a]*i,i*=256;return r},t.readUintLE=function(e,t,n){if(void 0===n&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var r=0,i=1,a=n;a=i;o--)n[o]=t/a&255,a*=256;return n},t.writeUintLE=function(e,t,n,i){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!r.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var a=1,o=i;o>>16|M<<16)|0)>>>20|_<<12,T=(T^=I=I+(N=(N^=k=k+T|0)>>>16|N<<16)|0)>>>20|T<<12,S=(S^=P=P+(j=(j^=A=A+S|0)>>>16|j<<16)|0)>>>20|S<<12,C=(C^=R=R+(L=(L^=E=E+C|0)>>>16|L<<16)|0)>>>20|C<<12,S=(S^=P=P+(j=(j^=A=A+S|0)>>>24|j<<8)|0)>>>25|S<<7,C=(C^=R=R+(L=(L^=E=E+C|0)>>>24|L<<8)|0)>>>25|C<<7,T=(T^=I=I+(N=(N^=k=k+T|0)>>>24|N<<8)|0)>>>25|T<<7,_=(_^=O=O+(M=(M^=x=x+_|0)>>>24|M<<8)|0)>>>25|_<<7,T=(T^=P=P+(L=(L^=x=x+T|0)>>>16|L<<16)|0)>>>20|T<<12,S=(S^=R=R+(M=(M^=k=k+S|0)>>>16|M<<16)|0)>>>20|S<<12,C=(C^=O=O+(N=(N^=A=A+C|0)>>>16|N<<16)|0)>>>20|C<<12,_=(_^=I=I+(j=(j^=E=E+_|0)>>>16|j<<16)|0)>>>20|_<<12,C=(C^=O=O+(N=(N^=A=A+C|0)>>>24|N<<8)|0)>>>25|C<<7,_=(_^=I=I+(j=(j^=E=E+_|0)>>>24|j<<8)|0)>>>25|_<<7,S=(S^=R=R+(M=(M^=k=k+S|0)>>>24|M<<8)|0)>>>25|S<<7,T=(T^=P=P+(L=(L^=x=x+T|0)>>>24|L<<8)|0)>>>25|T<<7;r.writeUint32LE(x+i|0,e,0),r.writeUint32LE(k+o|0,e,4),r.writeUint32LE(A+s|0,e,8),r.writeUint32LE(E+u|0,e,12),r.writeUint32LE(_+c|0,e,16),r.writeUint32LE(T+l|0,e,20),r.writeUint32LE(S+f|0,e,24),r.writeUint32LE(C+d|0,e,28),r.writeUint32LE(O+p|0,e,32),r.writeUint32LE(I+h|0,e,36),r.writeUint32LE(P+m|0,e,40),r.writeUint32LE(R+v|0,e,44),r.writeUint32LE(M+y|0,e,48),r.writeUint32LE(N+b|0,e,52),r.writeUint32LE(j+g|0,e,56),r.writeUint32LE(L+w|0,e,60)}function s(e,t,n,r,a){if(void 0===a&&(a=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(r.length>>=8,t++;if(r>0)throw new Error("ChaCha: counter overflow")}t.streamXOR=s,t.stream=function(e,t,n,r){return void 0===r&&(r=0),i.wipe(n),s(e,t,n,n,r)}},74533:function(e,t,n){"use strict";var r=n(42873),i=n(82625),a=n(63227),o=n(79734),s=n(46852);t.Cv=32,t.WH=12,t.pg=16;var u=new Uint8Array(16),c=function(){function e(e){if(this.nonceLength=t.WH,this.tagLength=t.pg,e.length!==t.Cv)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return e.prototype.seal=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var o=new Uint8Array(16);o.set(e,o.length-e.length);var s=new Uint8Array(32);r.stream(this._key,o,s,4);var u,c=t.length+this.tagLength;if(i){if(i.length!==c)throw new Error("ChaCha20Poly1305: incorrect destination length");u=i}else u=new Uint8Array(c);return r.streamXOR(this._key,o,t,u,4),this._authenticate(u.subarray(u.length-this.tagLength,u.length),s,u.subarray(0,u.length-this.tagLength),n),a.wipe(o),u},e.prototype.open=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(t.length0&&s.update(u.subarray(r.length%16))),s.update(n),n.length%16>0&&s.update(u.subarray(n.length%16));var c=new Uint8Array(8);r&&o.writeUint64LE(r.length,c),s.update(c),o.writeUint64LE(n.length,c),s.update(c);for(var l=s.digest(),f=0;f>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,n){return~(e-1)&t|e-1&n},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=n,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==n(e,t)}},44519:function(e,t,n){"use strict";t.Xx=t._w=t.aP=t.KS=t.jQ=void 0;var r=n(14701),i=n(21956),a=n(63227);function o(e){var t=new Float64Array(16);if(e)for(var n=0;n>16&1),n[s-1]&=65535;n[15]=r[15]-32767-(n[14]>>16&1);var u=n[15]>>16&1;n[14]&=65535,v(r,n,1-u)}for(var c=0;c<16;c++)e[2*c]=255&r[c],e[2*c+1]=r[c]>>8}function b(e,t){for(var n=0,r=0;r<32;r++)n|=e[r]^t[r];return(1&n-1>>>8)-1}function g(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return y(n,e),y(r,t),b(n,r)}function w(e){var t=new Uint8Array(32);return y(t,e),1&t[0]}function x(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function k(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function A(e,t,n){var r,i,a=0,o=0,s=0,u=0,c=0,l=0,f=0,d=0,p=0,h=0,m=0,v=0,y=0,b=0,g=0,w=0,x=0,k=0,A=0,E=0,_=0,T=0,S=0,C=0,O=0,I=0,P=0,R=0,M=0,N=0,j=0,L=n[0],D=n[1],B=n[2],U=n[3],F=n[4],Z=n[5],z=n[6],H=n[7],q=n[8],V=n[9],W=n[10],G=n[11],Y=n[12],K=n[13],J=n[14],Q=n[15];a+=(r=t[0])*L,o+=r*D,s+=r*B,u+=r*U,c+=r*F,l+=r*Z,f+=r*z,d+=r*H,p+=r*q,h+=r*V,m+=r*W,v+=r*G,y+=r*Y,b+=r*K,g+=r*J,w+=r*Q,o+=(r=t[1])*L,s+=r*D,u+=r*B,c+=r*U,l+=r*F,f+=r*Z,d+=r*z,p+=r*H,h+=r*q,m+=r*V,v+=r*W,y+=r*G,b+=r*Y,g+=r*K,w+=r*J,x+=r*Q,s+=(r=t[2])*L,u+=r*D,c+=r*B,l+=r*U,f+=r*F,d+=r*Z,p+=r*z,h+=r*H,m+=r*q,v+=r*V,y+=r*W,b+=r*G,g+=r*Y,w+=r*K,x+=r*J,k+=r*Q,u+=(r=t[3])*L,c+=r*D,l+=r*B,f+=r*U,d+=r*F,p+=r*Z,h+=r*z,m+=r*H,v+=r*q,y+=r*V,b+=r*W,g+=r*G,w+=r*Y,x+=r*K,k+=r*J,A+=r*Q,c+=(r=t[4])*L,l+=r*D,f+=r*B,d+=r*U,p+=r*F,h+=r*Z,m+=r*z,v+=r*H,y+=r*q,b+=r*V,g+=r*W,w+=r*G,x+=r*Y,k+=r*K,A+=r*J,E+=r*Q,l+=(r=t[5])*L,f+=r*D,d+=r*B,p+=r*U,h+=r*F,m+=r*Z,v+=r*z,y+=r*H,b+=r*q,g+=r*V,w+=r*W,x+=r*G,k+=r*Y,A+=r*K,E+=r*J,_+=r*Q,f+=(r=t[6])*L,d+=r*D,p+=r*B,h+=r*U,m+=r*F,v+=r*Z,y+=r*z,b+=r*H,g+=r*q,w+=r*V,x+=r*W,k+=r*G,A+=r*Y,E+=r*K,_+=r*J,T+=r*Q,d+=(r=t[7])*L,p+=r*D,h+=r*B,m+=r*U,v+=r*F,y+=r*Z,b+=r*z,g+=r*H,w+=r*q,x+=r*V,k+=r*W,A+=r*G,E+=r*Y,_+=r*K,T+=r*J,S+=r*Q,p+=(r=t[8])*L,h+=r*D,m+=r*B,v+=r*U,y+=r*F,b+=r*Z,g+=r*z,w+=r*H,x+=r*q,k+=r*V,A+=r*W,E+=r*G,_+=r*Y,T+=r*K,S+=r*J,C+=r*Q,h+=(r=t[9])*L,m+=r*D,v+=r*B,y+=r*U,b+=r*F,g+=r*Z,w+=r*z,x+=r*H,k+=r*q,A+=r*V,E+=r*W,_+=r*G,T+=r*Y,S+=r*K,C+=r*J,O+=r*Q,m+=(r=t[10])*L,v+=r*D,y+=r*B,b+=r*U,g+=r*F,w+=r*Z,x+=r*z,k+=r*H,A+=r*q,E+=r*V,_+=r*W,T+=r*G,S+=r*Y,C+=r*K,O+=r*J,I+=r*Q,v+=(r=t[11])*L,y+=r*D,b+=r*B,g+=r*U,w+=r*F,x+=r*Z,k+=r*z,A+=r*H,E+=r*q,_+=r*V,T+=r*W,S+=r*G,C+=r*Y,O+=r*K,I+=r*J,P+=r*Q,y+=(r=t[12])*L,b+=r*D,g+=r*B,w+=r*U,x+=r*F,k+=r*Z,A+=r*z,E+=r*H,_+=r*q,T+=r*V,S+=r*W,C+=r*G,O+=r*Y,I+=r*K,P+=r*J,R+=r*Q,b+=(r=t[13])*L,g+=r*D,w+=r*B,x+=r*U,k+=r*F,A+=r*Z,E+=r*z,_+=r*H,T+=r*q,S+=r*V,C+=r*W,O+=r*G,I+=r*Y,P+=r*K,R+=r*J,M+=r*Q,g+=(r=t[14])*L,w+=r*D,x+=r*B,k+=r*U,A+=r*F,E+=r*Z,_+=r*z,T+=r*H,S+=r*q,C+=r*V,O+=r*W,I+=r*G,P+=r*Y,R+=r*K,M+=r*J,N+=r*Q,w+=(r=t[15])*L,o+=38*(k+=r*B),s+=38*(A+=r*U),u+=38*(E+=r*F),c+=38*(_+=r*Z),l+=38*(T+=r*z),f+=38*(S+=r*H),d+=38*(C+=r*q),p+=38*(O+=r*V),h+=38*(I+=r*W),m+=38*(P+=r*G),v+=38*(R+=r*Y),y+=38*(M+=r*K),b+=38*(N+=r*J),g+=38*(j+=r*Q),a=(r=(a+=38*(x+=r*D))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),o=(r=o+i+65535)-65536*(i=Math.floor(r/65536)),s=(r=s+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),w=(r=w+i+65535)-65536*(i=Math.floor(r/65536)),a=(r=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),o=(r=o+i+65535)-65536*(i=Math.floor(r/65536)),s=(r=s+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),w=(r=w+i+65535)-65536*(i=Math.floor(r/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=u,e[4]=c,e[5]=l,e[6]=f,e[7]=d,e[8]=p,e[9]=h,e[10]=m,e[11]=v,e[12]=y,e[13]=b,e[14]=g,e[15]=w}function E(e,t){A(e,t,t)}function _(e,t){var n,r=o();for(n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)E(r,r),2!==n&&4!==n&&A(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}function T(e,t){var n=o(),r=o(),i=o(),a=o(),s=o(),u=o(),c=o(),f=o(),d=o();k(n,e[1],e[0]),k(d,t[1],t[0]),A(n,n,d),x(r,e[0],e[1]),x(d,t[0],t[1]),A(r,r,d),A(i,e[3],t[3]),A(i,i,l),A(a,e[2],t[2]),x(a,a,a),k(s,r,n),k(u,a,i),x(c,a,i),x(f,r,n),A(e[0],s,u),A(e[1],f,c),A(e[2],c,u),A(e[3],s,f)}function S(e,t,n){for(var r=0;r<4;r++)v(e[r],t[r],n)}function C(e,t){var n=o(),r=o(),i=o();_(i,t[2]),A(n,t[0],i),A(r,t[1],i),y(e,r),e[31]^=w(n)<<7}function O(e,t,n){h(e[0],s),h(e[1],u),h(e[2],u),h(e[3],s);for(var r=255;r>=0;--r){var i=n[r/8|0]>>(7&r)&1;S(e,t,i),T(t,e),T(e,e),S(e,t,i)}}function I(e,t){var n=[o(),o(),o(),o()];h(n[0],f),h(n[1],d),h(n[2],u),A(n[3],f,d),O(e,n,t)}function P(e){if(e.length!==t.aP)throw new Error("ed25519: seed must be ".concat(t.aP," bytes"));var n=(0,i.hash)(e);n[0]&=248,n[31]&=127,n[31]|=64;var r=new Uint8Array(32),a=[o(),o(),o(),o()];I(a,n),C(r,a);var s=new Uint8Array(64);return s.set(e),s.set(r,32),{publicKey:r,secretKey:s}}t._w=P;var R=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 M(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i>4)*R[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*R[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function N(e){for(var t=new Float64Array(64),n=0;n<64;n++)t[n]=e[n];for(var r=0;r<64;r++)e[r]=0;M(e,t)}function j(e,t){var n=o(),r=o(),i=o(),a=o(),l=o(),f=o(),d=o();return h(e[2],u),function(e,t){for(var n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}(e[1],t),E(i,e[1]),A(a,i,c),k(i,i,e[2]),x(a,e[2],a),E(l,a),E(f,l),A(d,f,l),A(n,d,i),A(n,n,a),function(e,t){var n,r=o();for(n=0;n<16;n++)r[n]=t[n];for(n=250;n>=0;n--)E(r,r),1!==n&&A(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}(n,n),A(n,n,i),A(n,n,a),A(n,n,a),A(e[0],n,a),E(r,e[0]),A(r,r,a),g(r,i)&&A(e[0],e[0],p),E(r,e[0]),A(r,r,a),g(r,i)?-1:(w(e[0])===t[31]>>7&&k(e[0],s,e[0]),A(e[3],e[0],e[1]),0)}t.Xx=function(e,t){var n=new Float64Array(64),r=[o(),o(),o(),o()],a=(0,i.hash)(e.subarray(0,32));a[0]&=248,a[31]&=127,a[31]|=64;var s=new Uint8Array(64);s.set(a.subarray(32),32);var u=new i.SHA512;u.update(s.subarray(32)),u.update(t);var c=u.digest();u.clean(),N(c),I(r,c),C(s,r),u.reset(),u.update(s.subarray(0,32)),u.update(e.subarray(32)),u.update(t);var l=u.digest();N(l);for(var f=0;f<32;f++)n[f]=c[f];for(var d=0;d<32;d++)for(var p=0;p<32;p++)n[d+p]+=l[d]*a[p];return M(s.subarray(32),n),s}},15202:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return"undefined"!==typeof e.saveState&&"undefined"!==typeof e.restoreState&&"undefined"!==typeof e.cleanSavedState}},81791:function(e,t,n){"use strict";var r=n(51680),i=n(63227),a=function(){function e(e,t,n,i){void 0===n&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=r.hmac(this._hash,n,t);this._hmac=new r.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(e){for(var t=new Uint8Array(e),n=0;nthis.blockSize?this._inner.update(t).finish(n).clean():n.set(t);for(var i=0;i>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},82625:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(46852),i=n(63227);t.DIGEST_LENGTH=16;var a=function(){function e(e){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var n=e[0]|e[1]<<8;this._r[0]=8191&n;var r=e[2]|e[3]<<8;this._r[1]=8191&(n>>>13|r<<3);var i=e[4]|e[5]<<8;this._r[2]=7939&(r>>>10|i<<6);var a=e[6]|e[7]<<8;this._r[3]=8191&(i>>>7|a<<9);var o=e[8]|e[9]<<8;this._r[4]=255&(a>>>4|o<<12),this._r[5]=o>>>1&8190;var s=e[10]|e[11]<<8;this._r[6]=8191&(o>>>14|s<<2);var u=e[12]|e[13]<<8;this._r[7]=8065&(s>>>11|u<<5);var c=e[14]|e[15]<<8;this._r[8]=8191&(u>>>8|c<<8),this._r[9]=c>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return e.prototype._blocks=function(e,t,n){for(var r=this._fin?0:2048,i=this._h[0],a=this._h[1],o=this._h[2],s=this._h[3],u=this._h[4],c=this._h[5],l=this._h[6],f=this._h[7],d=this._h[8],p=this._h[9],h=this._r[0],m=this._r[1],v=this._r[2],y=this._r[3],b=this._r[4],g=this._r[5],w=this._r[6],x=this._r[7],k=this._r[8],A=this._r[9];n>=16;){var E=e[t+0]|e[t+1]<<8;i+=8191&E;var _=e[t+2]|e[t+3]<<8;a+=8191&(E>>>13|_<<3);var T=e[t+4]|e[t+5]<<8;o+=8191&(_>>>10|T<<6);var S=e[t+6]|e[t+7]<<8;s+=8191&(T>>>7|S<<9);var C=e[t+8]|e[t+9]<<8;u+=8191&(S>>>4|C<<12),c+=C>>>1&8191;var O=e[t+10]|e[t+11]<<8;l+=8191&(C>>>14|O<<2);var I=e[t+12]|e[t+13]<<8;f+=8191&(O>>>11|I<<5);var P=e[t+14]|e[t+15]<<8,R=0,M=R;M+=i*h,M+=a*(5*A),M+=o*(5*k),M+=s*(5*x),R=(M+=u*(5*w))>>>13,M&=8191,M+=c*(5*g),M+=l*(5*b),M+=f*(5*y),M+=(d+=8191&(I>>>8|P<<8))*(5*v);var N=R+=(M+=(p+=P>>>5|r)*(5*m))>>>13;N+=i*m,N+=a*h,N+=o*(5*A),N+=s*(5*k),R=(N+=u*(5*x))>>>13,N&=8191,N+=c*(5*w),N+=l*(5*g),N+=f*(5*b),N+=d*(5*y),R+=(N+=p*(5*v))>>>13,N&=8191;var j=R;j+=i*v,j+=a*m,j+=o*h,j+=s*(5*A),R=(j+=u*(5*k))>>>13,j&=8191,j+=c*(5*x),j+=l*(5*w),j+=f*(5*g),j+=d*(5*b);var L=R+=(j+=p*(5*y))>>>13;L+=i*y,L+=a*v,L+=o*m,L+=s*h,R=(L+=u*(5*A))>>>13,L&=8191,L+=c*(5*k),L+=l*(5*x),L+=f*(5*w),L+=d*(5*g);var D=R+=(L+=p*(5*b))>>>13;D+=i*b,D+=a*y,D+=o*v,D+=s*m,R=(D+=u*h)>>>13,D&=8191,D+=c*(5*A),D+=l*(5*k),D+=f*(5*x),D+=d*(5*w);var B=R+=(D+=p*(5*g))>>>13;B+=i*g,B+=a*b,B+=o*y,B+=s*v,R=(B+=u*m)>>>13,B&=8191,B+=c*h,B+=l*(5*A),B+=f*(5*k),B+=d*(5*x);var U=R+=(B+=p*(5*w))>>>13;U+=i*w,U+=a*g,U+=o*b,U+=s*y,R=(U+=u*v)>>>13,U&=8191,U+=c*m,U+=l*h,U+=f*(5*A),U+=d*(5*k);var F=R+=(U+=p*(5*x))>>>13;F+=i*x,F+=a*w,F+=o*g,F+=s*b,R=(F+=u*y)>>>13,F&=8191,F+=c*v,F+=l*m,F+=f*h,F+=d*(5*A);var Z=R+=(F+=p*(5*k))>>>13;Z+=i*k,Z+=a*x,Z+=o*w,Z+=s*g,R=(Z+=u*b)>>>13,Z&=8191,Z+=c*y,Z+=l*v,Z+=f*m,Z+=d*h;var z=R+=(Z+=p*(5*A))>>>13;z+=i*A,z+=a*k,z+=o*x,z+=s*w,R=(z+=u*g)>>>13,z&=8191,z+=c*b,z+=l*y,z+=f*v,z+=d*m,i=M=8191&(R=(R=((R+=(z+=p*h)>>>13)<<2)+R|0)+(M&=8191)|0),a=N+=R>>>=13,o=j&=8191,s=L&=8191,u=D&=8191,c=B&=8191,l=U&=8191,f=F&=8191,d=Z&=8191,p=z&=8191,t+=16,n-=16}this._h[0]=i,this._h[1]=a,this._h[2]=o,this._h[3]=s,this._h[4]=u,this._h[5]=c,this._h[6]=l,this._h[7]=f,this._h[8]=d,this._h[9]=p},e.prototype.finish=function(e,t){void 0===t&&(t=0);var n,r,i,a,o=new Uint16Array(10);if(this._leftover){for(a=this._leftover,this._buffer[a++]=1;a<16;a++)this._buffer[a]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(n=this._h[1]>>>13,this._h[1]&=8191,a=2;a<10;a++)this._h[a]+=n,n=this._h[a]>>>13,this._h[a]&=8191;for(this._h[0]+=5*n,n=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=n,n=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=n,o[0]=this._h[0]+5,n=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this._h[a]+n,n=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,r=(1^n)-1,a=0;a<10;a++)o[a]&=r;for(r=~r,a=0;a<10;a++)this._h[a]=this._h[a]&r|o[a];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),i=this._h[0]+this._pad[0],this._h[0]=65535&i,a=1;a<8;a++)i=(this._h[a]+this._pad[a]|0)+(i>>>16)|0,this._h[a]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},e.prototype.update=function(e){var t,n=0,r=e.length;if(this._leftover){(t=16-this._leftover)>r&&(t=r);for(var i=0;i=16&&(t=r-r%16,this._blocks(e,n,t),n+=t,r-=t),r){for(i=0;i1&&void 0!==arguments[1]?arguments[1]:t.defaultRandomSource).randomBytes(e)}t.defaultRandomSource=new r.SystemRandomSource,t.randomBytes=o,t.randomUint32=function(){var e=o(4,arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.defaultRandomSource),n=(0,i.readUint32LE)(e);return(0,a.wipe)(e),n};var s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.defaultRandomSource;if(n.length<2)throw new Error("randomString charset is too short");if(n.length>256)throw new Error("randomString charset is too long");for(var i="",u=n.length,c=256-256%u;e>0;){for(var l=o(Math.ceil(256*e/c),r),f=0;f0;f++){var d=l[f];d1&&void 0!==arguments[1]?arguments[1]:s,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.defaultRandomSource;return u(Math.ceil(e/(Math.log(n.length)/Math.LN2)),n,r)}},93687:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;var a=function(){function e(){r(this,e),this.isAvailable=!1,this.isInstantiated=!1;var t="undefined"!==typeof self?self.crypto||self.msCrypto:null;t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}return i(e,[{key:"randomBytes",value:function(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");for(var t=new Uint8Array(e),n=0;n0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=s(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,a=t<<3,o=t%64<56?64:128;this._buffer[n]=128;for(var u=n+1;u0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.mE=a;var o=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 s(e,t,n,i,a){for(;a>=64;){for(var s=t[0],u=t[1],c=t[2],l=t[3],f=t[4],d=t[5],p=t[6],h=t[7],m=0;m<16;m++){var v=i+4*m;e[m]=r.readUint32BE(n,v)}for(m=16;m<64;m++){var y=e[m-2],b=(y>>>17|y<<15)^(y>>>19|y<<13)^y>>>10,g=((y=e[m-15])>>>7|y<<25)^(y>>>18|y<<14)^y>>>3;e[m]=(b+e[m-7]|0)+(g+e[m-16]|0)}for(m=0;m<64;m++){b=(((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&d^~f&p)|0)+(h+(o[m]+e[m]|0)|0)|0,g=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&u^s&c^u&c)|0;h=p,p=d,d=f,f=l+b|0,l=c,c=u,u=s,s=b+g|0}t[0]+=s,t[1]+=u,t[2]+=c,t[3]+=l,t[4]+=f,t[5]+=d,t[6]+=p,t[7]+=h,i+=64,a-=64}return i}t.vp=function(e){var t=new a;t.update(e);var n=t.digest();return t.clean(),n}},21956:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(79734),i=n(63227);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var a=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.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},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,n){if(void 0===n&&(n=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var r=0;if(this._bytesHashed+=n,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[r++],n--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(n>=this.blockSize&&(r=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,r,n),n%=this.blockSize);n>0;)this._buffer[this._bufferLength++]=e[r++],n--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,a=t<<3,o=t%128<112?128:256;this._buffer[n]=128;for(var u=n+1;u0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.stateHi),i.wipe(e.stateLo),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=a;var o=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 s(e,t,n,i,a,s,u){for(var c,l,f,d,p,h,m,v,y=n[0],b=n[1],g=n[2],w=n[3],x=n[4],k=n[5],A=n[6],E=n[7],_=i[0],T=i[1],S=i[2],C=i[3],O=i[4],I=i[5],P=i[6],R=i[7];u>=128;){for(var M=0;M<16;M++){var N=8*M+s;e[M]=r.readUint32BE(a,N),t[M]=r.readUint32BE(a,N+4)}for(M=0;M<80;M++){var j,L,D=y,B=b,U=g,F=w,Z=x,z=k,H=A,q=_,V=T,W=S,G=C,Y=O,K=I,J=P;if(p=65535&(l=R),h=l>>>16,m=65535&(c=E),v=c>>>16,p+=65535&(l=(O>>>14|x<<18)^(O>>>18|x<<14)^(x>>>9|O<<23)),h+=l>>>16,m+=65535&(c=(x>>>14|O<<18)^(x>>>18|O<<14)^(O>>>9|x<<23)),v+=c>>>16,p+=65535&(l=O&I^~O&P),h+=l>>>16,m+=65535&(c=x&k^~x&A),v+=c>>>16,c=o[2*M],p+=65535&(l=o[2*M+1]),h+=l>>>16,m+=65535&c,v+=c>>>16,c=e[M%16],h+=(l=t[M%16])>>>16,m+=65535&c,v+=c>>>16,m+=(h+=(p+=65535&l)>>>16)>>>16,p=65535&(l=d=65535&p|h<<16),h=l>>>16,m=65535&(c=f=65535&m|(v+=m>>>16)<<16),v=c>>>16,p+=65535&(l=(_>>>28|y<<4)^(y>>>2|_<<30)^(y>>>7|_<<25)),h+=l>>>16,m+=65535&(c=(y>>>28|_<<4)^(_>>>2|y<<30)^(_>>>7|y<<25)),v+=c>>>16,h+=(l=_&T^_&S^T&S)>>>16,m+=65535&(c=y&b^y&g^b&g),v+=c>>>16,j=65535&(m+=(h+=(p+=65535&l)>>>16)>>>16)|(v+=m>>>16)<<16,L=65535&p|h<<16,p=65535&(l=G),h=l>>>16,m=65535&(c=F),v=c>>>16,h+=(l=d)>>>16,m+=65535&(c=f),v+=c>>>16,b=D,g=B,w=U,x=F=65535&(m+=(h+=(p+=65535&l)>>>16)>>>16)|(v+=m>>>16)<<16,k=Z,A=z,E=H,y=j,T=q,S=V,C=W,O=G=65535&p|h<<16,I=Y,P=K,R=J,_=L,M%16===15)for(N=0;N<16;N++)c=e[N],p=65535&(l=t[N]),h=l>>>16,m=65535&c,v=c>>>16,c=e[(N+9)%16],p+=65535&(l=t[(N+9)%16]),h+=l>>>16,m+=65535&c,v+=c>>>16,f=e[(N+1)%16],p+=65535&(l=((d=t[(N+1)%16])>>>1|f<<31)^(d>>>8|f<<24)^(d>>>7|f<<25)),h+=l>>>16,m+=65535&(c=(f>>>1|d<<31)^(f>>>8|d<<24)^f>>>7),v+=c>>>16,f=e[(N+14)%16],h+=(l=((d=t[(N+14)%16])>>>19|f<<13)^(f>>>29|d<<3)^(d>>>6|f<<26))>>>16,m+=65535&(c=(f>>>19|d<<13)^(d>>>29|f<<3)^f>>>6),v+=c>>>16,v+=(m+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,e[N]=65535&m|v<<16,t[N]=65535&p|h<<16}p=65535&(l=_),h=l>>>16,m=65535&(c=y),v=c>>>16,c=n[0],h+=(l=i[0])>>>16,m+=65535&c,v+=c>>>16,v+=(m+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[0]=y=65535&m|v<<16,i[0]=_=65535&p|h<<16,p=65535&(l=T),h=l>>>16,m=65535&(c=b),v=c>>>16,c=n[1],h+=(l=i[1])>>>16,m+=65535&c,v+=c>>>16,v+=(m+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[1]=b=65535&m|v<<16,i[1]=T=65535&p|h<<16,p=65535&(l=S),h=l>>>16,m=65535&(c=g),v=c>>>16,c=n[2],h+=(l=i[2])>>>16,m+=65535&c,v+=c>>>16,v+=(m+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[2]=g=65535&m|v<<16,i[2]=S=65535&p|h<<16,p=65535&(l=C),h=l>>>16,m=65535&(c=w),v=c>>>16,c=n[3],h+=(l=i[3])>>>16,m+=65535&c,v+=c>>>16,v+=(m+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[3]=w=65535&m|v<<16,i[3]=C=65535&p|h<<16,p=65535&(l=O),h=l>>>16,m=65535&(c=x),v=c>>>16,c=n[4],h+=(l=i[4])>>>16,m+=65535&c,v+=c>>>16,v+=(m+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[4]=x=65535&m|v<<16,i[4]=O=65535&p|h<<16,p=65535&(l=I),h=l>>>16,m=65535&(c=k),v=c>>>16,c=n[5],h+=(l=i[5])>>>16,m+=65535&c,v+=c>>>16,v+=(m+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[5]=k=65535&m|v<<16,i[5]=I=65535&p|h<<16,p=65535&(l=P),h=l>>>16,m=65535&(c=A),v=c>>>16,c=n[6],h+=(l=i[6])>>>16,m+=65535&c,v+=c>>>16,v+=(m+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[6]=A=65535&m|v<<16,i[6]=P=65535&p|h<<16,p=65535&(l=R),h=l>>>16,m=65535&(c=E),v=c>>>16,c=n[7],h+=(l=i[7])>>>16,m+=65535&c,v+=c>>>16,v+=(m+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[7]=E=65535&m|v<<16,i[7]=R=65535&p|h<<16,s+=128,u-=128}return s}t.hash=function(e){var t=new a;t.update(e);var n=t.digest();return t.clean(),n}},63227:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t=0;--w){var x=n[w>>>3]>>>(7&w)&1;c(i,o,x),c(h,m,x),l(v,i,h),f(i,i,h),l(h,o,m),f(o,o,m),p(m,v),p(y,i),d(i,h,i),d(h,o,v),l(v,i,h),f(i,i,h),p(o,i),f(h,m,y),d(i,h,s),l(i,i,m),d(h,h,i),d(i,m,y),d(m,o,r),p(o,v),c(i,o,x),c(h,m,x)}for(var k=0;k<16;k++)r[k+16]=i[k],r[k+32]=h[k],r[k+48]=o[k],r[k+64]=m[k];var A=r.subarray(32),E=r.subarray(16);!function(e,t){for(var n=a(),r=0;r<16;r++)n[r]=t[r];for(var i=253;i>=0;i--)p(n,n),2!==i&&4!==i&&d(n,n,t);for(var o=0;o<16;o++)e[o]=n[o]}(A,A),d(E,E,A);var _=new Uint8Array(32);return function(e,t){for(var n=a(),r=a(),i=0;i<16;i++)r[i]=t[i];u(r),u(r),u(r);for(var o=0;o<2;o++){n[0]=r[0]-65517;for(var s=1;s<15;s++)n[s]=r[s]-65535-(n[s-1]>>16&1),n[s-1]&=65535;n[15]=r[15]-32767-(n[14]>>16&1);var l=n[15]>>16&1;n[14]&=65535,c(r,n,1-l)}for(var f=0;f<16;f++)e[2*f]=255&r[f],e[2*f+1]=r[f]>>8}(_,E),_}function m(e){return h(e,o)}function v(e){if(e.length!==t.KS)throw new Error("x25519: seed must be ".concat(t.KS," bytes"));var n=new Uint8Array(e);return{publicKey:m(n),secretKey:n}}t.Au=function(e){var t=(0,r.randomBytes)(32,e),n=v(t);return(0,i.wipe)(t),n},t.gi=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.length!==t.kz)throw new Error("X25519: incorrect secret key length");if(n.length!==t.kz)throw new Error("X25519: incorrect public key length");var i=h(e,n);if(r){for(var a=0,o=0;o=0)return i(e,t,t);var n=Math.abs(t),r=i(e,n,n);return"string"===typeof r?"-"+r:-1*r},f=["margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","top","bottom","left","right"].reduce((function(e,t){var n;return r({},e,((n={})[t]=l,n))}),{}),d=function(e){return function(t){var n={},r=i(t,"breakpoints",a),o=[null].concat(r.map((function(e){return"@media screen and (min-width: "+e+")"})));for(var s in e){var u="function"===typeof e[s]?e[s](t):e[s];if(null!=u)if(Array.isArray(u))for(var c=0;c0||s(!1),1==t.length)return e.INTERFACE.encodeFunctionData("callPositionManager",t);var n=c.NonfungiblePositionManager.INTERFACE.encodeFunctionData("multicall",[t]);return e.INTERFACE.encodeFunctionData("callPositionManager",[n])},e.encodeAddLiquidity=function(t,n,r,i){var o=t.mintAmountsWithSlippage(i),s=o.amount0,u=o.amount1;return a.lessThan(n.amount0.quotient,s)&&(s=n.amount0.quotient),a.lessThan(n.amount1.quotient,u)&&(u=n.amount1.quotient),w(r)?e.INTERFACE.encodeFunctionData("mint",[{token0:t.pool.token0.address,token1:t.pool.token1.address,fee:t.pool.fee,tickLower:t.tickLower,tickUpper:t.tickUpper,amount0Min:c.toHex(s),amount1Min:c.toHex(u),recipient:r.recipient}]):e.INTERFACE.encodeFunctionData("increaseLiquidity",[{token0:t.pool.token0.address,token1:t.pool.token1.address,amount0Min:c.toHex(s),amount1Min:c.toHex(u),tokenId:c.toHex(r.tokenId)}])},e.encodeApprove=function(n,r){switch(r){case t.ApprovalTypes.MAX:return e.encodeApproveMax(n.wrapped);case t.ApprovalTypes.MAX_MINUS_ONE:return e.encodeApproveMaxMinusOne(n.wrapped);case t.ApprovalTypes.ZERO_THEN_MAX:return e.encodeApproveZeroThenMax(n.wrapped);case t.ApprovalTypes.ZERO_THEN_MAX_MINUS_ONE:return e.encodeApproveZeroThenMaxMinusOne(n.wrapped);default:throw"Error: invalid ApprovalType"}},e}();x.INTERFACE=new o.Interface(u.abi);var k=function(){function e(){}return e.encodeMulticall=function(t,n){if(void 0===n)return c.Multicall.encodeMulticall(t);if(Array.isArray(t)||(t=[t]),"string"==typeof n&&n.startsWith("0x")){var r=function(e){if(!e.match(/^0x[0-9a-fA-F]{64}$/))throw new Error(e+" is not valid bytes32.");return e.toLowerCase()}(n);return e.INTERFACE.encodeFunctionData("multicall(bytes32,bytes[])",[r,t])}var i=c.toHex(n);return e.INTERFACE.encodeFunctionData("multicall(uint256,bytes[])",[i,t])},e}();function A(e){return c.toHex(e.multiply(1e4).quotient)}k.INTERFACE=new o.Interface(l.abi);var E=function(){function e(){}return e.encodeUnwrapWETH9=function(t,n,r){if("string"==typeof n)return c.Payments.encodeUnwrapWETH9(t,n,r);if(r){var i=A(r.fee),a=f.validateAndParseAddress(r.recipient);return e.INTERFACE.encodeFunctionData("unwrapWETH9WithFee(uint256,uint256,address)",[c.toHex(t),i,a])}return e.INTERFACE.encodeFunctionData("unwrapWETH9(uint256)",[c.toHex(t)])},e.encodeSweepToken=function(t,n,r,i){if("string"==typeof r)return c.Payments.encodeSweepToken(t,n,r,i);if(i){var a=A(i.fee),o=f.validateAndParseAddress(i.recipient);return e.INTERFACE.encodeFunctionData("sweepTokenWithFee(address,uint256,uint256,address)",[t.address,c.toHex(n),a,o])}return e.INTERFACE.encodeFunctionData("sweepToken(address,uint256)",[t.address,c.toHex(n)])},e.encodePull=function(t,n){return e.INTERFACE.encodeFunctionData("pull",[t.address,c.toHex(n)])},e.encodeWrapETH=function(t){return e.INTERFACE.encodeFunctionData("wrapETH",[c.toHex(t)])},e}();function _(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function T(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){_(a,r,i,o,s,"next",e)}function s(e){_(a,r,i,o,s,"throw",e)}o(void 0)}))}}function S(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}E.INTERFACE=new o.Interface(d.abi);var M,N=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=Object.create((t&&t.prototype instanceof f?t:f).prototype),a=new A(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=w(o,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function f(){}function d(){}function p(){}var h={};s(h,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(E([])));v&&v!==t&&n.call(v,i)&&(h=v);var y=p.prototype=f.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function g(e,t){var r;this._invoke=function(i,a){function o(){return new t((function(r,o){!function r(i,a,o,s){var u=c(e[i],e,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(f).then((function(e){l.value=e,o(l)}),(function(e){return r("throw",e,o,s)}))}s(u.arg)}(i,a,r,o)}))}return r=r?r.then(o,o):o()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function E(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(M={exports:{}}),M.exports),j=function(){function e(e,t,n){this._midPrice=null,e.length>0||s(!1);var r=e[0].chainId;e.every((function(e){return e.chainId===r}))||s(!1);var i=t.wrapped;e[0].involvesToken(i)||s(!1),e[e.length-1].involvesToken(n.wrapped)||s(!1);for(var a,o=[i],u=R(e.entries());!(a=u()).done;){var c=a.value,l=c[1],f=o[c[0]];f.equals(l.token0)||f.equals(l.token1)||s(!1);var d=f.equals(l.token0)?l.token1:l.token0;o.push(d)}this.pools=e,this.path=o,this.input=t,this.output=null!=n?n:o[o.length-1]}return C(e,[{key:"chainId",get:function(){return this.pools[0].chainId}},{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;var e=this.pools.slice(1).reduce((function(e,t){var n=e.price;return e.nextInput.equals(t.token0)?{nextInput:t.token1,price:n.multiply(t.token0Price)}:{nextInput:t.token0,price:n.multiply(t.token1Price)}}),this.pools[0].token0.equals(this.input.wrapped)?{nextInput:this.pools[0].token1,price:this.pools[0].token0Price}:{nextInput:this.pools[0].token0,price:this.pools[0].token1Price}).price;return this._midPrice=new f.Price(this.input,this.output,e.denominator,e.numerator)}}]),e}();function L(e,t){return e.inputAmount.currency.equals(t.inputAmount.currency)||s(!1),e.outputAmount.currency.equals(t.outputAmount.currency)||s(!1),e.outputAmount.equalTo(t.outputAmount)?e.inputAmount.equalTo(t.inputAmount)?e.swaps.reduce((function(e,t){return e+t.route.path.length}),0)-t.swaps.reduce((function(e,t){return e+t.route.path.length}),0):e.inputAmount.lessThan(t.inputAmount)?-1:1:e.outputAmount.lessThan(t.outputAmount)?1:-1}var D,B=function(){function e(e){var t=e.routes,n=e.tradeType,r=t[0].inputAmount.currency,i=t[0].outputAmount.currency;t.every((function(e){return r.wrapped.equals(e.route.input.wrapped)}))||s(!1),t.every((function(e){return i.wrapped.equals(e.route.output.wrapped)}))||s(!1);for(var a,o=t.map((function(e){return e.route.pools.length})).reduce((function(e,t){return e+t}),0),u=new Set,l=R(t);!(a=l()).done;)for(var d,p=R(a.value.route.pools);!(d=p()).done;){var m=d.value;u.add(m instanceof c.Pool?c.Pool.getAddress(m.token0,m.token1,m.fee):h.Pair.getAddress(m.token0,m.token1))}o!=u.size&&s(!1),n!==f.TradeType.EXACT_INPUT&&s(!1),this.swaps=t,this.tradeType=n}e.fromRoute=function(){var t=T(N.mark((function t(n,r,i){var a,o,u,c,l;return N.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=new Array(n.path.length),i!==f.TradeType.EXACT_INPUT&&s(!1),r.currency.equals(n.input)||s(!1),a[0]=r.wrapped,c=0;case 5:if(!(c0||s(!1),v>0||s(!1),r===u||o.length>0||s(!1),y=u.wrapped,g=i.wrapped,w=0;case 10:if(!(w1&&n.length>1)){t.next=46;break}return A=n.slice(0,w).concat(n.slice(w+1,n.length)),t.next=46,e.bestTradeExactIn(A,r,i,{maxNumResults:p,maxHops:v-1},[].concat(o,[x]),k,c);case 46:w++,t.next=10;break;case 49:return t.abrupt("return",c);case 50:case"end":return t.stop()}}),t,null,[[18,26]])})));return function(e,n,r,i,a,o,s){return t.apply(this,arguments)}}(),C(e,[{key:"route",get:function(){return 1!=this.swaps.length&&s(!1),this.swaps[0].route}},{key:"inputAmount",get:function(){if(this._inputAmount)return this._inputAmount;var e=this.swaps[0].inputAmount.currency,t=this.swaps.map((function(e){return e.inputAmount})).reduce((function(e,t){return e.add(t)}),f.CurrencyAmount.fromRawAmount(e,0));return this._inputAmount=t,this._inputAmount}},{key:"outputAmount",get:function(){if(this._outputAmount)return this._outputAmount;var e=this.swaps[0].outputAmount.currency,t=this.swaps.map((function(e){return e.outputAmount})).reduce((function(e,t){return e.add(t)}),f.CurrencyAmount.fromRawAmount(e,0));return this._outputAmount=t,this._outputAmount}},{key:"executionPrice",get:function(){var e;return null!=(e=this._executionPrice)?e:this._executionPrice=new f.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient)}},{key:"priceImpact",get:function(){if(this._priceImpact)return this._priceImpact;for(var e,t=f.CurrencyAmount.fromRawAmount(this.outputAmount.currency,0),n=R(this.swaps);!(e=n()).done;){var r=e.value;t=t.add(r.route.midPrice.quote(r.inputAmount))}var i=t.subtract(this.outputAmount).divide(t);return this._priceImpact=new f.Percent(i.numerator,i.denominator),this._priceImpact}}]),e}();(D=t.Protocol||(t.Protocol={})).V2="V2",D.V3="V3",D.MIXED="MIXED";var U=function(e){function n(n){var r;return(r=e.call(this,n.pairs,n.input,n.output)||this).protocol=t.Protocol.V2,r.pools=r.pairs,r}return I(n,e),n}(h.Route),F=function(e){function n(n){var r;return(r=e.call(this,n.pools,n.input,n.output)||this).protocol=t.Protocol.V3,r.path=n.tokenPath,r}return I(n,e),n}(c.Route),Z=function(e){function n(n){var r;return(r=e.call(this,n.pools,n.input,n.output)||this).protocol=t.Protocol.MIXED,r}return I(n,e),n}(j),z=function(){function e(e){var t=e.v2Routes,n=e.v3Routes,r=e.tradeType,i=e.mixedRoutes;this.swaps=[],this.routes=[];for(var a,o=R(t);!(a=o()).done;){var u=a.value,l=u.inputAmount,f=u.outputAmount,d=new U(u.routev2);this.routes.push(d),this.swaps.push({route:d,inputAmount:l,outputAmount:f})}for(var p,m=R(n);!(p=m()).done;){var v=p.value,y=v.inputAmount,b=v.outputAmount,g=new F(v.routev3);this.routes.push(g),this.swaps.push({route:g,inputAmount:y,outputAmount:b})}if(i)for(var w,x=R(i);!(w=x()).done;){var k=w.value,A=k.inputAmount,E=k.outputAmount,_=new Z(k.mixedRoute);this.routes.push(_),this.swaps.push({route:_,inputAmount:A,outputAmount:E})}this.tradeType=r;var T=this.swaps[0].inputAmount.currency,S=this.swaps[0].outputAmount.currency;this.swaps.every((function(e){return T.wrapped.equals(e.route.input.wrapped)}))||s(!1),this.swaps.every((function(e){return S.wrapped.equals(e.route.output.wrapped)}))||s(!1);for(var C,O=this.swaps.map((function(e){return e.route.pools.length})).reduce((function(e,t){return e+t}),0),I=new Set,P=R(this.swaps);!(C=P()).done;)for(var M,N=R(C.value.route.pools);!(M=N()).done;){var j=M.value;if(j instanceof c.Pool)I.add(c.Pool.getAddress(j.token0,j.token1,j.fee));else{if(!(j instanceof h.Pair))throw new Error("Unexpected pool type in route when constructing trade object");I.add(h.Pair.getAddress(j.token0,j.token1))}}O!=I.size&&s(!1)}var t=e.prototype;return t.minimumAmountOut=function(e,t){if(void 0===t&&(t=this.outputAmount),e.lessThan(b)&&s(!1),this.tradeType===f.TradeType.EXACT_OUTPUT)return t;var n=new f.Fraction(g).add(e).invert().multiply(t.quotient).quotient;return f.CurrencyAmount.fromRawAmount(t.currency,n)},t.maximumAmountIn=function(e,t){if(void 0===t&&(t=this.inputAmount),e.lessThan(b)&&s(!1),this.tradeType===f.TradeType.EXACT_INPUT)return t;var n=new f.Fraction(g).add(e).multiply(t.quotient).quotient;return f.CurrencyAmount.fromRawAmount(t.currency,n)},t.worstExecutionPrice=function(e){return new f.Price(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(e).quotient,this.minimumAmountOut(e).quotient)},e.fromRoutes=function(){var t=T(N.mark((function t(n,r,i,a){var o,s,u,l,f,d,p,m,v,y,b,g,w,x,k,A,E,_,T,S;return N.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o=[],s=[],u=[],l=R(n);!(f=l()).done;)m=new h.Trade(p=(d=f.value).routev2,d.amount,i),o.push({routev2:p,inputAmount:m.inputAmount,outputAmount:m.outputAmount});v=R(r);case 5:if((y=v()).done){t.next=14;break}return g=(b=y.value).routev3,w=b.amount,t.next=9,c.Trade.fromRoute(g,w,i);case 9:s.push({routev3:g,inputAmount:(x=t.sent).inputAmount,outputAmount:x.outputAmount});case 12:t.next=5;break;case 14:if(!a){t.next=25;break}k=R(a);case 16:if((A=k()).done){t.next=25;break}return _=(E=A.value).mixedRoute,T=E.amount,t.next=20,B.fromRoute(_,T,i);case 20:u.push({mixedRoute:_,inputAmount:(S=t.sent).inputAmount,outputAmount:S.outputAmount});case 23:t.next=16;break;case 25:return t.abrupt("return",new e({v2Routes:o,v3Routes:s,mixedRoutes:u,tradeType:i}));case 26:case"end":return t.stop()}}),t)})));return function(e,n,r,i){return t.apply(this,arguments)}}(),e.fromRoute=function(){var t=T(N.mark((function t(n,r,i){var a,o,s,u,l,f;return N.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=[],o=[],s=[],!(n instanceof h.Route)){t.next=9;break}u=new h.Trade(n,r,i),a=[{routev2:n,inputAmount:u.inputAmount,outputAmount:u.outputAmount}],t.next=26;break;case 9:if(!(n instanceof c.Route)){t.next=17;break}return t.next=12,c.Trade.fromRoute(n,r,i);case 12:o=[{routev3:n,inputAmount:(l=t.sent).inputAmount,outputAmount:l.outputAmount}],t.next=26;break;case 17:if(!(n instanceof j)){t.next=25;break}return t.next=20,B.fromRoute(n,r,i);case 20:s=[{mixedRoute:n,inputAmount:(f=t.sent).inputAmount,outputAmount:f.outputAmount}],t.next=26;break;case 25:throw new Error("Invalid route type");case 26:return t.abrupt("return",new e({v2Routes:a,v3Routes:o,mixedRoutes:s,tradeType:i}));case 27:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),C(e,[{key:"inputAmount",get:function(){if(this._inputAmount)return this._inputAmount;var e=this.swaps[0].inputAmount.currency,t=this.swaps.map((function(e){return e.inputAmount})).reduce((function(e,t){return e.add(t)}),f.CurrencyAmount.fromRawAmount(e,0));return this._inputAmount=t,this._inputAmount}},{key:"outputAmount",get:function(){if(this._outputAmount)return this._outputAmount;var e=this.swaps[0].outputAmount.currency,t=this.swaps.map((function(e){return e.outputAmount})).reduce((function(e,t){return e.add(t)}),f.CurrencyAmount.fromRawAmount(e,0));return this._outputAmount=t,this._outputAmount}},{key:"executionPrice",get:function(){var e;return null!=(e=this._executionPrice)?e:this._executionPrice=new f.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient)}},{key:"priceImpact",get:function(){if(this._priceImpact)return this._priceImpact;for(var e,t=f.CurrencyAmount.fromRawAmount(this.outputAmount.currency,0),n=R(this.swaps);!(e=n()).done;){var r=e.value;t=t.add(r.route.midPrice.quote(r.inputAmount))}var i=t.subtract(this.outputAmount).divide(t);return this._priceImpact=new f.Percent(i.numerator,i.denominator),this._priceImpact}}]),e}();function H(e){var t=e.pools.reduce((function(e,t,n){var r=e.inputToken,i=e.path,a=e.types,o=t.token0.equals(r)?t.token1:t.token0;return 0===n?{inputToken:o,types:["address","uint24","address"],path:[r.address,t instanceof c.Pool?t.fee:8388608,o.address]}:{inputToken:o,types:[].concat(a,["uint24","address"]),path:[].concat(i,[t instanceof c.Pool?t.fee:8388608,o.address])}}),{inputToken:e.input.wrapped,path:[],types:[]});return m.pack(t.types,t.path)}var q=function(e){for(var t=[],n=0,r=0;r2,k=w||!!r.fee||!!i||x;r.inputTokenPermit&&(y.inputAmount.currency.isToken||s(!1),b.push(c.SelfPermit.encodePermit(y.inputAmount.currency,r.inputTokenPermit)));for(var A,E=R(n);!(A=E()).done;){var _=A.value;if(_ instanceof h.Trade)b.push(e.encodeV2Swap(_,r,k,x));else if(_ instanceof c.Trade)for(var T,S=R(e.encodeV3Swap(_,r,k,x));!(T=S()).done;)b.push(T.value);else{if(!(_ instanceof B))throw new Error("Unsupported trade object");for(var C,O=R(e.encodeMixedRouteSwap(_,r,k,x));!(C=O()).done;)b.push(C.value)}}var I=f.CurrencyAmount.fromRawAmount(y.inputAmount.currency,0),P=f.CurrencyAmount.fromRawAmount(y.outputAmount.currency,0),M=n.reduce((function(e,t){return e.add(t.minimumAmountOut(r.slippageTolerance))}),P),N=n.reduce((function(e,t){return e.add(t.outputAmount)}),P),j=n.reduce((function(e,t){return e.add(t.maximumAmountIn(r.slippageTolerance))}),I);return{calldatas:b,sampleTrade:y,routerMustCustody:k,inputIsNative:g,outputIsNative:w,totalAmountIn:j,minimumAmountOut:M,quoteAmountOut:N}},e.swapCallParameters=function(t,n){var r=e.encodeSwaps(t,n),i=r.calldatas,a=r.sampleTrade,o=r.inputIsNative,s=r.totalAmountIn,u=r.minimumAmountOut;return r.routerMustCustody&&i.push(r.outputIsNative?E.encodeUnwrapWETH9(u.quotient,n.recipient,n.fee):E.encodeSweepToken(a.outputAmount.currency.wrapped,u.quotient,n.recipient,n.fee)),o&&(a.tradeType===f.TradeType.EXACT_OUTPUT||e.riskOfPartialFill(t))&&i.push(c.Payments.encodeRefundETH()),{calldata:k.encodeMulticall(i,n.deadlineOrPreviousBlockhash),value:c.toHex(o?s.quotient:W)}},e.swapAndAddCallParameters=function(n,r,i,a,o,u){var l=e.encodeSwaps(n,r,!0),d=l.calldatas,p=l.inputIsNative,h=l.outputIsNative,m=l.sampleTrade,v=l.totalAmountIn,y=l.quoteAmountOut,b=l.minimumAmountOut;r.outputTokenPermit&&(y.currency.isToken||s(!1),d.push(c.SelfPermit.encodePermit(y.currency,r.outputTokenPermit)));var g=m.route.chainId,w=i.pool.token0.wrapped.address===v.currency.wrapped.address,A=e.getPositionAmounts(i,w),_=A.positionAmountIn,T=A.positionAmountOut,S=p?f.WETH9[g]:_.currency.wrapped,C=h?f.WETH9[g]:T.currency.wrapped,O=T.subtract(y.wrapped);O.greaterThan(f.CurrencyAmount.fromRawAmount(T.currency,0))&&d.push(h?E.encodeWrapETH(O.quotient):E.encodePull(C,O.quotient)),d.push(p?E.encodeWrapETH(_.quotient):E.encodePull(S,_.quotient)),o!==t.ApprovalTypes.NOT_REQUIRED&&d.push(x.encodeApprove(S,o)),u!==t.ApprovalTypes.NOT_REQUIRED&&d.push(x.encodeApprove(C,u));var I,P=c.Position.fromAmounts({pool:i.pool,tickLower:i.tickLower,tickUpper:i.tickUpper,amount0:w?i.amount0.quotient.toString():b.quotient.toString(),amount1:w?b.quotient.toString():i.amount1.quotient.toString(),useFullPrecision:!1});return d.push(x.encodeAddLiquidity(i,P,a,r.slippageTolerance)),d.push(p?E.encodeUnwrapWETH9(W):E.encodeSweepToken(S,W)),d.push(h?E.encodeUnwrapWETH9(W):E.encodeSweepToken(C,W)),I=p?v.wrapped.add(_.wrapped).quotient:h?O.quotient:W,{calldata:k.encodeMulticall(d,r.deadlineOrPreviousBlockhash),value:I.toString()}},e.riskOfPartialFill=function(t){return Array.isArray(t)?t.some((function(t){return e.v3TradeWithHighPriceImpact(t)})):e.v3TradeWithHighPriceImpact(t)},e.v3TradeWithHighPriceImpact=function(e){return!(e instanceof h.Trade)&&e.priceImpact.greaterThan(G)},e.getPositionAmounts=function(e,t){var n=e.mintAmounts,r=n.amount1,i=f.CurrencyAmount.fromRawAmount(e.pool.token0,n.amount0),a=f.CurrencyAmount.fromRawAmount(e.pool.token1,r),o=t?[i,a]:[a,i];return{positionAmountIn:o[0],positionAmountOut:o[1]}},e}();Y.INTERFACE=new o.Interface(p.abi),t.ADDRESS_THIS=y,t.ApproveAndCall=x,t.MSG_SENDER=v,t.MixedRoute=Z,t.MixedRouteSDK=j,t.MixedRouteTrade=B,t.MulticallExtended=k,t.ONE=g,t.PaymentsExtended=E,t.RouteV2=U,t.RouteV3=F,t.SwapRouter=Y,t.Trade=z,t.V2_FEE_PATH_PLACEHOLDER=8388608,t.ZERO=b,t.encodeMixedRouteToPath=H,t.getOutputOfPools=V,t.isMint=w,t.partitionMixedRouteByProtocol=q,t.tradeComparator=L},66331:function(e,t,n){"use strict";n.r(t),n.d(t,{CurrencyAmount:function(){return C},Ether:function(){return F},Fraction:function(){return T},MaxUint256:function(){return b},NativeCurrency:function(){return N},Percent:function(){return P},Price:function(){return R},Rounding:function(){return a},SupportedChainId:function(){return r},Token:function(){return B},TradeType:function(){return i},WETH9:function(){return U},computePriceImpact:function(){return Z},sortedInsert:function(){return z},sqrt:function(){return G},validateAndParseAddress:function(){return j}});var r,i,a,o=n(77492),s=n.n(o),u=n(17389),c=n(61759),l=n.n(c),f=n(76791),d=n.n(f),p=n(26997),h=n.n(p),m=n(28552);!function(e){e[e.MAINNET=1]="MAINNET",e[e.GOERLI=5]="GOERLI",e[e.SEPOLIA=11155111]="SEPOLIA",e[e.ARBITRUM_ONE=42161]="ARBITRUM_ONE",e[e.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",e[e.OPTIMISM=10]="OPTIMISM",e[e.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",e[e.POLYGON=137]="POLYGON",e[e.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",e[e.CELO=42220]="CELO",e[e.CELO_ALFAJORES=44787]="CELO_ALFAJORES",e[e.BNB=56]="BNB"}(r||(r={})),function(e){e[e.EXACT_INPUT=0]="EXACT_INPUT",e[e.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(i||(i={})),function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP"}(a||(a={}));var v,y,b=s().BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function g(e,t){for(var n=0;n0||(0,u.Z)(!1),k.set({precision:e+1,rounding:E[n]});var r=new k(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return r.toFormat(r.decimalPlaces(),t)},t.toFixed=function(e,t,n){return void 0===t&&(t={groupSeparator:""}),void 0===n&&(n=a.ROUND_HALF_UP),Number.isInteger(e)||(0,u.Z)(!1),e>=0||(0,u.Z)(!1),A.DP=e,A.RM=_[n],new A(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,t)},w(e,[{key:"quotient",get:function(){return s().divide(this.numerator,this.denominator)}},{key:"remainder",get:function(){return new e(s().remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function(){return new e(this.numerator,this.denominator)}}]),e}(),S=h()(d()),C=function(e){function t(t,n,r){var i;return i=e.call(this,n,r)||this,s().lessThanOrEqual(i.quotient,b)||(0,u.Z)(!1),i.currency=t,i.decimalScale=s().exponentiate(s().BigInt(10),s().BigInt(t.decimals)),i}x(t,e),t.fromRawAmount=function(e,n){return new t(e,n)},t.fromFractionalAmount=function(e,n,r){return new t(e,n,r)};var n=t.prototype;return n.add=function(n){this.currency.equals(n.currency)||(0,u.Z)(!1);var r=e.prototype.add.call(this,n);return t.fromFractionalAmount(this.currency,r.numerator,r.denominator)},n.subtract=function(n){this.currency.equals(n.currency)||(0,u.Z)(!1);var r=e.prototype.subtract.call(this,n);return t.fromFractionalAmount(this.currency,r.numerator,r.denominator)},n.multiply=function(n){var r=e.prototype.multiply.call(this,n);return t.fromFractionalAmount(this.currency,r.numerator,r.denominator)},n.divide=function(n){var r=e.prototype.divide.call(this,n);return t.fromFractionalAmount(this.currency,r.numerator,r.denominator)},n.toSignificant=function(t,n,r){return void 0===t&&(t=6),void 0===r&&(r=a.ROUND_DOWN),e.prototype.divide.call(this,this.decimalScale).toSignificant(t,n,r)},n.toFixed=function(t,n,r){return void 0===t&&(t=this.currency.decimals),void 0===r&&(r=a.ROUND_DOWN),t<=this.currency.decimals||(0,u.Z)(!1),e.prototype.divide.call(this,this.decimalScale).toFixed(t,n,r)},n.toExact=function(e){return void 0===e&&(e={groupSeparator:""}),S.DP=this.currency.decimals,new S(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(e)},w(t,[{key:"wrapped",get:function(){return this.currency.isToken?this:t.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}]),t}(T),O=new T(s().BigInt(100));function I(e){return new P(e.numerator,e.denominator)}var P=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isPercent=!0,t}x(t,e);var n=t.prototype;return n.add=function(t){return I(e.prototype.add.call(this,t))},n.subtract=function(t){return I(e.prototype.subtract.call(this,t))},n.multiply=function(t){return I(e.prototype.multiply.call(this,t))},n.divide=function(t){return I(e.prototype.divide.call(this,t))},n.toSignificant=function(t,n,r){return void 0===t&&(t=5),e.prototype.multiply.call(this,O).toSignificant(t,n,r)},n.toFixed=function(t,n,r){return void 0===t&&(t=2),e.prototype.multiply.call(this,O).toFixed(t,n,r)},t}(T),R=function(e){function t(){for(var t,n,r,i,a,o=arguments.length,u=new Array(o),c=0;c=0&&t<255&&Number.isInteger(t)||(0,u.Z)(!1),this.chainId=e,this.decimals=t,this.symbol=n,this.name=r},N=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isNative=!0,t.isToken=!1,t}return x(t,e),t}(M);function j(e){try{return(0,m.getAddress)(e)}catch(t){throw new Error(e+" is not a valid address.")}}var L=/^0x[0-9a-fA-F]{40}$/;var D,B=function(e){function t(t,n,r,i,a,o){var s;return(s=e.call(this,t,r,i,a)||this).isNative=!1,s.isToken=!0,s.address=o?function(e){if(L.test(e))return e;throw new Error(e+" is not a valid address.")}(n):j(n),s}x(t,e);var n=t.prototype;return n.equals=function(e){return e.isToken&&this.chainId===e.chainId&&this.address.toLowerCase()===e.address.toLowerCase()},n.sortsBefore=function(e){return this.chainId!==e.chainId&&(0,u.Z)(!1),this.address.toLowerCase()===e.address.toLowerCase()&&(0,u.Z)(!1),this.address.toLowerCase()0||(0,u.Z)(!1),e.length<=n||(0,u.Z)(!1),0===e.length)return e.push(t),null;var i=e.length===n;if(i&&r(e[e.length-1],t)<=0)return t;for(var a=0,o=e.length;a>>1;r(e[s],t)<=0?a=s+1:o=s}return e.splice(a,0,t),i?e.pop():null}F._etherCache={};var H=s().BigInt(Number.MAX_SAFE_INTEGER),q=s().BigInt(0),V=s().BigInt(1),W=s().BigInt(2);function G(e){if(s().greaterThanOrEqual(e,q)||(0,u.Z)(!1),s().lessThan(e,H))return s().BigInt(Math.floor(Math.sqrt(s().toNumber(e))));var t,n;for(t=e,n=s().add(s().divide(e,W),V);s().lessThan(n,t);)t=n,n=s().divide(s().add(s().divide(e,n),n),W);return t}},97435:function(e,t,n){"use strict";e.exports=n(79812)},79812:function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var i,a=r(n(42324)),o=n(22367),s=n(93487),u=n(85125),c=r(n(77492)),l=n(96749),f=n(97232),d=n(74892),p=n(67979),h=n(66331);function m(){return(m=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(i=t.PM||(t.PM={})).UniswapTrade="UniswapTrade",i.NFTTrade="NFTTrade",i.UnwrapWETH="UnwrapWETH";var g,w,x,k,A=function(e,n){this.tradeType=t.PM.NFTTrade,n.length>0||a(!1),this.market=e,this.orders=n};(g=t.IY||(t.IY={})).Foundation="foundation",g.LooksRareV2="looksrareV2",g.NFT20="nft20",g.NFTX="nftx",g.Seaport="seaport",g.Sudoswap="Sudoswap",g.Cryptopunks="cryptopunks",g.X2Y2="x2y2",g.Element="element",(w=t.iv||(t.iv={})).ERC721="ERC721",w.ERC1155="ERC1155",w.Cryptopunk="Cryptopunk",function(e){e[e.V3_SWAP_EXACT_IN=0]="V3_SWAP_EXACT_IN",e[e.V3_SWAP_EXACT_OUT=1]="V3_SWAP_EXACT_OUT",e[e.PERMIT2_TRANSFER_FROM=2]="PERMIT2_TRANSFER_FROM",e[e.PERMIT2_PERMIT_BATCH=3]="PERMIT2_PERMIT_BATCH",e[e.SWEEP=4]="SWEEP",e[e.TRANSFER=5]="TRANSFER",e[e.PAY_PORTION=6]="PAY_PORTION",e[e.V2_SWAP_EXACT_IN=8]="V2_SWAP_EXACT_IN",e[e.V2_SWAP_EXACT_OUT=9]="V2_SWAP_EXACT_OUT",e[e.PERMIT2_PERMIT=10]="PERMIT2_PERMIT",e[e.WRAP_ETH=11]="WRAP_ETH",e[e.UNWRAP_WETH=12]="UNWRAP_WETH",e[e.PERMIT2_TRANSFER_FROM_BATCH=13]="PERMIT2_TRANSFER_FROM_BATCH",e[e.BALANCE_CHECK_ERC20=14]="BALANCE_CHECK_ERC20",e[e.SEAPORT_V1_5=16]="SEAPORT_V1_5",e[e.LOOKS_RARE_V2=17]="LOOKS_RARE_V2",e[e.NFTX=18]="NFTX",e[e.CRYPTOPUNKS=19]="CRYPTOPUNKS",e[e.OWNER_CHECK_721=21]="OWNER_CHECK_721",e[e.OWNER_CHECK_1155=22]="OWNER_CHECK_1155",e[e.SWEEP_ERC721=23]="SWEEP_ERC721",e[e.X2Y2_721=24]="X2Y2_721",e[e.SUDOSWAP=25]="SUDOSWAP",e[e.NFT20=26]="NFT20",e[e.X2Y2_1155=27]="X2Y2_1155",e[e.FOUNDATION=28]="FOUNDATION",e[e.SWEEP_ERC1155=29]="SWEEP_ERC1155",e[e.ELEMENT_MARKET=30]="ELEMENT_MARKET",e[e.SEAPORT_V1_4=32]="SEAPORT_V1_4",e[e.EXECUTE_SUB_PLAN=33]="EXECUTE_SUB_PLAN",e[e.APPROVE_ERC20=34]="APPROVE_ERC20"}(k||(k={}));var E=new Set([k.SEAPORT_V1_5,k.SEAPORT_V1_4,k.NFTX,k.LOOKS_RARE_V2,k.X2Y2_721,k.X2Y2_1155,k.FOUNDATION,k.SUDOSWAP,k.NFT20,k.EXECUTE_SUB_PLAN,k.CRYPTOPUNKS,k.ELEMENT_MARKET]),_=((x={})[k.EXECUTE_SUB_PLAN]=["bytes","bytes[]"],x[k.PERMIT2_PERMIT]=["((address token,uint160 amount,uint48 expiration,uint48 nonce) details,address spender,uint256 sigDeadline)","bytes"],x[k.PERMIT2_PERMIT_BATCH]=["((address token,uint160 amount,uint48 expiration,uint48 nonce)[] details,address spender,uint256 sigDeadline)","bytes"],x[k.PERMIT2_TRANSFER_FROM]=["address","address","uint160"],x[k.PERMIT2_TRANSFER_FROM_BATCH]=["(address from,address to,uint160 amount,address token)[]"],x[k.V3_SWAP_EXACT_IN]=["address","uint256","uint256","bytes","bool"],x[k.V3_SWAP_EXACT_OUT]=["address","uint256","uint256","bytes","bool"],x[k.V2_SWAP_EXACT_IN]=["address","uint256","uint256","address[]","bool"],x[k.V2_SWAP_EXACT_OUT]=["address","uint256","uint256","address[]","bool"],x[k.WRAP_ETH]=["address","uint256"],x[k.UNWRAP_WETH]=["address","uint256"],x[k.SWEEP]=["address","address","uint256"],x[k.SWEEP_ERC721]=["address","address","uint256"],x[k.SWEEP_ERC1155]=["address","address","uint256","uint256"],x[k.TRANSFER]=["address","address","uint256"],x[k.PAY_PORTION]=["address","address","uint256"],x[k.BALANCE_CHECK_ERC20]=["address","address","uint256"],x[k.OWNER_CHECK_721]=["address","address","uint256"],x[k.OWNER_CHECK_1155]=["address","address","uint256","uint256"],x[k.APPROVE_ERC20]=["address","uint256"],x[k.SEAPORT_V1_5]=["uint256","bytes"],x[k.SEAPORT_V1_4]=["uint256","bytes"],x[k.NFTX]=["uint256","bytes"],x[k.LOOKS_RARE_V2]=["uint256","bytes"],x[k.X2Y2_721]=["uint256","bytes","address","address","uint256"],x[k.X2Y2_1155]=["uint256","bytes","address","address","uint256","uint256"],x[k.FOUNDATION]=["uint256","bytes","address","address","uint256"],x[k.SUDOSWAP]=["uint256","bytes"],x[k.NFT20]=["uint256","bytes"],x[k.CRYPTOPUNKS]=["uint256","address","uint256"],x[k.ELEMENT_MARKET]=["uint256","bytes"],x),T=function(){function e(){this.commands="0x",this.inputs=[]}var t=e.prototype;return t.addSubPlan=function(e){this.addCommand(k.EXECUTE_SUB_PLAN,[e.commands,e.inputs],!0)},t.addCommand=function(e,t,n){void 0===n&&(n=!1);var r=function(e,t){return{type:e,encodedInput:l.defaultAbiCoder.encode(_[e],t)}}(e,t);if(this.inputs.push(r.encodedInput),n){if(!E.has(r.type))throw new Error("command type: "+r.type+" cannot be allowed to revert");r.type=128|r.type}this.commands=this.commands.concat(r.type.toString(16).padStart(2,"0"))},e}(),S=function(e){switch(e){case 1:return"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";case 5:return"0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6";case 137:return"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270";case 80001:return"0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889";case 10:case 420:return"0x4200000000000000000000000000000000000006";case 42161:return"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";case 421613:return"0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3";case 56:return"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c";default:throw new Error("WETH9 or UniversalRouter not deployed on chain "+e)}},C=u.BigNumber.from(2).pow(255),O="0x0000000000000000000000000000000000000000",I="0x0000000000000000000000000000000000000000",P="0x0000000000000000000000000000000000000001",R="0x0000000000000000000000000000000000000002",M=new h.Percent(c.BigInt(50),c.BigInt(100)),N=function(){function e(e,n){this.trade=e,this.options=n,this.tradeType=t.PM.UniswapTrade}return e.prototype.encode=function(e,t){var n,r=!0;this.trade.inputAmount.currency.isNative&&(e.addCommand(k.WRAP_ETH,[R,this.trade.maximumAmountIn(this.options.slippageTolerance).quotient.toString()]),r=!1),this.options.recipient=null!=(n=this.options.recipient)?n:P;for(var i,a=this.trade.outputAmount.currency.isNative,o=this.trade.inputAmount.currency.isNative,s=this.trade.tradeType===h.TradeType.EXACT_INPUT&&this.trade.routes.length>2||a,u=b(this.trade.swaps);!(i=u()).done;){var c=i.value;switch(c.route.protocol){case p.Protocol.V2:j(e,c,this.trade.tradeType,this.options,r,s);break;case p.Protocol.V3:L(e,c,this.trade.tradeType,this.options,r,s);break;case p.Protocol.MIXED:D(e,c,this.trade.tradeType,this.options,r,s);break;default:throw new Error("UNSUPPORTED_TRADE_PROTOCOL")}}s&&(a?e.addCommand(k.UNWRAP_WETH,[this.options.recipient,this.trade.minimumAmountOut(this.options.slippageTolerance).quotient.toString()]):e.addCommand(k.SWEEP,[this.trade.outputAmount.currency.wrapped.address,this.options.recipient,this.trade.minimumAmountOut(this.options.slippageTolerance).quotient.toString()])),o&&(this.trade.tradeType===h.TradeType.EXACT_OUTPUT||this.trade.priceImpact.greaterThan(M))&&e.addCommand(k.UNWRAP_WETH,[this.options.recipient,0])},e}();function j(e,t,n,r,i,a){var o=t.route,s=new f.Trade(o,n==h.TradeType.EXACT_INPUT?t.inputAmount:t.outputAmount,n);n==h.TradeType.EXACT_INPUT?e.addCommand(k.V2_SWAP_EXACT_IN,[a?R:r.recipient,s.maximumAmountIn(r.slippageTolerance).quotient.toString(),s.minimumAmountOut(r.slippageTolerance).quotient.toString(),o.path.map((function(e){return e.address})),i]):n==h.TradeType.EXACT_OUTPUT&&e.addCommand(k.V2_SWAP_EXACT_OUT,[a?R:r.recipient,s.minimumAmountOut(r.slippageTolerance).quotient.toString(),s.maximumAmountIn(r.slippageTolerance).quotient.toString(),o.path.map((function(e){return e.address})),i])}function L(e,t,n,r,i,a){var o=t.route,s=d.Trade.createUncheckedTrade({route:o,inputAmount:t.inputAmount,outputAmount:t.outputAmount,tradeType:n}),u=d.encodeRouteToPath(o,s.tradeType===h.TradeType.EXACT_OUTPUT);n==h.TradeType.EXACT_INPUT?e.addCommand(k.V3_SWAP_EXACT_IN,[a?R:r.recipient,s.maximumAmountIn(r.slippageTolerance).quotient.toString(),s.minimumAmountOut(r.slippageTolerance).quotient.toString(),u,i]):n==h.TradeType.EXACT_OUTPUT&&e.addCommand(k.V3_SWAP_EXACT_OUT,[a?R:r.recipient,s.minimumAmountOut(r.slippageTolerance).quotient.toString(),s.maximumAmountIn(r.slippageTolerance).quotient.toString(),u,i])}function D(e,t,n,r,i,a){var o=t.route,s=t.inputAmount,u=t.outputAmount,c=a?R:r.recipient;if(1===o.pools.length){if(o.pools[0]instanceof d.Pool)return L(e,t,n,r,i,a);if(o.pools[0]instanceof f.Pair)return j(e,t,n,r,i,a);throw new Error("Invalid route type")}for(var l,h=p.MixedRouteTrade.createUncheckedTrade({route:o,inputAmount:s,outputAmount:u,tradeType:n}),m=h.maximumAmountIn(r.slippageTolerance,s).quotient.toString(),v=h.minimumAmountOut(r.slippageTolerance,u).quotient.toString(),y=p.partitionMixedRouteByProtocol(o),b=function(e){return e===y.length-1},g=o.input.wrapped,w=0;w=e||a(!1),this.permit2Data=r)}return e.prototype.encode=function(e,t){U(e,{permit2Permit:this.permit2Data,permit2TransferFrom:{token:this.wethAddress,amount:this.amount.toString()}}),e.addCommand(k.UNWRAP_WETH,[R,this.amount])},e}();t.UNIVERSAL_ROUTER_ADDRESS=function(e){switch(e){case 1:case 5:case 11155111:case 137:case 80001:case 10:case 420:case 42161:case 421613:case 42220:case 44787:case 56:return"0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD";default:throw new Error("Universal Router not deployed on chain "+e)}}},97232:function(e,t,n){"use strict";n.r(t),n.d(t,{FACTORY_ADDRESS:function(){return c},INIT_CODE_HASH:function(){return l},InsufficientInputAmountError:function(){return O},InsufficientReservesError:function(){return C},MINIMUM_LIQUIDITY:function(){return f},Pair:function(){return P},Route:function(){return R},Router:function(){return B},Trade:function(){return j},computePairAddress:function(){return I},inputOutputComparator:function(){return M},tradeComparator:function(){return N}});var r=n(77492),i=n.n(r),a=n(66331),o=n(17389),s=n(46684),u=n(28552),c="0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",l="0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",f=i().BigInt(1e3),d=i().BigInt(0),p=i().BigInt(1),h=i().BigInt(5),m=i().BigInt(997),v=i().BigInt(1e3);function y(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var S="setPrototypeOf"in Object,C=function(e){function t(){var n;return(n=e.call(this)||this).isInsufficientReservesError=!0,n.name=n.constructor.name,S&&Object.setPrototypeOf(E(n),(this instanceof t?this.constructor:void 0).prototype),n}return g(t,e),t}(A(Error)),O=function(e){function t(){var n;return(n=e.call(this)||this).isInsufficientInputAmountError=!0,n.name=n.constructor.name,S&&Object.setPrototypeOf(E(n),(this instanceof t?this.constructor:void 0).prototype),n}return g(t,e),t}(A(Error)),I=function(e){var t=e.factoryAddress,n=e.tokenA,r=e.tokenB,i=n.sortsBefore(r)?[n,r]:[r,n],a=i[0],o=i[1];return(0,u.getCreate2Address)(t,(0,s.keccak256)(["bytes"],[(0,s.pack)(["address","address"],[a.address,o.address])]),l)},P=function(){function e(t,n){var r=t.currency.sortsBefore(n.currency)?[t,n]:[n,t];this.liquidityToken=new a.Token(r[0].currency.chainId,e.getAddress(r[0].currency,r[1].currency),18,"UNI-V2","Uniswap V2"),this.tokenAmounts=r}e.getAddress=function(e,t){return I({factoryAddress:c,tokenA:e,tokenB:t})};var t=e.prototype;return t.involvesToken=function(e){return e.equals(this.token0)||e.equals(this.token1)},t.priceOf=function(e){return this.involvesToken(e)||(0,o.Z)(!1),e.equals(this.token0)?this.token0Price:this.token1Price},t.reserveOf=function(e){return this.involvesToken(e)||(0,o.Z)(!1),e.equals(this.token0)?this.reserve0:this.reserve1},t.getOutputAmount=function(t){if(this.involvesToken(t.currency)||(0,o.Z)(!1),i().equal(this.reserve0.quotient,d)||i().equal(this.reserve1.quotient,d))throw new C;var n=this.reserveOf(t.currency),r=this.reserveOf(t.currency.equals(this.token0)?this.token1:this.token0),s=i().multiply(t.quotient,m),u=i().multiply(s,r.quotient),c=i().add(i().multiply(n.quotient,v),s),l=a.CurrencyAmount.fromRawAmount(t.currency.equals(this.token0)?this.token1:this.token0,i().divide(u,c));if(i().equal(l.quotient,d))throw new O;return[l,new e(n.add(t),r.subtract(l))]},t.getInputAmount=function(t){if(this.involvesToken(t.currency)||(0,o.Z)(!1),i().equal(this.reserve0.quotient,d)||i().equal(this.reserve1.quotient,d)||i().greaterThanOrEqual(t.quotient,this.reserveOf(t.currency).quotient))throw new C;var n=this.reserveOf(t.currency),r=this.reserveOf(t.currency.equals(this.token0)?this.token1:this.token0),s=i().multiply(i().multiply(r.quotient,t.quotient),v),u=i().multiply(i().subtract(n.quotient,t.quotient),m),c=a.CurrencyAmount.fromRawAmount(t.currency.equals(this.token0)?this.token1:this.token0,i().add(i().divide(s,u),p));return[c,new e(r.add(c),n.subtract(t))]},t.getLiquidityMinted=function(e,t,n){e.currency.equals(this.liquidityToken)||(0,o.Z)(!1);var r,s=t.currency.sortsBefore(n.currency)?[t,n]:[n,t];if(s[0].currency.equals(this.token0)&&s[1].currency.equals(this.token1)||(0,o.Z)(!1),i().equal(e.quotient,d))r=i().subtract((0,a.sqrt)(i().multiply(s[0].quotient,s[1].quotient)),f);else{var u=i().divide(i().multiply(s[0].quotient,e.quotient),this.reserve0.quotient),c=i().divide(i().multiply(s[1].quotient,e.quotient),this.reserve1.quotient);r=i().lessThanOrEqual(u,c)?u:c}if(!i().greaterThan(r,d))throw new O;return a.CurrencyAmount.fromRawAmount(this.liquidityToken,r)},t.getLiquidityValue=function(e,t,n,r,s){var u;if(void 0===r&&(r=!1),this.involvesToken(e)||(0,o.Z)(!1),t.currency.equals(this.liquidityToken)||(0,o.Z)(!1),n.currency.equals(this.liquidityToken)||(0,o.Z)(!1),i().lessThanOrEqual(n.quotient,t.quotient)||(0,o.Z)(!1),r){s||(0,o.Z)(!1);var c=i().BigInt(s);if(i().equal(c,d))u=t;else{var l=(0,a.sqrt)(i().multiply(this.reserve0.quotient,this.reserve1.quotient)),f=(0,a.sqrt)(c);if(i().greaterThan(l,f)){var p=i().multiply(t.quotient,i().subtract(l,f)),m=i().add(i().multiply(l,h),f),v=i().divide(p,m);u=t.add(a.CurrencyAmount.fromRawAmount(this.liquidityToken,v))}else u=t}}else u=t;return a.CurrencyAmount.fromRawAmount(e,i().divide(i().multiply(n.quotient,this.reserveOf(e).quotient),u.quotient))},b(e,[{key:"token0Price",get:function(){var e=this.tokenAmounts[1].divide(this.tokenAmounts[0]);return new a.Price(this.token0,this.token1,e.denominator,e.numerator)}},{key:"token1Price",get:function(){var e=this.tokenAmounts[0].divide(this.tokenAmounts[1]);return new a.Price(this.token1,this.token0,e.denominator,e.numerator)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"token0",get:function(){return this.tokenAmounts[0].currency}},{key:"token1",get:function(){return this.tokenAmounts[1].currency}},{key:"reserve0",get:function(){return this.tokenAmounts[0]}},{key:"reserve1",get:function(){return this.tokenAmounts[1]}}]),e}(),R=function(){function e(e,t,n){this._midPrice=null,e.length>0||(0,o.Z)(!1);var r=e[0].chainId;e.every((function(e){return e.chainId===r}))||(0,o.Z)(!1);var i=t.wrapped;e[0].involvesToken(i)||(0,o.Z)(!1),"undefined"===typeof n||e[e.length-1].involvesToken(n.wrapped)||(0,o.Z)(!1);for(var a,s=[i],u=T(e.entries());!(a=u()).done;){var c=a.value,l=c[0],f=c[1],d=s[l];d.equals(f.token0)||d.equals(f.token1)||(0,o.Z)(!1);var p=d.equals(f.token0)?f.token1:f.token0;s.push(p)}this.pairs=e,this.path=s,this.input=t,this.output=n}return b(e,[{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;for(var e,t=[],n=T(this.pairs.entries());!(e=n()).done;){var r=e.value,i=r[0],o=r[1];t.push(this.path[i].equals(o.token0)?new a.Price(o.reserve0.currency,o.reserve1.currency,o.reserve0.quotient,o.reserve1.quotient):new a.Price(o.reserve1.currency,o.reserve0.currency,o.reserve1.quotient,o.reserve0.quotient))}var s=t.slice(1).reduce((function(e,t){return e.multiply(t)}),t[0]);return this._midPrice=new a.Price(this.input,this.output,s.denominator,s.numerator)}},{key:"chainId",get:function(){return this.pairs[0].chainId}}]),e}();function M(e,t){return e.inputAmount.currency.equals(t.inputAmount.currency)||(0,o.Z)(!1),e.outputAmount.currency.equals(t.outputAmount.currency)||(0,o.Z)(!1),e.outputAmount.equalTo(t.outputAmount)?e.inputAmount.equalTo(t.inputAmount)?0:e.inputAmount.lessThan(t.inputAmount)?-1:1:e.outputAmount.lessThan(t.outputAmount)?1:-1}function N(e,t){var n=M(e,t);return 0!==n?n:e.priceImpact.lessThan(t.priceImpact)?-1:e.priceImpact.greaterThan(t.priceImpact)?1:e.route.path.length-t.route.path.length}var j=function(){function e(e,t,n){this.route=e,this.tradeType=n;var r=new Array(e.path.length);if(n===a.TradeType.EXACT_INPUT){t.currency.equals(e.input)||(0,o.Z)(!1),r[0]=t.wrapped;for(var i=0;i0;u--){var c=e.pairs[u-1].getInputAmount(r[u])[0];r[u-1]=c}this.inputAmount=a.CurrencyAmount.fromFractionalAmount(e.input,r[0].numerator,r[0].denominator),this.outputAmount=a.CurrencyAmount.fromFractionalAmount(e.output,t.numerator,t.denominator)}this.executionPrice=new a.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient),this.priceImpact=(0,a.computePriceImpact)(e.midPrice,this.inputAmount,this.outputAmount)}e.exactIn=function(t,n){return new e(t,n,a.TradeType.EXACT_INPUT)},e.exactOut=function(t,n){return new e(t,n,a.TradeType.EXACT_OUTPUT)};var t=e.prototype;return t.minimumAmountOut=function(e){if(e.lessThan(d)&&(0,o.Z)(!1),this.tradeType===a.TradeType.EXACT_OUTPUT)return this.outputAmount;var t=new a.Fraction(p).add(e).invert().multiply(this.outputAmount.quotient).quotient;return a.CurrencyAmount.fromRawAmount(this.outputAmount.currency,t)},t.maximumAmountIn=function(e){if(e.lessThan(d)&&(0,o.Z)(!1),this.tradeType===a.TradeType.EXACT_INPUT)return this.inputAmount;var t=new a.Fraction(p).add(e).multiply(this.inputAmount.quotient).quotient;return a.CurrencyAmount.fromRawAmount(this.inputAmount.currency,t)},e.bestTradeExactIn=function(t,n,r,i,s,u,c){var l=void 0===i?{}:i,f=l.maxNumResults,p=void 0===f?3:f,h=l.maxHops,m=void 0===h?3:h;void 0===s&&(s=[]),void 0===u&&(u=n),void 0===c&&(c=[]),t.length>0||(0,o.Z)(!1),m>0||(0,o.Z)(!1),n===u||s.length>0||(0,o.Z)(!1);for(var v=u.wrapped,y=r.wrapped,b=0;b1&&t.length>1){var x=t.slice(0,b).concat(t.slice(b+1,t.length));e.bestTradeExactIn(x,n,r,{maxNumResults:p,maxHops:m-1},[].concat(s,[g]),w,c)}}}return c},t.worstExecutionPrice=function(e){return new a.Price(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(e).quotient,this.minimumAmountOut(e).quotient)},e.bestTradeExactOut=function(t,n,r,i,s,u,c){var l=void 0===i?{}:i,f=l.maxNumResults,p=void 0===f?3:f,h=l.maxHops,m=void 0===h?3:h;void 0===s&&(s=[]),void 0===u&&(u=r),void 0===c&&(c=[]),t.length>0||(0,o.Z)(!1),m>0||(0,o.Z)(!1),r===u||s.length>0||(0,o.Z)(!1);for(var v=u.wrapped,y=n.wrapped,b=0;b1&&t.length>1){var x=t.slice(0,b).concat(t.slice(b+1,t.length));e.bestTradeExactOut(x,n,r,{maxNumResults:p,maxHops:m-1},[g].concat(s),w,c)}}}return c},e}();function L(e){return"0x"+e.quotient.toString(16)}var D="0x0",B=function(){function e(){}return e.swapCallParameters=function(e,t){var n=e.inputAmount.currency.isNative,r=e.outputAmount.currency.isNative;n&&r&&(0,o.Z)(!1),!("ttl"in t)||t.ttl>0||(0,o.Z)(!1);var i,s,u,c=(0,a.validateAndParseAddress)(t.recipient),l=L(e.maximumAmountIn(t.allowedSlippage)),f=L(e.minimumAmountOut(t.allowedSlippage)),d=e.route.path.map((function(e){return e.address})),p="ttl"in t?"0x"+(Math.floor((new Date).getTime()/1e3)+t.ttl).toString(16):"0x"+t.deadline.toString(16),h=Boolean(t.feeOnTransfer);switch(e.tradeType){case a.TradeType.EXACT_INPUT:n?(i=h?"swapExactETHForTokensSupportingFeeOnTransferTokens":"swapExactETHForTokens",s=[f,d,c,p],u=l):r?(i=h?"swapExactTokensForETHSupportingFeeOnTransferTokens":"swapExactTokensForETH",s=[l,f,d,c,p],u=D):(i=h?"swapExactTokensForTokensSupportingFeeOnTransferTokens":"swapExactTokensForTokens",s=[l,f,d,c,p],u=D);break;case a.TradeType.EXACT_OUTPUT:h&&(0,o.Z)(!1),n?(i="swapETHForExactTokens",s=[f,d,c,p],u=l):r?(i="swapTokensForExactETH",s=[f,l,d,c,p],u=D):(i="swapTokensForExactTokens",s=[f,l,d,c,p],u=D)}return{methodName:i,args:s,value:u}},e}()},74892:function(e,t,n){"use strict";n.r(t),n.d(t,{ADDRESS_ZERO:function(){return R},FACTORY_ADDRESS:function(){return P},FeeAmount:function(){return O},FullMath:function(){return z},LiquidityMath:function(){return Z},Multicall:function(){return Se},NoTickDataProvider:function(){return ee},NonfungiblePositionManager:function(){return Re},POOL_INIT_CODE_HASH:function(){return M},Payments:function(){return Oe},Pool:function(){return ke},Position:function(){return Ae},PositionLibrary:function(){return pe},Route:function(){return Ee},SelfPermit:function(){return Ce},SqrtPriceMath:function(){return V},Staker:function(){return Ne},SwapMath:function(){return G},SwapQuoter:function(){return Me},SwapRouter:function(){return je},TICK_SPACINGS:function(){return N},Tick:function(){return ge},TickLibrary:function(){return be},TickList:function(){return re},TickListDataProvider:function(){return we},TickMath:function(){return $},Trade:function(){return Te},computePoolAddress:function(){return F},encodeRouteToPath:function(){return ae},encodeSqrtRatioX96:function(){return oe},isSorted:function(){return te},maxLiquidityForAmounts:function(){return le},mostSignificantBit:function(){return J},nearestUsableTick:function(){return fe},priceToClosestTick:function(){return me},subIn256:function(){return ye},tickToPrice:function(){return he},toHex:function(){return ie},tradeComparator:function(){return _e}});var r=n(66331),i=n(77492),a=n.n(i),o=n(17389),s=n(86388),u=n(99456),c=n(28552),l=n(46684),f=JSON.parse('{"Mt":[{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"}]}'),d=JSON.parse('{"Mt":[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH9","type":"address"},{"internalType":"address","name":"_tokenDescriptor_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Collect","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"liquidity","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"DecreaseLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"liquidity","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"IncreaseLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH9","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"}],"internalType":"struct INonfungiblePositionManager.CollectParams","name":"params","type":"tuple"}],"name":"collect","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"name":"createAndInitializePoolIfNecessary","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct INonfungiblePositionManager.DecreaseLiquidityParams","name":"params","type":"tuple"}],"name":"decreaseLiquidity","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct INonfungiblePositionManager.IncreaseLiquidityParams","name":"params","type":"tuple"}],"name":"increaseLiquidity","outputs":[{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct INonfungiblePositionManager.MintParams","name":"params","type":"tuple"}],"name":"mint","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"positions","outputs":[{"internalType":"uint96","name":"nonce","type":"uint96"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"feeGrowthInside0LastX128","type":"uint256"},{"internalType":"uint256","name":"feeGrowthInside1LastX128","type":"uint256"},{"internalType":"uint128","name":"tokensOwed0","type":"uint128"},{"internalType":"uint128","name":"tokensOwed1","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refundETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitAllowed","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitAllowedIfNecessary","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitIfNecessary","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"sweepToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0Owed","type":"uint256"},{"internalType":"uint256","name":"amount1Owed","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"uniswapV3MintCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"unwrapWETH9","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]}'),p=JSON.parse('{"Mt":[{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitAllowed","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitAllowedIfNecessary","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitIfNecessary","outputs":[],"stateMutability":"payable","type":"function"}]}'),h=JSON.parse('{"Mt":[{"inputs":[],"name":"refundETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"sweepToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"feeBips","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"sweepTokenWithFee","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"unwrapWETH9","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"feeBips","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"unwrapWETH9WithFee","outputs":[],"stateMutability":"payable","type":"function"}]}'),m=JSON.parse('{"Mt":[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH9","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH9","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"quoteExactInput","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"name":"quoteExactInputSingle","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"quoteExactOutput","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"name":"quoteExactOutputSingle","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"path","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"view","type":"function"}]}'),v=JSON.parse('{"Mt":[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH9","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH9","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"quoteExactInput","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint160[]","name":"sqrtPriceX96AfterList","type":"uint160[]"},{"internalType":"uint32[]","name":"initializedTicksCrossedList","type":"uint32[]"},{"internalType":"uint256","name":"gasEstimate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct IQuoterV2.QuoteExactInputSingleParams","name":"params","type":"tuple"}],"name":"quoteExactInputSingle","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceX96After","type":"uint160"},{"internalType":"uint32","name":"initializedTicksCrossed","type":"uint32"},{"internalType":"uint256","name":"gasEstimate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"quoteExactOutput","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint160[]","name":"sqrtPriceX96AfterList","type":"uint160[]"},{"internalType":"uint32[]","name":"initializedTicksCrossedList","type":"uint32[]"},{"internalType":"uint256","name":"gasEstimate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct IQuoterV2.QuoteExactOutputSingleParams","name":"params","type":"tuple"}],"name":"quoteExactOutputSingle","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceX96After","type":"uint160"},{"internalType":"uint32","name":"initializedTicksCrossed","type":"uint32"},{"internalType":"uint256","name":"gasEstimate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"path","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"view","type":"function"}]}'),y=JSON.parse('{"Mt":[{"inputs":[{"internalType":"contract IUniswapV3Factory","name":"_factory","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"_nonfungiblePositionManager","type":"address"},{"internalType":"uint256","name":"_maxIncentiveStartLeadTime","type":"uint256"},{"internalType":"uint256","name":"_maxIncentiveDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"DepositTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20Minimal","name":"rewardToken","type":"address"},{"indexed":true,"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":false,"internalType":"address","name":"refundee","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"IncentiveCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"incentiveId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"refund","type":"uint256"}],"name":"IncentiveEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"incentiveId","type":"bytes32"},{"indexed":false,"internalType":"uint128","name":"liquidity","type":"uint128"}],"name":"TokenStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"incentiveId","type":"bytes32"}],"name":"TokenUnstaked","type":"event"},{"inputs":[{"internalType":"contract IERC20Minimal","name":"rewardToken","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amountRequested","type":"uint256"}],"name":"claimReward","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20Minimal","name":"rewardToken","type":"address"},{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address","name":"refundee","type":"address"}],"internalType":"struct IUniswapV3Staker.IncentiveKey","name":"key","type":"tuple"},{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"createIncentive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deposits","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint48","name":"numberOfStakes","type":"uint48"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20Minimal","name":"rewardToken","type":"address"},{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address","name":"refundee","type":"address"}],"internalType":"struct IUniswapV3Staker.IncentiveKey","name":"key","type":"tuple"}],"name":"endIncentive","outputs":[{"internalType":"uint256","name":"refund","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"contract IUniswapV3Factory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20Minimal","name":"rewardToken","type":"address"},{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address","name":"refundee","type":"address"}],"internalType":"struct IUniswapV3Staker.IncentiveKey","name":"key","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRewardInfo","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"uint160","name":"secondsInsideX128","type":"uint160"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"incentives","outputs":[{"internalType":"uint256","name":"totalRewardUnclaimed","type":"uint256"},{"internalType":"uint160","name":"totalSecondsClaimedX128","type":"uint160"},{"internalType":"uint96","name":"numberOfStakes","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxIncentiveDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxIncentiveStartLeadTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"nonfungiblePositionManager","outputs":[{"internalType":"contract INonfungiblePositionManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Minimal","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20Minimal","name":"rewardToken","type":"address"},{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address","name":"refundee","type":"address"}],"internalType":"struct IUniswapV3Staker.IncentiveKey","name":"key","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes32","name":"incentiveId","type":"bytes32"}],"name":"stakes","outputs":[{"internalType":"uint160","name":"secondsPerLiquidityInsideInitialX128","type":"uint160"},{"internalType":"uint128","name":"liquidity","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"transferDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20Minimal","name":"rewardToken","type":"address"},{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address","name":"refundee","type":"address"}],"internalType":"struct IUniswapV3Staker.IncentiveKey","name":"key","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unstakeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]}'),b=JSON.parse('{"Mt":[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH9","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH9","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMinimum","type":"uint256"}],"internalType":"struct ISwapRouter.ExactInputParams","name":"params","type":"tuple"}],"name":"exactInput","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMinimum","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct ISwapRouter.ExactInputSingleParams","name":"params","type":"tuple"}],"name":"exactInputSingle","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMaximum","type":"uint256"}],"internalType":"struct ISwapRouter.ExactOutputParams","name":"params","type":"tuple"}],"name":"exactOutput","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMaximum","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct ISwapRouter.ExactOutputSingleParams","name":"params","type":"tuple"}],"name":"exactOutputSingle","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"refundETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitAllowed","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitAllowedIfNecessary","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitIfNecessary","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"sweepToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"feeBips","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"sweepTokenWithFee","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"unwrapWETH9","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"feeBips","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"unwrapWETH9WithFee","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]}');function g(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,i)}function w(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){g(a,r,i,o,s,"next",e)}function s(e){g(a,r,i,o,s,"throw",e)}o(void 0)}))}}function x(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var T,S,C,O,I=(T=function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(P){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),o=new C(r||[]);return a._invoke=function(e,t,n){var r=f;return function(i,a){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw a;return I()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=_(o,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=l(e,t,n);if("normal"===u.type){if(r=n.done?h:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(P){return{type:"throw",arg:P}}}e.wrap=c;var f="suspendedStart",d="suspendedYield",p="executing",h="completed",m={};function v(){}function y(){}function b(){}var g={};g[a]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(O([])));x&&x!==n&&r.call(x,a)&&(g=x);var k=b.prototype=v.prototype=Object.create(g);function A(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,a,o,s){var u=l(e[i],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"===typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(f).then((function(e){c.value=e,o(c)}),(function(e){return n("throw",e,o,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function _(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,_(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=l(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function O(e){if(e){var n=e[a];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(n){Function("r","regeneratorRuntime = r")(t)}},T(S={exports:{}},S.exports),S.exports),P="0x1F98431c8aD98523631AE4a59f267346ea31F984",R="0x0000000000000000000000000000000000000000",M="0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54";!function(e){e[e.LOWEST=100]="LOWEST",e[e.LOW=500]="LOW",e[e.MEDIUM=3e3]="MEDIUM",e[e.HIGH=1e4]="HIGH"}(O||(O={}));var N=((C={})[O.LOWEST]=1,C[O.LOW]=10,C[O.MEDIUM]=60,C[O.HIGH]=200,C),j=a().BigInt(-1),L=a().BigInt(0),D=a().BigInt(1),B=a().exponentiate(a().BigInt(2),a().BigInt(96)),U=a().exponentiate(B,a().BigInt(2));function F(e){var t=e.factoryAddress,n=e.tokenA,r=e.tokenB,i=e.fee,a=e.initCodeHashManualOverride,o=n.sortsBefore(r)?[n,r]:[r,n],u=o[0],f=o[1];return(0,c.getCreate2Address)(t,(0,l.keccak256)(["bytes"],[s.$.encode(["address","address","uint24"],[u.address,f.address,i])]),null!=a?a:M)}var Z=function(){function e(){}return e.addDelta=function(e,t){return a().lessThan(t,L)?a().subtract(e,a().multiply(t,j)):a().add(e,t)},e}(),z=function(){function e(){}return e.mulDivRoundingUp=function(e,t,n){var r=a().multiply(e,t),i=a().divide(r,n);return a().notEqual(a().remainder(r,n),L)&&(i=a().add(i,D)),i},e}(),H=a().subtract(a().exponentiate(a().BigInt(2),a().BigInt(160)),D);function q(e,t){var n=a().multiply(e,t);return a().bitwiseAnd(n,r.MaxUint256)}var V=function(){function e(){}return e.getAmount0Delta=function(e,t,n,r){if(a().greaterThan(e,t)){var i=[t,e];e=i[0],t=i[1]}var o=a().leftShift(n,a().BigInt(96)),s=a().subtract(t,e);return r?z.mulDivRoundingUp(z.mulDivRoundingUp(o,s,t),D,e):a().divide(a().divide(a().multiply(o,s),t),e)},e.getAmount1Delta=function(e,t,n,r){if(a().greaterThan(e,t)){var i=[t,e];e=i[0],t=i[1]}return r?z.mulDivRoundingUp(n,a().subtract(t,e),B):a().divide(a().multiply(n,a().subtract(t,e)),B)},e.getNextSqrtPriceFromInput=function(e,t,n,r){return a().greaterThan(e,L)||(0,o.Z)(!1),a().greaterThan(t,L)||(0,o.Z)(!1),r?this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!0):this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!0)},e.getNextSqrtPriceFromOutput=function(e,t,n,r){return a().greaterThan(e,L)||(0,o.Z)(!1),a().greaterThan(t,L)||(0,o.Z)(!1),r?this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!1):this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!1)},e.getNextSqrtPriceFromAmount0RoundingUp=function(e,t,n,i){if(a().equal(n,L))return e;var s=a().leftShift(t,a().BigInt(96));if(i){var u=q(n,e);if(a().equal(a().divide(u,n),e)){var c=function(e,t){var n=a().add(e,t);return a().bitwiseAnd(n,r.MaxUint256)}(s,u);if(a().greaterThanOrEqual(c,s))return z.mulDivRoundingUp(s,e,c)}return z.mulDivRoundingUp(s,D,a().add(a().divide(s,e),n))}var l=q(n,e);a().equal(a().divide(l,n),e)||(0,o.Z)(!1),a().greaterThan(s,l)||(0,o.Z)(!1);var f=a().subtract(s,l);return z.mulDivRoundingUp(s,e,f)},e.getNextSqrtPriceFromAmount1RoundingDown=function(e,t,n,r){if(r){var i=a().lessThanOrEqual(n,H)?a().divide(a().leftShift(n,a().BigInt(96)),t):a().divide(a().multiply(n,B),t);return a().add(e,i)}var s=z.mulDivRoundingUp(n,B,t);return a().greaterThan(e,s)||(0,o.Z)(!1),a().subtract(e,s)},e}(),W=a().exponentiate(a().BigInt(10),a().BigInt(6)),G=function(){function e(){}return e.computeSwapStep=function(e,t,n,r,i){var o={},s=a().greaterThanOrEqual(e,t),u=a().greaterThanOrEqual(r,L);if(u){var c=a().divide(a().multiply(r,a().subtract(W,a().BigInt(i))),W);o.amountIn=s?V.getAmount0Delta(t,e,n,!0):V.getAmount1Delta(e,t,n,!0),a().greaterThanOrEqual(c,o.amountIn)?o.sqrtRatioNextX96=t:o.sqrtRatioNextX96=V.getNextSqrtPriceFromInput(e,n,c,s)}else o.amountOut=s?V.getAmount1Delta(t,e,n,!1):V.getAmount0Delta(e,t,n,!1),a().greaterThanOrEqual(a().multiply(r,j),o.amountOut)?o.sqrtRatioNextX96=t:o.sqrtRatioNextX96=V.getNextSqrtPriceFromOutput(e,n,a().multiply(r,j),s);var l=a().equal(t,o.sqrtRatioNextX96);return s?(o.amountIn=l&&u?o.amountIn:V.getAmount0Delta(o.sqrtRatioNextX96,e,n,!0),o.amountOut=l&&!u?o.amountOut:V.getAmount1Delta(o.sqrtRatioNextX96,e,n,!1)):(o.amountIn=l&&u?o.amountIn:V.getAmount1Delta(e,o.sqrtRatioNextX96,n,!0),o.amountOut=l&&!u?o.amountOut:V.getAmount0Delta(e,o.sqrtRatioNextX96,n,!1)),!u&&a().greaterThan(o.amountOut,a().multiply(r,j))&&(o.amountOut=a().multiply(r,j)),u&&a().notEqual(o.sqrtRatioNextX96,t)?o.feeAmount=a().subtract(r,o.amountIn):o.feeAmount=z.mulDivRoundingUp(o.amountIn,a().BigInt(i),a().subtract(W,a().BigInt(i))),[o.sqrtRatioNextX96,o.amountIn,o.amountOut,o.feeAmount]},e}(),Y=a().BigInt(2),K=[128,64,32,16,8,4,2,1].map((function(e){return[e,a().exponentiate(Y,a().BigInt(e))]}));function J(e){a().greaterThan(e,L)||(0,o.Z)(!1),a().lessThanOrEqual(e,r.MaxUint256)||(0,o.Z)(!1);for(var t,n=0,i=_(K);!(t=i()).done;){var s=t.value,u=s[0],c=s[1];a().greaterThanOrEqual(e,c)&&(e=a().signedRightShift(e,a().BigInt(u)),n+=u)}return n}function Q(e,t){return a().signedRightShift(a().multiply(e,a().BigInt(t)),a().BigInt(128))}var X=a().exponentiate(a().BigInt(2),a().BigInt(32)),$=function(){function e(){}return e.getSqrtRatioAtTick=function(t){t>=e.MIN_TICK&&t<=e.MAX_TICK&&Number.isInteger(t)||(0,o.Z)(!1);var n=t<0?-1*t:t,i=0!=(1&n)?a().BigInt("0xfffcb933bd6fad37aa2d162d1a594001"):a().BigInt("0x100000000000000000000000000000000");return 0!=(2&n)&&(i=Q(i,"0xfff97272373d413259a46990580e213a")),0!=(4&n)&&(i=Q(i,"0xfff2e50f5f656932ef12357cf3c7fdcc")),0!=(8&n)&&(i=Q(i,"0xffe5caca7e10e4e61c3624eaa0941cd0")),0!=(16&n)&&(i=Q(i,"0xffcb9843d60f6159c9db58835c926644")),0!=(32&n)&&(i=Q(i,"0xff973b41fa98c081472e6896dfb254c0")),0!=(64&n)&&(i=Q(i,"0xff2ea16466c96a3843ec78b326b52861")),0!=(128&n)&&(i=Q(i,"0xfe5dee046a99a2a811c461f1969c3053")),0!=(256&n)&&(i=Q(i,"0xfcbe86c7900a88aedcffc83b479aa3a4")),0!=(512&n)&&(i=Q(i,"0xf987a7253ac413176f2b074cf7815e54")),0!=(1024&n)&&(i=Q(i,"0xf3392b0822b70005940c7a398e4b70f3")),0!=(2048&n)&&(i=Q(i,"0xe7159475a2c29b7443b29c7fa6e889d9")),0!=(4096&n)&&(i=Q(i,"0xd097f3bdfd2022b8845ad8f792aa5825")),0!=(8192&n)&&(i=Q(i,"0xa9f746462d870fdf8a65dc1f90e061e5")),0!=(16384&n)&&(i=Q(i,"0x70d869a156d2a1b890bb3df62baf32f7")),0!=(32768&n)&&(i=Q(i,"0x31be135f97d08fd981231505542fcfa6")),0!=(65536&n)&&(i=Q(i,"0x9aa508b5b7a84e1c677de54f3e99bc9")),0!=(131072&n)&&(i=Q(i,"0x5d6af8dedb81196699c329225ee604")),0!=(262144&n)&&(i=Q(i,"0x2216e584f5fa1ea926041bedfe98")),0!=(524288&n)&&(i=Q(i,"0x48a170391f7dc42444e8fa2")),t>0&&(i=a().divide(r.MaxUint256,i)),a().greaterThan(a().remainder(i,X),L)?a().add(a().divide(i,X),D):a().divide(i,X)},e.getTickAtSqrtRatio=function(t){a().greaterThanOrEqual(t,e.MIN_SQRT_RATIO)&&a().lessThan(t,e.MAX_SQRT_RATIO)||(0,o.Z)(!1);var n,r=a().leftShift(t,a().BigInt(32)),i=J(r);n=a().greaterThanOrEqual(a().BigInt(i),a().BigInt(128))?a().signedRightShift(r,a().BigInt(i-127)):a().leftShift(r,a().BigInt(127-i));for(var s=a().leftShift(a().subtract(a().BigInt(i),a().BigInt(128)),a().BigInt(64)),u=0;u<14;u++){n=a().signedRightShift(a().multiply(n,n),a().BigInt(127));var c=a().signedRightShift(n,a().BigInt(128));s=a().bitwiseOr(s,a().leftShift(c,a().BigInt(63-u))),n=a().signedRightShift(n,c)}var l=a().multiply(s,a().BigInt("255738958999603826347141")),f=a().toNumber(a().signedRightShift(a().subtract(l,a().BigInt("3402992956809132418596140100660247210")),a().BigInt(128))),d=a().toNumber(a().signedRightShift(a().add(l,a().BigInt("291339464771989622907027621153398088495")),a().BigInt(128)));return f===d?f:a().lessThanOrEqual(e.getSqrtRatioAtTick(d),t)?d:f},e}();$.MIN_TICK=-887272,$.MAX_TICK=-$.MIN_TICK,$.MIN_SQRT_RATIO=a().BigInt("4295128739"),$.MAX_SQRT_RATIO=a().BigInt("1461446703485210103287273052203988822378723970342");var ee=function(){function e(){}var t=e.prototype;return t.getTick=function(){var t=w(I.mark((function t(n){return I.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error(e.ERROR_MESSAGE);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),t.nextInitializedTickWithinOneWord=function(){var t=w(I.mark((function t(n,r,i){return I.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error(e.ERROR_MESSAGE);case 1:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e}();function te(e,t){for(var n=0;n0)return!1;return!0}function ne(e,t){return e.index-t.index}ee.ERROR_MESSAGE="No tick data provider was given";var re=function(){function e(){}return e.validateList=function(e,t){t>0||(0,o.Z)(!1),e.every((function(e){return e.index%t===0}))||(0,o.Z)(!1),a().equal(e.reduce((function(e,t){var n=t.liquidityNet;return a().add(e,n)}),L),L)||(0,o.Z)(!1),te(e,ne)||(0,o.Z)(!1)},e.isBelowSmallest=function(e,t){return e.length>0||(0,o.Z)(!1),t0||(0,o.Z)(!1),t>=e[e.length-1].index},e.getTick=function(e,t){var n=e[this.binarySearch(e,t)];return n.index!==t&&(0,o.Z)(!1),n},e.binarySearch=function(e,t){this.isBelowSmallest(e,t)&&(0,o.Z)(!1);for(var n,r=0,i=e.length-1;;){if(e[n=Math.floor((r+i)/2)].index<=t&&(n===e.length-1||e[n+1].index>t))return n;e[n].index>8<<8)*i;if(e.isBelowSmallest(t,n))return[o,!1];var s=e.nextInitializedTick(t,n,r).index,u=Math.max(o,s);return[u,u===s]}var c=(((a+1>>8)+1<<8)-1)*i;if(this.isAtOrAboveLargest(t,n))return[c,!1];var l=this.nextInitializedTick(t,n,r).index,f=Math.min(c,l);return[f,f===l]},e}();function ie(e){var t=a().BigInt(e).toString(16);return t.length%2!==0&&(t="0"+t),"0x"+t}function ae(e,t){var n=e.input.wrapped,r=e.pools.reduce((function(e,t,n){var r=e.inputToken,i=e.path,a=e.types,o=t.token0.equals(r)?t.token1:t.token0;return 0===n?{inputToken:o,types:["address","uint24","address"],path:[r.address,t.fee,o.address]}:{inputToken:o,types:[].concat(a,["uint24","address"]),path:[].concat(i,[t.fee,o.address])}}),{inputToken:n,path:[],types:[]}),i=r.path,a=r.types;return t?(0,l.pack)(a.reverse(),i.reverse()):(0,l.pack)(a,i)}function oe(e,t){var n=a().leftShift(a().BigInt(e),a().BigInt(192)),i=a().BigInt(t),o=a().divide(n,i);return(0,r.sqrt)(o)}function se(e,t,n){if(a().greaterThan(e,t)){var r=[t,e];e=r[0],t=r[1]}var i=a().divide(a().multiply(e,t),B);return a().divide(a().multiply(a().BigInt(n),i),a().subtract(t,e))}function ue(e,t,n){if(a().greaterThan(e,t)){var r=[t,e];e=r[0],t=r[1]}var i=a().multiply(a().multiply(a().BigInt(n),e),t),o=a().multiply(B,a().subtract(t,e));return a().divide(i,o)}function ce(e,t,n){if(a().greaterThan(e,t)){var r=[t,e];e=r[0],t=r[1]}return a().divide(a().multiply(a().BigInt(n),B),a().subtract(t,e))}function le(e,t,n,r,i,o){if(a().greaterThan(t,n)){var s=[n,t];t=s[0],n=s[1]}var u=o?ue:se;if(a().lessThanOrEqual(e,t))return u(t,n,r);if(a().lessThan(e,n)){var c=u(e,n,r),l=ce(t,e,i);return a().lessThan(c,l)?c:l}return ce(t,n,i)}function fe(e,t){Number.isInteger(e)&&Number.isInteger(t)||(0,o.Z)(!1),t>0||(0,o.Z)(!1),e>=$.MIN_TICK&&e<=$.MAX_TICK||(0,o.Z)(!1);var n=Math.round(e/t)*t;return n<$.MIN_TICK?n+t:n>$.MAX_TICK?n-t:n}var de=a().exponentiate(a().BigInt(2),a().BigInt(128)),pe=function(){function e(){}return e.getTokensOwed=function(e,t,n,r,i){return[a().divide(a().multiply(ye(r,e),n),de),a().divide(a().multiply(ye(i,t),n),de)]},e}();function he(e,t,n){var i=$.getSqrtRatioAtTick(n),o=a().multiply(i,i);return e.sortsBefore(t)?new r.Price(e,t,U,o):new r.Price(e,t,o,U)}function me(e){var t=e.baseCurrency.sortsBefore(e.quoteCurrency),n=t?oe(e.numerator,e.denominator):oe(e.denominator,e.numerator),r=$.getTickAtSqrtRatio(n),i=he(e.baseCurrency,e.quoteCurrency,r+1);return t?e.lessThan(i)||r++:e.greaterThan(i)||r++,r}var ve=a().exponentiate(a().BigInt(2),a().BigInt(256));function ye(e,t){var n=a().subtract(e,t);return a().lessThan(n,L)?a().add(ve,n):n}var be=function(){function e(){}return e.getFeeGrowthInside=function(e,t,n,r,i,a,o){var s,u,c,l;return i>=n?(s=e.feeGrowthOutside0X128,u=e.feeGrowthOutside1X128):(s=ye(a,e.feeGrowthOutside0X128),u=ye(o,e.feeGrowthOutside1X128)),i=$.MIN_TICK&&t<=$.MAX_TICK||(0,o.Z)(!1),this.index=t,this.liquidityGross=a().BigInt(n),this.liquidityNet=a().BigInt(r)},we=function(){function e(e,t){var n=e.map((function(e){return e instanceof ge?e:new ge(e)}));re.validateList(n,t),this.ticks=n}var t=e.prototype;return t.getTick=function(){var e=w(I.mark((function e(t){return I.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",re.getTick(this.ticks,t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.nextInitializedTickWithinOneWord=function(){var e=w(I.mark((function e(t,n,r){return I.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",re.nextInitializedTickWithinOneWord(this.ticks,t,n,r));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),e}(),xe=new ee,ke=function(){function e(e,t,n,r,i,s,u){void 0===u&&(u=xe),Number.isInteger(n)&&n<1e6||(0,o.Z)(!1);var c=$.getSqrtRatioAtTick(s),l=$.getSqrtRatioAtTick(s+1);a().greaterThanOrEqual(a().BigInt(r),c)&&a().lessThanOrEqual(a().BigInt(r),l)||(0,o.Z)(!1);var f=e.sortsBefore(t)?[e,t]:[t,e];this.token0=f[0],this.token1=f[1],this.fee=n,this.sqrtRatioX96=a().BigInt(r),this.liquidity=a().BigInt(i),this.tickCurrent=s,this.tickDataProvider=Array.isArray(u)?new we(u,N[n]):u}e.getAddress=function(e,t,n,r,i){return F({factoryAddress:null!=i?i:P,fee:n,tokenA:e,tokenB:t,initCodeHashManualOverride:r})};var t=e.prototype;return t.involvesToken=function(e){return e.equals(this.token0)||e.equals(this.token1)},t.priceOf=function(e){return this.involvesToken(e)||(0,o.Z)(!1),e.equals(this.token0)?this.token0Price:this.token1Price},t.getOutputAmount=function(){var t=w(I.mark((function t(n,i){var s,u,c,l,f,d,p;return I.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.involvesToken(n.currency)||(0,o.Z)(!1),s=n.currency.equals(this.token0),t.next=4,this.swap(s,n.quotient,i);case 4:return u=t.sent,c=u.amountCalculated,l=u.sqrtRatioX96,f=u.liquidity,d=u.tickCurrent,p=s?this.token1:this.token0,t.abrupt("return",[r.CurrencyAmount.fromRawAmount(p,a().multiply(c,j)),new e(this.token0,this.token1,this.fee,l,f,d,this.tickDataProvider)]);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),t.getInputAmount=function(){var t=w(I.mark((function t(n,i){var s,u,c,l,f,d,p;return I.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.currency.isToken&&this.involvesToken(n.currency)||(0,o.Z)(!1),s=n.currency.equals(this.token1),t.next=4,this.swap(s,a().multiply(n.quotient,j),i);case 4:return u=t.sent,c=u.amountCalculated,l=u.sqrtRatioX96,f=u.liquidity,d=u.tickCurrent,p=s?this.token0:this.token1,t.abrupt("return",[r.CurrencyAmount.fromRawAmount(p,c),new e(this.token0,this.token1,this.fee,l,f,d,this.tickDataProvider)]);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),t.swap=function(){var e=w(I.mark((function e(t,n,r){var i,s,u,c,l,f;return I.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r||(r=t?a().add($.MIN_SQRT_RATIO,D):a().subtract($.MAX_SQRT_RATIO,D)),t?(a().greaterThan(r,$.MIN_SQRT_RATIO)||(0,o.Z)(!1),a().lessThan(r,this.sqrtRatioX96)||(0,o.Z)(!1)):(a().lessThan(r,$.MAX_SQRT_RATIO)||(0,o.Z)(!1),a().greaterThan(r,this.sqrtRatioX96)||(0,o.Z)(!1)),i=a().greaterThanOrEqual(n,L),s={amountSpecifiedRemaining:n,amountCalculated:L,sqrtPriceX96:this.sqrtRatioX96,tick:this.tickCurrent,liquidity:this.liquidity};case 4:if(!a().notEqual(s.amountSpecifiedRemaining,L)||s.sqrtPriceX96==r){e.next=35;break}return(u={}).sqrtPriceStartX96=s.sqrtPriceX96,e.next=9,this.tickDataProvider.nextInitializedTickWithinOneWord(s.tick,t,this.tickSpacing);case 9:if(c=e.sent,u.tickNext=c[0],u.initialized=c[1],u.tickNext<$.MIN_TICK?u.tickNext=$.MIN_TICK:u.tickNext>$.MAX_TICK&&(u.tickNext=$.MAX_TICK),u.sqrtPriceNextX96=$.getSqrtRatioAtTick(u.tickNext),l=G.computeSwapStep(s.sqrtPriceX96,(t?a().lessThan(u.sqrtPriceNextX96,r):a().greaterThan(u.sqrtPriceNextX96,r))?r:u.sqrtPriceNextX96,s.liquidity,s.amountSpecifiedRemaining,this.fee),s.sqrtPriceX96=l[0],u.amountIn=l[1],u.amountOut=l[2],u.feeAmount=l[3],i?(s.amountSpecifiedRemaining=a().subtract(s.amountSpecifiedRemaining,a().add(u.amountIn,u.feeAmount)),s.amountCalculated=a().subtract(s.amountCalculated,u.amountOut)):(s.amountSpecifiedRemaining=a().add(s.amountSpecifiedRemaining,u.amountOut),s.amountCalculated=a().add(s.amountCalculated,a().add(u.amountIn,u.feeAmount))),!a().equal(s.sqrtPriceX96,u.sqrtPriceNextX96)){e.next=32;break}if(!u.initialized){e.next=29;break}return e.t0=a(),e.next=25,this.tickDataProvider.getTick(u.tickNext);case 25:e.t1=e.sent.liquidityNet,f=e.t0.BigInt.call(e.t0,e.t1),t&&(f=a().multiply(f,j)),s.liquidity=Z.addDelta(s.liquidity,f);case 29:s.tick=t?u.tickNext-1:u.tickNext,e.next=33;break;case 32:s.sqrtPriceX96!=u.sqrtPriceStartX96&&(s.tick=$.getTickAtSqrtRatio(s.sqrtPriceX96));case 33:e.next=4;break;case 35:return e.abrupt("return",{amountCalculated:s.amountCalculated,sqrtRatioX96:s.sqrtPriceX96,liquidity:s.liquidity,tickCurrent:s.tick});case 36:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),k(e,[{key:"token0Price",get:function(){var e;return null!=(e=this._token0Price)?e:this._token0Price=new r.Price(this.token0,this.token1,U,a().multiply(this.sqrtRatioX96,this.sqrtRatioX96))}},{key:"token1Price",get:function(){var e;return null!=(e=this._token1Price)?e:this._token1Price=new r.Price(this.token1,this.token0,a().multiply(this.sqrtRatioX96,this.sqrtRatioX96),U)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"tickSpacing",get:function(){return N[this.fee]}}]),e}(),Ae=function(){function e(e){var t=e.pool,n=e.liquidity,r=e.tickLower,i=e.tickUpper;this._token0Amount=null,this._token1Amount=null,this._mintAmounts=null,r=$.MIN_TICK&&r%t.tickSpacing===0||(0,o.Z)(!1),i<=$.MAX_TICK&&i%t.tickSpacing===0||(0,o.Z)(!1),this.pool=t,this.tickLower=r,this.tickUpper=i,this.liquidity=a().BigInt(n)}var t=e.prototype;return t.ratiosAfterSlippage=function(e){var t=this.pool.token0Price.asFraction.multiply(new r.Percent(1).subtract(e)),n=this.pool.token0Price.asFraction.multiply(e.add(1)),i=oe(t.numerator,t.denominator);a().lessThanOrEqual(i,$.MIN_SQRT_RATIO)&&(i=a().add($.MIN_SQRT_RATIO,a().BigInt(1)));var o=oe(n.numerator,n.denominator);return a().greaterThanOrEqual(o,$.MAX_SQRT_RATIO)&&(o=a().subtract($.MAX_SQRT_RATIO,a().BigInt(1))),{sqrtRatioX96Lower:i,sqrtRatioX96Upper:o}},t.mintAmountsWithSlippage=function(t){var n=this.ratiosAfterSlippage(t),r=n.sqrtRatioX96Upper,i=n.sqrtRatioX96Lower,a=new ke(this.pool.token0,this.pool.token1,this.pool.fee,i,0,$.getTickAtSqrtRatio(i)),o=new ke(this.pool.token0,this.pool.token1,this.pool.fee,r,0,$.getTickAtSqrtRatio(r)),s=e.fromAmounts(A({pool:this.pool,tickLower:this.tickLower,tickUpper:this.tickUpper},this.mintAmounts,{useFullPrecision:!1}));return{amount0:new e({pool:o,liquidity:s.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts.amount0,amount1:new e({pool:a,liquidity:s.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts.amount1}},t.burnAmountsWithSlippage=function(t){var n=this.ratiosAfterSlippage(t),r=n.sqrtRatioX96Upper,i=n.sqrtRatioX96Lower,a=new ke(this.pool.token0,this.pool.token1,this.pool.fee,i,0,$.getTickAtSqrtRatio(i)),o=new e({pool:new ke(this.pool.token0,this.pool.token1,this.pool.fee,r,0,$.getTickAtSqrtRatio(r)),liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount0,s=new e({pool:a,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount1;return{amount0:o.quotient,amount1:s.quotient}},e.fromAmounts=function(t){var n=t.pool,r=t.tickLower,i=t.tickUpper,a=t.amount0,o=t.amount1,s=t.useFullPrecision,u=$.getSqrtRatioAtTick(r),c=$.getSqrtRatioAtTick(i);return new e({pool:n,tickLower:r,tickUpper:i,liquidity:le(n.sqrtRatioX96,u,c,a,o,s)})},e.fromAmount0=function(t){var n=t.pool,i=t.tickLower,a=t.tickUpper,o=t.amount0,s=t.useFullPrecision;return e.fromAmounts({pool:n,tickLower:i,tickUpper:a,amount0:o,amount1:r.MaxUint256,useFullPrecision:s})},e.fromAmount1=function(t){var n=t.pool,i=t.tickLower,a=t.tickUpper,o=t.amount1;return e.fromAmounts({pool:n,tickLower:i,tickUpper:a,amount0:r.MaxUint256,amount1:o,useFullPrecision:!0})},k(e,[{key:"token0PriceLower",get:function(){return he(this.pool.token0,this.pool.token1,this.tickLower)}},{key:"token0PriceUpper",get:function(){return he(this.pool.token0,this.pool.token1,this.tickUpper)}},{key:"amount0",get:function(){return null===this._token0Amount&&(this.pool.tickCurrent0||(0,o.Z)(!1);var r=e[0].chainId,i=e.every((function(e){return e.chainId===r}));i||(0,o.Z)(!1);var a=t.wrapped;e[0].involvesToken(a)||(0,o.Z)(!1),e[e.length-1].involvesToken(n.wrapped)||(0,o.Z)(!1);for(var s,u=[a],c=_(e.entries());!(s=c()).done;){var l=s.value,f=l[0],d=l[1],p=u[f];p.equals(d.token0)||p.equals(d.token1)||(0,o.Z)(!1);var h=p.equals(d.token0)?d.token1:d.token0;u.push(h)}this.pools=e,this.tokenPath=u,this.input=t,this.output=null!=n?n:u[u.length-1]}return k(e,[{key:"chainId",get:function(){return this.pools[0].chainId}},{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;var e=this.pools.slice(1).reduce((function(e,t){var n=e.nextInput,r=e.price;return n.equals(t.token0)?{nextInput:t.token1,price:r.multiply(t.token0Price)}:{nextInput:t.token0,price:r.multiply(t.token1Price)}}),this.pools[0].token0.equals(this.input.wrapped)?{nextInput:this.pools[0].token1,price:this.pools[0].token0Price}:{nextInput:this.pools[0].token0,price:this.pools[0].token1Price}).price;return this._midPrice=new r.Price(this.input,this.output,e.denominator,e.numerator)}}]),e}();function _e(e,t){return e.inputAmount.currency.equals(t.inputAmount.currency)||(0,o.Z)(!1),e.outputAmount.currency.equals(t.outputAmount.currency)||(0,o.Z)(!1),e.outputAmount.equalTo(t.outputAmount)?e.inputAmount.equalTo(t.inputAmount)?e.swaps.reduce((function(e,t){return e+t.route.tokenPath.length}),0)-t.swaps.reduce((function(e,t){return e+t.route.tokenPath.length}),0):e.inputAmount.lessThan(t.inputAmount)?-1:1:e.outputAmount.lessThan(t.outputAmount)?1:-1}var Te=function(){function e(e){var t=e.routes,n=e.tradeType,r=t[0].inputAmount.currency,i=t[0].outputAmount.currency;t.every((function(e){var t=e.route;return r.wrapped.equals(t.input.wrapped)}))||(0,o.Z)(!1),t.every((function(e){var t=e.route;return i.wrapped.equals(t.output.wrapped)}))||(0,o.Z)(!1);for(var a,s=t.map((function(e){return e.route.pools.length})).reduce((function(e,t){return e+t}),0),u=new Set,c=_(t);!(a=c()).done;)for(var l,f=_(a.value.route.pools);!(l=f()).done;){var d=l.value;u.add(ke.getAddress(d.token0,d.token1,d.fee))}s!=u.size&&(0,o.Z)(!1),this.swaps=t,this.tradeType=n}e.exactIn=function(){var t=w(I.mark((function t(n,i){return I.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.fromRoute(n,i,r.TradeType.EXACT_INPUT));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.exactOut=function(){var t=w(I.mark((function t(n,i){return I.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.fromRoute(n,i,r.TradeType.EXACT_OUTPUT));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.fromRoute=function(){var t=w(I.mark((function t(n,i,a){var s,u,c,l,f,d,p,h,m,v,y;return I.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=new Array(n.tokenPath.length),a!==r.TradeType.EXACT_INPUT){t.next=19;break}i.currency.equals(n.input)||(0,o.Z)(!1),s[0]=i.wrapped,l=0;case 5:if(!(l0)){t.next=32;break}return m=n.pools[h-1],t.next=26,m.getInputAmount(s[h]);case 26:v=t.sent,y=v[0],s[h-1]=y;case 29:h--,t.next=22;break;case 32:u=r.CurrencyAmount.fromFractionalAmount(n.input,s[0].numerator,s[0].denominator),c=r.CurrencyAmount.fromFractionalAmount(n.output,i.numerator,i.denominator);case 34:return t.abrupt("return",new e({routes:[{inputAmount:u,outputAmount:c,route:n}],tradeType:a}));case 35:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.fromRoutes=function(){var t=w(I.mark((function t(n,i){var a,s,u,c,l,f,d,p,h,m,v,y,b,g,w,x,k;return I.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=[],s=_(n);case 2:if((u=s()).done){t.next=43;break}if(c=u.value,l=c.route,f=c.amount,d=new Array(l.tokenPath.length),p=void 0,h=void 0,i!==r.TradeType.EXACT_INPUT){t.next=25;break}f.currency.equals(l.input)||(0,o.Z)(!1),p=r.CurrencyAmount.fromFractionalAmount(l.input,f.numerator,f.denominator),d[0]=r.CurrencyAmount.fromFractionalAmount(l.input.wrapped,f.numerator,f.denominator),m=0;case 12:if(!(m0)){t.next=39;break}return w=l.pools[g-1],t.next=33,w.getInputAmount(d[g]);case 33:x=t.sent,k=x[0],d[g-1]=k;case 36:g--,t.next=29;break;case 39:p=r.CurrencyAmount.fromFractionalAmount(l.input,d[0].numerator,d[0].denominator);case 40:a.push({route:l,inputAmount:p,outputAmount:h});case 41:t.next=2;break;case 43:return t.abrupt("return",new e({routes:a,tradeType:i}));case 44:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.createUncheckedTrade=function(t){return new e(A({},t,{routes:[{inputAmount:t.inputAmount,outputAmount:t.outputAmount,route:t.route}]}))},e.createUncheckedTradeWithMultipleRoutes=function(t){return new e(t)};var t=e.prototype;return t.minimumAmountOut=function(e,t){if(void 0===t&&(t=this.outputAmount),e.lessThan(L)&&(0,o.Z)(!1),this.tradeType===r.TradeType.EXACT_OUTPUT)return t;var n=new r.Fraction(D).add(e).invert().multiply(t.quotient).quotient;return r.CurrencyAmount.fromRawAmount(t.currency,n)},t.maximumAmountIn=function(e,t){if(void 0===t&&(t=this.inputAmount),e.lessThan(L)&&(0,o.Z)(!1),this.tradeType===r.TradeType.EXACT_INPUT)return t;var n=new r.Fraction(D).add(e).multiply(t.quotient).quotient;return r.CurrencyAmount.fromRawAmount(t.currency,n)},t.worstExecutionPrice=function(e){return new r.Price(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(e).quotient,this.minimumAmountOut(e).quotient)},e.bestTradeExactIn=function(){var t=w(I.mark((function t(n,i,a,s,u,c,l){var f,d,p,h,m,v,y,b,g,w,x,k;return I.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:d=(f=void 0===s?{}:s).maxNumResults,p=void 0===d?3:d,h=f.maxHops,m=void 0===h?3:h,void 0===u&&(u=[]),void 0===c&&(c=i),void 0===l&&(l=[]),n.length>0||(0,o.Z)(!1),m>0||(0,o.Z)(!1),i===c||u.length>0||(0,o.Z)(!1),v=c.wrapped,y=a.wrapped,b=0;case 10:if(!(b1&&n.length>1)){t.next=43;break}return k=n.slice(0,b).concat(n.slice(b+1,n.length)),t.next=43,e.bestTradeExactIn(k,i,a,{maxNumResults:p,maxHops:m-1},[].concat(u,[g]),w,l);case 43:b++,t.next=10;break;case 46:return t.abrupt("return",l);case 47:case"end":return t.stop()}}),t,null,[[15,23]])})));return function(e,n,r,i,a,o,s){return t.apply(this,arguments)}}(),e.bestTradeExactOut=function(){var t=w(I.mark((function t(n,i,a,s,u,c,l){var f,d,p,h,m,v,y,b,g,w,x,k;return I.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:d=(f=void 0===s?{}:s).maxNumResults,p=void 0===d?3:d,h=f.maxHops,m=void 0===h?3:h,void 0===u&&(u=[]),void 0===c&&(c=a),void 0===l&&(l=[]),n.length>0||(0,o.Z)(!1),m>0||(0,o.Z)(!1),a===c||u.length>0||(0,o.Z)(!1),v=c.wrapped,y=i.wrapped,b=0;case 10:if(!(b1&&n.length>1)){t.next=43;break}return k=n.slice(0,b).concat(n.slice(b+1,n.length)),t.next=43,e.bestTradeExactOut(k,i,a,{maxNumResults:p,maxHops:m-1},[g].concat(u),w,l);case 43:b++,t.next=10;break;case 46:return t.abrupt("return",l);case 47:case"end":return t.stop()}}),t,null,[[15,23]])})));return function(e,n,r,i,a,o,s){return t.apply(this,arguments)}}(),k(e,[{key:"route",get:function(){return 1!=this.swaps.length&&(0,o.Z)(!1),this.swaps[0].route}},{key:"inputAmount",get:function(){if(this._inputAmount)return this._inputAmount;var e=this.swaps[0].inputAmount.currency,t=this.swaps.map((function(e){return e.inputAmount})).reduce((function(e,t){return e.add(t)}),r.CurrencyAmount.fromRawAmount(e,0));return this._inputAmount=t,this._inputAmount}},{key:"outputAmount",get:function(){if(this._outputAmount)return this._outputAmount;var e=this.swaps[0].outputAmount.currency,t=this.swaps.map((function(e){return e.outputAmount})).reduce((function(e,t){return e.add(t)}),r.CurrencyAmount.fromRawAmount(e,0));return this._outputAmount=t,this._outputAmount}},{key:"executionPrice",get:function(){var e;return null!=(e=this._executionPrice)?e:this._executionPrice=new r.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient)}},{key:"priceImpact",get:function(){if(this._priceImpact)return this._priceImpact;for(var e,t=r.CurrencyAmount.fromRawAmount(this.outputAmount.currency,0),n=_(this.swaps);!(e=n()).done;){var i=e.value,a=i.route,o=i.inputAmount,s=a.midPrice;t=t.add(s.quote(o))}var u=t.subtract(this.outputAmount).divide(t);return this._priceImpact=new r.Percent(u.numerator,u.denominator),this._priceImpact}}]),e}(),Se=function(){function e(){}return e.encodeMulticall=function(t){return Array.isArray(t)||(t=[t]),1===t.length?t[0]:e.INTERFACE.encodeFunctionData("multicall",[t])},e}();Se.INTERFACE=new u.vU(f.Mt);var Ce=function(){function e(){}return e.encodePermit=function(t,n){return"nonce"in n?e.INTERFACE.encodeFunctionData("selfPermitAllowed",[t.address,ie(n.nonce),ie(n.expiry),n.v,n.r,n.s]):e.INTERFACE.encodeFunctionData("selfPermit",[t.address,ie(n.amount),ie(n.deadline),n.v,n.r,n.s])},e}();Ce.INTERFACE=new u.vU(p.Mt);var Oe=function(){function e(){}return e.encodeFeeBips=function(e){return ie(e.multiply(1e4).quotient)},e.encodeUnwrapWETH9=function(t,n,i){if(n=(0,r.validateAndParseAddress)(n),i){var a=this.encodeFeeBips(i.fee),o=(0,r.validateAndParseAddress)(i.recipient);return e.INTERFACE.encodeFunctionData("unwrapWETH9WithFee",[ie(t),n,a,o])}return e.INTERFACE.encodeFunctionData("unwrapWETH9",[ie(t),n])},e.encodeSweepToken=function(t,n,i,a){if(i=(0,r.validateAndParseAddress)(i),a){var o=this.encodeFeeBips(a.fee),s=(0,r.validateAndParseAddress)(a.recipient);return e.INTERFACE.encodeFunctionData("sweepTokenWithFee",[t.address,ie(n),i,o,s])}return e.INTERFACE.encodeFunctionData("sweepToken",[t.address,ie(n),i])},e.encodeRefundETH=function(){return e.INTERFACE.encodeFunctionData("refundETH")},e}();Oe.INTERFACE=new u.vU(h.Mt);var Ie=ie(a().subtract(a().exponentiate(a().BigInt(2),a().BigInt(128)),a().BigInt(1)));function Pe(e){return Object.keys(e).some((function(e){return"recipient"===e}))}var Re=function(){function e(){}return e.encodeCreate=function(t){return e.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[t.token0.address,t.token1.address,t.fee,ie(t.sqrtRatioX96)])},e.createCallParameters=function(e){return{calldata:this.encodeCreate(e),value:ie(0)}},e.addCallParameters=function(t,n){a().greaterThan(t.liquidity,L)||(0,o.Z)(!1);var i=[],s=t.mintAmounts,u=s.amount0,c=s.amount1,l=t.mintAmountsWithSlippage(n.slippageTolerance),f=ie(l.amount0),d=ie(l.amount1),p=ie(n.deadline);if(Pe(n)&&n.createPool&&i.push(this.encodeCreate(t.pool)),n.token0Permit&&i.push(Ce.encodePermit(t.pool.token0,n.token0Permit)),n.token1Permit&&i.push(Ce.encodePermit(t.pool.token1,n.token1Permit)),Pe(n)){var h=(0,r.validateAndParseAddress)(n.recipient);i.push(e.INTERFACE.encodeFunctionData("mint",[{token0:t.pool.token0.address,token1:t.pool.token1.address,fee:t.pool.fee,tickLower:t.tickLower,tickUpper:t.tickUpper,amount0Desired:ie(u),amount1Desired:ie(c),amount0Min:f,amount1Min:d,recipient:h,deadline:p}]))}else i.push(e.INTERFACE.encodeFunctionData("increaseLiquidity",[{tokenId:ie(n.tokenId),amount0Desired:ie(u),amount1Desired:ie(c),amount0Min:f,amount1Min:d,deadline:p}]));var m=ie(0);if(n.useNative){var v=n.useNative.wrapped;t.pool.token0.equals(v)||t.pool.token1.equals(v)||(0,o.Z)(!1);var y=t.pool.token0.equals(v)?u:c;a().greaterThan(y,L)&&i.push(Oe.encodeRefundETH()),m=ie(y)}return{calldata:Se.encodeMulticall(i),value:m}},e.encodeCollect=function(t){var n=[],i=ie(t.tokenId),a=t.expectedCurrencyOwed0.currency.isNative||t.expectedCurrencyOwed1.currency.isNative,o=(0,r.validateAndParseAddress)(t.recipient);if(n.push(e.INTERFACE.encodeFunctionData("collect",[{tokenId:i,recipient:a?R:o,amount0Max:Ie,amount1Max:Ie}])),a){var s=t.expectedCurrencyOwed0.currency.isNative?t.expectedCurrencyOwed0.quotient:t.expectedCurrencyOwed1.quotient,u=t.expectedCurrencyOwed0.currency.isNative?t.expectedCurrencyOwed1.currency:t.expectedCurrencyOwed0.currency,c=t.expectedCurrencyOwed0.currency.isNative?t.expectedCurrencyOwed1.quotient:t.expectedCurrencyOwed0.quotient;n.push(Oe.encodeUnwrapWETH9(s,o)),n.push(Oe.encodeSweepToken(u,c,o))}return n},e.collectCallParameters=function(t){var n=e.encodeCollect(t);return{calldata:Se.encodeMulticall(n),value:ie(0)}},e.removeCallParameters=function(t,n){var i=[],s=ie(n.deadline),u=ie(n.tokenId),c=new Ae({pool:t.pool,liquidity:n.liquidityPercentage.multiply(t.liquidity).quotient,tickLower:t.tickLower,tickUpper:t.tickUpper});a().greaterThan(c.liquidity,L)||(0,o.Z)(!1);var l=c.burnAmountsWithSlippage(n.slippageTolerance),f=l.amount0,d=l.amount1;n.permit&&i.push(e.INTERFACE.encodeFunctionData("permit",[(0,r.validateAndParseAddress)(n.permit.spender),u,ie(n.permit.deadline),n.permit.v,n.permit.r,n.permit.s])),i.push(e.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:u,liquidity:ie(c.liquidity),amount0Min:ie(f),amount1Min:ie(d),deadline:s}]));var p=n.collectOptions,h=p.expectedCurrencyOwed0,m=p.expectedCurrencyOwed1,v=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(p,["expectedCurrencyOwed0","expectedCurrencyOwed1"]);return i.push.apply(i,e.encodeCollect(A({tokenId:ie(n.tokenId),expectedCurrencyOwed0:h.add(r.CurrencyAmount.fromRawAmount(h.currency,f)),expectedCurrencyOwed1:m.add(r.CurrencyAmount.fromRawAmount(m.currency,d))},v))),n.liquidityPercentage.equalTo(D)?n.burnToken&&i.push(e.INTERFACE.encodeFunctionData("burn",[u])):!0===n.burnToken&&(0,o.Z)(!1),{calldata:Se.encodeMulticall(i),value:ie(0)}},e.safeTransferFromParameters=function(t){var n=(0,r.validateAndParseAddress)(t.recipient),i=(0,r.validateAndParseAddress)(t.sender);return{calldata:t.data?e.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256,bytes)",[i,n,ie(t.tokenId),t.data]):e.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256)",[i,n,ie(t.tokenId)]),value:ie(0)}},e}();Re.INTERFACE=new u.vU(d.Mt);var Me=function(){function e(){}return e.quoteCallParameters=function(e,t,n,i){void 0===i&&(i={});var a,s=1===e.pools.length,u=ie(t.quotient),c=i.useQuoterV2?this.V2INTERFACE:this.V1INTERFACE;if(s){var l,f,d={tokenIn:e.tokenPath[0].address,tokenOut:e.tokenPath[1].address,fee:e.pools[0].fee,sqrtPriceLimitX96:ie(null!=(l=null==(f=i)?void 0:f.sqrtPriceLimitX96)?l:0)},p=A({},d,n==r.TradeType.EXACT_INPUT?{amountIn:u}:{amount:u}),h=[d.tokenIn,d.tokenOut,d.fee,u,d.sqrtPriceLimitX96],m=n===r.TradeType.EXACT_INPUT?"quoteExactInputSingle":"quoteExactOutputSingle";a=c.encodeFunctionData(m,i.useQuoterV2?[p]:h)}else{var v;void 0!==(null==(v=i)?void 0:v.sqrtPriceLimitX96)&&(0,o.Z)(!1);var y=ae(e,n===r.TradeType.EXACT_OUTPUT),b=n===r.TradeType.EXACT_INPUT?"quoteExactInput":"quoteExactOutput";a=c.encodeFunctionData(b,[y,u])}return{calldata:a,value:ie(0)}},e}();Me.V1INTERFACE=new u.vU(m.Mt),Me.V2INTERFACE=new u.vU(v.Mt);var Ne=function(){function e(){}return e.encodeClaim=function(t,n){var i,a=[];a.push(e.INTERFACE.encodeFunctionData("unstakeToken",[this._encodeIncentiveKey(t),ie(n.tokenId)]));var o=(0,r.validateAndParseAddress)(n.recipient),s=null!=(i=n.amount)?i:0;return a.push(e.INTERFACE.encodeFunctionData("claimReward",[t.rewardToken.address,o,ie(s)])),a},e.collectRewards=function(t,n){t=Array.isArray(t)?t:[t];for(var r=[],i=0;i1){for(var r=[],i=0;i.04045?Math.pow((e+.005)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.005)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.005)/1.055,2.4):n/12.92,[.4124*(e*=100)+.3576*(t*=100)+.1805*(n*=100),.2126*e+.7152*t+.0722*n,.0193*e+.1192*t+.9505*n]}function i(e,t,n){return t/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(t=t>.008856?Math.pow(t,1/3):7.787*t+16/116)-16,500*(e-t),200*(t-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]}function a(e,t,n){var a=r(e,t,n);return i(a[0],a[1],a[2])}function o(e,t){var n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2],u=n-a,c=r-o,l=i-s,f=Math.sqrt(r*r+i*i),d=a-n,p=Math.sqrt(o*o+s*s)-f,h=Math.sqrt(u*u+c*c+l*l),m=Math.sqrt(h)>Math.sqrt(Math.abs(d))+Math.sqrt(Math.abs(p))?Math.sqrt(h*h-d*d-p*p):0;return d/=1,p/=1*(1+.045*f),m/=1*(1+.015*f),Math.sqrt(d*d+p*p+m*m)}function s(e,t){return o(a.apply(void 0,e),a.apply(void 0,t))}Object.defineProperty(t,"__esModule",{value:!0}),t.getColorDiffStatus=t.hexDiff=t.rgbDiff=t.deltaE94=t.rgbToCIELab=t.xyzToCIELab=t.rgbToXyz=t.hslToRgb=t.rgbToHsl=t.rgbToHex=t.hexToRgb=t.DELTAE94_DIFF_STATUS=void 0,t.DELTAE94_DIFF_STATUS={NA:0,PERFECT:1,CLOSE:2,GOOD:10,SIMILAR:50},t.hexToRgb=n,t.rgbToHex=function(e,t,n){return"#"+((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1,7)},t.rgbToHsl=function(e,t,n){e/=255,t/=255,n/=255;var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=0,s=(r+i)/2;if(r!==i){var u=r-i;switch(o=s>.5?u/(2-r-i):u/(r+i),r){case e:a=(t-n)/u+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0===t)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,u=2*n-s;r=o(u,s,e+1/3),i=o(u,s,e),a=o(u,s,e-1/3)}return[255*r,255*i,255*a]},t.rgbToXyz=r,t.xyzToCIELab=i,t.rgbToCIELab=a,t.deltaE94=o,t.rgbDiff=s,t.hexDiff=function(e,t){return s(n(e),n(t))},t.getColorDiffStatus=function(e){return e0?e.filter((function(e){for(var n=e.r,r=e.g,i=e.b,a=0;a0&&this._opts.filters.splice(t)}return this},e.prototype.clearFilters=function(){return this._opts.filters=[],this},e.prototype.quality=function(e){return this._opts.quality=e,this},e.prototype.useImageClass=function(e){return this._opts.ImageClass=e,this},e.prototype.useGenerator=function(e,t){return this._opts.generators||(this._opts.generators=[]),this._opts.generators.push(t?{name:e,options:t}:e),this},e.prototype.useQuantizer=function(e,t){return this._opts.quantizer=t?{name:e,options:t}:e,this},e.prototype.build=function(){return new i.default(this._src,this._opts)},e.prototype.getPalette=function(e){return this.build().getPalette(e)},e.prototype.getSwatches=function(e){return this.build().getPalette(e)},e}();t.default=o},78210:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(73026),a=r(n(46864)),o=n(43965),s=function(){function e(t,n){this._src=t,this.opts=o.assignDeep({},e.DefaultOpts,n)}return e.use=function(e){this._pipeline=e},e.from=function(e){return new a.default(e)},Object.defineProperty(e.prototype,"result",{get:function(){return this._result},enumerable:!1,configurable:!0}),e.prototype._process=function(t,n){this.opts.quantizer;t.scaleDown(this.opts);var r=i.buildProcessOptions(this.opts,n);return e._pipeline.process(t.getImageData(),r)},e.prototype.palette=function(){return this.swatches()},e.prototype.swatches=function(){throw new Error("Method deprecated. Use `Vibrant.result.palettes[name]` instead")},e.prototype.getPalette=function(){var e=this,t=arguments[0],n="string"===typeof t?t:"default",r="string"===typeof t?arguments[1]:t,i=new this.opts.ImageClass;return i.load(this._src).then((function(t){return e._process(t,{generators:[n]})})).then((function(t){return e._result=t,t.palettes[n]})).then((function(e){return i.remove(),r&&r(void 0,e),e})).catch((function(e){return i.remove(),r&&r(e),Promise.reject(e)}))},e.prototype.getPalettes=function(){var e=this,t=arguments[0],n=arguments[1],r=Array.isArray(t)?t:["*"],i=Array.isArray(t)?n:t,a=new this.opts.ImageClass;return a.load(this._src).then((function(t){return e._process(t,{generators:r})})).then((function(t){return e._result=t,t.palettes})).then((function(e){return a.remove(),i&&i(void 0,e),e})).catch((function(e){return a.remove(),i&&i(e),Promise.reject(e)}))},e.DefaultOpts={colorCount:64,quality:5,filters:[]},e}();t.default=s},73026:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildProcessOptions=void 0;var r=n(43965);t.buildProcessOptions=function(e,t){var n=e.colorCount,i=e.quantizer,a=e.generators,o=e.filters,s={colorCount:n},u="string"===typeof i?{name:i,options:{}}:i;return u.options=r.assignDeep({},s,u.options),r.assignDeep({},{quantizer:u,generators:a,filters:o},t)}},14671:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=s&&p<=u&&h>=i&&h<=a&&!function(e,t){return e.Vibrant===t||e.DarkVibrant===t||e.LightVibrant===t||e.Muted===t||e.DarkMuted===t||e.LightMuted===t}(e,t)){var m=function(e,t,n,r,i,a,o){function s(e,t){return 1-Math.abs(e-t)}return function(){for(var e=[],t=0;tf)&&(l=t,f=m)}})),l}t.default=function(e,t){t=Object.assign({},a,t);var n=function(e){var t=0;return e.forEach((function(e){t=Math.max(t,e.population)})),t}(e),s=function(e,t,n){var r={Vibrant:null,DarkVibrant:null,LightVibrant:null,Muted:null,DarkMuted:null,LightMuted:null};return r.Vibrant=o(r,e,t,n.targetNormalLuma,n.minNormalLuma,n.maxNormalLuma,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.LightVibrant=o(r,e,t,n.targetLightLuma,n.minLightLuma,1,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.DarkVibrant=o(r,e,t,n.targetDarkLuma,0,n.maxDarkLuma,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.Muted=o(r,e,t,n.targetNormalLuma,n.minNormalLuma,n.maxNormalLuma,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r.LightMuted=o(r,e,t,n.targetLightLuma,n.minLightLuma,1,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r.DarkMuted=o(r,e,t,n.targetDarkLuma,0,n.maxDarkLuma,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r}(e,n,t);return function(e,t,n){if(!e.Vibrant&&!e.DarkVibrant&&!e.LightVibrant){if(!e.DarkVibrant&&e.DarkMuted){var a=e.DarkMuted.hsl,o=a[0],s=a[1],u=a[2];u=n.targetDarkLuma,e.DarkVibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}if(!e.LightVibrant&&e.LightMuted){var c=e.LightMuted.hsl;o=c[0],s=c[1],u=c[2],u=n.targetDarkLuma,e.DarkVibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}}if(!e.Vibrant&&e.DarkVibrant){var l=e.DarkVibrant.hsl;o=l[0],s=l[1],u=l[2],u=n.targetNormalLuma,e.Vibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}else if(!e.Vibrant&&e.LightVibrant){var f=e.LightVibrant.hsl;o=f[0],s=f[1],u=f[2],u=n.targetNormalLuma,e.Vibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}if(!e.DarkVibrant&&e.Vibrant){var d=e.Vibrant.hsl;o=d[0],s=d[1],u=d[2],u=n.targetDarkLuma,e.DarkVibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}if(!e.LightVibrant&&e.Vibrant){var p=e.Vibrant.hsl;o=p[0],s=p[1],u=p[2],u=n.targetLightLuma,e.LightVibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}if(!e.Muted&&e.Vibrant){var h=e.Vibrant.hsl;o=h[0],s=h[1],u=h[2],u=n.targetMutesSaturation,e.Muted=new r.Swatch(i.hslToRgb(o,s,u),0)}if(!e.DarkMuted&&e.DarkVibrant){var m=e.DarkVibrant.hsl;o=m[0],s=m[1],u=m[2],u=n.targetMutesSaturation,e.DarkMuted=new r.Swatch(i.hslToRgb(o,s,u),0)}if(!e.LightMuted&&e.LightVibrant){var v=e.LightVibrant.hsl;o=v[0],s=v[1],u=v[2],u=n.targetMutesSaturation,e.LightMuted=new r.Swatch(i.hslToRgb(o,s,u),0)}}(s,0,t),s}},2120:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype._initCanvas=function(){var e=this.image,t=this._canvas=document.createElement("canvas"),n=t.getContext("2d");if(!n)throw new ReferenceError("Failed to create canvas context");this._context=n,t.className="@vibrant/canvas",t.style.display="none",this._width=t.width=e.width,this._height=t.height=e.height,n.drawImage(e,0,0),document.body.appendChild(t)},t.prototype.load=function(e){var t,n,r=this;if("string"===typeof e)t=document.createElement("img"),function(e){var t=new URL(e,location.href);return t.protocol===location.protocol&&t.host===location.host&&t.port===location.port}(n=e)||function(e,t){var n=new URL(e),r=new URL(t);return n.protocol===r.protocol&&n.hostname===r.hostname&&n.port===r.port}(window.location.href,n)||(t.crossOrigin="anonymous"),t.src=n;else{if(!(e instanceof HTMLImageElement))return Promise.reject(new Error("Cannot load buffer as an image in browser"));t=e,n=e.src}return this.image=t,new Promise((function(e,i){var a=function(){r._initCanvas(),e(r)};t.complete?a():(t.onload=a,t.onerror=function(e){return i(new Error("Fail to load image: "+n))})}))},t.prototype.clear=function(){this._context.clearRect(0,0,this._width,this._height)},t.prototype.update=function(e){this._context.putImageData(e,0,0)},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t.prototype.resize=function(e,t,n){var r=this,i=r._canvas,a=r._context,o=r.image;this._width=i.width=e,this._height=i.height=t,a.scale(n,n),a.drawImage(o,0,0)},t.prototype.getPixelCount=function(){return this._width*this._height},t.prototype.getImageData=function(){return this._context.getImageData(0,0,this._width,this._height)},t.prototype.remove=function(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)},t}(n(21986).ImageBase);t.default=i},28826:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.pixels=e,this.opts=t;var n=t.sigBits,r=function(e,t,r){return(e<<2*n)+(t<>=p,f>>=p,d>>=p)]+=1,l>i&&(i=l),lo&&(o=f),fu&&(u=d),d0?e+1:e}),0),this.hist=h,this.rmax=i,this.rmin=a,this.gmax=o,this.gmin=s,this.bmax=u,this.bmin=c}return Object.defineProperty(e.prototype,"colorCount",{get:function(){return this._colorCount},enumerable:!1,configurable:!0}),e}();t.default=n},21986:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyFilters=t.ImageBase=void 0;var n=function(){function e(){}return e.prototype.scaleDown=function(e){var t=this.getWidth(),n=this.getHeight(),r=1;if(e.maxDimension>0){var i=Math.max(t,n);i>e.maxDimension&&(r=e.maxDimension/i)}else r=1/e.quality;r<1&&this.resize(t*r,n*r,r)},e}();t.ImageBase=n,t.applyFilters=function(e,t){if(t.length>0)for(var n=e.data,r=n.length/4,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,c=0;c0))break;var i=r.split(),a=i[0],o=i[1];if(e.push(a),o&&o.count()>0&&e.push(o),e.size()===n)break;n=e.size()}}t.default=function(e,t){if(0===e.length||t.colorCount<2||t.colorCount>256)throw new Error("Wrong MMCQ parameters");var n=a.default.build(e),r=(n.histogram.colorCount,new o.default((function(e,t){return e.count()-t.count()})));r.push(n),s(r,.75*t.colorCount);var u=new o.default((function(e,t){return e.count()*e.volume()-t.count()*t.volume()}));return u.contents=r.contents,s(u,t.colorCount-u.size()),function(e){var t=[];for(;e.size();){var n=e.pop(),r=n.avg();r[0],r[1],r[2];t.push(new i.Swatch(r,n.count()))}return t}(u)}},54711:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._comparator=e,this.contents=[],this._sorted=!1}return e.prototype._sort=function(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)},e.prototype.push=function(e){this.contents.push(e),this._sorted=!1},e.prototype.peek=function(e){return this._sort(),e="number"===typeof e?e:this.contents.length-1,this.contents[e]},e.prototype.pop=function(){return this._sort(),this.contents.pop()},e.prototype.size=function(){return this.contents.length},e.prototype.map=function(e){return this._sort(),this.contents.map(e)},e}();t.default=n},79768:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(28826)),a=function(){function e(e,t,n,r,i,a,o){this.histogram=o,this._volume=-1,this._count=-1,this.dimension={r1:e,r2:t,g1:n,g2:r,b1:i,b2:a}}return e.build=function(t){var n=new i.default(t,{sigBits:5});return new e(n.rmin,n.rmax,n.gmin,n.gmax,n.bmin,n.bmax,n)},e.prototype.invalidate=function(){this._volume=this._count=-1,this._avg=null},e.prototype.volume=function(){if(this._volume<0){var e=this.dimension,t=e.r1,n=e.r2,r=e.g1,i=e.g2,a=e.b1,o=e.b2;this._volume=(n-t+1)*(i-r+1)*(o-a+1)}return this._volume},e.prototype.count=function(){if(this._count<0){for(var e=this.histogram,t=e.hist,n=e.getColorIndex,r=this.dimension,i=r.r1,a=r.r2,o=r.g1,s=r.g2,u=r.b1,c=r.b2,l=0,f=i;f<=a;f++)for(var d=o;d<=s;d++)for(var p=u;p<=c;p++){l+=t[n(f,d,p)]}this._count=l}return this._count},e.prototype.clone=function(){var t=this.histogram,n=this.dimension;return new e(n.r1,n.r2,n.g1,n.g2,n.b1,n.b2,t)},e.prototype.avg=function(){if(!this._avg){var e=this.histogram,t=e.hist,n=e.getColorIndex,r=this.dimension,i=r.r1,a=r.r2,o=r.g1,s=r.g2,u=r.b1,c=r.b2,l=0,f=void 0,d=void 0,p=void 0;f=d=p=0;for(var h=i;h<=a;h++)for(var m=o;m<=s;m++)for(var v=u;v<=c;v++){var y=t[n(h,m,v)];l+=y,f+=y*(h+.5)*8,d+=y*(m+.5)*8,p+=y*(v+.5)*8}this._avg=l?[~~(f/l),~~(d/l),~~(p/l)]:[~~(8*(i+a+1)/2),~~(8*(o+s+1)/2),~~(8*(u+c+1)/2)]}return this._avg},e.prototype.contains=function(e){var t=e[0],n=e[1],r=e[2],i=this.dimension,a=i.r1,o=i.r2,s=i.g1,u=i.g2,c=i.b1,l=i.b2;return n>>=3,r>>=3,(t>>=3)>=a&&t<=o&&n>=s&&n<=u&&r>=c&&r<=l},e.prototype.split=function(){var e=this.histogram,t=e.hist,n=e.getColorIndex,r=this.dimension,i=r.r1,a=r.r2,o=r.g1,s=r.g2,u=r.b1,c=r.b2,l=this.count();if(!l)return[];if(1===l)return[this.clone()];var f,d,p=a-i+1,h=s-o+1,m=c-u+1,v=Math.max(p,h,m),y=null;f=d=0;var b=null;if(v===p){b="r",y=new Uint32Array(a+1);for(var g=i;g<=a;g++){f=0;for(var w=o;w<=s;w++)for(var x=u;x<=c;x++){f+=t[n(g,w,x)]}d+=f,y[g]=d}}else if(v===h){b="g",y=new Uint32Array(s+1);for(w=o;w<=s;w++){f=0;for(g=i;g<=a;g++)for(x=u;x<=c;x++){f+=t[n(g,w,x)]}d+=f,y[w]=d}}else{b="b",y=new Uint32Array(c+1);for(x=u;x<=c;x++){f=0;for(g=i;g<=a;g++)for(w=o;w<=s;w++){f+=t[n(g,w,x)]}d+=f,y[x]=d}}for(var k=-1,A=new Uint32Array(y.length),E=0;Ed/2&&(k=E),A[E]=d-_}var T=this;return function(e){var t=e+"1",n=e+"2",r=T.dimension[t],i=T.dimension[n],a=T.clone(),o=T.clone(),s=k-r,u=i-k;for(s<=u?(i=Math.min(i-1,~~(k+u/2)),i=Math.max(0,i)):(i=Math.max(r,~~(k-1-s/2)),i=Math.min(T.dimension[n],i));!y[i];)i++;for(var c=A[i];!c&&y[i-1];)c=A[--i];return a.dimension[n]=i,o.dimension[t]=i+1,[a,o]}(b)},e}();t.default=a},32760:function(e,t,n){"use strict";function r(){return(null===n.g||void 0===n.g?void 0:n.g.crypto)||(null===n.g||void 0===n.g?void 0:n.g.msCrypto)||{}}function i(){var e=r();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=r,t.getSubtleCrypto=i,t.isBrowserCryptoAvailable=function(){return!!r()&&!!i()}},34300:function(e,t){"use strict";function n(){return"undefined"===typeof document&&"undefined"!==typeof navigator&&"ReactNative"===navigator.product}function r(){return"undefined"!==typeof process&&"undefined"!==typeof process.versions&&"undefined"!==typeof process.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=n,t.isNode=r,t.isBrowser=function(){return!n()&&!r()}},55503:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66797);r.__exportStar(n(32760),t),r.__exportStar(n(34300),t)},23375:function(e,t,n){"use strict";n.d(t,{q:function(){return a}});var r=n(43144),i=n(15671),a=(0,r.Z)((function e(){(0,i.Z)(this,e)}))},66727:function(e,t,n){"use strict";n.r(t),n.d(t,{IEvents:function(){return r.q}});var r=n(23375)},3918:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HEARTBEAT_EVENTS=t.HEARTBEAT_INTERVAL=void 0;var r=n(93659);t.HEARTBEAT_INTERVAL=r.FIVE_SECONDS,t.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"}},17122:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(66797).__exportStar(n(3918),t)},80588:function(e,t,n){"use strict";var r=n(17061).default,i=n(56690).default,a=n(89728).default,o=n(61655).default,s=n(26389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.HeartBeat=void 0;var u=n(66797),c=n(68041),l=n(93659),f=n(45326),d=n(17122),p=function(e){o(n,e);var t=s(n);function n(e){var r;return i(this,n),(r=t.call(this,e)).events=new c.EventEmitter,r.interval=d.HEARTBEAT_INTERVAL,r.interval=(null===e||void 0===e?void 0:e.interval)||d.HEARTBEAT_INTERVAL,r}return a(n,[{key:"init",value:function(){return u.__awaiter(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initialize();case 2:case"end":return e.stop()}}),e,this)})))}},{key:"stop",value:function(){clearInterval(this.intervalRef)}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"initialize",value:function(){return u.__awaiter(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.intervalRef=setInterval((function(){return t.pulse()}),l.toMiliseconds(this.interval));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"pulse",value:function(){this.events.emit(d.HEARTBEAT_EVENTS.pulse)}}],[{key:"init",value:function(e){return u.__awaiter(this,void 0,void 0,r().mark((function t(){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new n(e),t.next=3,i.init();case 3:return t.abrupt("return",i);case 4:case"end":return t.stop()}}),t)})))}}]),n}(f.IHeartBeat);t.HeartBeat=p},1345:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66797);r.__exportStar(n(80588),t),r.__exportStar(n(45326),t),r.__exportStar(n(17122),t)},61398:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default,a=n(61655).default,o=n(26389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.IHeartBeat=void 0;var s=function(e){a(n,e);var t=o(n);function n(e){return i(this,n),t.call(this)}return r(n)}(n(66727).IEvents);t.IHeartBeat=s},45326:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(66797).__exportStar(n(61398),t)},17507:function(e,t,n){"use strict";n.r(t),n.d(t,{HttpConnection:function(){return p},default:function(){return h}});var r=n(74165),i=n(15861),a=n(15671),o=n(43144),s=n(68041),u=n(7605),c=n.n(u),l=n(76090),f=n(31567),d={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,a.Z)(this,e),this.url=t,this.disableProviderPing=n,this.events=new s.EventEmitter,this.isAvailable=!1,this.registering=!1,!(0,f.isHttpUrl)(t))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(t));this.url=t,this.disableProviderPing=n}return(0,o.Z)(e,[{key:"connected",get:function(){return this.isAvailable}},{key:"connecting",get:function(){return this.registering}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"open",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n=arguments;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:this.url,e.next=3,this.register(t);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isAvailable){e.next=2;break}throw new Error("Connection already closed");case 2:this.onClose();case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t,n){var i,a,o;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isAvailable){e.next=3;break}return e.next=3,this.register();case 3:return e.prev=3,i=(0,l.u)(t),e.next=7,c()(this.url,Object.assign(Object.assign({},d),{body:i}));case 7:return a=e.sent,e.next=10,a.json();case 10:o=e.sent,this.onPayload({data:o}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(3),this.onError(t.id,e.t0);case 17:case"end":return e.stop()}}),e,this,[[3,14]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"register",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n,i,a,o=this,s=arguments;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]?s[0]:this.url,(0,f.isHttpUrl)(t)){e.next=3;break}throw new Error("Provided URL is not compatible with HTTP connection: ".concat(t));case 3:if(!this.registering){e.next=7;break}return n=this.events.getMaxListeners(),(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),e.abrupt("return",new Promise((function(e,t){o.events.once("register_error",(function(e){o.resetMaxListeners(),t(e)})),o.events.once("open",(function(){if(o.resetMaxListeners(),"undefined"===typeof o.isAvailable)return t(new Error("HTTP connection is missing or invalid"));e()}))})));case 7:if(this.url=t,this.registering=!0,e.prev=9,this.disableProviderPing){e.next=14;break}return i=(0,l.u)({id:1,jsonrpc:"2.0",method:"test",params:[]}),e.next=14,c()(t,Object.assign(Object.assign({},d),{body:i}));case 14:this.onOpen(),e.next=23;break;case 17:throw e.prev=17,e.t0=e.catch(9),a=this.parseError(e.t0),this.events.emit("register_error",a),this.onClose(),a;case 23:case"end":return e.stop()}}),e,this,[[9,17]])})));return function(){return e.apply(this,arguments)}}()},{key:"onOpen",value:function(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}},{key:"onClose",value:function(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}},{key:"onPayload",value:function(e){if("undefined"!==typeof e.data){var t="string"===typeof e.data?(0,l.D)(e.data):e.data;this.events.emit("payload",t)}}},{key:"onError",value:function(e,t){var n=this.parseError(t),r=n.message||n.toString(),i=(0,f.formatJsonRpcError)(e,r);this.events.emit("payload",i)}},{key:"parseError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url;return(0,f.parseConnectionError)(e,t,"HTTP")}},{key:"resetMaxListeners",value:function(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}]),e}(),h=p},13730:function(e,t,n){"use strict";n.r(t),n.d(t,{JsonRpcProvider:function(){return f},default:function(){return d}});var r=n(74165),i=n(15861),a=n(15671),o=n(43144),s=n(60136),u=n(29388),c=n(68041),l=n(31567),f=function(e){(0,s.Z)(n,e);var t=(0,u.Z)(n);function n(e){var r;return(0,a.Z)(this,n),(r=t.call(this,e)).events=new c.EventEmitter,r.hasRegisteredEventListeners=!1,r.connection=r.setConnection(e),r.connection.connected&&r.registerEventListeners(),r}return(0,o.Z)(n,[{key:"connect",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n=arguments;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:this.connection,e.next=3,this.open(t);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.close();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"request",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t,n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.requestStrict((0,l.formatJsonRpcRequest)(t.method,t.params||[],t.id||(0,l.getBigIntRpcId)().toString()),n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"requestStrict",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t,n){var a=this;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=(0,i.Z)((0,r.Z)().mark((function e(i,o){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a.connection.connected){e.next=9;break}return e.prev=1,e.next=4,a.open();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),o(e.t0);case 9:return a.events.on("".concat(t.id),(function(e){(0,l.isJsonRpcError)(e)?o(e.error):i(e.result)})),e.prev=10,e.next=13,a.connection.send(t,n);case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(10),o(e.t1);case 18:case"end":return e.stop()}}),e,null,[[1,6],[10,15]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setConnection",value:function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.connection}},{key:"onPayload",value:function(e){this.events.emit("payload",e),(0,l.isJsonRpcResponse)(e)?this.events.emit("".concat(e.id),e):this.events.emit("message",{type:e.method,data:e.params})}},{key:"onClose",value:function(e){e&&3e3===e.code&&this.events.emit("error",new Error("WebSocket connection closed abnormally with code: ".concat(e.code," ").concat(e.reason?"(".concat(e.reason,")"):""))),this.events.emit("disconnect")}},{key:"open",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n=arguments;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>0&&void 0!==n[0]?n[0]:this.connection,this.connection!==t||!this.connection.connected){e.next=3;break}return e.abrupt("return");case 3:if(this.connection.connected&&this.close(),"string"!==typeof t){e.next=8;break}return e.next=7,this.connection.open(t);case 7:t=this.connection;case 8:return this.connection=this.setConnection(t),e.next=11,this.connection.open();case 11:this.registerEventListeners(),this.events.emit("connect");case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.connection.close();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"registerEventListeners",value:function(){var e=this;this.hasRegisteredEventListeners||(this.connection.on("payload",(function(t){return e.onPayload(t)})),this.connection.on("close",(function(t){return e.onClose(t)})),this.connection.on("error",(function(t){return e.events.emit("error",t)})),this.connection.on("register_error",(function(t){return e.onClose()})),this.hasRegisteredEventListeners=!0)}}]),n}(l.IJsonRpcProvider),d=f},92182:function(e,t,n){"use strict";n.d(t,{CA:function(){return o},JV:function(){return c},O4:function(){return a},dQ:function(){return s},xK:function(){return u}});var r,i=n(4942),a="INTERNAL_ERROR",o="SERVER_ERROR",s=[-32700,-32600,-32601,-32602,-32603],u=(r={},(0,i.Z)(r,"PARSE_ERROR",{code:-32700,message:"Parse error"}),(0,i.Z)(r,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),(0,i.Z)(r,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),(0,i.Z)(r,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),(0,i.Z)(r,a,{code:-32603,message:"Internal error"}),(0,i.Z)(r,o,{code:-32e3,message:"Server error"}),r),c=o},46362:function(e,t,n){"use strict";var r=n(55503);n.o(r,"IJsonRpcProvider")&&n.d(t,{IJsonRpcProvider:function(){return r.IJsonRpcProvider}}),n.o(r,"formatJsonRpcError")&&n.d(t,{formatJsonRpcError:function(){return r.formatJsonRpcError}}),n.o(r,"formatJsonRpcRequest")&&n.d(t,{formatJsonRpcRequest:function(){return r.formatJsonRpcRequest}}),n.o(r,"formatJsonRpcResult")&&n.d(t,{formatJsonRpcResult:function(){return r.formatJsonRpcResult}}),n.o(r,"getBigIntRpcId")&&n.d(t,{getBigIntRpcId:function(){return r.getBigIntRpcId}}),n.o(r,"isHttpUrl")&&n.d(t,{isHttpUrl:function(){return r.isHttpUrl}}),n.o(r,"isJsonRpcError")&&n.d(t,{isJsonRpcError:function(){return r.isJsonRpcError}}),n.o(r,"isJsonRpcRequest")&&n.d(t,{isJsonRpcRequest:function(){return r.isJsonRpcRequest}}),n.o(r,"isJsonRpcResponse")&&n.d(t,{isJsonRpcResponse:function(){return r.isJsonRpcResponse}}),n.o(r,"isJsonRpcResult")&&n.d(t,{isJsonRpcResult:function(){return r.isJsonRpcResult}}),n.o(r,"isLocalhostUrl")&&n.d(t,{isLocalhostUrl:function(){return r.isLocalhostUrl}}),n.o(r,"isReactNative")&&n.d(t,{isReactNative:function(){return r.isReactNative}}),n.o(r,"isWsUrl")&&n.d(t,{isWsUrl:function(){return r.isWsUrl}})},31140:function(e,t,n){"use strict";n.d(t,{CX:function(){return s},L2:function(){return o},by:function(){return a},i5:function(){return i}});var r=n(92182);function i(e){return r.dQ.includes(e)}function a(e){return Object.keys(r.xK).includes(e)?r.xK[e]:r.xK[r.JV]}function o(e){var t=Object.values(r.xK).find((function(t){return t.code===e}));return t||r.xK[r.JV]}function s(e,t,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error("Unavailable ".concat(n," RPC url at ").concat(t)):e}},4352:function(e,t,n){"use strict";n.d(t,{CS:function(){return o},RI:function(){return c},sT:function(){return s},tm:function(){return u}});var r=n(31140),i=n(92182);function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function o(){return BigInt(a(arguments.length>0&&void 0!==arguments[0]?arguments[0]:6))}function s(e,t,n){return{id:n||a(),jsonrpc:"2.0",method:e,params:t}}function u(e,t){return{id:e,jsonrpc:"2.0",result:t}}function c(e,t,n){return{id:e,jsonrpc:"2.0",error:l(t,n)}}function l(e,t){return"undefined"===typeof e?(0,r.by)(i.O4):("string"===typeof e&&(e=Object.assign(Object.assign({},(0,r.by)(i.CA)),{message:e})),"undefined"!==typeof t&&(e.data=t),(0,r.i5)(e.code)&&(e=(0,r.L2)(e.code)),e)}},31567:function(e,t,n){"use strict";n.d(t,{IJsonRpcProvider:function(){return o.x0},formatJsonRpcError:function(){return a.RI},formatJsonRpcRequest:function(){return a.sT},formatJsonRpcResult:function(){return a.tm},getBigIntRpcId:function(){return a.CS},isHttpUrl:function(){return s.jK},isJsonRpcError:function(){return u.jg},isJsonRpcRequest:function(){return u.DW},isJsonRpcResponse:function(){return u.u},isJsonRpcResult:function(){return u.k4},isLocalhostUrl:function(){return s.JF},isWsUrl:function(){return s.UZ},parseConnectionError:function(){return r.CX}});n(92182);var r=n(31140),i=n(46362);n.o(i,"IJsonRpcProvider")&&n.d(t,{IJsonRpcProvider:function(){return i.IJsonRpcProvider}}),n.o(i,"formatJsonRpcError")&&n.d(t,{formatJsonRpcError:function(){return i.formatJsonRpcError}}),n.o(i,"formatJsonRpcRequest")&&n.d(t,{formatJsonRpcRequest:function(){return i.formatJsonRpcRequest}}),n.o(i,"formatJsonRpcResult")&&n.d(t,{formatJsonRpcResult:function(){return i.formatJsonRpcResult}}),n.o(i,"getBigIntRpcId")&&n.d(t,{getBigIntRpcId:function(){return i.getBigIntRpcId}}),n.o(i,"isHttpUrl")&&n.d(t,{isHttpUrl:function(){return i.isHttpUrl}}),n.o(i,"isJsonRpcError")&&n.d(t,{isJsonRpcError:function(){return i.isJsonRpcError}}),n.o(i,"isJsonRpcRequest")&&n.d(t,{isJsonRpcRequest:function(){return i.isJsonRpcRequest}}),n.o(i,"isJsonRpcResponse")&&n.d(t,{isJsonRpcResponse:function(){return i.isJsonRpcResponse}}),n.o(i,"isJsonRpcResult")&&n.d(t,{isJsonRpcResult:function(){return i.isJsonRpcResult}}),n.o(i,"isLocalhostUrl")&&n.d(t,{isLocalhostUrl:function(){return i.isLocalhostUrl}}),n.o(i,"isReactNative")&&n.d(t,{isReactNative:function(){return i.isReactNative}}),n.o(i,"isWsUrl")&&n.d(t,{isWsUrl:function(){return i.isWsUrl}});var a=n(4352),o=n(67099),s=n(10948),u=n(26063)},67099:function(e,t,n){"use strict";n.d(t,{x0:function(){return s}});var r=n(43144),i=n(15671),a=n(60136),o=n(29388),s=function(e){(0,a.Z)(n,e);var t=(0,o.Z)(n);function n(e){return(0,i.Z)(this,n),t.call(this)}return(0,r.Z)(n)}(function(e){(0,a.Z)(n,e);var t=(0,o.Z)(n);function n(){return(0,i.Z)(this,n),t.call(this)}return(0,r.Z)(n)}((0,r.Z)((function e(){(0,i.Z)(this,e)}))))},10948:function(e,t,n){"use strict";n.d(t,{JF:function(){return u},UZ:function(){return s},jK:function(){return o}});var r="^https?:",i="^wss?:";function a(e,t){var n=function(e){var t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return"undefined"!==typeof n&&new RegExp(t).test(n)}function o(e){return a(e,r)}function s(e){return a(e,i)}function u(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}},26063:function(e,t,n){"use strict";function r(e){return"object"===typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function i(e){return r(e)&&"method"in e}function a(e){return r(e)&&(o(e)||s(e))}function o(e){return"result"in e}function s(e){return"error"in e}n.d(t,{DW:function(){return i},jg:function(){return s},k4:function(){return o},u:function(){return a}})},60074:function(e,t,n){"use strict";var r=n(17061).default,i=n(56690).default,a=n(89728).default;var o=n(66797),s=n(84217),u=o.__importDefault(n(82703)),c=n(72038),l=function(){function e(){i(this,e),this.localStorage=u.default}return a(e,[{key:"getKeys",value:function(){return o.__awaiter(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object.keys(this.localStorage));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getEntries",value:function(){return o.__awaiter(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object.entries(this.localStorage).map(c.parseEntry));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getItem",value:function(e){return o.__awaiter(this,void 0,void 0,r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(n=this.localStorage.getItem(e))){t.next=3;break}return t.abrupt("return",void 0);case 3:return t.abrupt("return",s.safeJsonParse(n));case 4:case"end":return t.stop()}}),t,this)})))}},{key:"setItem",value:function(e,t){return o.__awaiter(this,void 0,void 0,r().mark((function n(){return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:this.localStorage.setItem(e,s.safeJsonStringify(t));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"removeItem",value:function(e){return o.__awaiter(this,void 0,void 0,r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.localStorage.removeItem(e);case 1:case"end":return t.stop()}}),t,this)})))}}]),e}();t.ZP=l},82703:function(e,t,n){"use strict";!function(){var t;function r(){}(t=r).prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},t.prototype.setItem=function(e,t){this[e]=String(t)},t.prototype.removeItem=function(e){delete this[e]},t.prototype.clear=function(){var e=this;Object.keys(e).forEach((function(t){e[t]=void 0,delete e[t]}))},t.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},t.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),"undefined"!==typeof n.g&&n.g.localStorage?e.exports=n.g.localStorage:"undefined"!==typeof window&&window.localStorage?e.exports=window.localStorage:e.exports=new r}()},72038:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66797);r.__exportStar(n(28383),t),r.__exportStar(n(99483),t)},28383:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default;Object.defineProperty(t,"__esModule",{value:!0}),t.IKeyValueStorage=void 0;var a=r((function e(){i(this,e)}));t.IKeyValueStorage=a},99483:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseEntry=void 0;var r=n(84217);t.parseEntry=function(e){var t;return[e[0],r.safeJsonParse(null!==(t=e[1])&&void 0!==t?t:"")]}},82923:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PINO_CUSTOM_CONTEXT_KEY=t.PINO_LOGGER_DEFAULTS=void 0,t.PINO_LOGGER_DEFAULTS={level:"info"},t.PINO_CUSTOM_CONTEXT_KEY="custom_context"},91451:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;var r=n(66797),i=r.__importDefault(n(24));Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return i.default}}),r.__exportStar(n(82923),t),r.__exportStar(n(41067),t)},41067:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateChildLogger=t.formatChildLoggerContext=t.getLoggerContext=t.setBrowserLoggerContext=t.getBrowserLoggerContext=t.getDefaultLoggerOptions=void 0;var r=n(82923);function i(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.PINO_CUSTOM_CONTEXT_KEY]||""}function a(e,t){return e[arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.PINO_CUSTOM_CONTEXT_KEY]=t,e}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.PINO_CUSTOM_CONTEXT_KEY;return"undefined"===typeof e.bindings?i(e,t):e.bindings().context||""}function s(e,t){var n=o(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.PINO_CUSTOM_CONTEXT_KEY);return n.trim()?"".concat(n,"/").concat(t):t}t.getDefaultLoggerOptions=function(e){return Object.assign(Object.assign({},e),{level:(null===e||void 0===e?void 0:e.level)||r.PINO_LOGGER_DEFAULTS.level})},t.getBrowserLoggerContext=i,t.setBrowserLoggerContext=a,t.getLoggerContext=o,t.formatChildLoggerContext=s,t.generateChildLogger=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.PINO_CUSTOM_CONTEXT_KEY,i=s(e,t,n);return a(e.child({context:i}),i,n)}},7370:function(){},15139:function(){},76090:function(e,t,n){"use strict";n.d(t,{D:function(){return a},u:function(){return o}});var r=function(e){return JSON.stringify(e,(function(e,t){return"bigint"===typeof t?t.toString()+"n":t}))},i=function(e){var t=e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(t,(function(e,t){return"string"===typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t}))};function a(e){if("string"!==typeof e)throw new Error("Cannot safe json parse value of type ".concat(typeof e));try{return i(e)}catch(t){return e}}function o(e){return"string"===typeof e?e:r(e)||""}},16073:function(e,t,n){"use strict";t.D=void 0;var r=n(38783);t.D=function(){var e,t;try{e=r.getDocumentOrThrow(),t=r.getLocationOrThrow()}catch(a){return null}function n(){for(var t=arguments.length,n=new Array(t),r=0;r-1){var s=a.getAttribute("href");if(s)if(-1===s.toLowerCase().indexOf("https:")&&-1===s.toLowerCase().indexOf("http:")&&0!==s.indexOf("//")){var u=t.protocol+"//"+t.host;if(0===s.indexOf("/"))u+=s;else{var c=t.pathname.split("/");c.pop(),u+=c.join("/")+"/"+s}r.push(u)}else if(0===s.indexOf("//")){var l=t.protocol+s;r.push(l)}else r.push(s)}}return r}(),name:i}}},88939:function(e,t,n){"use strict";var r=n(38416).default,i=n(27424).default,a=n(74704).default,o=n(861).default,s=n(82376),u=n(8271),c=n(94266),l=n(2214),f=Symbol("encodeFragmentIdentifier");function d(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function p(e,t){return t.encode?t.strict?s(e):encodeURIComponent(e):e}function h(e,t){return t.decode?u(e):e}function m(e){return Array.isArray(e)?e.sort():"object"===typeof e?m(Object.keys(e)).sort((function(e,t){return Number(e)-Number(t)})).map((function(t){return e[t]})):e}function v(e){var t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function y(e){var t=(e=v(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function b(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function g(e,t){d((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);var n=function(e){var t;switch(e.arrayFormat){case"index":return function(e,n,r){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return function(e,n,r){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return function(e,n,r){t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return function(t,n,r){var i="string"===typeof n&&n.includes(e.arrayFormatSeparator),a="string"===typeof n&&!i&&h(n,e).includes(e.arrayFormatSeparator);n=a?h(n,e):n;var o=i||a?n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)})):null===n?n:h(n,e);r[t]=o};case"bracket-separator":return function(t,n,r){var i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),i){var a=null===n?[]:n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)}));void 0!==r[t]?r[t]=[].concat(r[t],a):r[t]=a}else r[t]=n?h(n,e):n};default:return function(e,t,n){void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!==typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;var o,s=a(e.split("&"));try{for(s.s();!(o=s.n()).done;){var u=o.value;if(""!==u){var l=c(t.decode?u.replace(/\+/g," "):u,"="),f=i(l,2),p=f[0],v=f[1];v=void 0===v?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?v:h(v,t),n(h(p,t),v,r)}}}catch(_){s.e(_)}finally{s.f()}for(var y=0,g=Object.keys(r);y0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var n=c(e,"#"),r=i(n,2),a=r[0],o=r[1];return Object.assign({url:a.split("?")[0]||"",query:g(y(e),t)},t&&t.parseFragmentIdentifier&&o?{fragmentIdentifier:h(o,t)}:{})},t.stringifyUrl=function(e,n){n=Object.assign(r({encode:!0,strict:!0},f,!0),n);var i=v(e.url).split("?")[0]||"",a=t.extract(e.url),o=t.parse(a,{sort:!1}),s=Object.assign(o,e.query),u=t.stringify(s,n);u&&(u="?".concat(u));var c=function(e){var t="",n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(c="#".concat(n[f]?p(e.fragmentIdentifier,n):e.fragmentIdentifier)),"".concat(i).concat(u).concat(c)},t.pick=function(e,n,i){i=Object.assign(r({parseFragmentIdentifier:!0},f,!1),i);var a=t.parseUrl(e,i),o=a.url,s=a.query,u=a.fragmentIdentifier;return t.stringifyUrl({url:o,query:l(s,n),fragmentIdentifier:u},i)},t.exclude=function(e,n,r){var i=Array.isArray(n)?function(e){return!n.includes(e)}:function(e,t){return!n(e,t)};return t.pick(e,i,r)}},54813:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66797);r.__exportStar(n(6775),t),r.__exportStar(n(73403),t)},6775:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},73403:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},93659:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66797);r.__exportStar(n(60271),t),r.__exportStar(n(36349),t),r.__exportStar(n(28886),t),r.__exportStar(n(54813),t)},28886:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(66797).__exportStar(n(45780),t)},45780:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default;Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;var a=r((function e(){i(this,e)}));t.IWatch=a},6317:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;var r=n(54813);t.toMiliseconds=function(e){return e*r.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/r.ONE_THOUSAND)}},98083:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise((function(t){setTimeout((function(){t(!0)}),e)}))}},60271:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66797);r.__exportStar(n(98083),t),r.__exportStar(n(6317),t)},36349:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;var a=function(){function e(){r(this,e),this.timestamps=new Map}return i(e,[{key:"start",value:function(e){if(this.timestamps.has(e))throw new Error("Watch already started for label: ".concat(e));this.timestamps.set(e,{started:Date.now()})}},{key:"stop",value:function(e){var t=this.get(e);if("undefined"!==typeof t.elapsed)throw new Error("Watch already stopped for label: ".concat(e));var n=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:n})}},{key:"get",value:function(e){var t=this.timestamps.get(e);if("undefined"===typeof t)throw new Error("No timestamp found for label: ".concat(e));return t}},{key:"elapsed",value:function(e){var t=this.get(e),n=t.elapsed||Date.now()-t.started;return n}}]),e}();t.Watch=a,t.default=a},88283:function(e,t,n){"use strict";var r=n(38783)},7289:function(e,t,n){"use strict";var r=n(38416).default,i=n(27424).default,a=n(74704).default,o=n(861).default,s=n(82376),u=n(8271),c=n(94266),l=n(2214),f=Symbol("encodeFragmentIdentifier");function d(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function p(e,t){return t.encode?t.strict?s(e):encodeURIComponent(e):e}function h(e,t){return t.decode?u(e):e}function m(e){return Array.isArray(e)?e.sort():"object"===typeof e?m(Object.keys(e)).sort((function(e,t){return Number(e)-Number(t)})).map((function(t){return e[t]})):e}function v(e){var t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function y(e){var t=(e=v(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function b(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function g(e,t){d((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);var n=function(e){var t;switch(e.arrayFormat){case"index":return function(e,n,r){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return function(e,n,r){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return function(e,n,r){t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return function(t,n,r){var i="string"===typeof n&&n.includes(e.arrayFormatSeparator),a="string"===typeof n&&!i&&h(n,e).includes(e.arrayFormatSeparator);n=a?h(n,e):n;var o=i||a?n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)})):null===n?n:h(n,e);r[t]=o};case"bracket-separator":return function(t,n,r){var i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),i){var a=null===n?[]:n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)}));void 0!==r[t]?r[t]=[].concat(r[t],a):r[t]=a}else r[t]=n?h(n,e):n};default:return function(e,t,n){void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!==typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;var o,s=a(e.split("&"));try{for(s.s();!(o=s.n()).done;){var u=o.value;if(""!==u){var l=c(t.decode?u.replace(/\+/g," "):u,"="),f=i(l,2),p=f[0],v=f[1];v=void 0===v?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?v:h(v,t),n(h(p,t),v,r)}}}catch(_){s.e(_)}finally{s.f()}for(var y=0,g=Object.keys(r);y0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var n=c(e,"#"),r=i(n,2),a=r[0],o=r[1];return Object.assign({url:a.split("?")[0]||"",query:g(y(e),t)},t&&t.parseFragmentIdentifier&&o?{fragmentIdentifier:h(o,t)}:{})},t.stringifyUrl=function(e,n){n=Object.assign(r({encode:!0,strict:!0},f,!0),n);var i=v(e.url).split("?")[0]||"",a=t.extract(e.url),o=t.parse(a,{sort:!1}),s=Object.assign(o,e.query),u=t.stringify(s,n);u&&(u="?".concat(u));var c=function(e){var t="",n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(c="#".concat(n[f]?p(e.fragmentIdentifier,n):e.fragmentIdentifier)),"".concat(i).concat(u).concat(c)},t.pick=function(e,n,i){i=Object.assign(r({parseFragmentIdentifier:!0},f,!1),i);var a=t.parseUrl(e,i),o=a.url,s=a.query,u=a.fragmentIdentifier;return t.stringifyUrl({url:o,query:l(s,n),fragmentIdentifier:u},i)},t.exclude=function(e,n,r){var i=Array.isArray(n)?function(e){return!n.includes(e)}:function(e,t){return!n(e,t)};return t.pick(e,i,r)}},38783:function(e,t){"use strict";function n(e){var t=void 0;return"undefined"!==typeof window&&"undefined"!==typeof window[e]&&(t=window[e]),t}function r(e){var t=n(e);if(!t)throw new Error("".concat(e," is not defined in Window"));return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=n,t.getFromWindowOrThrow=r,t.getDocumentOrThrow=function(){return r("document")},t.getDocument=function(){return n("document")},t.getNavigatorOrThrow=function(){return r("navigator")},t.getNavigator=function(){return n("navigator")},t.getLocationOrThrow=function(){return r("location")},t.getLocation=function(){return n("location")},t.getCryptoOrThrow=function(){return r("crypto")},t.getCrypto=function(){return n("crypto")},t.getLocalStorageOrThrow=function(){return r("localStorage")},t.getLocalStorage=function(){return n("localStorage")}},68987:function(e,t,n){"use strict";n.r(t),n.d(t,{EthereumProvider:function(){return cs},OPTIONAL_EVENTS:function(){return Ko},OPTIONAL_METHODS:function(){return Go},REQUIRED_EVENTS:function(){return Yo},REQUIRED_METHODS:function(){return Wo},default:function(){return us}});var r=n(29439),i=n(74165),a=n(15861),o=n(15671),s=n(43144),u=n(93433),c=n(4942),l=n(37762),f=n(68041),d=n.n(f),p=n(74533),h=n(81791),m=n(14701),v=n(49900),y=n(23539),b=n(45201),g=n(49324),w=n(74233),x=n(93659),k=n(38783),A=(n(36835),n(27964),n(7370),{waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}});function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];return Object.keys(e).forEach((function(r){if(!t.length||t.includes(r)){var i=e[r];n.push.apply(n,(0,u.Z)(i.accounts))}})),n}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var _={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}};function T(e,t){var n=_[e],r=n.message,i=n.code;return{message:t?"".concat(r," ").concat(t):r,code:i}}function S(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}var C=n(97326),O=n(60136),I=n(29388),P=n(1413),R=n(60074),M=n(1345),N=n(91451),j=n(23375),L=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e){var r;return(0,o.Z)(this,n),(r=t.call(this)).opts=e,r.protocol="wc",r.version=2,r}return(0,s.Z)(n)}(j.q),D=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var i;return(0,o.Z)(this,n),(i=t.call(this)).core=e,i.logger=r,i.records=new Map,i}return(0,s.Z)(n)}(j.q),B=(0,s.Z)((function e(t,n){(0,o.Z)(this,e),this.logger=t,this.core=n})),U=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var i;return(0,o.Z)(this,n),(i=t.call(this)).relayer=e,i.logger=r,i}return(0,s.Z)(n)}(j.q),F=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e){return(0,o.Z)(this,n),t.call(this)}return(0,s.Z)(n)}(j.q),Z=(0,s.Z)((function e(t,n,r,i){(0,o.Z)(this,e),this.core=t,this.logger=n,this.name=r})),z=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var i;return(0,o.Z)(this,n),(i=t.call(this)).relayer=e,i.logger=r,i}return(0,s.Z)(n)}(j.q),H=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var i;return(0,o.Z)(this,n),(i=t.call(this)).core=e,i.logger=r,i}return(0,s.Z)(n)}(j.q),q=(0,s.Z)((function e(t,n){(0,o.Z)(this,e),this.projectId=t,this.logger=n})),V=(0,s.Z)((function e(t){(0,o.Z)(this,e),this.opts=t,this.protocol="wc",this.version=2})),W=(0,s.Z)((function e(t){(0,o.Z)(this,e),this.client=t})),G=n(76090),Y=n(44519),K="EdDSA",J="JWT",Q=".",X="base64url",$="utf8",ee="utf8",te=":",ne="did",re="key",ie="base58btc",ae="z",oe="K36";function se(e){return(0,w.toString)((0,g.fromString)((0,G.u)(e),$),X)}function ue(e){var t=(0,g.fromString)(oe,ie),n=ae+(0,w.toString)((0,b.concat)([t,e]),ie);return[ne,re,n].join(te)}function ce(e){return[se(e.header),se(e.payload),(t=e.signature,(0,w.toString)(t,X))].join(Q);var t}function le(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,m.randomBytes)(32);return Y._w(e)}function fe(e,t,n,r){return de.apply(this,arguments)}function de(){return de=(0,a.Z)((0,i.Z)().mark((function e(t,n,r,a){var o,s,u,c,l,f,d=arguments;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>4&&void 0!==d[4]?d[4]:(0,x.fromMiliseconds)(Date.now()),s={alg:K,typ:J},u=ue(a.publicKey),i={header:s,payload:c={iss:u,sub:t,aud:n,iat:o,exp:o+r}},l=(0,g.fromString)([se(i.header),se(i.payload)].join(Q),ee),f=Y.Xx(a.secretKey,l),e.abrupt("return",ce({header:s,payload:c,signature:f}));case 8:case"end":return e.stop()}var i}),e)}))),de.apply(this,arguments)}n(15139);var pe=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i"u")throw new Error("Missing sender public key for type 1 envelope");var n=typeof e.senderPublicKey<"u"?(0,g.fromString)(e.senderPublicKey,Ie):void 0,r=typeof e.iv<"u"?(0,g.fromString)(e.iv,Ie):(0,m.randomBytes)(De);return function(e){if(ze(e.type)===Ne){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return(0,w.toString)((0,b.concat)([e.type,e.senderPublicKey,e.iv,e.sealed]),Pe)}return(0,w.toString)((0,b.concat)([e.type,e.iv,e.sealed]),Pe)}({type:t,sealed:new p.OK((0,g.fromString)(e.symKey,Ie)).seal(r,(0,g.fromString)(e.message,Re)),iv:r,senderPublicKey:n})}function qe(e){var t=new p.OK((0,g.fromString)(e.symKey,Ie)),n=Ve(e.encoded),r=n.sealed,i=n.iv,a=t.open(i,r);if(null===a)throw new Error("Failed to decrypt");return(0,w.toString)(a,Re)}function Ve(e){var t=(0,g.fromString)(e,Pe),n=t.slice(je,Le),r=Le;if(ze(n)===Ne){var i=r+Be,a=i+De,o=t.slice(r,i),s=t.slice(i,a);return{type:n,sealed:t.slice(a),iv:s,senderPublicKey:o}}var u=r+De,c=t.slice(r,u);return{type:n,sealed:t.slice(u),iv:c}}function We(e,t){var n=Ve(e);return Ge({type:ze(n.type),senderPublicKey:typeof n.senderPublicKey<"u"?(0,w.toString)(n.senderPublicKey,Ie):void 0,receiverPublicKey:null===t||void 0===t?void 0:t.receiverPublicKey})}function Ge(e){var t=(null===e||void 0===e?void 0:e.type)||Me;if(t===Ne){if(typeof(null===e||void 0===e?void 0:e.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(null===e||void 0===e?void 0:e.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:null===e||void 0===e?void 0:e.senderPublicKey,receiverPublicKey:null===e||void 0===e?void 0:e.receiverPublicKey}}function Ye(e){return e.type===Ne&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}var Ke=Object.defineProperty,Je=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,$e=function(e,t,n){return t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},et=function(e,t){for(var n in t||(t={}))Qe.call(t,n)&&$e(e,n,t[n]);if(Je){var r,i=(0,l.Z)(Je(t));try{for(i.s();!(r=i.n()).done;){n=r.value;Xe.call(t,n)&&$e(e,n,t[n])}}catch(a){i.e(a)}finally{i.f()}}return e},tt="ReactNative",nt={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},rt="js";function it(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function at(){return!(0,k.getDocument)()&&!!(0,k.getNavigator)()&&navigator.product===tt}function ot(){return!it()&&!!(0,k.getNavigator)()}function st(){return at()?nt.reactNative:it()?nt.node:ot()?nt.browser:nt.unknown}function ut(e,t,r){var i=function(){if(st()===nt.reactNative&&typeof n.g<"u"&&typeof(null==n.g?void 0:n.g.Platform)<"u"){var e=n.g.Platform;return[e.OS,e.Version].join("-")}var t=Ae();if(null===t)return"unknown";var r=t.os?t.os.replace(" ","").toLowerCase():"unknown";return"browser"===t.type?[r,t.name,t.version].join("-"):[r,t.version].join("-")}(),a=function(){var e,t=st();return t===nt.browser?[t,(null==(e=(0,k.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),[rt,r].join("-"),i,a].join("/")}function ct(e){var t=e.protocol,n=e.version,r=e.relayUrl,i=e.sdkVersion,a=e.auth,o=e.projectId,s=e.useOnCloseEvent,u=r.split("?"),c={auth:a,ua:ut(t,n,i),projectId:o,useOnCloseEvent:s||void 0},l=function(e,t){var n=Se.parse(e);return n=et(et({},n),t),Se.stringify(n)}(u[1]||"",c);return u[0]+"?"+l}function lt(e,t){return e.filter((function(e){return t.includes(e)})).length===e.length}function ft(e){return Object.fromEntries(e.entries())}function dt(e){return new Map(Object.entries(e))}function pt(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x.FIVE_MINUTES,i=arguments.length>1?arguments[1]:void 0,a=(0,x.toMiliseconds)(r||x.FIVE_MINUTES);return{resolve:function(t){n&&e&&(clearTimeout(n),e(t))},reject:function(e){n&&t&&(clearTimeout(n),t(e))},done:function(){return new Promise((function(r,o){n=setTimeout((function(){o(new Error(i))}),a),e=r,t=o}))}}}function ht(e,t,n){return new Promise(function(){var r=(0,a.Z)((0,i.Z)().mark((function r(a,o){var s,u;return(0,i.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=setTimeout((function(){return o(new Error(n))}),t),r.prev=1,r.next=4,e;case 4:u=r.sent,a(u),r.next=11;break;case 8:r.prev=8,r.t0=r.catch(1),o(r.t0);case 11:clearTimeout(s);case 12:case"end":return r.stop()}}),r,null,[[1,8]])})));return function(e,t){return r.apply(this,arguments)}}())}function mt(e,t){if("string"==typeof t&&t.startsWith("".concat(e,":")))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return"topic:".concat(t)}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return"id:".concat(t)}throw new Error("Unknown expirer target type: ".concat(e))}function vt(e){var t=e.split(":"),n=(0,r.Z)(t,2),i=n[0],a=n[1],o={id:void 0,topic:void 0};if("topic"===i&&"string"==typeof a)o.topic=a;else{if("id"!==i||!Number.isInteger(Number(a)))throw new Error("Invalid target, expected id:number or topic:string, got ".concat(i,":").concat(a));o.id=Number(a)}return o}function yt(e,t){return(0,x.fromMiliseconds)((t||Date.now())+(0,x.toMiliseconds)(e))}function bt(e){return Date.now()>=(0,x.toMiliseconds)(e)}function gt(e,t){return"".concat(e).concat(t?":".concat(t):"")}function wt(e){return xt.apply(this,arguments)}function xt(){return xt=(0,a.Z)((0,i.Z)().mark((function e(t){var r,a,o,s,u,c,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.id,a=t.topic,o=t.wcDeepLink,e.prev=1,o){e.next=4;break}return e.abrupt("return");case 4:if(s="string"==typeof o?JSON.parse(o):o,"string"==typeof(u=null===s||void 0===s?void 0:s.href)){e.next=8;break}return e.abrupt("return");case 8:if(u.endsWith("/")&&(u=u.slice(0,-1)),c="".concat(u,"/wc?requestId=").concat(r,"&sessionTopic=").concat(a),(l=st())!==nt.browser){e.next=14;break}c.startsWith("https://")?window.open(c,"_blank","noreferrer noopener"):window.open(c,"_self","noreferrer noopener"),e.next=18;break;case 14:if(e.t0=l===nt.reactNative&&typeof(null==n.g?void 0:n.g.Linking)<"u",!e.t0){e.next=18;break}return e.next=18,n.g.Linking.openURL(c);case 18:e.next=23;break;case 20:e.prev=20,e.t1=e.catch(1),console.error(e.t1);case 23:case"end":return e.stop()}}),e,null,[[1,20]])}))),xt.apply(this,arguments)}function kt(e){return(null===e||void 0===e?void 0:e.relay)||{protocol:"irn"}}function At(e){var t=A[e];if(typeof t>"u")throw new Error("Relay Protocol not supported: ".concat(e));return t}var Et=Object.defineProperty,_t=Object.getOwnPropertySymbols,Tt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable,Ct=function(e,t,n){return t in e?Et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function Ot(e){var t={},n="relay"+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-");return Object.keys(e).forEach((function(r){if(r.startsWith(n)){var i=r.replace(n,""),a=e[r];t[i]=a}})),t}function It(e){var t=e.indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t),i=e.substring(t+1,n).split("@"),a=typeof n<"u"?e.substring(n):"",o=Se.parse(a);return{protocol:r,topic:Pt(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:Ot(o)}}function Pt(e){return e.startsWith("//")?e.substring(2):e}function Rt(e){return"".concat(e.protocol,":").concat(e.topic,"@").concat(e.version,"?")+Se.stringify(function(e,t){for(var n in t||(t={}))Tt.call(t,n)&&Ct(e,n,t[n]);if(_t){var r,i=(0,l.Z)(_t(t));try{for(i.s();!(r=i.n()).done;)n=r.value,St.call(t,n)&&Ct(e,n,t[n])}catch(a){i.e(a)}finally{i.f()}}return e}({symKey:e.symKey},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",n={};return Object.keys(e).forEach((function(r){var i="relay"+t+r;e[r]&&(n[i]=e[r])})),n}(e.relay)))}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Mt(e){var t=[];return e.forEach((function(e){var n=e.split(":"),i=(0,r.Z)(n,2),a=i[0],o=i[1];t.push("".concat(a,":").concat(o))})),t}function Nt(e,t){var n=Qt(e,t);if(n)throw new Error(n.message);for(var i={},a=0,o=Object.entries(e);a"u"}function zt(e,t){return!(!t||!Zt(e))||"string"==typeof e&&!!e.trim().length}function Ht(e,t){return!(!t||!Zt(e))||"number"==typeof e&&!isNaN(e)}function qt(e){return!(!zt(e,!1)||!e.includes(":"))&&2===e.split(":").length}function Vt(e){var t;return null==(t=null===e||void 0===e?void 0:e.proposer)?void 0:t.publicKey}function Wt(e){return null===e||void 0===e?void 0:e.topic}function Gt(e){var t=!0;return Ut(e)?e.length&&(t=e.every((function(e){return zt(e,!1)}))):t=!1,t}function Yt(e,t,n){var i=null;return Object.entries(e).forEach((function(e){var a=(0,r.Z)(e,2),o=a[0],s=a[1];if(!i){var u=function(e,t,n){var r=null;return Ut(t)&&t.length?t.forEach((function(e){r||qt(e)||(r=Bt("UNSUPPORTED_CHAINS","".concat(n,", chain ").concat(e,' should be a string and conform to "namespace:chainId" format')))})):qt(e)||(r=Bt("UNSUPPORTED_CHAINS","".concat(n,', chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }'))),r}(o,Ce(o,s),"".concat(t," ").concat(n));u&&(i=u)}})),i}function Kt(e,t){var n=null;return Ut(e)?e.forEach((function(e){n||function(e){if(zt(e,!1)&&e.includes(":")){var t=e.split(":");if(3===t.length){var n=t[0]+":"+t[1];return!!t[2]&&qt(n)}}return!1}(e)||(n=Bt("UNSUPPORTED_ACCOUNTS","".concat(t,", account ").concat(e,' should be a string and conform to "namespace:chainId:address" format')))})):n=Bt("UNSUPPORTED_ACCOUNTS","".concat(t,', accounts should be an array of strings conforming to "namespace:chainId:address" format')),n}function Jt(e,t){var n=null;return Object.values(e).forEach((function(e){if(!n){var r=function(e,t){var n=null;return Gt(null===e||void 0===e?void 0:e.methods)?Gt(null===e||void 0===e?void 0:e.events)||(n=Bt("UNSUPPORTED_EVENTS","".concat(t,", events should be an array of strings or empty array for no events"))):n=Bt("UNSUPPORTED_METHODS","".concat(t,", methods should be an array of strings or empty array for no methods")),n}(e,"".concat(t,", namespace"));r&&(n=r)}})),n}function Qt(e,t){var n=null;if(e&&Ft(e)){var r=Jt(e,t);r&&(n=r);var i=function(e,t){var n=null;return Object.values(e).forEach((function(e){if(!n){var r=Kt(null===e||void 0===e?void 0:e.accounts,"".concat(t," namespace"));r&&(n=r)}})),n}(e,t);i&&(n=i)}else n=Dt("MISSING_OR_INVALID","".concat(t,", namespaces should be an object with data"));return n}function Xt(e){return zt(e.protocol,!0)}function $t(e,t){var n=!1;return t&&!e?n=!0:e&&Ut(e)&&e.length&&e.forEach((function(e){n=Xt(e)})),n}function en(e){return"number"==typeof e}function tn(e){return typeof e<"u"&&null!==typeof e}function nn(e){return!(!e||"object"!=typeof e||!e.code||!Ht(e.code,!1)||!e.message||!zt(e.message,!1))}function rn(e){return!(Zt(e)||!zt(e.method,!1))}function an(e){return!(Zt(e)||Zt(e.result)&&Zt(e.error)||!Ht(e.id,!1)||!zt(e.jsonrpc,!1))}function on(e){return!(Zt(e)||!zt(e.name,!1))}function sn(e,t){return!(!qt(t)||!function(e){var t=[];return Object.values(e).forEach((function(e){t.push.apply(t,(0,u.Z)(Mt(e.accounts)))})),t}(e).includes(t))}function un(e,t,n){return!!zt(n,!1)&&function(e,t){var n=[];return Object.values(e).forEach((function(e){Mt(e.accounts).includes(t)&&n.push.apply(n,(0,u.Z)(e.methods))})),n}(e,t).includes(n)}function cn(e,t,n){return!!zt(n,!1)&&function(e,t){var n=[];return Object.values(e).forEach((function(e){Mt(e.accounts).includes(t)&&n.push.apply(n,(0,u.Z)(e.events))})),n}(e,t).includes(n)}function ln(e,t,n){var r=null,i=function(e){var t={};return Object.keys(e).forEach((function(n){var r;n.includes(":")?t[n]=e[n]:null==(r=e[n].chains)||r.forEach((function(r){t[r]={methods:e[n].methods,events:e[n].events}}))})),t}(e),a=function(e){var t={};return Object.keys(e).forEach((function(n){if(n.includes(":"))t[n]=e[n];else{var r=Mt(e[n].accounts);null===r||void 0===r||r.forEach((function(r){t[r]={accounts:e[n].accounts.filter((function(e){return e.includes("".concat(r,":"))})),methods:e[n].methods,events:e[n].events}}))}})),t}(t),o=Object.keys(i),s=Object.keys(a),u=fn(Object.keys(e)),c=fn(Object.keys(t)),l=u.filter((function(e){return!c.includes(e)}));return l.length&&(r=Dt("NON_CONFORMING_NAMESPACES","".concat(n," namespaces keys don't satisfy requiredNamespaces.\n Required: ").concat(l.toString(),"\n Received: ").concat(Object.keys(t).toString()))),lt(o,s)||(r=Dt("NON_CONFORMING_NAMESPACES","".concat(n," namespaces chains don't satisfy required namespaces.\n Required: ").concat(o.toString(),"\n Approved: ").concat(s.toString()))),Object.keys(t).forEach((function(e){if(e.includes(":")&&!r){var i=Mt(t[e].accounts);i.includes(e)||(r=Dt("NON_CONFORMING_NAMESPACES","".concat(n," namespaces accounts don't satisfy namespace accounts for ").concat(e,"\n Required: ").concat(e,"\n Approved: ").concat(i.toString())))}})),o.forEach((function(e){r||(lt(i[e].methods,a[e].methods)?lt(i[e].events,a[e].events)||(r=Dt("NON_CONFORMING_NAMESPACES","".concat(n," namespaces events don't satisfy namespace events for ").concat(e))):r=Dt("NON_CONFORMING_NAMESPACES","".concat(n," namespaces methods don't satisfy namespace methods for ").concat(e)))})),r}function fn(e){return(0,u.Z)(new Set(e.map((function(e){return e.includes(":")?e.split(":")[0]:e}))))}function dn(e,t){return Ht(e,!1)&&e<=t.max&&e>=t.min}var pn=n(13730),hn=n(31567),mn=function(e){return e.split("?")[0]},vn="undefined"!==typeof WebSocket?WebSocket:"undefined"!==typeof n.g&&"undefined"!==typeof n.g.WebSocket?n.g.WebSocket:"undefined"!==typeof window&&"undefined"!==typeof window.WebSocket?window.WebSocket:"undefined"!==typeof self&&"undefined"!==typeof self.WebSocket?self.WebSocket:n(78720),yn=function(){function e(t){if((0,o.Z)(this,e),this.url=t,this.events=new f.EventEmitter,this.registering=!1,!(0,hn.isWsUrl)(t))throw new Error("Provided URL is not compatible with WebSocket connection: ".concat(t));this.url=t}return(0,s.Z)(e,[{key:"connected",get:function(){return"undefined"!==typeof this.socket}},{key:"connecting",get:function(){return this.registering}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"open",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t,n=arguments;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:this.url,e.next=3,this.register(t);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){"undefined"!==typeof t.socket?(t.socket.onclose=function(n){t.onClose(n),e()},t.socket.close()):n(new Error("Connection already closed"))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!==typeof this.socket){e.next=4;break}return e.next=3,this.register();case 3:this.socket=e.sent;case 4:try{this.socket.send((0,G.u)(t))}catch(n){this.onError(t.id,n)}case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"register",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url;if(!(0,hn.isWsUrl)(t))throw new Error("Provided URL is not compatible with WebSocket connection: ".concat(t));if(this.registering){var r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((function(t,n){e.events.once("register_error",(function(t){e.resetMaxListeners(),n(t)})),e.events.once("open",(function(){if(e.resetMaxListeners(),"undefined"===typeof e.socket)return n(new Error("WebSocket connection is missing or invalid"));t(e.socket)}))}))}return this.url=t,this.registering=!0,new Promise((function(r,i){var a=(0,hn.isReactNative)()?void 0:{rejectUnauthorized:!(0,hn.isLocalhostUrl)(t)},o=new vn(t,[],a);"undefined"!==typeof WebSocket||"undefined"!==typeof n.g&&"undefined"!==typeof n.g.WebSocket||"undefined"!==typeof window&&"undefined"!==typeof window.WebSocket||"undefined"!==typeof self&&"undefined"!==typeof self.WebSocket?o.onerror=function(t){var n=t;i(e.emitError(n.error))}:o.on("error",(function(t){i(e.emitError(t))})),o.onopen=function(){e.onOpen(o),r(o)}}))}},{key:"onOpen",value:function(e){var t=this;e.onmessage=function(e){return t.onPayload(e)},e.onclose=function(e){return t.onClose(e)},this.socket=e,this.registering=!1,this.events.emit("open")}},{key:"onClose",value:function(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}},{key:"onPayload",value:function(e){if("undefined"!==typeof e.data){var t="string"===typeof e.data?(0,G.D)(e.data):e.data;this.events.emit("payload",t)}}},{key:"onError",value:function(e,t){var n=this.parseError(t),r=n.message||n.toString(),i=(0,hn.formatJsonRpcError)(e,r);this.events.emit("payload",i)}},{key:"parseError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url;return(0,hn.parseConnectionError)(e,mn(t),"WS")}},{key:"resetMaxListeners",value:function(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}},{key:"emitError",value:function(e){var t=this.parseError(new Error((null===e||void 0===e?void 0:e.message)||"WebSocket connection failed for host: ".concat(mn(this.url))));return this.events.emit("register_error",t),t}}]),e}(),bn=yn,gn=n(23108),wn=n.n(gn);var xn=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r>>0,o=new Uint8Array(a);e[t];){var l=n[e.charCodeAt(t)];if(255===l)return;for(var f=0,d=a-1;(0!==l||f>>0,o[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,t++}if(" "!==e[t]){for(var p=a-i;p!==a&&0===o[p];)p++;for(var h=new Uint8Array(r+(a-p)),m=r;p!==a;)h[m++]=o[p++];return h}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,a=t.length;i!==a&&0===t[i];)i++,n++;for(var o=(a-i)*l+1>>>0,c=new Uint8Array(o);i!==a;){for(var f=t[i],d=0,p=o-1;(0!==f||d>>0,c[p]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");r=d,i++}for(var h=o-r;h!==o&&0===c[h];)h++;for(var m=u.repeat(n);hn;)a+=t[i&s>>(o-=n)];if(o&&(a+=t[i&s<=8&&(u-=8,s[l++]=255&c>>u)}if(u>=n||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return s}(e,i,r,t)}})},Rn=On({prefix:"\0",name:"identity",encode:function(e){return function(e){return(new TextDecoder).decode(e)}(e)},decode:function(e){return function(e){return(new TextEncoder).encode(e)}(e)}}),Mn=Object.freeze({__proto__:null,identity:Rn}),Nn=Pn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),jn=Object.freeze({__proto__:null,base2:Nn}),Ln=Pn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Dn=Object.freeze({__proto__:null,base8:Ln}),Bn=In({prefix:"9",name:"base10",alphabet:"0123456789"}),Un=Object.freeze({__proto__:null,base10:Bn}),Fn=Pn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Zn=Pn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),zn=Object.freeze({__proto__:null,base16:Fn,base16upper:Zn}),Hn=Pn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),qn=Pn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vn=Pn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Wn=Pn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gn=Pn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yn=Pn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Kn=Pn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Jn=Pn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Qn=Pn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Xn=Object.freeze({__proto__:null,base32:Hn,base32upper:qn,base32pad:Vn,base32padupper:Wn,base32hex:Gn,base32hexupper:Yn,base32hexpad:Kn,base32hexpadupper:Jn,base32z:Qn}),$n=In({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),er=In({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),tr=Object.freeze({__proto__:null,base36:$n,base36upper:er}),nr=In({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),rr=In({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),ir=Object.freeze({__proto__:null,base58btc:nr,base58flickr:rr}),ar=Pn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),or=Pn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),sr=Pn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ur=Pn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),cr=Object.freeze({__proto__:null,base64:ar,base64pad:or,base64url:sr,base64urlpad:ur}),lr=Array.from("\ud83d\ude80\ud83e\ude90\u2604\ud83d\udef0\ud83c\udf0c\ud83c\udf11\ud83c\udf12\ud83c\udf13\ud83c\udf14\ud83c\udf15\ud83c\udf16\ud83c\udf17\ud83c\udf18\ud83c\udf0d\ud83c\udf0f\ud83c\udf0e\ud83d\udc09\u2600\ud83d\udcbb\ud83d\udda5\ud83d\udcbe\ud83d\udcbf\ud83d\ude02\u2764\ud83d\ude0d\ud83e\udd23\ud83d\ude0a\ud83d\ude4f\ud83d\udc95\ud83d\ude2d\ud83d\ude18\ud83d\udc4d\ud83d\ude05\ud83d\udc4f\ud83d\ude01\ud83d\udd25\ud83e\udd70\ud83d\udc94\ud83d\udc96\ud83d\udc99\ud83d\ude22\ud83e\udd14\ud83d\ude06\ud83d\ude44\ud83d\udcaa\ud83d\ude09\u263a\ud83d\udc4c\ud83e\udd17\ud83d\udc9c\ud83d\ude14\ud83d\ude0e\ud83d\ude07\ud83c\udf39\ud83e\udd26\ud83c\udf89\ud83d\udc9e\u270c\u2728\ud83e\udd37\ud83d\ude31\ud83d\ude0c\ud83c\udf38\ud83d\ude4c\ud83d\ude0b\ud83d\udc97\ud83d\udc9a\ud83d\ude0f\ud83d\udc9b\ud83d\ude42\ud83d\udc93\ud83e\udd29\ud83d\ude04\ud83d\ude00\ud83d\udda4\ud83d\ude03\ud83d\udcaf\ud83d\ude48\ud83d\udc47\ud83c\udfb6\ud83d\ude12\ud83e\udd2d\u2763\ud83d\ude1c\ud83d\udc8b\ud83d\udc40\ud83d\ude2a\ud83d\ude11\ud83d\udca5\ud83d\ude4b\ud83d\ude1e\ud83d\ude29\ud83d\ude21\ud83e\udd2a\ud83d\udc4a\ud83e\udd73\ud83d\ude25\ud83e\udd24\ud83d\udc49\ud83d\udc83\ud83d\ude33\u270b\ud83d\ude1a\ud83d\ude1d\ud83d\ude34\ud83c\udf1f\ud83d\ude2c\ud83d\ude43\ud83c\udf40\ud83c\udf37\ud83d\ude3b\ud83d\ude13\u2b50\u2705\ud83e\udd7a\ud83c\udf08\ud83d\ude08\ud83e\udd18\ud83d\udca6\u2714\ud83d\ude23\ud83c\udfc3\ud83d\udc90\u2639\ud83c\udf8a\ud83d\udc98\ud83d\ude20\u261d\ud83d\ude15\ud83c\udf3a\ud83c\udf82\ud83c\udf3b\ud83d\ude10\ud83d\udd95\ud83d\udc9d\ud83d\ude4a\ud83d\ude39\ud83d\udde3\ud83d\udcab\ud83d\udc80\ud83d\udc51\ud83c\udfb5\ud83e\udd1e\ud83d\ude1b\ud83d\udd34\ud83d\ude24\ud83c\udf3c\ud83d\ude2b\u26bd\ud83e\udd19\u2615\ud83c\udfc6\ud83e\udd2b\ud83d\udc48\ud83d\ude2e\ud83d\ude46\ud83c\udf7b\ud83c\udf43\ud83d\udc36\ud83d\udc81\ud83d\ude32\ud83c\udf3f\ud83e\udde1\ud83c\udf81\u26a1\ud83c\udf1e\ud83c\udf88\u274c\u270a\ud83d\udc4b\ud83d\ude30\ud83e\udd28\ud83d\ude36\ud83e\udd1d\ud83d\udeb6\ud83d\udcb0\ud83c\udf53\ud83d\udca2\ud83e\udd1f\ud83d\ude41\ud83d\udea8\ud83d\udca8\ud83e\udd2c\u2708\ud83c\udf80\ud83c\udf7a\ud83e\udd13\ud83d\ude19\ud83d\udc9f\ud83c\udf31\ud83d\ude16\ud83d\udc76\ud83e\udd74\u25b6\u27a1\u2753\ud83d\udc8e\ud83d\udcb8\u2b07\ud83d\ude28\ud83c\udf1a\ud83e\udd8b\ud83d\ude37\ud83d\udd7a\u26a0\ud83d\ude45\ud83d\ude1f\ud83d\ude35\ud83d\udc4e\ud83e\udd32\ud83e\udd20\ud83e\udd27\ud83d\udccc\ud83d\udd35\ud83d\udc85\ud83e\uddd0\ud83d\udc3e\ud83c\udf52\ud83d\ude17\ud83e\udd11\ud83c\udf0a\ud83e\udd2f\ud83d\udc37\u260e\ud83d\udca7\ud83d\ude2f\ud83d\udc86\ud83d\udc46\ud83c\udfa4\ud83d\ude47\ud83c\udf51\u2744\ud83c\udf34\ud83d\udca3\ud83d\udc38\ud83d\udc8c\ud83d\udccd\ud83e\udd40\ud83e\udd22\ud83d\udc45\ud83d\udca1\ud83d\udca9\ud83d\udc50\ud83d\udcf8\ud83d\udc7b\ud83e\udd10\ud83e\udd2e\ud83c\udfbc\ud83e\udd75\ud83d\udea9\ud83c\udf4e\ud83c\udf4a\ud83d\udc7c\ud83d\udc8d\ud83d\udce3\ud83e\udd42"),fr=lr.reduce((function(e,t,n){return e[n]=t,e}),[]),dr=lr.reduce((function(e,t,n){return e[t.codePointAt(0)]=n,e}),[]);var pr=On({prefix:"\ud83d\ude80",name:"base256emoji",encode:function(e){return e.reduce((function(e,t){return e+=fr[t]}),"")},decode:function(e){var t,n=[],r=(0,l.Z)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=dr[i.codePointAt(0)];if(void 0===a)throw new Error("Non-base256emoji character: ".concat(i));n.push(a)}}catch(o){r.e(o)}finally{r.f()}return new Uint8Array(n)}}),hr=Object.freeze({__proto__:null,base256emoji:pr}),mr=function e(t,n,r){n=n||[];for(var i=r=r||0;t>=br;)n[r++]=255&t|vr,t/=128;for(;t&yr;)n[r++]=255&t|vr,t>>>=7;return n[r]=0|t,e.bytes=r-i+1,n},vr=128,yr=-128,br=Math.pow(2,31);var gr=function e(t,n){var r,i=0,a=0,o=n=n||0,s=t.length;do{if(o>=s)throw e.bytes=0,new RangeError("Could not decode varint");r=t[o++],i+=a<28?(r&xr)<=wr);return e.bytes=o-n,i},wr=128,xr=127;var kr=Math.pow(2,7),Ar=Math.pow(2,14),Er=Math.pow(2,21),_r=Math.pow(2,28),Tr=Math.pow(2,35),Sr=Math.pow(2,42),Cr=Math.pow(2,49),Or=Math.pow(2,56),Ir=Math.pow(2,63),Pr={encode:mr,decode:gr,encodingLength:function(e){return e2&&void 0!==arguments[2]?arguments[2]:0;return Pr.encode(e,t,n),t},Mr=function(e){return Pr.encodingLength(e)},Nr=function(e,t){var n=t.byteLength,r=Mr(e),i=r+Mr(n),a=new Uint8Array(i+n);return Rr(e,a,0),Rr(n,a,r),a.set(t,i),new jr(e,n,t,a)},jr=(0,s.Z)((function e(t,n,r,i){(0,o.Z)(this,e),this.code=t,this.size=n,this.digest=r,this.bytes=i})),Lr=function(e){var t=e.name,n=e.code,r=e.encode;return new Dr(t,n,r)},Dr=function(){function e(t,n,r){(0,o.Z)(this,e),this.name=t,this.code=n,this.encode=r}return(0,s.Z)(e,[{key:"digest",value:function(e){var t=this;if(e instanceof Uint8Array){var n=this.encode(e);return n instanceof Uint8Array?Nr(this.code,n):n.then((function(e){return Nr(t.code,e)}))}throw Error("Unknown type, must be binary type")}}]),e}(),Br=function(e){return function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,crypto.subtle.digest(e,n);case 3:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},Ur=Lr({name:"sha2-256",code:18,encode:Br("SHA-256")}),Fr=Lr({name:"sha2-512",code:19,encode:Br("SHA-512")}),Zr=Object.freeze({__proto__:null,sha256:Ur,sha512:Fr}),zr=An,Hr={code:0,name:"identity",encode:zr,digest:function(e){return Nr(0,zr(e))}},qr=Object.freeze({__proto__:null,identity:Hr});new TextEncoder,new TextDecoder;var Vr=(0,P.Z)((0,P.Z)((0,P.Z)((0,P.Z)((0,P.Z)((0,P.Z)((0,P.Z)((0,P.Z)((0,P.Z)((0,P.Z)({},Mn),jn),Dn),Un),zn),Xn),tr),ir),cr),hr);function Wr(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Gr(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}(0,P.Z)((0,P.Z)({},Zr),qr);var Yr=Gr("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),Kr=Gr("ascii","a",(function(e){for(var t="a",n=0;n0&&void 0!==arguments[0]?arguments[0]:0;return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Wr(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length),n=0;n1&&void 0!==arguments[1]?arguments[1]:"utf8",n=Jr[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.decoder.decode("".concat(n.prefix).concat(e)):Wr(globalThis.Buffer.from(e,"utf-8"))}var Xr="core",$r="".concat("wc","@2:").concat(Xr,":"),ei="error",ti={database:":memory:"},ni="client_ed25519_seed",ri=x.ONE_DAY,ii=x.SIX_HOURS,ai="wss://relay.walletconnect.com",oi="wss://relay.walletconnect.org",si="relayer_message",ui="relayer_message_ack",ci="relayer_connect",li="relayer_disconnect",fi="relayer_error",di="relayer_connection_stalled",pi="relayer_transport_closed",hi="relayer_publish",mi="payload",vi="connect",yi="disconnect",bi="error",gi=x.ONE_SECOND/2,wi="subscription_created",xi="subscription_deleted",ki="subscription_sync",Ai="subscription_resubscribed",Ei=1e3*x.FIVE_SECONDS,_i={wc_pairingDelete:{req:{ttl:x.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:x.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:x.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:x.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:x.ONE_DAY,prompt:!1,tag:0},res:{ttl:x.ONE_DAY,prompt:!1,tag:0}}},Ti="history_created",Si="history_updated",Ci="history_deleted",Oi="history_sync",Ii="expirer_created",Pi="expirer_deleted",Ri="expirer_expired",Mi="expirer_sync",Ni="verify-api",ji="https://verify.walletconnect.com",Li=function(){function e(t,n){var r=this;(0,o.Z)(this,e),this.core=t,this.logger=n,this.keychain=new Map,this.name="keychain",this.version="0.3",this.initialized=!1,this.storagePrefix=$r,this.init=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.initialized){e.next=5;break}return e.next=3,r.getKeyChain();case 3:typeof(t=e.sent)<"u"&&(r.keychain=t),r.initialized=!0;case 5:case"end":return e.stop()}}),e)}))),this.has=function(e){return r.isInitialized(),r.keychain.has(e)},this.set=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),r.keychain.set(t,n),e.next=4,r.persist();case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this.get=function(e){r.isInitialized();var t=r.keychain.get(e);if(typeof t>"u"){var n=Dt("NO_MATCHING_KEY","".concat(r.name,": ").concat(e)).message;throw new Error(n)}return t},this.del=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),r.keychain.delete(t),e.next=4,r.persist();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.core=t,this.logger=(0,N.generateChildLogger)(n,this.name)}return(0,s.Z)(e,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"setKeyChain",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.setItem(this.storageKey,ft(t));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getKeyChain",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.getItem(this.storageKey);case 2:return t=e.sent,e.abrupt("return",typeof t<"u"?dt(t):void 0);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"persist",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setKeyChain(this.keychain);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"isInitialized",value:function(){if(!this.initialized){var e=Dt("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),e}(),Di=function(){function e(t,n,r){var s=this;(0,o.Z)(this,e),this.core=t,this.logger=n,this.name="crypto",this.initialized=!1,this.init=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=s.initialized,e.t0){e.next=5;break}return e.next=4,s.keychain.init();case 4:s.initialized=!0;case 5:case"end":return e.stop()}}),e)}))),this.hasKeys=function(e){return s.isInitialized(),s.keychain.has(e)},this.getClientId=(0,a.Z)((0,i.Z)().mark((function e(){var t,n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),e.next=3,s.getClientSeed();case 3:return t=e.sent,n=le(t),e.abrupt("return",ue(n.publicKey));case 6:case"end":return e.stop()}}),e)}))),this.generateKeyPair=function(){s.isInitialized();var e=function(){var e=y.Au();return{privateKey:(0,w.toString)(e.secretKey,Ie),publicKey:(0,w.toString)(e.publicKey,Ie)}}();return s.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),e.next=3,s.getClientSeed();case 3:return n=e.sent,r=le(n),a=Ue(),o=ri,e.next=9,fe(a,t,o,r);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.generateSharedKey=function(e,t,n){s.isInitialized();var r=function(e,t){var n=y.gi((0,g.fromString)(e,Ie),(0,g.fromString)(t,Ie)),r=new h.t(v.mE,n).expand(Be);return(0,w.toString)(r,Ie)}(s.getPrivateKey(e),t);return s.setSymKey(r,n)},this.setSymKey=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),r=n||Fe(t),e.next=4,s.keychain.set(r,t);case 4:return e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this.deleteKeyPair=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),e.next=3,s.keychain.del(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.deleteSymKey=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),e.next=3,s.keychain.del(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.encode=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,r){var a,o,u,c,l,f,d;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.isInitialized(),a=Ge(r),o=(0,G.u)(n),!Ye(a)){e.next=7;break}return u=a.senderPublicKey,c=a.receiverPublicKey,e.next=6,s.generateSharedKey(u,c);case 6:t=e.sent;case 7:return l=s.getSymKey(t),f=a.type,d=a.senderPublicKey,e.abrupt("return",He({type:f,symKey:l,message:o,senderPublicKey:d}));case 9:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.decode=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,r){var a,o,u,c,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.isInitialized(),!Ye(a=We(n,r))){e.next=7;break}return o=a.receiverPublicKey,u=a.senderPublicKey,e.next=6,s.generateSharedKey(o,u);case 6:t=e.sent;case 7:return e.prev=7,c=s.getSymKey(t),l=qe({symKey:c,encoded:n}),e.abrupt("return",(0,G.D)(l));case 12:return e.prev=12,e.t0=e.catch(7),e.t1=s.logger,e.t2="Failed to decode message from topic: '".concat(t,"', clientId: '"),e.next=18,s.getClientId();case 18:e.t3=e.sent,e.t4=e.t2.concat.call(e.t2,e.t3,"'"),e.t1.error.call(e.t1,e.t4),s.logger.error(e.t0);case 22:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t,n,r){return e.apply(this,arguments)}}(),this.getPayloadType=function(e){return ze(Ve(e).type)},this.getPayloadSenderPublicKey=function(e){var t=Ve(e);return t.senderPublicKey?(0,w.toString)(t.senderPublicKey,Ie):void 0},this.core=t,this.logger=(0,N.generateChildLogger)(n,this.name),this.keychain=r||new Li(this.core,this.logger)}return(0,s.Z)(e,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"setPrivateKey",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.keychain.set(t,n);case 2:return e.abrupt("return",t);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getPrivateKey",value:function(e){return this.keychain.get(e)}},{key:"getClientSeed",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t="",e.prev=1,t=this.keychain.get(ni),e.next=10;break;case 5:return e.prev=5,e.t0=e.catch(1),t=Ue(),e.next=10,this.keychain.set(ni,t);case 10:return e.abrupt("return",Qr(t,"base16"));case 11:case"end":return e.stop()}}),e,this,[[1,5]])})));return function(){return e.apply(this,arguments)}}()},{key:"getSymKey",value:function(e){return this.keychain.get(e)}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Dt("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),e}(),Bi=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var s;return(0,o.Z)(this,n),(s=t.call(this,e,r)).logger=e,s.core=r,s.messages=new Map,s.name="messages",s.version="0.3",s.initialized=!1,s.storagePrefix=$r,s.init=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.initialized){e.next=15;break}return s.logger.trace("Initialized"),e.prev=2,e.next=5,s.getRelayerMessages();case 5:typeof(t=e.sent)<"u"&&(s.messages=t),s.logger.debug("Successfully Restored records for ".concat(s.name)),s.logger.trace({type:"method",method:"restore",size:s.messages.size}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),s.logger.debug("Failed to Restore records for ".concat(s.name)),s.logger.error(e.t0);case 12:return e.prev=12,s.initialized=!0,e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[2,9,12,15]])}))),s.set=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var r,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.isInitialized(),r=Ze(n),typeof(a=s.messages.get(t))>"u"&&(a={}),e.t0=typeof a[r]<"u",e.t0){e.next=10;break}return a[r]=n,s.messages.set(t,a),e.next=10,s.persist();case 10:return e.abrupt("return",r);case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.get=function(e){s.isInitialized();var t=s.messages.get(e);return typeof t>"u"&&(t={}),t},s.has=function(e,t){return s.isInitialized(),typeof s.get(e)[Ze(t)]<"u"},s.del=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),s.messages.delete(t),e.next=4,s.persist();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.logger=(0,N.generateChildLogger)(e,s.name),s.core=r,s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"setRelayerMessages",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.setItem(this.storageKey,ft(t));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRelayerMessages",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.getItem(this.storageKey);case 2:return t=e.sent,e.abrupt("return",typeof t<"u"?dt(t):void 0);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"persist",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setRelayerMessages(this.messages);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"isInitialized",value:function(){if(!this.initialized){var e=Dt("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),n}(B),Ui=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var s;return(0,o.Z)(this,n),(s=t.call(this,e,r)).relayer=e,s.logger=r,s.events=new f.EventEmitter,s.name="publisher",s.queue=new Map,s.publishTimeout=(0,x.toMiliseconds)(x.TEN_SECONDS),s.queueTimeout=(0,x.toMiliseconds)(x.FIVE_SECONDS),s.needsTransportRestart=!1,s.publish=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,r){var a,o,u,c,l,f,d;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.logger.debug("Publishing Payload"),s.logger.trace({type:"method",method:"publish",params:{topic:t,message:n,opts:r}}),e.prev=1,a=(null===r||void 0===r?void 0:r.ttl)||ii,o=kt(r),u=(null===r||void 0===r?void 0:r.prompt)||!1,c=(null===r||void 0===r?void 0:r.tag)||0,l=(null===r||void 0===r?void 0:r.id)||(0,hn.getBigIntRpcId)().toString(),f={topic:t,message:n,opts:{ttl:a,relay:o,prompt:u,tag:c,id:l}},d=setTimeout((function(){return s.queue.set(l,f)}),s.queueTimeout),e.prev=3,e.next=6,ht(s.rpcPublish(t,n,a,o,u,c,l),s.publishTimeout);case 6:return e.next=8,e.sent;case 8:clearTimeout(d),s.relayer.events.emit(hi,f),e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(3),s.logger.debug("Publishing Payload stalled"),s.needsTransportRestart=!0,e.abrupt("return");case 16:s.logger.debug("Successfully Published Payload"),s.logger.trace({type:"method",method:"publish",params:{topic:t,message:n,opts:r}}),e.next=22;break;case 19:throw e.prev=19,e.t1=e.catch(1),s.logger.debug("Failed to Publish Payload"),s.logger.error(e.t1),e.t1;case 22:case"end":return e.stop()}}),e,null,[[1,19],[3,12]])})));return function(t,n,r){return e.apply(this,arguments)}}(),s.on=function(e,t){s.events.on(e,t)},s.once=function(e,t){s.events.once(e,t)},s.off=function(e,t){s.events.off(e,t)},s.removeListener=function(e,t){s.events.removeListener(e,t)},s.relayer=e,s.logger=(0,N.generateChildLogger)(r,s.name),s.registerEventListeners(),s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"rpcPublish",value:function(e,t,n,r,i,a,o){var s,u,c,l,f={method:At(r.protocol).publish,params:{topic:e,message:t,ttl:n,prompt:i,tag:a},id:o};return Zt(null==(s=f.params)?void 0:s.prompt)&&(null==(u=f.params)||delete u.prompt),Zt(null==(c=f.params)?void 0:c.tag)&&(null==(l=f.params)||delete l.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:f}),this.relayer.request(f)}},{key:"onPublish",value:function(e){this.queue.delete(e)}},{key:"checkQueue",value:function(){var e=this;this.queue.forEach(function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){var r,a,o;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.topic,a=n.message,o=n.opts,t.next=3,e.publish(r,a,o);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"registerEventListeners",value:function(){var e=this;this.relayer.core.heartbeat.on(M.HEARTBEAT_EVENTS.pulse,(function(){if(e.needsTransportRestart)return e.needsTransportRestart=!1,void e.relayer.events.emit(di);e.checkQueue()})),this.relayer.on(ui,(function(t){e.onPublish(t.id.toString())}))}}]),n}(U),Fi=function(){function e(){var t=this;(0,o.Z)(this,e),this.map=new Map,this.set=function(e,n){var r=t.get(e);t.exists(e,n)||t.map.set(e,[].concat((0,u.Z)(r),[n]))},this.get=function(e){return t.map.get(e)||[]},this.exists=function(e,n){return t.get(e).includes(n)},this.delete=function(e,n){if(typeof n>"u")t.map.delete(e);else if(t.map.has(e)){var r=t.get(e);if(t.exists(e,n)){var i=r.filter((function(e){return e!==n}));i.length?t.map.set(e,i):t.map.delete(e)}}},this.clear=function(){t.map.clear()}}return(0,s.Z)(e,[{key:"topics",get:function(){return Array.from(this.map.keys())}}]),e}(),Zi=Object.defineProperty,zi=Object.defineProperties,Hi=Object.getOwnPropertyDescriptors,qi=Object.getOwnPropertySymbols,Vi=Object.prototype.hasOwnProperty,Wi=Object.prototype.propertyIsEnumerable,Gi=function(e,t,n){return t in e?Zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Yi=function(e,t){for(var n in t||(t={}))Vi.call(t,n)&&Gi(e,n,t[n]);if(qi){var r,i=(0,l.Z)(qi(t));try{for(i.s();!(r=i.n()).done;){n=r.value;Wi.call(t,n)&&Gi(e,n,t[n])}}catch(a){i.e(a)}finally{i.f()}}return e},Ki=function(e,t){return zi(e,Hi(t))},Ji=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var s;return(0,o.Z)(this,n),(s=t.call(this,e,r)).relayer=e,s.logger=r,s.subscriptions=new Map,s.topicMap=new Fi,s.events=new f.EventEmitter,s.name="subscription",s.version="0.3",s.pending=new Map,s.cached=[],s.initialized=!1,s.pendingSubscriptionWatchLabel="pending_sub_watch_label",s.pollingInterval=20,s.storagePrefix=$r,s.subscribeTimeout=1e4,s.restartInProgress=!1,s.batchSubscribeTopicsLimit=500,s.init=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=s.initialized,e.t0){e.next=10;break}return s.logger.trace("Initialized"),e.next=5,s.restart();case 5:return s.registerEventListeners(),s.onEnable(),e.next=9,s.relayer.core.crypto.getClientId();case 9:s.clientId=e.sent;case 10:case"end":return e.stop()}}),e)}))),s.subscribe=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var r,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.restartToComplete();case 2:return s.isInitialized(),s.logger.debug("Subscribing Topic"),s.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:n}}),e.prev=5,r=kt(n),a={topic:t,relay:r},s.pending.set(t,a),e.next=10,s.rpcSubscribe(t,r);case 10:return o=e.sent,e.abrupt("return",(s.onSubscribe(o,a),s.logger.debug("Successfully Subscribed Topic"),s.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:n}}),o));case 14:throw e.prev=14,e.t0=e.catch(5),s.logger.debug("Failed to Subscribe Topic"),s.logger.error(e.t0),e.t0;case 17:case"end":return e.stop()}}),e,null,[[5,14]])})));return function(t,n){return e.apply(this,arguments)}}(),s.unsubscribe=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.restartToComplete();case 2:if(s.isInitialized(),!(typeof(null===n||void 0===n?void 0:n.id)<"u")){e.next=8;break}return e.next=6,s.unsubscribeById(t,n.id,n);case 6:e.next=10;break;case 8:return e.next=10,s.unsubscribeByTopic(t,n);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.isSubscribed=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s.topics.includes(t)){e.next=4;break}e.t0=!0,e.next=7;break;case 4:return e.next=6,new Promise((function(e,n){var r=new x.Watch;r.start(s.pendingSubscriptionWatchLabel);var i=setInterval((function(){!s.pending.has(t)&&s.topics.includes(t)&&(clearInterval(i),r.stop(s.pendingSubscriptionWatchLabel),e(!0)),r.elapsed(s.pendingSubscriptionWatchLabel)>=Ei&&(clearInterval(i),r.stop(s.pendingSubscriptionWatchLabel),n(new Error("Subscription resolution timeout")))}),s.pollingInterval)})).catch((function(){return!1}));case 6:e.t0=e.sent;case 7:return e.abrupt("return",e.t0);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.on=function(e,t){s.events.on(e,t)},s.once=function(e,t){s.events.once(e,t)},s.off=function(e,t){s.events.off(e,t)},s.removeListener=function(e,t){s.events.removeListener(e,t)},s.restart=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.restartInProgress=!0,e.next=3,s.restore();case 3:return e.next=5,s.reset();case 5:s.restartInProgress=!1;case 6:case"end":return e.stop()}}),e)}))),s.relayer=e,s.logger=(0,N.generateChildLogger)(r,s.name),s.clientId="",s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"length",get:function(){return this.subscriptions.size}},{key:"ids",get:function(){return Array.from(this.subscriptions.keys())}},{key:"values",get:function(){return Array.from(this.subscriptions.values())}},{key:"topics",get:function(){return this.topicMap.topics}},{key:"hasSubscription",value:function(e,t){var n=!1;try{n=this.getSubscription(e).topic===t}catch(r){}return n}},{key:"onEnable",value:function(){this.cached=[],this.initialized=!0}},{key:"onDisable",value:function(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}},{key:"unsubscribeByTopic",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var r,o=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.topicMap.get(t),e.next=3,Promise.all(r.map(function(){var e=(0,a.Z)((0,i.Z)().mark((function e(r){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.unsubscribeById(t,r,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"unsubscribeById",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,r){var a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:n,opts:r}}),e.prev=1,a=kt(r),e.next=5,this.rpcUnsubscribe(t,n,a);case 5:return o=Bt("USER_DISCONNECTED","".concat(this.name,", ").concat(t)),e.next=8,this.onUnsubscribe(t,n,o);case 8:this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:n,opts:r}}),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(1),this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e.t0),e.t0;case 15:case"end":return e.stop()}}),e,this,[[1,12]])})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"rpcSubscribe",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={method:At(n.protocol).subscribe,params:{topic:t}},this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),e.prev=2,e.next=5,ht(this.relayer.request(r),this.subscribeTimeout);case 5:return e.next=7,e.sent;case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(di);case 12:return e.abrupt("return",Ze(t+this.clientId));case 13:case"end":return e.stop()}}),e,this,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"rpcBatchSubscribe",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return");case 2:return n=t[0].relay,r={method:At(n.protocol).batchSubscribe,params:{topics:t.map((function(e){return e.topic}))}},this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),e.prev=4,e.next=7,ht(this.relayer.request(r),this.subscribeTimeout);case 7:return e.next=9,e.sent;case 9:return e.abrupt("return",e.sent);case 12:e.prev=12,e.t0=e.catch(4),this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(di);case 15:case"end":return e.stop()}}),e,this,[[4,12]])})));return function(t){return e.apply(this,arguments)}}()},{key:"rpcUnsubscribe",value:function(e,t,n){var r={method:At(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),this.relayer.request(r)}},{key:"onSubscribe",value:function(e,t){this.setSubscription(e,Ki(Yi({},t),{id:e})),this.pending.delete(t.topic)}},{key:"onBatchSubscribe",value:function(e){var t=this;e.length&&e.forEach((function(e){t.setSubscription(e.id,Yi({},e)),t.pending.delete(e.topic)}))}},{key:"onUnsubscribe",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,r){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.events.removeAllListeners(n),this.hasSubscription(n,t)&&this.deleteSubscription(n,r),e.next=4,this.relayer.messages.del(t);case 4:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"setRelayerSubscriptions",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.relayer.core.storage.setItem(this.storageKey,t);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRelayerSubscriptions",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.relayer.core.storage.getItem(this.storageKey);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setSubscription",value:function(e,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}},{key:"addSubscription",value:function(e,t){this.subscriptions.set(e,Yi({},t)),this.topicMap.set(t.topic,e),this.events.emit(wi,t)}},{key:"getSubscription",value:function(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});var t=this.subscriptions.get(e);if(!t){var n=Dt("NO_MATCHING_KEY","".concat(this.name,": ").concat(e)).message;throw new Error(n)}return t}},{key:"deleteSubscription",value:function(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});var n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(xi,Ki(Yi({},n),{reason:t}))}},{key:"persist",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setRelayerSubscriptions(this.values);case 2:this.events.emit(ki);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"reset",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t,n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.cached.length){e.next=10;break}t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit),n=0;case 3:if(!(n"u")&&t.length){e.next=6;break}return e.abrupt("return");case 6:if(!this.subscriptions.size){e.next=9;break}throw n=Dt("RESTORE_WILL_OVERRIDE",this.name),r=n.message,this.logger.error(r),this.logger.error("".concat(this.name,": ").concat(JSON.stringify(this.values))),new Error(r);case 9:this.cached=t,this.logger.debug("Successfully Restored subscriptions for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",subscriptions:this.values}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),this.logger.debug("Failed to Restore subscriptions for ".concat(this.name)),this.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"batchSubscribe",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.rpcBatchSubscribe(t);case 4:Ut(n=e.sent)&&this.onBatchSubscribe(n.map((function(e,n){return Ki(Yi({},t[n]),{id:e})})));case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onConnect",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.restartInProgress,e.t0){e.next=5;break}return e.next=4,this.restart();case 4:this.onEnable();case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onDisconnect",value:function(){this.onDisable()}},{key:"checkPending",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.relayer.transportExplicitlyClosed){e.next=2;break}return e.abrupt("return");case 2:return t=[],this.pending.forEach((function(e){t.push(e)})),e.next=6,this.batchSubscribe(t);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"registerEventListeners",value:function(){var e=this;this.relayer.core.heartbeat.on(M.HEARTBEAT_EVENTS.pulse,(0,a.Z)((0,i.Z)().mark((function t(){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.checkPending();case 2:case"end":return t.stop()}}),t)})))),this.relayer.on(ci,(0,a.Z)((0,i.Z)().mark((function t(){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.onConnect();case 2:case"end":return t.stop()}}),t)})))),this.relayer.on(li,(function(){e.onDisconnect()})),this.events.on(wi,function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){var r;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=wi,e.logger.info("Emitting ".concat(r)),e.logger.debug({type:"event",event:r,data:n}),t.next=5,e.persist();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.events.on(xi,function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){var r;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=xi,e.logger.info("Emitting ".concat(r)),e.logger.debug({type:"event",event:r,data:n}),t.next=5,e.persist();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Dt("NOT_INITIALIZED",this.name).message;throw new Error(e)}}},{key:"restartToComplete",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.restartInProgress,!e.t0){e.next=4;break}return e.next=4,new Promise((function(e){var n=setInterval((function(){t.restartInProgress||(clearInterval(n),e())}),t.pollingInterval)}));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(z),Qi=Object.defineProperty,Xi=Object.getOwnPropertySymbols,$i=Object.prototype.hasOwnProperty,ea=Object.prototype.propertyIsEnumerable,ta=function(e,t,n){return t in e?Qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},na=function(e,t){for(var n in t||(t={}))$i.call(t,n)&&ta(e,n,t[n]);if(Xi){var r,i=(0,l.Z)(Xi(t));try{for(i.s();!(r=i.n()).done;){n=r.value;ea.call(t,n)&&ta(e,n,t[n])}}catch(a){i.e(a)}finally{i.f()}}return e},ra=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e){var r;return(0,o.Z)(this,n),(r=t.call(this,e)).protocol="wc",r.version=2,r.events=new f.EventEmitter,r.name="relayer",r.transportExplicitlyClosed=!1,r.initialized=!1,r.reconnecting=!1,r.connectionStatusPollingInterval=20,r.staleConnectionErrors=["socket hang up","socket stalled"],r.request=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.logger.debug("Publishing Request Payload"),e.prev=1,e.next=4,r.toEstablishConnection();case 4:return e.next=6,r.provider.request(t);case 6:return e.abrupt("return",e.sent);case 9:throw e.prev=9,e.t0=e.catch(1),r.logger.debug("Failed to Publish Request"),r.logger.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(t){return e.apply(this,arguments)}}(),r.core=e.core,r.logger=typeof e.logger<"u"&&"string"!=typeof e.logger?(0,N.generateChildLogger)(e.logger,r.name):(0,N.pino)((0,N.getDefaultLoggerOptions)({level:e.logger||"error"})),r.messages=new Bi(r.logger,e.core),r.subscriber=new Ji((0,C.Z)(r),r.logger),r.publisher=new Ui((0,C.Z)(r),r.logger),r.relayUrl=(null===e||void 0===e?void 0:e.relayUrl)||ai,r.projectId=e.projectId,r.provider={},r}return(0,s.Z)(n,[{key:"init",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.trace("Initialized"),e.next=3,this.createProvider();case 3:return e.next=5,Promise.all([this.messages.init(),this.subscriber.init()]);case 5:return e.prev=5,e.next=8,this.transportOpen();case 8:e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(5),this.logger.warn("Connection via ".concat(this.relayUrl," failed, attempting to connect via failover domain ").concat(oi,"...")),e.next=15,this.restartTransport(oi);case 15:this.registerEventListeners(),this.initialized=!0,setTimeout((0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=0===t.subscriber.topics.length,!e.t0){e.next=6;break}return t.logger.info("No topics subscribed to after init, closing transport"),e.next=5,t.transportClose();case 5:t.transportExplicitlyClosed=!1;case 6:case"end":return e.stop()}}),e)}))),1e4);case 16:case"end":return e.stop()}}),e,this,[[5,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"connected",get:function(){return this.provider.connection.connected}},{key:"connecting",get:function(){return this.provider.connection.connecting}},{key:"publish",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,r){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isInitialized(),e.next=3,this.publisher.publish(t,n,r);case 3:return e.next=5,this.recordMessageEvent({topic:t,message:n,publishedAt:Date.now()});case 5:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"subscribe",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var r,o,s=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isInitialized(),o=(null==(r=this.subscriber.topicMap.get(t))?void 0:r[0])||"",e.t0=o,e.t0){e.next=7;break}return e.next=6,Promise.all([new Promise((function(e){s.subscriber.once(wi,(function(n){n.topic===t&&e()}))})),new Promise(function(){var e=(0,a.Z)((0,i.Z)().mark((function e(r){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.subscriber.subscribe(t,n);case 2:o=e.sent,r();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())]);case 6:e.t0=o;case 7:return e.abrupt("return",e.t0);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"unsubscribe",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isInitialized(),e.next=3,this.subscriber.unsubscribe(t,n);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"transportClose",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.transportExplicitlyClosed=!0,e.t0=this.connected,!e.t0){e.next=6;break}return e.next=5,this.provider.disconnect();case 5:this.events.emit(pi);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"transportOpen",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.transportExplicitlyClosed=!1,this.reconnecting){e.next=23;break}return this.relayUrl=t||this.relayUrl,this.reconnecting=!0,e.prev=2,e.t0=Promise,e.t1=new Promise((function(e){r.initialized||e(),r.subscriber.once(Ai,(function(){e()}))})),e.next=7,Promise.race([new Promise(function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ht(r.provider.connect(),1e4,"Socket stalled when trying to connect to ".concat(r.relayUrl)).catch((function(e){return n(e)})).then((function(){return t()})).finally((function(){return r.removeListener(pi,r.rejectTransportOpen)}));case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),new Promise((function(e){return r.once(pi,r.rejectTransportOpen)}))]);case 7:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=11,e.t0.all.call(e.t0,e.t3);case 11:e.next=20;break;case 13:if(e.prev=13,e.t4=e.catch(2),this.logger.error(e.t4),n=e.t4,this.isConnectionStalled(n.message)){e.next=19;break}throw e.t4;case 19:this.events.emit(pi);case 20:return e.prev=20,this.reconnecting=!1,e.finish(20);case 23:case"end":return e.stop()}}),e,this,[[2,13,20,23]])})));return function(t){return e.apply(this,arguments)}}()},{key:"restartTransport",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.transportExplicitlyClosed||this.reconnecting,e.t0){e.next=11;break}if(this.relayUrl=t||this.relayUrl,e.t1=this.connected,!e.t1){e.next=7;break}return e.next=7,Promise.all([new Promise((function(e){n.provider.once(yi,(function(){e()}))})),this.transportClose()]);case 7:return e.next=9,this.createProvider();case 9:return e.next=11,this.transportOpen();case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isConnectionStalled",value:function(e){return this.staleConnectionErrors.some((function(t){return e.includes(t)}))}},{key:"rejectTransportOpen",value:function(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}},{key:"createProvider",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.crypto.signJWT(this.relayUrl);case 2:t=e.sent,this.provider=new pn.JsonRpcProvider(new bn(ct({sdkVersion:"2.9.2",protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0}))),this.registerProviderListeners();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"recordMessageEvent",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,r=t.message,e.next=3,this.messages.set(n,r);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"shouldIgnoreMessageEvent",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.topic,(r=t.message)&&0!==r.length){e.next=3;break}return e.abrupt("return",(this.logger.debug("Ignoring invalid/empty message: ".concat(r)),!0));case 3:return e.next=5,this.subscriber.isSubscribed(n);case 5:if(e.sent){e.next=7;break}return e.abrupt("return",(this.logger.debug("Ignoring message for non-subscribed topic ".concat(n)),!0));case 7:return a=this.messages.has(n,r),e.abrupt("return",(a&&this.logger.debug("Ignoring duplicate message: ".concat(r)),a));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onProviderPayload",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r,a,o,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),!(0,hn.isJsonRpcRequest)(t)){e.next=13;break}if(t.method.endsWith("_subscription")){e.next=3;break}return e.abrupt("return");case 3:return n=t.params,r=n.data,a=r.topic,o=r.message,s=r.publishedAt,u={topic:a,message:o,publishedAt:s},this.logger.debug("Emitting Relayer Payload"),this.logger.trace(na({type:"event",event:n.id},u)),this.events.emit(n.id,u),e.next=9,this.acknowledgePayload(t);case 9:return e.next=11,this.onMessageEvent(u);case 11:e.next=14;break;case 13:(0,hn.isJsonRpcResponse)(t)&&this.events.emit(ui,t);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onMessageEvent",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.shouldIgnoreMessageEvent(t);case 2:if(e.t0=e.sent,e.t0){e.next=7;break}return this.events.emit(si,t),e.next=7,this.recordMessageEvent(t);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"acknowledgePayload",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,hn.formatJsonRpcResult)(t.id,!0),e.next=3,this.provider.connection.send(n);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"registerProviderListeners",value:function(){var e=this;this.provider.on(mi,(function(t){return e.onProviderPayload(t)})),this.provider.on(vi,(function(){e.events.emit(ci)})),this.provider.on(yi,(function(){e.onProviderDisconnect()})),this.provider.on(bi,(function(t){e.logger.error(t),e.events.emit(fi,t)}))}},{key:"registerEventListeners",value:function(){var e=this;this.events.on(di,(0,a.Z)((0,i.Z)().mark((function t(){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.restartTransport();case 2:case"end":return t.stop()}}),t)}))))}},{key:"onProviderDisconnect",value:function(){this.events.emit(li),this.attemptToReconnect()}},{key:"attemptToReconnect",value:function(){var e=this;this.transportExplicitlyClosed||setTimeout((0,a.Z)((0,i.Z)().mark((function t(){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.restartTransport();case 2:case"end":return t.stop()}}),t)}))),(0,x.toMiliseconds)(gi))}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Dt("NOT_INITIALIZED",this.name).message;throw new Error(e)}}},{key:"toEstablishConnection",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connected){e.next=7;break}if(!this.connecting){e.next=5;break}return e.next=4,new Promise((function(e){var n=setInterval((function(){t.connected&&(clearInterval(n),e())}),t.connectionStatusPollingInterval)}));case 4:return e.abrupt("return",e.sent);case 5:return e.next=7,this.restartTransport();case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(F),ia=Object.defineProperty,aa=Object.getOwnPropertySymbols,oa=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,ua=function(e,t,n){return t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ca=function(e,t){for(var n in t||(t={}))oa.call(t,n)&&ua(e,n,t[n]);if(aa){var r,i=(0,l.Z)(aa(t));try{for(i.s();!(r=i.n()).done;){n=r.value;sa.call(t,n)&&ua(e,n,t[n])}}catch(a){i.e(a)}finally{i.f()}}return e},la=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r,s){var u,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$r,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return(0,o.Z)(this,n),(u=t.call(this,e,r,s,c)).core=e,u.logger=r,u.name=s,u.map=new Map,u.version="0.3",u.cached=[],u.initialized=!1,u.storagePrefix=$r,u.init=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=u.initialized,e.t0){e.next=8;break}return u.logger.trace("Initialized"),e.next=5,u.restore();case 5:u.cached.forEach((function(e){u.getKey&&null!==e&&!Zt(e)?u.map.set(u.getKey(e),e):Vt(e)?u.map.set(e.id,e):Wt(e)&&u.map.set(e.topic,e)})),u.cached=[],u.initialized=!0;case 8:case"end":return e.stop()}}),e)}))),u.set=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.isInitialized(),!u.map.has(t)){e.next=6;break}return e.next=4,u.update(t,n);case 4:e.next=11;break;case 6:return u.logger.debug("Setting value"),u.logger.trace({type:"method",method:"set",key:t,value:n}),u.map.set(t,n),e.next=11,u.persist();case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),u.get=function(e){return u.isInitialized(),u.logger.debug("Getting value"),u.logger.trace({type:"method",method:"get",key:e}),u.getData(e)},u.getAll=function(e){return u.isInitialized(),e?u.values.filter((function(t){return Object.keys(e).every((function(n){return wn()(t[n],e[n])}))})):u.values},u.update=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.isInitialized(),u.logger.debug("Updating value"),u.logger.trace({type:"method",method:"update",key:t,update:n}),r=ca(ca({},u.getData(t)),n),u.map.set(t,r),e.next=5,u.persist();case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),u.delete=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.isInitialized(),e.t0=u.map.has(t),!e.t0){e.next=8;break}return u.logger.debug("Deleting value"),u.logger.trace({type:"method",method:"delete",key:t,reason:n}),u.map.delete(t),e.next=8,u.persist();case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),u.logger=(0,N.generateChildLogger)(r,u.name),u.storagePrefix=c,u.getKey=l,u}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"length",get:function(){return this.map.size}},{key:"keys",get:function(){return Array.from(this.map.keys())}},{key:"values",get:function(){return Array.from(this.map.values())}},{key:"setDataStore",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.setItem(this.storageKey,t);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getDataStore",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.getItem(this.storageKey);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getData",value:function(e){var t=this.map.get(e);if(!t){var n=Dt("NO_MATCHING_KEY","".concat(this.name,": ").concat(e)).message;throw this.logger.error(n),new Error(n)}return t}},{key:"persist",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setDataStore(this.values);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restore",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t,n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getDataStore();case 3:if(!(typeof(t=e.sent)>"u")&&t.length){e.next=6;break}return e.abrupt("return");case 6:if(!this.map.size){e.next=9;break}throw n=Dt("RESTORE_WILL_OVERRIDE",this.name),r=n.message,this.logger.error(r),new Error(r);case 9:this.cached=t,this.logger.debug("Successfully Restored value for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",value:this.values}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),this.logger.debug("Failed to Restore value for ".concat(this.name)),this.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"isInitialized",value:function(){if(!this.initialized){var e=Dt("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),n}(Z),fa=function(){function e(t,n){var r=this;(0,o.Z)(this,e),this.core=t,this.logger=n,this.name="pairing",this.version="0.3",this.events=new(d()),this.initialized=!1,this.storagePrefix=$r,this.ignoredPayloadTypes=[Ne],this.registeredMethods=[],this.init=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=r.initialized,e.t0){e.next=10;break}return e.next=4,r.pairings.init();case 4:return e.next=6,r.cleanup();case 6:r.registerRelayerEvents(),r.registerExpirerEvents(),r.initialized=!0,r.logger.trace("Initialized");case 10:case"end":return e.stop()}}),e)}))),this.register=function(e){var t=e.methods;r.isInitialized(),r.registeredMethods=(0,u.Z)(new Set([].concat((0,u.Z)(r.registeredMethods),(0,u.Z)(t))))},this.create=(0,a.Z)((0,i.Z)().mark((function e(){var t,n,a,o,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),t=Ue(),e.next=4,r.core.crypto.setSymKey(t);case 4:return n=e.sent,a=yt(x.FIVE_MINUTES),s={topic:n,expiry:a,relay:o={protocol:"irn"},active:!1},u=Rt({protocol:r.core.protocol,version:r.core.version,topic:n,symKey:t,relay:o}),e.next=11,r.pairings.set(n,s);case 11:return e.next=13,r.core.relayer.subscribe(n);case 13:return r.core.expirer.set(n,a),e.abrupt("return",{topic:n,uri:u});case 15:case"end":return e.stop()}}),e)}))),this.pair=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.isInitialized(),r.isValidPair(t),n=It(t.uri),a=n.topic,o=n.symKey,s=n.relay,!r.pairings.keys.includes(a)){e.next=4;break}throw new Error("Pairing already exists: ".concat(a));case 4:if(!r.core.crypto.hasKeys(a)){e.next=6;break}throw new Error("Keychain already exists: ".concat(a));case 6:return u=yt(x.FIVE_MINUTES),c={topic:a,relay:s,expiry:u,active:!1},e.next=9,r.pairings.set(a,c);case 9:return e.next=11,r.core.crypto.setSymKey(o,a);case 11:return e.next=13,r.core.relayer.subscribe(a,{relay:s});case 13:if(r.core.expirer.set(a,u),e.t0=t.activatePairing,!e.t0){e.next=18;break}return e.next=18,r.activate({topic:a});case 18:return e.abrupt("return",c);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.activate=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,r.isInitialized(),a=yt(x.THIRTY_DAYS),e.next=5,r.pairings.update(n,{active:!0,expiry:a});case 5:r.core.expirer.set(n,a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.ping=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidPing(t);case 3:if(n=t.topic,!r.pairings.keys.includes(n)){e.next=15;break}return e.next=7,r.sendRequest(n,"wc_pairingPing",{});case 7:return a=e.sent,o=pt(),s=o.done,u=o.resolve,c=o.reject,r.events.once(gt("pairing_ping",a),(function(e){var t=e.error;t?c(t):u()})),e.next=15,s();case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.updateExpiry=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,a=t.expiry,r.isInitialized(),e.next=4,r.pairings.update(n,{expiry:a});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.updateMetadata=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,a=t.metadata,r.isInitialized(),e.next=4,r.pairings.update(n,{peerMetadata:a});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.getPairings=function(){return r.isInitialized(),r.pairings.values},this.disconnect=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidDisconnect(t);case 3:if(n=t.topic,e.t0=r.pairings.keys.includes(n),!e.t0){e.next=10;break}return e.next=8,r.sendRequest(n,"wc_pairingDelete",Bt("USER_DISCONNECTED"));case 8:return e.next=10,r.deletePairing(n);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.sendRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,a){var o,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(0,hn.formatJsonRpcRequest)(n,a),e.next=3,r.core.crypto.encode(t,o);case 3:return s=e.sent,u=_i[n].req,e.abrupt("return",(r.core.history.set(t,o),r.core.relayer.publish(t,s,u),o.id));case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.sendResult=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,a){var o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(0,hn.formatJsonRpcResult)(t,a),e.next=3,r.core.crypto.encode(n,o);case 3:return s=e.sent,e.next=6,r.core.history.get(n,t);case 6:return u=e.sent,c=_i[u.request.method].res,e.next=10,r.core.relayer.publish(n,s,c);case 10:return e.next=12,r.core.history.resolve(o);case 12:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.sendError=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,a){var o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(0,hn.formatJsonRpcError)(t,a),e.next=3,r.core.crypto.encode(n,o);case 3:return s=e.sent,e.next=6,r.core.history.get(n,t);case 6:return u=e.sent,c=_i[u.request.method]?_i[u.request.method].res:_i.unregistered_method.res,e.next=10,r.core.relayer.publish(n,s,c);case 10:return e.next=12,r.core.history.resolve(o);case 12:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.deletePairing=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.core.relayer.unsubscribe(t);case 2:return e.next=4,Promise.all([r.pairings.delete(t,Bt("USER_DISCONNECTED")),r.core.crypto.deleteSymKey(t),n?Promise.resolve():r.core.expirer.del(t)]);case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this.cleanup=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.pairings.getAll().filter((function(e){return bt(e.expiry)})),e.next=3,Promise.all(t.map((function(e){return r.deletePairing(e.topic)})));case 3:case"end":return e.stop()}}),e)}))),this.onRelayEventRequest=function(e){var t=e.topic,n=e.payload;switch(n.method){case"wc_pairingPing":return r.onPairingPingRequest(t,n);case"wc_pairingDelete":return r.onPairingDeleteRequest(t,n);default:return r.onUnknownRpcMethodRequest(t,n)}},this.onRelayEventResponse=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,a=t.payload,e.next=4,r.core.history.get(n,a.id);case 4:o=e.sent.request.method,e.t0=o,e.next="wc_pairingPing"===e.t0?8:9;break;case 8:return e.abrupt("return",r.onPairingPingResponse(n,a));case 9:return e.abrupt("return",r.onUnknownRpcMethodResponse(o));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onPairingPingRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.id,e.prev=1,r.isValidPing({topic:t}),e.next=5,r.sendResult(a,t,!0);case 5:r.events.emit("pairing_ping",{id:a,topic:t}),e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(1),e.next=12,r.sendError(a,t,e.t0);case 12:r.logger.error(e.t0);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),this.onPairingPingResponse=function(e,t){var n=t.id;setTimeout((function(){(0,hn.isJsonRpcResult)(t)?r.events.emit(gt("pairing_ping",n),{}):(0,hn.isJsonRpcError)(t)&&r.events.emit(gt("pairing_ping",n),{error:t.error})}),500)},this.onPairingDeleteRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.id,e.prev=1,r.isValidDisconnect({topic:t}),e.next=5,r.deletePairing(t);case 5:r.events.emit("pairing_delete",{id:a,topic:t}),e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(1),e.next=12,r.sendError(a,t,e.t0);case 12:r.logger.error(e.t0);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),this.onUnknownRpcMethodRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o,s;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.id,o=n.method,e.prev=1,!r.registeredMethods.includes(o)){e.next=4;break}return e.abrupt("return");case 4:return s=Bt("WC_METHOD_UNSUPPORTED",o),e.next=7,r.sendError(a,t,s);case 7:r.logger.error(s),e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,r.sendError(a,t,e.t0);case 14:r.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,n){return e.apply(this,arguments)}}(),this.onUnknownRpcMethodResponse=function(e){r.registeredMethods.includes(e)||r.logger.error(Bt("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=function(e){if(!tn(e)){var t=Dt("MISSING_OR_INVALID","pair() params: ".concat(e)).message;throw new Error(t)}if(!function(e){if(zt(e,!1))try{return typeof new URL(e)<"u"}catch(t){return!1}return!1}(e.uri)){var n=Dt("MISSING_OR_INVALID","pair() uri: ".concat(e.uri)).message;throw new Error(n)}},this.isValidPing=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","ping() params: ".concat(t)),a=n.message,new Error(a);case 3:return o=t.topic,e.next=6,r.isValidPairingTopic(o);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.isValidDisconnect=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","disconnect() params: ".concat(t)),a=n.message,new Error(a);case 3:return o=t.topic,e.next=6,r.isValidPairingTopic(o);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.isValidPairingTopic=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(zt(t,!1)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","pairing topic should be a string: ".concat(t)),a=n.message,new Error(a);case 3:if(r.pairings.keys.includes(t)){e.next=6;break}throw o=Dt("NO_MATCHING_KEY","pairing topic doesn't exist: ".concat(t)),s=o.message,new Error(s);case 6:if(!bt(r.pairings.get(t).expiry)){e.next=11;break}return e.next=9,r.deletePairing(t);case 9:throw u=Dt("EXPIRED","pairing topic: ".concat(t)),c=u.message,new Error(c);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.core=t,this.logger=(0,N.generateChildLogger)(n,this.name),this.pairings=new la(this.core,this.logger,this.name,this.storagePrefix)}return(0,s.Z)(e,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Dt("NOT_INITIALIZED",this.name).message;throw new Error(e)}}},{key:"registerRelayerEvents",value:function(){var e=this;this.core.relayer.on(si,function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){var r,a,o;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.topic,a=n.message,e.pairings.keys.includes(r)&&!e.ignoredPayloadTypes.includes(e.core.crypto.getPayloadType(a))){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,e.core.crypto.decode(r,a);case 5:if(o=t.sent,t.prev=6,!(0,hn.isJsonRpcRequest)(o)){t.next=11;break}e.core.history.set(r,o),e.onRelayEventRequest({topic:r,payload:o}),t.next=18;break;case 11:if(t.t0=(0,hn.isJsonRpcResponse)(o),!t.t0){t.next=18;break}return t.next=15,e.core.history.resolve(o);case 15:return t.next=17,e.onRelayEventResponse({topic:r,payload:o});case 17:e.core.history.delete(r,o.id);case 18:t.next=23;break;case 20:t.prev=20,t.t1=t.catch(6),e.logger.error(t.t1);case 23:case"end":return t.stop()}}),t,null,[[6,20]])})));return function(e){return t.apply(this,arguments)}}())}},{key:"registerExpirerEvents",value:function(){var e=this;this.core.expirer.on(Ri,function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){var r,a;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=vt(n.target),a=r.topic,t.t0=a&&e.pairings.keys.includes(a),!t.t0){t.next=6;break}return t.next=5,e.deletePairing(a,!0);case 5:e.events.emit("pairing_expire",{topic:a});case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}]),e}(),da=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var s;return(0,o.Z)(this,n),(s=t.call(this,e,r)).core=e,s.logger=r,s.records=new Map,s.events=new f.EventEmitter,s.name="history",s.version="0.3",s.cached=[],s.initialized=!1,s.storagePrefix=$r,s.init=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=s.initialized,e.t0){e.next=9;break}return s.logger.trace("Initialized"),e.next=5,s.restore();case 5:s.cached.forEach((function(e){return s.records.set(e.id,e)})),s.cached=[],s.registerEventListeners(),s.initialized=!0;case 9:case"end":return e.stop()}}),e)}))),s.set=function(e,t,n){if(s.isInitialized(),s.logger.debug("Setting JSON-RPC request history record"),s.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:n}),!s.records.has(t.id)){var r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:n,expiry:yt(x.THIRTY_DAYS)};s.records.set(r.id,r),s.events.emit(Ti,r)}},s.resolve=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.isInitialized(),s.logger.debug("Updating JSON-RPC response history record"),s.logger.trace({type:"method",method:"update",response:t}),s.records.has(t.id)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,s.getRecord(t.id);case 4:typeof(n=e.sent).response>"u"&&(n.response=(0,hn.isJsonRpcError)(t)?{error:t.error}:{result:t.result},s.records.set(n.id,n),s.events.emit(Si,n));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.get=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),s.logger.debug("Getting record"),s.logger.trace({type:"method",method:"get",topic:t,id:n}),e.next=5,s.getRecord(n);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.delete=function(e,t){s.isInitialized(),s.logger.debug("Deleting record"),s.logger.trace({type:"method",method:"delete",id:t}),s.values.forEach((function(n){if(n.topic===e){if(typeof t<"u"&&n.id!==t)return;s.records.delete(n.id),s.events.emit(Ci,n)}}))},s.exists=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.isInitialized(),!s.records.has(n)){e.next=9;break}return e.next=4,s.getRecord(n);case 4:e.t1=e.sent.topic,e.t2=t,e.t0=e.t1===e.t2,e.next=10;break;case 9:e.t0=!1;case 10:return e.abrupt("return",e.t0);case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.on=function(e,t){s.events.on(e,t)},s.once=function(e,t){s.events.once(e,t)},s.off=function(e,t){s.events.off(e,t)},s.removeListener=function(e,t){s.events.removeListener(e,t)},s.logger=(0,N.generateChildLogger)(r,s.name),s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"size",get:function(){return this.records.size}},{key:"keys",get:function(){return Array.from(this.records.keys())}},{key:"values",get:function(){return Array.from(this.records.values())}},{key:"pending",get:function(){var e=[];return this.values.forEach((function(t){if(!(typeof t.response<"u")){var n={topic:t.topic,request:(0,hn.formatJsonRpcRequest)(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(n)}})),e}},{key:"setJsonRpcRecords",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.setItem(this.storageKey,t);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getJsonRpcRecords",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.getItem(this.storageKey);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRecord",value:function(e){this.isInitialized();var t=this.records.get(e);if(!t){var n=Dt("NO_MATCHING_KEY","".concat(this.name,": ").concat(e)).message;throw new Error(n)}return t}},{key:"persist",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setJsonRpcRecords(this.values);case 2:this.events.emit(Oi);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restore",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t,n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getJsonRpcRecords();case 3:if(!(typeof(t=e.sent)>"u")&&t.length){e.next=6;break}return e.abrupt("return");case 6:if(!this.records.size){e.next=9;break}throw n=Dt("RESTORE_WILL_OVERRIDE",this.name),r=n.message,this.logger.error(r),new Error(r);case 9:this.cached=t,this.logger.debug("Successfully Restored records for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",records:this.values}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),this.logger.debug("Failed to Restore records for ".concat(this.name)),this.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"registerEventListeners",value:function(){var e=this;this.events.on(Ti,(function(t){var n=Ti;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,record:t}),e.persist()})),this.events.on(Si,(function(t){var n=Si;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,record:t}),e.persist()})),this.events.on(Ci,(function(t){var n=Ci;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,record:t}),e.persist()})),this.core.heartbeat.on(M.HEARTBEAT_EVENTS.pulse,(function(){e.cleanup()}))}},{key:"cleanup",value:function(){var e=this;try{this.records.forEach((function(t){(0,x.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(e.logger.info("Deleting expired history log: ".concat(t.id)),e.delete(t.topic,t.id))}))}catch(t){this.logger.warn(t)}}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Dt("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),n}(D),pa=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var s;return(0,o.Z)(this,n),(s=t.call(this,e,r)).core=e,s.logger=r,s.expirations=new Map,s.events=new f.EventEmitter,s.name="expirer",s.version="0.3",s.cached=[],s.initialized=!1,s.storagePrefix=$r,s.init=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=s.initialized,e.t0){e.next=9;break}return s.logger.trace("Initialized"),e.next=5,s.restore();case 5:s.cached.forEach((function(e){return s.expirations.set(e.target,e)})),s.cached=[],s.registerEventListeners(),s.initialized=!0;case 9:case"end":return e.stop()}}),e)}))),s.has=function(e){try{var t=s.formatTarget(e);return typeof s.getExpiration(t)<"u"}catch(n){return!1}},s.set=function(e,t){s.isInitialized();var n=s.formatTarget(e),r={target:n,expiry:t};s.expirations.set(n,r),s.checkExpiry(n,r),s.events.emit(Ii,{target:n,expiration:r})},s.get=function(e){s.isInitialized();var t=s.formatTarget(e);return s.getExpiration(t)},s.del=function(e){if(s.isInitialized(),s.has(e)){var t=s.formatTarget(e),n=s.getExpiration(t);s.expirations.delete(t),s.events.emit(Pi,{target:t,expiration:n})}},s.on=function(e,t){s.events.on(e,t)},s.once=function(e,t){s.events.once(e,t)},s.off=function(e,t){s.events.off(e,t)},s.removeListener=function(e,t){s.events.removeListener(e,t)},s.logger=(0,N.generateChildLogger)(r,s.name),s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"length",get:function(){return this.expirations.size}},{key:"keys",get:function(){return Array.from(this.expirations.keys())}},{key:"values",get:function(){return Array.from(this.expirations.values())}},{key:"formatTarget",value:function(e){if("string"==typeof e)return function(e){return mt("topic",e)}(e);if("number"==typeof e)return function(e){return mt("id",e)}(e);var t=Dt("UNKNOWN_TYPE","Target type: ".concat(typeof e)).message;throw new Error(t)}},{key:"setExpirations",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.setItem(this.storageKey,t);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getExpirations",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.getItem(this.storageKey);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"persist",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setExpirations(this.values);case 2:this.events.emit(Mi);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restore",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t,n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getExpirations();case 3:if(!(typeof(t=e.sent)>"u")&&t.length){e.next=6;break}return e.abrupt("return");case 6:if(!this.expirations.size){e.next=9;break}throw n=Dt("RESTORE_WILL_OVERRIDE",this.name),r=n.message,this.logger.error(r),new Error(r);case 9:this.cached=t,this.logger.debug("Successfully Restored expirations for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",expirations:this.values}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),this.logger.debug("Failed to Restore expirations for ".concat(this.name)),this.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"getExpiration",value:function(e){var t=this.expirations.get(e);if(!t){var n=Dt("NO_MATCHING_KEY","".concat(this.name,": ").concat(e)).message;throw this.logger.error(n),new Error(n)}return t}},{key:"checkExpiry",value:function(e,t){var n=t.expiry;(0,x.toMiliseconds)(n)-Date.now()<=0&&this.expire(e,t)}},{key:"expire",value:function(e,t){this.expirations.delete(e),this.events.emit(Ri,{target:e,expiration:t})}},{key:"checkExpirations",value:function(){var e=this;this.core.relayer.connected&&this.expirations.forEach((function(t,n){return e.checkExpiry(n,t)}))}},{key:"registerEventListeners",value:function(){var e=this;this.core.heartbeat.on(M.HEARTBEAT_EVENTS.pulse,(function(){return e.checkExpirations()})),this.events.on(Ii,(function(t){var n=Ii;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,data:t}),e.persist()})),this.events.on(Ri,(function(t){var n=Ri;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,data:t}),e.persist()})),this.events.on(Pi,(function(t){var n=Pi;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,data:t}),e.persist()}))}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Dt("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),n}(H),ha=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var s;return(0,o.Z)(this,n),(s=t.call(this,e,r)).projectId=e,s.logger=r,s.name=Ni,s.initialized=!1,s.init=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=at()||!ot(),e.t0){e.next=5;break}return s.verifyUrl=(null===t||void 0===t?void 0:t.verifyUrl)||ji,e.next=5,s.createIframe();case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.register=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=s.initialized,e.t0){e.next=4;break}return e.next=4,s.init();case 4:if(!s.iframe){e.next=6;break}try{null==(n=s.iframe.contentWindow)||n.postMessage(t.attestationId,s.verifyUrl),s.logger.info("postMessage sent: ".concat(t.attestationId," ").concat(s.verifyUrl))}catch(r){}case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.resolve=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s.isDevEnv){e.next=2;break}return e.abrupt("return","");case 2:return s.logger.info("resolving attestation: ".concat(t.attestationId)),r=s.startAbortTimer(x.FIVE_SECONDS),e.next=6,fetch("".concat(s.verifyUrl,"/attestation/").concat(t.attestationId),{signal:s.abortController.signal});case 6:if(a=e.sent,clearTimeout(r),200!==a.status){e.next=20;break}return e.next=11,a.json();case 11:if(e.t1=n=e.sent,null!=e.t1){e.next=16;break}e.t2=void 0,e.next=17;break;case 16:e.t2=n.origin;case 17:e.t0=e.t2,e.next=21;break;case 20:e.t0="";case 21:return e.abrupt("return",e.t0);case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.createIframe=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.race([new Promise((function(e,t){if(document.getElementById(Ni))return e();var n=document.createElement("iframe");n.setAttribute("id",Ni),n.setAttribute("src","".concat(s.verifyUrl,"/").concat(s.projectId)),n.style.display="none",n.addEventListener("load",(function(){s.initialized=!0,e()})),n.addEventListener("error",(function(e){t(e)})),document.body.append(n),s.iframe=n})),new Promise((function(e){setTimeout((function(){return e("iframe load timeout")}),(0,x.toMiliseconds)(x.ONE_SECOND/2))}))]);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),s.logger.error("Verify iframe failed to load: ".concat(s.verifyUrl)),s.logger.error(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])}))),s.logger=(0,N.generateChildLogger)(r,s.name),s.verifyUrl=ji,s.abortController=new AbortController,s.isDevEnv=it()&&{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/6hnvSmry5GBrjanXK4WTHbqjFKTqBwcodwY8QnQU3ojt",REACT_APP_PORTIS_ID:"",REACT_APP_FORTMATIC_KEY:"",REACT_APP_GOOGLE_ANALYTICS_ID:"G-8RHNLJ21N1"}.IS_VITEST,s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"startAbortTimer",value:function(e){var t=this;return setTimeout((function(){return t.abortController.abort()}),(0,x.toMiliseconds)(e))}}]),n}(q),ma=Object.defineProperty,va=Object.getOwnPropertySymbols,ya=Object.prototype.hasOwnProperty,ba=Object.prototype.propertyIsEnumerable,ga=function(e,t,n){return t in e?ma(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},wa=function(e,t){for(var n in t||(t={}))ya.call(t,n)&&ga(e,n,t[n]);if(va){var r,i=(0,l.Z)(va(t));try{for(i.s();!(r=i.n()).done;){n=r.value;ba.call(t,n)&&ga(e,n,t[n])}}catch(a){i.e(a)}finally{i.f()}}return e},xa=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e){var r;(0,o.Z)(this,n),(r=t.call(this,e)).protocol="wc",r.version=2,r.name=Xr,r.events=new f.EventEmitter,r.initialized=!1,r.on=function(e,t){return r.events.on(e,t)},r.once=function(e,t){return r.events.once(e,t)},r.off=function(e,t){return r.events.off(e,t)},r.removeListener=function(e,t){return r.events.removeListener(e,t)},r.projectId=null===e||void 0===e?void 0:e.projectId,r.relayUrl=(null===e||void 0===e?void 0:e.relayUrl)||ai;var i=typeof(null===e||void 0===e?void 0:e.logger)<"u"&&"string"!=typeof(null===e||void 0===e?void 0:e.logger)?e.logger:(0,N.pino)((0,N.getDefaultLoggerOptions)({level:(null===e||void 0===e?void 0:e.logger)||ei}));return r.logger=(0,N.generateChildLogger)(i,r.name),r.heartbeat=new M.HeartBeat,r.crypto=new Di((0,C.Z)(r),r.logger,null===e||void 0===e?void 0:e.keychain),r.history=new da((0,C.Z)(r),r.logger),r.expirer=new pa((0,C.Z)(r),r.logger),r.storage=null!=e&&e.storage?e.storage:new R.ZP(wa(wa({},ti),null===e||void 0===e?void 0:e.storageOptions)),r.relayer=new ra({core:(0,C.Z)(r),logger:r.logger,relayUrl:r.relayUrl,projectId:r.projectId}),r.pairing=new fa((0,C.Z)(r),r.logger),r.verify=new ha(r.projectId||"",r.logger),r}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"start",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.initialized,e.t0){e.next=4;break}return e.next=4,this.initialize();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"initialize",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.trace("Initialized"),e.prev=1,e.next=4,this.crypto.init();case 4:return e.next=6,this.history.init();case 6:return e.next=8,this.expirer.init();case 8:return e.next=10,this.relayer.init();case 10:return e.next=12,this.heartbeat.init();case 12:return e.next=14,this.pairing.init();case 14:this.initialized=!0,this.logger.info("Core Initialization Success"),e.next=21;break;case 18:throw e.prev=18,e.t0=e.catch(1),this.logger.warn("Core Initialization Failure at epoch ".concat(Date.now()),e.t0),this.logger.error(e.t0.message),e.t0;case 21:case"end":return e.stop()}}),e,this,[[1,18]])})));return function(){return e.apply(this,arguments)}}()}],[{key:"init",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var r,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new n(t),e.next=3,r.initialize();case 3:return e.next=5,r.crypto.getClientId();case 5:return a=e.sent,e.next=8,r.storage.setItem("WALLETCONNECT_CLIENT_ID",a);case 8:return e.abrupt("return",r);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(L),ka=xa,Aa="client",Ea="".concat("wc","@").concat(2,":").concat(Aa,":"),_a=Aa,Ta="error",Sa="WALLETCONNECT_DEEPLINK_CHOICE",Ca="Proposal expired",Oa=x.SEVEN_DAYS,Ia={wc_sessionPropose:{req:{ttl:x.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:x.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:x.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:x.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:x.ONE_DAY,prompt:!1,tag:1104},res:{ttl:x.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:x.ONE_DAY,prompt:!1,tag:1106},res:{ttl:x.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:x.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:x.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:x.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:x.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:x.ONE_DAY,prompt:!1,tag:1112},res:{ttl:x.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:x.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:x.THIRTY_SECONDS,prompt:!1,tag:1115}}},Pa={min:x.FIVE_MINUTES,max:x.SEVEN_DAYS},Ra="idle",Ma="active",Na=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"],ja=Object.defineProperty,La=Object.defineProperties,Da=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,Ua=Object.prototype.hasOwnProperty,Fa=Object.prototype.propertyIsEnumerable,Za=function(e,t,n){return t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},za=function(e,t){for(var n in t||(t={}))Ua.call(t,n)&&Za(e,n,t[n]);if(Ba){var r,i=(0,l.Z)(Ba(t));try{for(i.s();!(r=i.n()).done;){n=r.value;Fa.call(t,n)&&Za(e,n,t[n])}}catch(a){i.e(a)}finally{i.f()}}return e},Ha=function(e,t){return La(e,Da(t))},qa=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e){var r;return(0,o.Z)(this,n),(r=t.call(this,e)).name="engine",r.events=new(d()),r.initialized=!1,r.ignoredPayloadTypes=[Ne],r.requestQueue={state:Ra,requests:[]},r.requestQueueDelay=x.ONE_SECOND,r.init=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=r.initialized,e.t0){e.next=9;break}return e.next=4,r.cleanup();case 4:r.registerRelayerEvents(),r.registerExpirerEvents(),r.client.core.pairing.register({methods:Object.keys(Ia)}),r.initialized=!0,setTimeout((function(){r.requestQueue.requests=r.getPendingSessionRequests(),r.processRequestQueue()}),(0,x.toMiliseconds)(r.requestQueueDelay));case 9:case"end":return e.stop()}}),e)}))),r.connect=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,o,s,u,c,l,f,d,p,h,m,v,y,b,g,w,k,A,E,_,T,S;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),n=Ha(za({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}}),e.next=4,r.isValidConnect(n);case 4:if(o=n.pairingTopic,s=n.requiredNamespaces,u=n.optionalNamespaces,c=n.sessionProperties,l=n.relays,p=!1,(f=o)&&(p=r.client.core.pairing.pairings.get(f).active),f&&p){e.next=13;break}return e.next=9,r.client.core.pairing.create();case 9:h=e.sent,m=h.topic,v=h.uri,f=m,d=v;case 13:return e.next=15,r.client.core.crypto.generateKeyPair();case 15:if(y=e.sent,b=za({requiredNamespaces:s,optionalNamespaces:u,relays:null!==l&&void 0!==l?l:[{protocol:"irn"}],proposer:{publicKey:y,metadata:r.client.metadata}},c&&{sessionProperties:c}),g=pt(x.FIVE_MINUTES,Ca),w=g.reject,k=g.resolve,A=g.done,r.events.once(gt("session_connect"),function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.error,a=t.session,!n){e.next=5;break}w(n),e.next=17;break;case 5:if(!a){e.next=17;break}return a.self.publicKey=y,o=Ha(za({},a),{requiredNamespaces:a.requiredNamespaces,optionalNamespaces:a.optionalNamespaces}),e.next=10,r.client.session.set(a.topic,o);case 10:return e.next=12,r.setExpiry(a.topic,a.expiry);case 12:if(e.t0=f,!e.t0){e.next=16;break}return e.next=16,r.client.core.pairing.updateMetadata({topic:f,metadata:a.peer.metadata});case 16:k(o);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f){e.next=24;break}throw E=Dt("NO_MATCHING_KEY","connect() pairing topic: ".concat(f)),_=E.message,new Error(_);case 24:return e.next=26,r.sendRequest(f,"wc_sessionPropose",b);case 26:return T=e.sent,S=yt(x.FIVE_MINUTES),e.next=30,r.setProposal(T,za({id:T,expiry:S},b));case 30:return e.abrupt("return",{uri:d,approval:A});case 31:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.pair=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.client.core.pairing.pair(t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.approve=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c,l,f,d,p,h,m,v,y;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidApprove(t);case 3:return n=t.id,a=t.relayProtocol,o=t.namespaces,s=t.sessionProperties,u=r.client.proposal.get(n),c=u.pairingTopic,l=u.proposer,f=u.requiredNamespaces,d=u.optionalNamespaces,c=c||"",Ft(f)||(f=Nt(o,"approve()")),e.next=8,r.client.core.crypto.generateKeyPair();case 8:return p=e.sent,h=l.publicKey,e.next=12,r.client.core.crypto.generateSharedKey(p,h);case 12:if(m=e.sent,e.t0=c&&n,!e.t0){e.next=23;break}return e.next=17,r.client.core.pairing.updateMetadata({topic:c,metadata:l.metadata});case 17:return e.next=19,r.sendResult(n,c,{relay:{protocol:null!==a&&void 0!==a?a:"irn"},responderPublicKey:p});case 19:return e.next=21,r.client.proposal.delete(n,Bt("USER_DISCONNECTED"));case 21:return e.next=23,r.client.core.pairing.activate({topic:c});case 23:return v=za({relay:{protocol:null!==a&&void 0!==a?a:"irn"},namespaces:o,requiredNamespaces:f,optionalNamespaces:d,pairingTopic:c,controller:{publicKey:p,metadata:r.client.metadata},expiry:yt(Oa)},s&&{sessionProperties:s}),e.next=26,r.client.core.relayer.subscribe(m);case 26:return e.next=28,r.sendRequest(m,"wc_sessionSettle",v);case 28:return y=Ha(za({},v),{topic:m,pairingTopic:c,acknowledged:!1,self:v.controller,peer:{publicKey:l.publicKey,metadata:l.metadata},controller:p}),e.next=31,r.client.session.set(m,y);case 31:return e.next=33,r.setExpiry(m,yt(Oa));case 33:return e.abrupt("return",{topic:m,acknowledged:function(){return new Promise((function(e){return setTimeout((function(){return e(r.client.session.get(m))}),500)}))}});case 34:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.reject=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidReject(t);case 3:if(n=t.id,a=t.reason,o=r.client.proposal.get(n),s=o.pairingTopic,e.t0=s,!e.t0){e.next=10;break}return e.next=8,r.sendError(n,s,a);case 8:return e.next=10,r.client.proposal.delete(n,Bt("USER_DISCONNECTED"));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.update=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidUpdate(t);case 3:return n=t.topic,a=t.namespaces,e.next=7,r.sendRequest(n,"wc_sessionUpdate",{namespaces:a});case 7:return o=e.sent,s=pt(),u=s.done,c=s.resolve,l=s.reject,r.events.once(gt("session_update",o),(function(e){var t=e.error;t?l(t):c()})),e.next=15,r.client.session.update(n,{namespaces:a});case 15:return e.abrupt("return",{acknowledged:u});case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.extend=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidExtend(t);case 3:return n=t.topic,e.next=6,r.sendRequest(n,"wc_sessionExtend",{});case 6:return a=e.sent,o=pt(),s=o.done,u=o.resolve,c=o.reject,r.events.once(gt("session_extend",a),(function(e){var t=e.error;t?c(t):u()})),e.next=14,r.setExpiry(n,yt(Oa));case 14:return e.abrupt("return",{acknowledged:s});case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.request=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c,l,f,d,p;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidRequest(t);case 3:return n=t.chainId,a=t.request,o=t.topic,s=t.expiry,e.next=9,r.sendRequest(o,"wc_sessionRequest",{request:a,chainId:n},s);case 9:return u=e.sent,c=pt(s),l=c.done,f=c.resolve,d=c.reject,r.events.once(gt("session_request",u),(function(e){var t=e.error,n=e.result;t?d(t):f(n)})),r.client.events.emit("session_request_sent",{topic:o,request:a,chainId:n,id:u}),e.next=17,r.client.core.storage.getItem(Sa);case 17:return p=e.sent,wt({id:u,topic:o,wcDeepLink:p}),e.next=21,l();case 21:return e.abrupt("return",e.sent);case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.respond=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidRespond(t);case 3:if(n=t.topic,a=t.response,o=a.id,!(0,hn.isJsonRpcResult)(a)){e.next=9;break}return e.next=7,r.sendResult(o,n,a.result);case 7:e.next=13;break;case 9:if(e.t0=(0,hn.isJsonRpcError)(a),!e.t0){e.next=13;break}return e.next=13,r.sendError(o,n,a.error);case 13:r.cleanupAfterResponse(t);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.ping=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidPing(t);case 3:if(n=t.topic,!r.client.session.keys.includes(n)){e.next=17;break}return e.next=7,r.sendRequest(n,"wc_sessionPing",{});case 7:return a=e.sent,o=pt(),s=o.done,u=o.resolve,c=o.reject,r.events.once(gt("session_ping",a),(function(e){var t=e.error;t?c(t):u()})),e.next=15,s();case 15:e.next=21;break;case 17:if(e.t0=r.client.core.pairing.pairings.keys.includes(n),!e.t0){e.next=21;break}return e.next=21,r.client.core.pairing.ping({topic:n});case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.emit=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidEmit(t);case 3:return n=t.topic,a=t.event,o=t.chainId,e.next=6,r.sendRequest(n,"wc_sessionEvent",{event:a,chainId:o});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.disconnect=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidDisconnect(t);case 3:if(n=t.topic,!r.client.session.keys.includes(n)){e.next=13;break}return a=(0,hn.getBigIntRpcId)().toString(),s=function e(t){(null===t||void 0===t?void 0:t.id.toString())===a&&(r.client.core.relayer.events.removeListener(ui,e),o())},e.next=9,Promise.all([new Promise((function(e){o=e,r.client.core.relayer.on(ui,s)})),r.sendRequest(n,"wc_sessionDelete",Bt("USER_DISCONNECTED"),void 0,a)]);case 9:return e.next=11,r.deleteSession(n);case 11:e.next=15;break;case 13:return e.next=15,r.client.core.pairing.disconnect({topic:n});case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.find=function(e){return r.isInitialized(),r.client.session.getAll().filter((function(t){return function(e,t){var n=t.requiredNamespaces,r=Object.keys(e.namespaces),i=Object.keys(n),a=!0;return!!lt(i,r)&&(r.forEach((function(t){var r=e.namespaces[t],i=r.accounts,o=r.methods,s=r.events,u=Mt(i),c=n[t];(!lt(Ce(t,c),u)||!lt(c.methods,o)||!lt(c.events,s))&&(a=!1)})),a)}(t,e)}))},r.getPendingSessionRequests=function(){return r.isInitialized(),r.client.pendingRequest.getAll()},r.cleanupDuplicatePairings=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.pairingTopic){e.next=14;break}if(e.prev=1,n=r.client.core.pairing.pairings.get(t.pairingTopic),a=r.client.core.pairing.pairings.getAll().filter((function(e){var r,i;return(null==(r=e.peerMetadata)?void 0:r.url)&&(null==(i=e.peerMetadata)?void 0:i.url)===t.peer.metadata.url&&e.topic&&e.topic!==n.topic})),0!==a.length){e.next=5;break}return e.abrupt("return");case 5:return r.client.logger.info("Cleaning up ".concat(a.length," duplicate pairing(s)")),e.next=8,Promise.all(a.map((function(e){return r.client.core.pairing.disconnect({topic:e.topic})})));case 8:r.client.logger.info("Duplicate pairings clean up finished"),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),r.client.logger.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t){return e.apply(this,arguments)}}(),r.deleteSession=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.client.session.get(t),o=a.self,e.next=3,r.client.core.relayer.unsubscribe(t);case 3:if(r.client.session.delete(t,Bt("USER_DISCONNECTED")),e.t0=r.client.core.crypto.keychain.has(o.publicKey),!e.t0){e.next=8;break}return e.next=8,r.client.core.crypto.deleteKeyPair(o.publicKey);case 8:if(e.t1=r.client.core.crypto.keychain.has(t),!e.t1){e.next=12;break}return e.next=12,r.client.core.crypto.deleteSymKey(t);case 12:n||r.client.core.expirer.del(t),r.client.core.storage.removeItem(Sa).catch((function(e){return r.client.logger.warn(e)}));case 14:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.deleteProposal=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([r.client.proposal.delete(t,Bt("USER_DISCONNECTED")),n?Promise.resolve():r.client.core.expirer.del(t)]);case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.deletePendingSessionRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o=arguments;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=o.length>2&&void 0!==o[2]&&o[2],e.next=3,Promise.all([r.client.pendingRequest.delete(t,n),a?Promise.resolve():r.client.core.expirer.del(t)]);case 3:r.requestQueue.requests=r.requestQueue.requests.filter((function(e){return e.id!==t})),a&&(r.requestQueue.state=Ra);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.setExpiry=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=r.client.session.keys.includes(t),!e.t0){e.next=4;break}return e.next=4,r.client.session.update(t,{expiry:n});case 4:r.client.core.expirer.set(t,n);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.setProposal=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.client.proposal.set(t,n);case 2:r.client.core.expirer.set(t,n.expiry);case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.setPendingSessionRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Ia.wc_sessionRequest.req.ttl,a=t.id,o=t.topic,s=t.params,e.next=3,r.client.pendingRequest.set(a,{id:a,topic:o,params:s});case 3:n&&r.client.core.expirer.set(a,yt(n));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.sendRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,a,o,s){var u,c,l,f;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=(0,hn.formatJsonRpcRequest)(n,a),!ot()||!Na.includes(n)){e.next=5;break}return c=Ze(JSON.stringify(u)),e.next=5,r.client.core.verify.register({attestationId:c});case 5:return e.next=7,r.client.core.crypto.encode(t,u);case 7:return l=e.sent,f=Ia[n].req,e.abrupt("return",(o&&(f.ttl=o),s&&(f.id=s),r.client.core.history.set(t,u),r.client.core.relayer.publish(t,l,f),u.id));case 10:case"end":return e.stop()}}),e)})));return function(t,n,r,i,a){return e.apply(this,arguments)}}(),r.sendResult=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,a){var o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(0,hn.formatJsonRpcResult)(t,a),e.next=3,r.client.core.crypto.encode(n,o);case 3:return s=e.sent,e.next=6,r.client.core.history.get(n,t);case 6:return u=e.sent,c=Ia[u.request.method].res,r.client.core.relayer.publish(n,s,c),e.next=11,r.client.core.history.resolve(o);case 11:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),r.sendError=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n,a){var o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(0,hn.formatJsonRpcError)(t,a),e.next=3,r.client.core.crypto.encode(n,o);case 3:return s=e.sent,e.next=6,r.client.core.history.get(n,t);case 6:return u=e.sent,c=Ia[u.request.method].res,r.client.core.relayer.publish(n,s,c),e.next=11,r.client.core.history.resolve(o);case 11:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),r.cleanup=(0,a.Z)((0,i.Z)().mark((function e(){var t,n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],n=[],r.client.session.getAll().forEach((function(e){bt(e.expiry)&&t.push(e.topic)})),r.client.proposal.getAll().forEach((function(e){bt(e.expiry)&&n.push(e.id)})),e.next=5,Promise.all([].concat((0,u.Z)(t.map((function(e){return r.deleteSession(e)}))),(0,u.Z)(n.map((function(e){return r.deleteProposal(e)})))));case 5:case"end":return e.stop()}}),e)}))),r.onRelayEventRequest=function(e){var t=e.topic,n=e.payload,i=n.method;switch(i){case"wc_sessionPropose":return r.onSessionProposeRequest(t,n);case"wc_sessionSettle":return r.onSessionSettleRequest(t,n);case"wc_sessionUpdate":return r.onSessionUpdateRequest(t,n);case"wc_sessionExtend":return r.onSessionExtendRequest(t,n);case"wc_sessionPing":return r.onSessionPingRequest(t,n);case"wc_sessionDelete":return r.onSessionDeleteRequest(t,n);case"wc_sessionRequest":return r.onSessionRequest(t,n);case"wc_sessionEvent":return r.onSessionEventRequest(t,n);default:return r.client.logger.info("Unsupported request method ".concat(i))}},r.onRelayEventResponse=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,a=t.payload,e.next=4,r.client.core.history.get(n,a.id);case 4:o=e.sent.request.method,e.t0=o,e.next="wc_sessionPropose"===e.t0?8:"wc_sessionSettle"===e.t0?9:"wc_sessionUpdate"===e.t0?10:"wc_sessionExtend"===e.t0?11:"wc_sessionPing"===e.t0?12:"wc_sessionRequest"===e.t0?13:14;break;case 8:return e.abrupt("return",r.onSessionProposeResponse(n,a));case 9:return e.abrupt("return",r.onSessionSettleResponse(n,a));case 10:return e.abrupt("return",r.onSessionUpdateResponse(n,a));case 11:return e.abrupt("return",r.onSessionExtendResponse(n,a));case 12:return e.abrupt("return",r.onSessionPingResponse(n,a));case 13:return e.abrupt("return",r.onSessionRequestResponse(n,a));case 14:return e.abrupt("return",r.client.logger.info("Unsupported response method ".concat(o)));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.onRelayEventUnknownPayload=function(e){var t=e.topic,n=Dt("MISSING_OR_INVALID","Decoded payload on topic ".concat(t," is not identifiable as a JSON-RPC request or a response.")).message;throw new Error(n)},r.onSessionProposeRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o,s,u,c,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.params,o=n.id,e.prev=1,r.isValidConnect(za({},n.params)),s=yt(x.FIVE_MINUTES),u=za({id:o,pairingTopic:t,expiry:s},a),e.next=6,r.setProposal(o,u);case 6:return c=Ze(JSON.stringify(n)),e.next=9,r.getVerifyContext(c,u.proposer.metadata);case 9:l=e.sent,r.client.events.emit("session_proposal",{id:o,params:u,verifyContext:l}),e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(1),e.next=17,r.sendError(o,t,e.t0);case 17:r.client.logger.error(e.t0);case 18:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionProposeResponse=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o,s,u,c,l,f;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.id,!(0,hn.isJsonRpcResult)(n)){e.next=22;break}return o=n.result,r.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o}),s=r.client.proposal.get(a),r.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s}),u=s.proposer.publicKey,r.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u}),c=o.responderPublicKey,r.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c}),e.next=12,r.client.core.crypto.generateSharedKey(u,c);case 12:return l=e.sent,r.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:l}),e.next=16,r.client.core.relayer.subscribe(l);case 16:return f=e.sent,r.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),e.next=20,r.client.core.pairing.activate({topic:t});case 20:e.next=27;break;case 22:if(e.t0=(0,hn.isJsonRpcError)(n),!e.t0){e.next=27;break}return e.next=26,r.client.proposal.delete(a,Bt("USER_DISCONNECTED"));case 26:r.events.emit(gt("session_connect"),{error:n.error});case 27:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionSettleRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o,s,u,c,l,f,d,p,h,m,v;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.id,o=n.params,e.prev=1,r.isValidSessionSettleRequest(o),s=n.params,u=s.relay,c=s.controller,l=s.expiry,f=s.namespaces,d=s.requiredNamespaces,p=s.optionalNamespaces,h=s.sessionProperties,m=s.pairingTopic,v=za({topic:t,relay:u,expiry:l,namespaces:f,acknowledged:!0,pairingTopic:m,requiredNamespaces:d,optionalNamespaces:p,controller:c.publicKey,self:{publicKey:"",metadata:r.client.metadata},peer:{publicKey:c.publicKey,metadata:c.metadata}},h&&{sessionProperties:h}),e.next=6,r.sendResult(n.id,t,!0);case 6:r.events.emit(gt("session_connect"),{session:v}),r.cleanupDuplicatePairings(v),e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,r.sendError(a,t,e.t0);case 14:r.client.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionSettleResponse=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.id,!(0,hn.isJsonRpcResult)(n)){e.next=7;break}return e.next=4,r.client.session.update(t,{acknowledged:!0});case 4:r.events.emit(gt("session_approve",a),{}),e.next=12;break;case 7:if(e.t0=(0,hn.isJsonRpcError)(n),!e.t0){e.next=12;break}return e.next=11,r.client.session.delete(t,Bt("USER_DISCONNECTED"));case 11:r.events.emit(gt("session_approve",a),{error:n.error});case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionUpdateRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.params,o=n.id,e.prev=1,r.isValidUpdate(za({topic:t},a)),e.next=5,r.client.session.update(t,{namespaces:a.namespaces});case 5:return e.next=7,r.sendResult(o,t,!0);case 7:r.client.events.emit("session_update",{id:o,topic:t,params:a}),e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,r.sendError(o,t,e.t0);case 14:r.client.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionUpdateResponse=function(e,t){var n=t.id;(0,hn.isJsonRpcResult)(t)?r.events.emit(gt("session_update",n),{}):(0,hn.isJsonRpcError)(t)&&r.events.emit(gt("session_update",n),{error:t.error})},r.onSessionExtendRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.id,e.prev=1,r.isValidExtend({topic:t}),e.next=5,r.setExpiry(t,yt(Oa));case 5:return e.next=7,r.sendResult(a,t,!0);case 7:r.client.events.emit("session_extend",{id:a,topic:t}),e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,r.sendError(a,t,e.t0);case 14:r.client.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionExtendResponse=function(e,t){var n=t.id;(0,hn.isJsonRpcResult)(t)?r.events.emit(gt("session_extend",n),{}):(0,hn.isJsonRpcError)(t)&&r.events.emit(gt("session_extend",n),{error:t.error})},r.onSessionPingRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.id,e.prev=1,r.isValidPing({topic:t}),e.next=5,r.sendResult(a,t,!0);case 5:r.client.events.emit("session_ping",{id:a,topic:t}),e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(1),e.next=12,r.sendError(a,t,e.t0);case 12:r.client.logger.error(e.t0);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionPingResponse=function(e,t){var n=t.id;setTimeout((function(){(0,hn.isJsonRpcResult)(t)?r.events.emit(gt("session_ping",n),{}):(0,hn.isJsonRpcError)(t)&&r.events.emit(gt("session_ping",n),{error:t.error})}),500)},r.onSessionDeleteRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.id,e.prev=1,r.isValidDisconnect({topic:t,reason:n.params}),e.next=5,Promise.all([new Promise((function(e){r.client.core.relayer.once(hi,(0,a.Z)((0,i.Z)().mark((function n(){return(0,i.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=e,n.next=3,r.deleteSession(t);case 3:n.t1=n.sent,(0,n.t0)(n.t1);case 5:case"end":return n.stop()}}),n)}))))})),r.sendResult(o,t,!0)]);case 5:r.client.events.emit("session_delete",{id:o,topic:t}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),r.client.logger.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.id,o=n.params,e.prev=1,r.isValidRequest(za({topic:t},o)),e.next=5,r.setPendingSessionRequest({id:a,topic:t,params:o});case 5:return r.addRequestToQueue({id:a,topic:t,params:o}),e.next=8,r.processRequestQueue();case 8:e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,r.sendError(a,t,e.t0);case 14:r.client.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionRequestResponse=function(e,t){var n=t.id;(0,hn.isJsonRpcResult)(t)?r.events.emit(gt("session_request",n),{result:t.result}):(0,hn.isJsonRpcError)(t)&&r.events.emit(gt("session_request",n),{error:t.error})},r.onSessionEventRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.id,o=n.params,e.prev=1,r.isValidEmit(za({topic:t},o)),r.client.events.emit("session_event",{id:a,topic:t,params:o}),e.next=10;break;case 5:return e.prev=5,e.t0=e.catch(1),e.next=9,r.sendError(a,t,e.t0);case 9:r.client.logger.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[1,5]])})));return function(t,n){return e.apply(this,arguments)}}(),r.addRequestToQueue=function(e){r.requestQueue.requests.push(e)},r.cleanupAfterResponse=function(e){r.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout((function(){r.requestQueue.state=Ra,r.processRequestQueue()}),(0,x.toMiliseconds)(r.requestQueueDelay))},r.processRequestQueue=(0,a.Z)((0,i.Z)().mark((function e(){var t,n,a,o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.requestQueue.state!==Ma){e.next=3;break}return r.client.logger.info("session request queue is already active."),e.abrupt("return");case 3:if(t=r.requestQueue.requests[0]){e.next=7;break}return r.client.logger.info("session request queue is empty."),e.abrupt("return");case 7:return e.prev=7,n=t.id,a=t.topic,o=t.params,s=Ze(JSON.stringify({id:n,params:o})),u=r.client.session.get(a),e.next=15,r.getVerifyContext(s,u.peer.metadata);case 15:c=e.sent,r.requestQueue.state=Ma,r.client.events.emit("session_request",{id:n,topic:a,params:o,verifyContext:c}),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(7),r.client.logger.error(e.t0);case 22:case"end":return e.stop()}}),e,null,[[7,19]])}))),r.isValidConnect=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c,l,f,d;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","connect() params: ".concat(JSON.stringify(t))),a=n.message,new Error(a);case 3:if(o=t.pairingTopic,s=t.requiredNamespaces,u=t.optionalNamespaces,c=t.sessionProperties,l=t.relays,e.t0=Zt(o),e.t0){e.next=8;break}return e.next=8,r.isValidPairingTopic(o);case 8:if($t(l,!0)){e.next=11;break}throw f=Dt("MISSING_OR_INVALID","connect() relays: ".concat(l)),d=f.message,new Error(d);case 11:!Zt(s)&&0!==Ft(s)&&r.validateNamespaces(s,"requiredNamespaces"),!Zt(u)&&0!==Ft(u)&&r.validateNamespaces(u,"optionalNamespaces"),Zt(c)||r.validateSessionProps(c,"sessionProperties");case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.validateNamespaces=function(e,t){var n=function(e,t,n){var r=null;if(e&&Ft(e)){var i=Jt(e,t);i&&(r=i);var a=Yt(e,t,n);a&&(r=a)}else r=Dt("MISSING_OR_INVALID","".concat(t,", ").concat(n," should be an object with data"));return r}(e,"connect()",t);if(n)throw new Error(n.message)},r.isValidApprove=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c,l,f,d;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=2;break}throw new Error(Dt("MISSING_OR_INVALID","approve() params: ".concat(t)).message);case 2:return n=t.id,a=t.namespaces,o=t.relayProtocol,s=t.sessionProperties,e.next=5,r.isValidProposalId(n);case 5:if(u=r.client.proposal.get(n),!(c=Qt(a,"approve()"))){e.next=8;break}throw new Error(c.message);case 8:if(!(l=ln(u.requiredNamespaces,a,"approve()"))){e.next=11;break}throw new Error(l.message);case 11:if(zt(o,!0)){e.next=14;break}throw f=Dt("MISSING_OR_INVALID","approve() relayProtocol: ".concat(o)),d=f.message,new Error(d);case 14:Zt(s)||r.validateSessionProps(s,"sessionProperties");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidReject=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","reject() params: ".concat(t)),a=n.message,new Error(a);case 3:return o=t.id,s=t.reason,e.next=6,r.isValidProposalId(o);case 6:if(nn(s)){e.next=9;break}throw u=Dt("MISSING_OR_INVALID","reject() reason: ".concat(JSON.stringify(s))),c=u.message,new Error(c);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidSessionSettleRequest=function(e){if(!tn(e)){var t=Dt("MISSING_OR_INVALID","onSessionSettleRequest() params: ".concat(e)).message;throw new Error(t)}var n=e.relay,r=e.controller,i=e.namespaces,a=e.expiry;if(!Xt(n)){var o=Dt("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string").message;throw new Error(o)}var s=function(e,t){var n=null;return zt(null===e||void 0===e?void 0:e.publicKey,!1)||(n=Dt("MISSING_OR_INVALID","".concat(t," controller public key should be a string"))),n}(r,"onSessionSettleRequest()");if(s)throw new Error(s.message);var u=Qt(i,"onSessionSettleRequest()");if(u)throw new Error(u.message);if(bt(a)){var c=Dt("EXPIRED","onSessionSettleRequest()").message;throw new Error(c)}},r.isValidUpdate=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","update() params: ".concat(t)),a=n.message,new Error(a);case 3:return o=t.topic,s=t.namespaces,e.next=6,r.isValidSessionTopic(o);case 6:if(u=r.client.session.get(o),!(c=Qt(s,"update()"))){e.next=9;break}throw new Error(c.message);case 9:if(!(l=ln(u.requiredNamespaces,s,"update()"))){e.next=12;break}throw new Error(l.message);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidExtend=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","extend() params: ".concat(t)),a=n.message,new Error(a);case 3:return o=t.topic,e.next=6,r.isValidSessionTopic(o);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidRequest=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c,l,f,d,p,h,m,v,y,b,g;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","request() params: ".concat(t)),a=n.message,new Error(a);case 3:return o=t.topic,s=t.request,u=t.chainId,c=t.expiry,e.next=6,r.isValidSessionTopic(o);case 6:if(l=r.client.session.get(o),sn(f=l.namespaces,u)){e.next=10;break}throw d=Dt("MISSING_OR_INVALID","request() chainId: ".concat(u)),p=d.message,new Error(p);case 10:if(rn(s)){e.next=13;break}throw h=Dt("MISSING_OR_INVALID","request() ".concat(JSON.stringify(s))),m=h.message,new Error(m);case 13:if(un(f,u,s.method)){e.next=16;break}throw v=Dt("MISSING_OR_INVALID","request() method: ".concat(s.method)),y=v.message,new Error(y);case 16:if(!c||dn(c,Pa)){e.next=19;break}throw b=Dt("MISSING_OR_INVALID","request() expiry: ".concat(c,". Expiry must be a number (in seconds) between ").concat(Pa.min," and ").concat(Pa.max)),g=b.message,new Error(g);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidRespond=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","respond() params: ".concat(t)),a=n.message,new Error(a);case 3:return o=t.topic,s=t.response,e.next=6,r.isValidSessionTopic(o);case 6:if(an(s)){e.next=9;break}throw u=Dt("MISSING_OR_INVALID","respond() response: ".concat(JSON.stringify(s))),c=u.message,new Error(c);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidPing=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","ping() params: ".concat(t)),a=n.message,new Error(a);case 3:return o=t.topic,e.next=6,r.isValidSessionOrPairingTopic(o);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidEmit=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o,s,u,c,l,f,d,p,h,m,v;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","emit() params: ".concat(t)),a=n.message,new Error(a);case 3:return o=t.topic,s=t.event,u=t.chainId,e.next=6,r.isValidSessionTopic(o);case 6:if(c=r.client.session.get(o),sn(l=c.namespaces,u)){e.next=10;break}throw f=Dt("MISSING_OR_INVALID","emit() chainId: ".concat(u)),d=f.message,new Error(d);case 10:if(on(s)){e.next=13;break}throw p=Dt("MISSING_OR_INVALID","emit() event: ".concat(JSON.stringify(s))),h=p.message,new Error(h);case 13:if(cn(l,u,s.name)){e.next=16;break}throw m=Dt("MISSING_OR_INVALID","emit() event: ".concat(JSON.stringify(s))),v=m.message,new Error(v);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidDisconnect=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","disconnect() params: ".concat(t)),a=n.message,new Error(a);case 3:return o=t.topic,e.next=6,r.isValidSessionOrPairingTopic(o);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.getVerifyContext=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={verified:{verifyUrl:n.verifyUrl||"",validation:"UNKNOWN",origin:n.url||""}},e.prev=1,e.next=4,r.client.core.verify.resolve({attestationId:t,verifyUrl:n.verifyUrl});case 4:(o=e.sent)&&(a.verified.origin=o,a.verified.validation=o===n.url?"VALID":"INVALID"),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),r.client.logger.error(e.t0);case 11:return e.abrupt("return",(r.client.logger.info("Verify context: ".concat(JSON.stringify(a))),a));case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),r.validateSessionProps=function(e,t){Object.values(e).forEach((function(e){if(!zt(e,!1)){var n=Dt("MISSING_OR_INVALID","".concat(t," must be in Record format. Received: ").concat(JSON.stringify(e))).message;throw new Error(n)}}))},r}return(0,s.Z)(n,[{key:"isInitialized",value:function(){if(!this.initialized){var e=Dt("NOT_INITIALIZED",this.name).message;throw new Error(e)}}},{key:"registerRelayerEvents",value:function(){var e=this;this.client.core.relayer.on(si,function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){var r,a,o;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.topic,a=n.message,!e.ignoredPayloadTypes.includes(e.client.core.crypto.getPayloadType(a))){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,e.client.core.crypto.decode(r,a);case 5:if(o=t.sent,t.prev=6,!(0,hn.isJsonRpcRequest)(o)){t.next=11;break}e.client.core.history.set(r,o),e.onRelayEventRequest({topic:r,payload:o}),t.next=20;break;case 11:if(!(0,hn.isJsonRpcResponse)(o)){t.next=19;break}return t.next=14,e.client.core.history.resolve(o);case 14:return t.next=16,e.onRelayEventResponse({topic:r,payload:o});case 16:e.client.core.history.delete(r,o.id),t.next=20;break;case 19:e.onRelayEventUnknownPayload({topic:r,payload:o});case 20:t.next=25;break;case 22:t.prev=22,t.t0=t.catch(6),e.client.logger.error(t.t0);case 25:case"end":return t.stop()}}),t,null,[[6,22]])})));return function(e){return t.apply(this,arguments)}}())}},{key:"registerExpirerEvents",value:function(){var e=this;this.client.core.expirer.on(Ri,function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){var r,a,o;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=vt(n.target),a=r.topic,!(o=r.id)||!e.client.pendingRequest.keys.includes(o)){t.next=5;break}return t.next=4,e.deletePendingSessionRequest(o,Dt("EXPIRED"),!0);case 4:return t.abrupt("return",t.sent);case 5:if(!a){t.next=13;break}if(t.t0=e.client.session.keys.includes(a),!t.t0){t.next=11;break}return t.next=10,e.deleteSession(a,!0);case 10:e.client.events.emit("session_expire",{topic:a});case 11:t.next=18;break;case 13:if(t.t1=o,!t.t1){t.next=18;break}return t.next=17,e.deleteProposal(o,!0);case 17:e.client.events.emit("proposal_expire",{id:o});case 18:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"isValidPairingTopic",value:function(e){if(!zt(e,!1)){var t=Dt("MISSING_OR_INVALID","pairing topic should be a string: ".concat(e)).message;throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){var n=Dt("NO_MATCHING_KEY","pairing topic doesn't exist: ".concat(e)).message;throw new Error(n)}if(bt(this.client.core.pairing.pairings.get(e).expiry)){var r=Dt("EXPIRED","pairing topic: ".concat(e)).message;throw new Error(r)}}},{key:"isValidSessionTopic",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r,a,o,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(zt(t,!1)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","session topic should be a string: ".concat(t)),r=n.message,new Error(r);case 3:if(this.client.session.keys.includes(t)){e.next=6;break}throw a=Dt("NO_MATCHING_KEY","session topic doesn't exist: ".concat(t)),o=a.message,new Error(o);case 6:if(!bt(this.client.session.get(t).expiry)){e.next=11;break}return e.next=9,this.deleteSession(t);case 9:throw s=Dt("EXPIRED","session topic: ".concat(t)),u=s.message,new Error(u);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isValidSessionOrPairingTopic",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.client.session.keys.includes(t)){e.next=5;break}return e.next=3,this.isValidSessionTopic(t);case 3:e.next=16;break;case 5:if(!this.client.core.pairing.pairings.keys.includes(t)){e.next=9;break}this.isValidPairingTopic(t),e.next=16;break;case 9:if(!zt(t,!1)){e.next=14;break}throw n=Dt("NO_MATCHING_KEY","session or pairing topic doesn't exist: ".concat(t)),r=n.message,new Error(r);case 14:throw a=Dt("MISSING_OR_INVALID","session or pairing topic should be a string: ".concat(t)),o=a.message,new Error(o);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isValidProposalId",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r,a,o,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(en(t)){e.next=3;break}throw n=Dt("MISSING_OR_INVALID","proposal id should be a number: ".concat(t)),r=n.message,new Error(r);case 3:if(this.client.proposal.keys.includes(t)){e.next=6;break}throw a=Dt("NO_MATCHING_KEY","proposal id doesn't exist: ".concat(t)),o=a.message,new Error(o);case 6:if(!bt(this.client.proposal.get(t).expiry)){e.next=11;break}return e.next=9,this.deleteProposal(t);case 9:throw s=Dt("EXPIRED","proposal id: ".concat(t)),u=s.message,new Error(u);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(W),Va=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var i;return(0,o.Z)(this,n),(i=t.call(this,e,r,"proposal",Ea)).core=e,i.logger=r,i}return(0,s.Z)(n)}(la),Wa=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var i;return(0,o.Z)(this,n),(i=t.call(this,e,r,"session",Ea)).core=e,i.logger=r,i}return(0,s.Z)(n)}(la),Ga=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e,r){var i;return(0,o.Z)(this,n),(i=t.call(this,e,r,"request",Ea,(function(e){return e.id}))).core=e,i.logger=r,i}return(0,s.Z)(n)}(la),Ya=function(e){(0,O.Z)(n,e);var t=(0,I.Z)(n);function n(e){var r;(0,o.Z)(this,n),(r=t.call(this,e)).protocol="wc",r.version=2,r.name=_a,r.events=new f.EventEmitter,r.on=function(e,t){return r.events.on(e,t)},r.once=function(e,t){return r.events.once(e,t)},r.off=function(e,t){return r.events.off(e,t)},r.removeListener=function(e,t){return r.events.removeListener(e,t)},r.removeAllListeners=function(e){return r.events.removeAllListeners(e)},r.connect=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.connect(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.pair=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.pair(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.approve=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.approve(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.reject=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.reject(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.update=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.update(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.extend=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.extend(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.request=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.request(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.respond=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.respond(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.ping=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.ping(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.emit=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.emit(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.disconnect=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.disconnect(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.find=function(e){try{return r.engine.find(e)}catch(t){throw r.logger.error(t.message),t}},r.getPendingSessionRequests=function(){try{return r.engine.getPendingSessionRequests()}catch(e){throw r.logger.error(e.message),e}},r.name=(null===e||void 0===e?void 0:e.name)||_a,r.metadata=(null===e||void 0===e?void 0:e.metadata)||(0,Te.D)()||{name:"",description:"",url:"",icons:[""]};var s=typeof(null===e||void 0===e?void 0:e.logger)<"u"&&"string"!=typeof(null===e||void 0===e?void 0:e.logger)?e.logger:(0,N.pino)((0,N.getDefaultLoggerOptions)({level:(null===e||void 0===e?void 0:e.logger)||Ta}));return r.core=(null===e||void 0===e?void 0:e.core)||new ka(e),r.logger=(0,N.generateChildLogger)(s,r.name),r.session=new Wa(r.core,r.logger),r.proposal=new Va(r.core,r.logger),r.pendingRequest=new Ga(r.core,r.logger),r.engine=new qa((0,C.Z)(r)),r}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"pairing",get:function(){return this.core.pairing.pairings}},{key:"initialize",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.trace("Initialized"),e.prev=1,e.next=4,this.core.start();case 4:return e.next=6,this.session.init();case 6:return e.next=8,this.proposal.init();case 8:return e.next=10,this.pendingRequest.init();case 10:return e.next=12,this.engine.init();case 12:this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success"),e.next=19;break;case 16:throw e.prev=16,e.t0=e.catch(1),this.logger.info("SignClient Initialization Failure"),this.logger.error(e.t0.message),e.t0;case 19:case"end":return e.stop()}}),e,this,[[1,16]])})));return function(){return e.apply(this,arguments)}}()}],[{key:"init",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new n(t),e.next=3,r.initialize();case 3:return e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(V);n(88283),n(7289);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Ka(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.Z)(new Set([].concat((0,u.Z)(e),(0,u.Z)(t))))}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Ja(e){return e.includes(":")}function Qa(e){return Ja(e)?e.split(":")[0]:e}var Xa={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}};function $a(e,t){var n=Xa[e],r=n.message,i=n.code;return{message:t?"".concat(r," ").concat(t):r,code:i}}function eo(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function to(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}var no=n(17507),ro="error",io="".concat("wc","@2:").concat("universal_provider",":"),ao="default_chain_changed",oo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof n.g<"u"?n.g:typeof self<"u"?self:{},so={exports:{}};!function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",o=16,s=32,u=64,c=128,l=256,f=1/0,d=9007199254740991,p=NaN,h=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",s],["partialRight",u],["rearg",l]],v="[object Arguments]",y="[object Array]",b="[object Boolean]",g="[object Date]",w="[object Error]",x="[object Function]",k="[object GeneratorFunction]",A="[object Map]",E="[object Number]",_="[object Object]",T="[object Promise]",S="[object RegExp]",C="[object Set]",O="[object String]",I="[object Symbol]",P="[object WeakMap]",R="[object ArrayBuffer]",M="[object DataView]",N="[object Float32Array]",j="[object Float64Array]",L="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",U="[object Uint8Array]",F="[object Uint8ClampedArray]",Z="[object Uint16Array]",z="[object Uint32Array]",H=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,Y=RegExp(W.source),K=RegExp(G.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,re=RegExp(ne.source),ie=/^\s+/,ae=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,ke="\\ud800-\\udfff",Ae="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Ce="\\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",Oe="['\u2019]",Ie="["+ke+"]",Pe="["+Ce+"]",Re="["+Ae+"]",Me="\\d+",Ne="["+Ee+"]",je="["+_e+"]",Le="[^"+ke+Ce+Me+Ee+_e+Te+"]",De="\\ud83c[\\udffb-\\udfff]",Be="[^"+ke+"]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ze="["+Te+"]",ze="\\u200d",He="(?:"+je+"|"+Le+")",qe="(?:"+Ze+"|"+Le+")",Ve="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",We="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Re+"|"+De+")"+"?",Ye="["+Se+"]?",Ke=Ye+Ge+("(?:"+ze+"(?:"+[Be,Ue,Fe].join("|")+")"+Ye+Ge+")*"),Je="(?:"+[Ne,Ue,Fe].join("|")+")"+Ke,Qe="(?:"+[Be+Re+"?",Re,Ue,Fe,Ie].join("|")+")",Xe=RegExp(Oe,"g"),$e=RegExp(Re,"g"),et=RegExp(De+"(?="+De+")|"+Qe+Ke,"g"),tt=RegExp([Ze+"?"+je+"+"+Ve+"(?="+[Pe,Ze,"$"].join("|")+")",qe+"+"+We+"(?="+[Pe,Ze+He,"$"].join("|")+")",Ze+"?"+He+"+"+Ve,Ze+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Me,Je].join("|"),"g"),nt=RegExp("["+ze+ke+Ae+Se+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["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"],at=-1,ot={};ot[N]=ot[j]=ot[L]=ot[D]=ot[B]=ot[U]=ot[F]=ot[Z]=ot[z]=!0,ot[v]=ot[y]=ot[R]=ot[b]=ot[M]=ot[g]=ot[w]=ot[x]=ot[A]=ot[E]=ot[_]=ot[S]=ot[C]=ot[O]=ot[P]=!1;var st={};st[v]=st[y]=st[R]=st[M]=st[b]=st[g]=st[N]=st[j]=st[L]=st[D]=st[B]=st[A]=st[E]=st[_]=st[S]=st[C]=st[O]=st[I]=st[U]=st[F]=st[Z]=st[z]=!0,st[w]=st[x]=st[P]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,lt=parseInt,ft="object"==typeof oo&&oo&&oo.Object===Object&&oo,dt="object"==typeof self&&self&&self.Object===Object&&self,pt=ft||dt||Function("return this")(),ht=t&&!t.nodeType&&t,mt=ht&&e&&!e.nodeType&&e,vt=mt&&mt.exports===ht,yt=vt&&ft.process,bt=function(){try{return mt&&mt.require&&mt.require("util").types||yt&&yt.binding&&yt.binding("util")}catch(e){}}(),gt=bt&&bt.isArrayBuffer,wt=bt&&bt.isDate,xt=bt&&bt.isMap,kt=bt&&bt.isRegExp,At=bt&&bt.isSet,Et=bt&&bt.isTypedArray;function _t(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Tt(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i-1}function Rt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function tn(e,t){for(var n=e.length;n--&&Zt(t,e[n],0)>-1;);return n}var nn=Wt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"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"}),rn=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+ut[e]}function on(e){return nt.test(e)}function sn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function cn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var mn=function e(t){var ae=(t=null==t?pt:mn.defaults(pt.Object(),t,mn.pick(pt,it))).Array,ke=t.Date,Ae=t.Error,Ee=t.Function,_e=t.Math,Te=t.Object,Se=t.RegExp,Ce=t.String,Oe=t.TypeError,Ie=ae.prototype,Pe=Ee.prototype,Re=Te.prototype,Me=t["__core-js_shared__"],Ne=Pe.toString,je=Re.hasOwnProperty,Le=0,De=function(){var e=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Be=Re.toString,Ue=Ne.call(Te),Fe=pt._,Ze=Se("^"+Ne.call(je).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ze=vt?t.Buffer:n,He=t.Symbol,qe=t.Uint8Array,Ve=ze?ze.allocUnsafe:n,We=un(Te.getPrototypeOf,Te),Ge=Te.create,Ye=Re.propertyIsEnumerable,Ke=Ie.splice,Je=He?He.isConcatSpreadable:n,Qe=He?He.iterator:n,et=He?He.toStringTag:n,nt=function(){try{var e=la(Te,"defineProperty");return e({},"",{}),e}catch(t){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ft=ke&&ke.now!==pt.Date.now&&ke.now,dt=t.setTimeout!==pt.setTimeout&&t.setTimeout,ht=_e.ceil,mt=_e.floor,yt=Te.getOwnPropertySymbols,bt=ze?ze.isBuffer:n,Bt=t.isFinite,Wt=Ie.join,vn=un(Te.keys,Te),yn=_e.max,bn=_e.min,gn=ke.now,wn=t.parseInt,xn=_e.random,kn=Ie.reverse,An=la(t,"DataView"),En=la(t,"Map"),_n=la(t,"Promise"),Tn=la(t,"Set"),Sn=la(t,"WeakMap"),Cn=la(Te,"create"),On=Sn&&new Sn,In={},Pn=La(An),Rn=La(En),Mn=La(_n),Nn=La(Tn),jn=La(Sn),Ln=He?He.prototype:n,Dn=Ln?Ln.valueOf:n,Bn=Ln?Ln.toString:n;function Un(e){if(es(e)&&!Ho(e)&&!(e instanceof Hn)){if(e instanceof zn)return e;if(je.call(e,"__wrapped__"))return Da(e)}return new zn(e)}var Fn=function(){function e(){}return function(t){if(!$o(t))return{};if(Ge)return Ge(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Zn(){}function zn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Hn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,r,i,a,o){var s,u=1&t,c=2&t,l=4&t;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!$o(e))return e;var f=Ho(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&je.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return Ci(e,s)}else{var d=pa(e),p=d==x||d==k;if(Go(e))return ki(e,u);if(d==_||d==v||p&&!a){if(s=c||p?{}:ma(e),!u)return c?function(e,t){return Oi(e,da(e),t)}(e,function(e,t){return e&&Oi(t,Ps(t),e)}(s,e)):function(e,t){return Oi(e,fa(e),t)}(e,rr(s,e))}else{if(!st[d])return a?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case R:return Ai(e);case b:case g:return new r(+e);case M:return function(e,t){var n=t?Ai(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case j:case L:case D:case B:case U:case F:case Z:case z:return Ei(e,n);case A:return new r;case E:case O:return new r(e);case S:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new r;case I:return function(e){return Dn?Te(Dn.call(e)):{}}(e)}}(e,d,u)}}o||(o=new Yn);var h=o.get(e);if(h)return h;o.set(e,s),as(e)?e.forEach((function(n){s.add(sr(n,t,r,n,e,o))})):ts(e)&&e.forEach((function(n,i){s.set(i,sr(n,t,r,i,e,o))}));var m=f?n:(l?c?ra:na:c?Ps:Is)(e);return St(m||e,(function(n,i){m&&(n=e[i=n]),er(s,i,sr(n,t,r,i,e,o))})),s}function ur(e,t,r){var i=r.length;if(null==e)return!i;for(e=Te(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function cr(e,t,i){if("function"!=typeof e)throw new Oe(r);return Oa((function(){e.apply(n,i)}),t)}function lr(e,t,n,r){var i=-1,a=Pt,o=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=Mt(t,Qt(n))),r?(a=Rt,o=!1):t.length>=200&&(a=$t,o=!1,t=new Gn(t));e:for(;++i-1},Vn.prototype.set=function(e,t){var n=this.__data__,r=tr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(En||Vn),string:new qn}},Wn.prototype.delete=function(e){var t=ua(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return ua(this,e).get(e)},Wn.prototype.has=function(e){return ua(this,e).has(e)},Wn.prototype.set=function(e,t){var n=ua(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(e){return this.__data__.set(e,i),this},Gn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new Vn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Vn){var r=n.__data__;if(!En||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this};var fr=Ri(gr),dr=Ri(wr,!0);function pr(e,t){var n=!0;return fr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function hr(e,t,r){for(var i=-1,a=e.length;++i0&&n(s)?t>1?vr(s,t-1,n,r,i):Nt(i,s):r||(i[i.length]=s)}return i}var yr=Mi(),br=Mi(!0);function gr(e,t){return e&&yr(e,t,Is)}function wr(e,t){return e&&br(e,t,Is)}function xr(e,t){return It(t,(function(t){return Jo(e[t])}))}function kr(e,t){for(var r=0,i=(t=bi(t,e)).length;null!=e&&rt}function Tr(e,t){return null!=e&&je.call(e,t)}function Sr(e,t){return null!=e&&t in Te(e)}function Cr(e,t,r){for(var i=r?Rt:Pt,a=e[0].length,o=e.length,s=o,u=ae(o),c=1/0,l=[];s--;){var f=e[s];s&&t&&(f=Mt(f,Qt(t))),c=bn(f.length,c),u[s]=!r&&(t||a>=120&&f.length>=120)?new Gn(s&&f):n}f=e[0];var d=-1,p=u[0];e:for(;++d=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,i=t.length,a={};++r-1;)s!==e&&Ke.call(s,u,1),Ke.call(e,u,1);return e}function Wr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ya(i)?Ke.call(e,i,1):li(e,i)}}return e}function Gr(e,t){return e+mt(xn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Kr(e,t){return Ia(_a(e,t,nu),e+"")}function Jr(e){return Jn(Us(e))}function Qr(e,t){var n=Us(e);return Ma(n,or(t,0,n.length))}function Xr(e,t,r,i){if(!$o(e))return e;for(var a=-1,o=(t=bi(t,e)).length,s=o-1,u=e;null!=u&&++ai?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=ae(i);++r>>1,o=e[a];null!==o&&!ss(o)&&(n?o<=t:o=200){var c=t?null:Yi(e);if(c)return ln(c);o=!1,i=$t,u=new Gn}else u=t?[]:s;e:for(;++r=i?e:ni(e,t,r)}var xi=ut||function(e){return pt.clearTimeout(e)};function ki(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function Ai(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function Ei(e,t){var n=t?Ai(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function _i(e,t){if(e!==t){var r=e!==n,i=null===e,a=e===e,o=ss(e),s=t!==n,u=null===t,c=t===t,l=ss(t);if(!u&&!l&&!o&&e>t||o&&s&&c&&!u&&!l||i&&s&&c||!r&&c||!a)return 1;if(!i&&!o&&!l&&e1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&"function"==typeof o?(a--,o):n,s&&ba(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=Te(t);++i-1?a[o?t[s]:s]:n}}function Bi(e){return ta((function(t){var i=t.length,a=i,o=zn.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if("function"!=typeof s)throw new Oe(r);if(o&&!u&&"wrapper"==aa(s))var u=new zn([],!0)}for(a=u?a:i;++a1&&g.reverse(),d&&lu))return!1;var l=o.get(e),f=o.get(t);if(l&&f)return l==t&&f==e;var d=-1,p=!0,h=2&r?new Gn:n;for(o.set(e,t),o.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return St(m,(function(n){var r="_."+n[0];t&n[1]&&!Pt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ue):[]}(r),n)))}function Ra(e){var t=0,r=0;return function(){var i=gn(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ma(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ro(e,r)}));function lo(e){var t=Un(e);return t.__chain__=!0,t}function fo(e,t){return t(e)}var po=ta((function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hn&&ya(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:fo,args:[a],thisArg:n}),new zn(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(a)}));var ho=Ii((function(e,t,n){je.call(e,n)?++e[n]:ir(e,n,1)}));var mo=Di(Za),vo=Di(za);function yo(e,t){return(Ho(e)?St:fr)(e,sa(t,3))}function bo(e,t){return(Ho(e)?Ct:dr)(e,sa(t,3))}var go=Ii((function(e,t,n){je.call(e,n)?e[n].push(t):ir(e,n,[t])}));var wo=Kr((function(e,t,n){var r=-1,i="function"==typeof t,a=Vo(e)?ae(e.length):[];return fr(e,(function(e){a[++r]=i?_t(t,e,n):Or(e,t,n)})),a})),xo=Ii((function(e,t,n){ir(e,n,t)}));function ko(e,t){return(Ho(e)?Mt:Br)(e,sa(t,3))}var Ao=Ii((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Eo=Kr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ba(e,t[0],t[1])?t=[]:n>2&&ba(t[0],t[1],t[2])&&(t=[t[0]]),Hr(e,vr(t,1),[])})),_o=ft||function(){return pt.Date.now()};function To(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Ji(e,c,n,n,n,n,t)}function So(e,t){var i;if("function"!=typeof t)throw new Oe(r);return e=ps(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Co=Kr((function(e,t,n){var r=1;if(n.length){var i=cn(n,oa(Co));r|=s}return Ji(e,r,t,n,i)})),Oo=Kr((function(e,t,n){var r=3;if(n.length){var i=cn(n,oa(Oo));r|=s}return Ji(t,r,e,n,i)}));function Io(e,t,i){var a,o,s,u,c,l,f=0,d=!1,p=!1,h=!0;if("function"!=typeof e)throw new Oe(r);function m(t){var r=a,i=o;return a=o=n,f=t,u=e.apply(i,r)}function v(e){var r=e-l;return l===n||r>=t||r<0||p&&e-f>=s}function y(){var e=_o();if(v(e))return b(e);c=Oa(y,function(e){var n=t-(e-l);return p?bn(n,s-(e-f)):n}(e))}function b(e){return c=n,h&&a?m(e):(a=o=n,u)}function g(){var e=_o(),r=v(e);if(a=arguments,o=this,l=e,r){if(c===n)return function(e){return f=e,c=Oa(y,t),d?m(e):u}(l);if(p)return xi(c),c=Oa(y,t),m(l)}return c===n&&(c=Oa(y,t)),u}return t=ms(t)||0,$o(i)&&(d=!!i.leading,s=(p="maxWait"in i)?yn(ms(i.maxWait)||0,t):s,h="trailing"in i?!!i.trailing:h),g.cancel=function(){c!==n&&xi(c),f=0,a=l=o=c=n},g.flush=function(){return c===n?u:b(_o())},g}var Po=Kr((function(e,t){return cr(e,1,t)})),Ro=Kr((function(e,t,n){return cr(e,ms(t)||0,n)}));function Mo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Oe(r);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Mo.Cache||Wn),n}function No(e){if("function"!=typeof e)throw new Oe(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Mo.Cache=Wn;var jo=gi((function(e,t){var n=(t=1==t.length&&Ho(t[0])?Mt(t[0],Qt(sa())):Mt(vr(t,1),Qt(sa()))).length;return Kr((function(r){for(var i=-1,a=bn(r.length,n);++i=t})),zo=Ir(function(){return arguments}())?Ir:function(e){return es(e)&&je.call(e,"callee")&&!Ye.call(e,"callee")},Ho=ae.isArray,qo=gt?Qt(gt):function(e){return es(e)&&Er(e)==R};function Vo(e){return null!=e&&Xo(e.length)&&!Jo(e)}function Wo(e){return es(e)&&Vo(e)}var Go=bt||mu,Yo=wt?Qt(wt):function(e){return es(e)&&Er(e)==g};function Ko(e){if(!es(e))return!1;var t=Er(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function Jo(e){if(!$o(e))return!1;var t=Er(e);return t==x||t==k||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qo(e){return"number"==typeof e&&e==ps(e)}function Xo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function $o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=xt?Qt(xt):function(e){return es(e)&&pa(e)==A};function ns(e){return"number"==typeof e||es(e)&&Er(e)==E}function rs(e){if(!es(e)||Er(e)!=_)return!1;var t=We(e);if(null===t)return!0;var n=je.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Ue}var is=kt?Qt(kt):function(e){return es(e)&&Er(e)==S};var as=At?Qt(At):function(e){return es(e)&&pa(e)==C};function os(e){return"string"==typeof e||!Ho(e)&&es(e)&&Er(e)==O}function ss(e){return"symbol"==typeof e||es(e)&&Er(e)==I}var us=Et?Qt(Et):function(e){return es(e)&&Xo(e.length)&&!!ot[Er(e)]};var cs=Vi(Dr),ls=Vi((function(e,t){return e<=t}));function fs(e){if(!e)return[];if(Vo(e))return os(e)?dn(e):Ci(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=pa(e);return(t==A?sn:t==C?ln:Us)(e)}function ds(e){return e?(e=ms(e))===f||e===-f?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function ps(e){var t=ds(e),n=t%1;return t===t?n?t-n:t:0}function hs(e){return e?or(ps(e),0,h):0}function ms(e){if("number"==typeof e)return e;if(ss(e))return p;if($o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var n=me.test(e);return n||ye.test(e)?lt(e.slice(2),n?2:8):he.test(e)?p:+e}function vs(e){return Oi(e,Ps(e))}function ys(e){return null==e?"":ui(e)}var bs=Pi((function(e,t){if(ka(t)||Vo(t))Oi(t,Is(t),e);else for(var n in t)je.call(t,n)&&er(e,n,t[n])})),gs=Pi((function(e,t){Oi(t,Ps(t),e)})),ws=Pi((function(e,t,n,r){Oi(t,Ps(t),e,r)})),xs=Pi((function(e,t,n,r){Oi(t,Is(t),e,r)})),ks=ta(ar);var As=Kr((function(e,t){e=Te(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&ba(t[0],t[1],a)&&(i=1);++r1),t})),Oi(e,ra(e),n),r&&(n=sr(n,7,$i));for(var i=t.length;i--;)li(n,t[i]);return n}));var js=ta((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return Ts(e,n)}))}(e,t)}));function Ls(e,t){if(null==e)return{};var n=Mt(ra(e),(function(e){return[e]}));return t=sa(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var Ds=Ki(Is),Bs=Ki(Ps);function Us(e){return null==e?[]:Xt(e,Is(e))}var Fs=ji((function(e,t,n){return t=t.toLowerCase(),e+(n?Zs(t):t)}));function Zs(e){return Ks(ys(e).toLowerCase())}function zs(e){return(e=ys(e))&&e.replace(ge,nn).replace($e,"")}var Hs=ji((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),qs=ji((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Vs=Ni("toLowerCase");var Ws=ji((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Gs=ji((function(e,t,n){return e+(n?" ":"")+Ks(t)}));var Ys=ji((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ks=Ni("toUpperCase");function Js(e,t,r){return e=ys(e),(t=r?n:t)===n?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Qs=Kr((function(e,t){try{return _t(e,n,t)}catch(r){return Ko(r)?r:new Ae(r)}})),Xs=ta((function(e,t){return St(t,(function(t){t=ja(t),ir(e,t,Co(e[t],e))})),e}));function $s(e){return function(){return e}}var eu=Bi(),tu=Bi(!0);function nu(e){return e}function ru(e){return Nr("function"==typeof e?e:sr(e,1))}var iu=Kr((function(e,t){return function(n){return Or(n,e,t)}})),au=Kr((function(e,t){return function(n){return Or(e,n,t)}}));function ou(e,t,n){var r=Is(t),i=xr(t,r);null==n&&(!$o(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=xr(t,Is(t)));var a=!($o(n)&&"chain"in n)||!!n.chain,o=Jo(e);return St(i,(function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=Ci(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function su(){}var uu=zi(Mt),cu=zi(Ot),lu=zi(Dt);function fu(e){return ga(e)?Vt(ja(e)):function(e){return function(t){return kr(t,e)}}(e)}var du=qi(),pu=qi(!0);function hu(){return[]}function mu(){return!1}var vu=Zi((function(e,t){return e+t}),0),yu=Gi("ceil"),bu=Zi((function(e,t){return e/t}),1),gu=Gi("floor");var wu=Zi((function(e,t){return e*t}),1),xu=Gi("round"),ku=Zi((function(e,t){return e-t}),0);return Un.after=function(e,t){if("function"!=typeof t)throw new Oe(r);return e=ps(e),function(){if(--e<1)return t.apply(this,arguments)}},Un.ary=To,Un.assign=bs,Un.assignIn=gs,Un.assignInWith=ws,Un.assignWith=xs,Un.at=ks,Un.before=So,Un.bind=Co,Un.bindAll=Xs,Un.bindKey=Oo,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ho(e)?e:[e]},Un.chain=lo,Un.chunk=function(e,t,r){t=(r?ba(e,t,r):t===n)?1:yn(ps(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=ae(ht(i/t));aa?0:a+r),(i=i===n||i>a?a:ps(i))<0&&(i+=a),i=r>i?0:hs(i);r>>0)?(e=ys(e))&&("string"==typeof t||null!=t&&!is(t))&&(!(t=ui(t))&&on(e))?wi(dn(e),0,r):e.split(t,r):[]},Un.spread=function(e,t){if("function"!=typeof e)throw new Oe(r);return t=null==t?0:yn(ps(t),0),Kr((function(n){var r=n[t],i=wi(n,0,t);return r&&Nt(i,r),_t(e,this,i)}))},Un.tail=function(e){var t=null==e?0:e.length;return t?ni(e,1,t):[]},Un.take=function(e,t,r){return e&&e.length?ni(e,0,(t=r||t===n?1:ps(t))<0?0:t):[]},Un.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?ni(e,(t=i-(t=r||t===n?1:ps(t)))<0?0:t,i):[]},Un.takeRightWhile=function(e,t){return e&&e.length?di(e,sa(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?di(e,sa(t,3)):[]},Un.tap=function(e,t){return t(e),e},Un.throttle=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new Oe(r);return $o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),Io(e,t,{leading:i,maxWait:t,trailing:a})},Un.thru=fo,Un.toArray=fs,Un.toPairs=Ds,Un.toPairsIn=Bs,Un.toPath=function(e){return Ho(e)?Mt(e,ja):ss(e)?[e]:Ci(Na(ys(e)))},Un.toPlainObject=vs,Un.transform=function(e,t,n){var r=Ho(e),i=r||Go(e)||us(e);if(t=sa(t,4),null==n){var a=e&&e.constructor;n=i?r?new a:[]:$o(e)&&Jo(a)?Fn(We(e)):{}}return(i?St:gr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Un.unary=function(e){return To(e,1)},Un.union=$a,Un.unionBy=eo,Un.unionWith=to,Un.uniq=function(e){return e&&e.length?ci(e):[]},Un.uniqBy=function(e,t){return e&&e.length?ci(e,sa(t,2)):[]},Un.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ci(e,n,t):[]},Un.unset=function(e,t){return null==e||li(e,t)},Un.unzip=no,Un.unzipWith=ro,Un.update=function(e,t,n){return null==e?e:fi(e,t,yi(n))},Un.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:fi(e,t,yi(r),i)},Un.values=Us,Un.valuesIn=function(e){return null==e?[]:Xt(e,Ps(e))},Un.without=io,Un.words=Js,Un.wrap=function(e,t){return Lo(yi(t),e)},Un.xor=ao,Un.xorBy=oo,Un.xorWith=so,Un.zip=uo,Un.zipObject=function(e,t){return mi(e||[],t||[],er)},Un.zipObjectDeep=function(e,t){return mi(e||[],t||[],Xr)},Un.zipWith=co,Un.entries=Ds,Un.entriesIn=Bs,Un.extend=gs,Un.extendWith=ws,ou(Un,Un),Un.add=vu,Un.attempt=Qs,Un.camelCase=Fs,Un.capitalize=Zs,Un.ceil=yu,Un.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=ms(r))===r?r:0),t!==n&&(t=(t=ms(t))===t?t:0),or(ms(e),t,r)},Un.clone=function(e){return sr(e,4)},Un.cloneDeep=function(e){return sr(e,5)},Un.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:n)},Un.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:n)},Un.conformsTo=function(e,t){return null==t||ur(e,t,Is(t))},Un.deburr=zs,Un.defaultTo=function(e,t){return null==e||e!==e?t:e},Un.divide=bu,Un.endsWith=function(e,t,r){e=ys(e),t=ui(t);var i=e.length,a=r=r===n?i:or(ps(r),0,i);return(r-=t.length)>=0&&e.slice(r,a)==t},Un.eq=Uo,Un.escape=function(e){return(e=ys(e))&&K.test(e)?e.replace(G,rn):e},Un.escapeRegExp=function(e){return(e=ys(e))&&re.test(e)?e.replace(ne,"\\$&"):e},Un.every=function(e,t,r){var i=Ho(e)?Ot:pr;return r&&ba(e,t,r)&&(t=n),i(e,sa(t,3))},Un.find=mo,Un.findIndex=Za,Un.findKey=function(e,t){return Ut(e,sa(t,3),gr)},Un.findLast=vo,Un.findLastIndex=za,Un.findLastKey=function(e,t){return Ut(e,sa(t,3),wr)},Un.floor=gu,Un.forEach=yo,Un.forEachRight=bo,Un.forIn=function(e,t){return null==e?e:yr(e,sa(t,3),Ps)},Un.forInRight=function(e,t){return null==e?e:br(e,sa(t,3),Ps)},Un.forOwn=function(e,t){return e&&gr(e,sa(t,3))},Un.forOwnRight=function(e,t){return e&&wr(e,sa(t,3))},Un.get=_s,Un.gt=Fo,Un.gte=Zo,Un.has=function(e,t){return null!=e&&ha(e,t,Tr)},Un.hasIn=Ts,Un.head=qa,Un.identity=nu,Un.includes=function(e,t,n,r){e=Vo(e)?e:Us(e),n=n&&!r?ps(n):0;var i=e.length;return n<0&&(n=yn(i+n,0)),os(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Zt(e,t,n)>-1},Un.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ps(n);return i<0&&(i=yn(r+i,0)),Zt(e,t,i)},Un.inRange=function(e,t,r){return t=ds(t),r===n?(r=t,t=0):r=ds(r),function(e,t,n){return e>=bn(t,n)&&e=-d&&e<=d},Un.isSet=as,Un.isString=os,Un.isSymbol=ss,Un.isTypedArray=us,Un.isUndefined=function(e){return e===n},Un.isWeakMap=function(e){return es(e)&&pa(e)==P},Un.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Er(e)},Un.join=function(e,t){return null==e?"":Wt.call(e,t)},Un.kebabCase=Hs,Un.last=Ya,Un.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=(a=ps(r))<0?yn(i+a,0):bn(a,i-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,a):Ft(e,Ht,a,!0)},Un.lowerCase=qs,Un.lowerFirst=Vs,Un.lt=cs,Un.lte=ls,Un.max=function(e){return e&&e.length?hr(e,nu,_r):n},Un.maxBy=function(e,t){return e&&e.length?hr(e,sa(t,2),_r):n},Un.mean=function(e){return qt(e,nu)},Un.meanBy=function(e,t){return qt(e,sa(t,2))},Un.min=function(e){return e&&e.length?hr(e,nu,Dr):n},Un.minBy=function(e,t){return e&&e.length?hr(e,sa(t,2),Dr):n},Un.stubArray=hu,Un.stubFalse=mu,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=wu,Un.nth=function(e,t){return e&&e.length?zr(e,ps(t)):n},Un.noConflict=function(){return pt._===this&&(pt._=Fe),this},Un.noop=su,Un.now=_o,Un.pad=function(e,t,n){e=ys(e);var r=(t=ps(t))?fn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Hi(mt(i),n)+e+Hi(ht(i),n)},Un.padEnd=function(e,t,n){e=ys(e);var r=(t=ps(t))?fn(e):0;return t&&rt){var i=e;e=t,t=i}if(r||e%1||t%1){var a=xn();return bn(e+a*(t-e+ct("1e-"+((a+"").length-1))),t)}return Gr(e,t)},Un.reduce=function(e,t,n){var r=Ho(e)?jt:Gt,i=arguments.length<3;return r(e,sa(t,4),n,i,fr)},Un.reduceRight=function(e,t,n){var r=Ho(e)?Lt:Gt,i=arguments.length<3;return r(e,sa(t,4),n,i,dr)},Un.repeat=function(e,t,r){return t=(r?ba(e,t,r):t===n)?1:ps(t),Yr(ys(e),t)},Un.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Un.result=function(e,t,r){var i=-1,a=(t=bi(t,e)).length;for(a||(a=1,e=n);++id)return[];var n=h,r=bn(e,h);t=sa(t),e-=h;for(var i=Kt(r,t);++n=o)return e;var u=r-fn(i);if(u<1)return i;var c=s?wi(s,0,u).join(""):e.slice(0,u);if(a===n)return c+i;if(s&&(u+=c.length-u),is(a)){if(e.slice(u).search(a)){var l,f=c;for(a.global||(a=Se(a.source,ys(pe.exec(a))+"g")),a.lastIndex=0;l=a.exec(f);)var d=l.index;c=c.slice(0,d===n?u:d)}}else if(e.indexOf(ui(a),u)!=u){var p=c.lastIndexOf(a);p>-1&&(c=c.slice(0,p))}return c+i},Un.unescape=function(e){return(e=ys(e))&&Y.test(e)?e.replace(W,hn):e},Un.uniqueId=function(e){var t=++Le;return ys(e)+t},Un.upperCase=Ys,Un.upperFirst=Ks,Un.each=yo,Un.eachRight=bo,Un.first=qa,ou(Un,function(){var e={};return gr(Un,(function(t,n){je.call(Un.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Un.VERSION="4.17.21",St(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Un[e].placeholder=Un})),St(["drop","take"],(function(e,t){Hn.prototype[e]=function(r){r=r===n?1:yn(ps(r),0);var i=this.__filtered__&&!t?new Hn(this):this.clone();return i.__filtered__?i.__takeCount__=bn(r,i.__takeCount__):i.__views__.push({size:bn(r,h),type:e+(i.__dir__<0?"Right":"")}),i},Hn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),St(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Hn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),St(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Hn.prototype[e]=function(){return this[n](1).value()[0]}})),St(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Hn.prototype[e]=function(){return this.__filtered__?new Hn(this):this[n](1)}})),Hn.prototype.compact=function(){return this.filter(nu)},Hn.prototype.find=function(e){return this.filter(e).head()},Hn.prototype.findLast=function(e){return this.reverse().find(e)},Hn.prototype.invokeMap=Kr((function(e,t){return"function"==typeof e?new Hn(this):this.map((function(n){return Or(n,e,t)}))})),Hn.prototype.reject=function(e){return this.filter(No(sa(e)))},Hn.prototype.slice=function(e,t){e=ps(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Hn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ps(t))<0?r.dropRight(-t):r.take(t-e)),r)},Hn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hn.prototype.toArray=function(){return this.take(h)},gr(Hn.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=Un[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);a&&(Un.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,u=t instanceof Hn,c=s[0],l=u||Ho(t),f=function(e){var t=a.apply(Un,Nt([e],s));return i&&d?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var d=this.__chain__,p=!!this.__actions__.length,h=o&&!d,m=u&&!p;if(!o&&l){t=m?t:new Hn(this);var v=e.apply(t,s);return v.__actions__.push({func:fo,args:[f],thisArg:n}),new zn(v,d)}return h&&m?e.apply(this,s):(v=this.thru(f),h?i?v.value()[0]:v.value():v)})})),St(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ie[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Un.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ho(i)?i:[],e)}return this[n]((function(n){return t.apply(Ho(n)?n:[],e)}))}})),gr(Hn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";je.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}})),In[Ui(n,2).name]=[{name:"wrapper",func:n}],Hn.prototype.clone=function(){var e=new Hn(this.__wrapped__);return e.__actions__=Ci(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ci(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ci(this.__views__),e},Hn.prototype.reverse=function(){if(this.__filtered__){var e=new Hn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ho(e),r=t<0,i=n?e.length:0,a=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Un.prototype.plant=function(e){for(var t,r=this;r instanceof Zn;){var i=Da(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t},Un.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hn){var t=e;return this.__actions__.length&&(t=new Hn(this)),(t=t.reverse()).__actions__.push({func:fo,args:[Xa],thisArg:n}),new zn(t,this.__chain__)}return this.thru(Xa)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,Qe&&(Un.prototype[Qe]=function(){return this}),Un}();mt?((mt.exports=mn)._=mn,ht._=mn):pt._=mn}).call(oo)}(so,so.exports);var uo=Object.defineProperty,co=Object.defineProperties,lo=Object.getOwnPropertyDescriptors,fo=Object.getOwnPropertySymbols,po=Object.prototype.hasOwnProperty,ho=Object.prototype.propertyIsEnumerable,mo=function(e,t,n){return t in e?uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},vo=function(e,t){for(var n in t||(t={}))po.call(t,n)&&mo(e,n,t[n]);if(fo){var r,i=(0,l.Z)(fo(t));try{for(i.s();!(r=i.n()).done;){n=r.value;ho.call(t,n)&&mo(e,n,t[n])}}catch(a){i.e(a)}finally{i.f()}}return e},yo=function(e,t){return co(e,lo(t))};function bo(e,t,n){var r,i=go(e);return t.rpcMap&&(r=t.rpcMap[i]),r||(r="".concat("https://rpc.walletconnect.com/v1","?chainId=eip155:").concat(i,"&projectId=").concat(n)),r}function go(e){return e.includes("eip155")?Number(e.split(":")[1]):Number(e)}function wo(e){return e.map((function(e){return"".concat(e.split(":")[0],":").concat(e.split(":")[1])}))}function xo(e){var t,n,i,a,o={};if(!to(e))return o;for(var s=0,u=Object.entries(e);s"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||bo(e,this.namespace);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new no.default(n,_o("disableProviderPing")))}}]),e}(),Co=function(){function e(t){(0,o.Z)(this,e),this.name="eip155",this.namespace=t.namespace,this.events=_o("events"),this.client=_o("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}return(0,s.Z)(e,[{key:"request",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.request.method,e.next="eth_requestAccounts"===e.t0?3:"eth_accounts"===e.t0?4:"wallet_switchEthereumChain"===e.t0?5:"eth_chainId"===e.t0?8:9;break;case 3:case 4:return e.abrupt("return",this.getAccounts());case 5:return e.next=7,this.handleSwitchChain(t);case 7:return e.abrupt("return",e.sent);case 8:return e.abrupt("return",parseInt(this.getDefaultChain()));case 9:if(!this.namespace.methods.includes(t.request.method)){e.next=15;break}return e.next=12,this.client.request(t);case 12:e.t1=e.sent,e.next=16;break;case 15:e.t1=this.getHttpProvider().request(t.request);case 16:return e.abrupt("return",e.t1);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"setDefaultChain",value:function(e,t){var n=go(e);if(!this.httpProviders[n]){var r=t||bo("".concat(this.name,":").concat(n),this.namespace,this.client.core.projectId);if(!r)throw new Error("No RPC url provided for chainId: ".concat(n));this.setHttpProvider(n,r)}this.chainId=n,this.events.emit(ao,"".concat(this.name,":").concat(n))}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"createHttpProvider",value:function(e,t){var n=t||bo("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new no.HttpConnection(n,_o("disableProviderPing")))}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r,i=go(n);t[i]=e.createHttpProvider(i,null==(r=e.namespace.rpcMap)?void 0:r[n])})),t}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"getHttpProvider",value:function(){var e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"handleSwitchChain",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=(a=t.request.params?null==(n=t.request.params[0])?void 0:n.chainId:"0x0").startsWith("0x")?a:"0x".concat(a),o=parseInt(a,16),!this.isChainApproved(o)){e.next=7;break}this.setDefaultChain("".concat(o)),e.next=14;break;case 7:if(!this.namespace.methods.includes("wallet_switchEthereumChain")){e.next=13;break}return e.next=10,this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:a}]},chainId:null==(r=this.namespace.chains)?void 0:r[0]});case 10:this.setDefaultChain("".concat(o)),e.next=14;break;case 13:throw new Error("Failed to switch to chain 'eip155:".concat(o,"'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method."));case 14:return e.abrupt("return",null);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isChainApproved",value:function(e){return this.namespace.chains.includes("".concat(this.name,":").concat(e))}}]),e}(),Oo=function(){function e(t){(0,o.Z)(this,e),this.name="solana",this.namespace=t.namespace,this.events=_o("events"),this.client=_o("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}return(0,s.Z)(e,[{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"request",value:function(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}},{key:"setDefaultChain",value:function(e,t){if(!this.httpProviders[e]){var n=t||bo("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(ao,"".concat(this.name,":").concat(this.chainId))}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r;t[n]=e.createHttpProvider(n,null==(r=e.namespace.rpcMap)?void 0:r[n])})),t}},{key:"getHttpProvider",value:function(){var e="".concat(this.name,":").concat(this.chainId),t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||bo(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new no.default(n,_o("disableProviderPing")))}}]),e}(),Io=function(){function e(t){(0,o.Z)(this,e),this.name="cosmos",this.namespace=t.namespace,this.events=_o("events"),this.client=_o("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}return(0,s.Z)(e,[{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"request",value:function(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}},{key:"setDefaultChain",value:function(e,t){if(this.chainId=e,!this.httpProviders[e]){var n=t||bo("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));this.setHttpProvider(e,n)}this.events.emit(ao,"".concat(this.name,":").concat(this.chainId))}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r;t[n]=e.createHttpProvider(n,null==(r=e.namespace.rpcMap)?void 0:r[n])})),t}},{key:"getHttpProvider",value:function(){var e="".concat(this.name,":").concat(this.chainId),t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||bo(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new no.default(n,_o("disableProviderPing")))}}]),e}(),Po=function(){function e(t){(0,o.Z)(this,e),this.name="cip34",this.namespace=t.namespace,this.events=_o("events"),this.client=_o("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}return(0,s.Z)(e,[{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"request",value:function(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}},{key:"setDefaultChain",value:function(e,t){if(this.chainId=e,!this.httpProviders[e]){var n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));this.setHttpProvider(e,n)}this.events.emit(ao,"".concat(this.name,":").concat(this.chainId))}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r=e.getCardanoRPCUrl(n);t[n]=e.createHttpProvider(n,r)})),t}},{key:"getHttpProvider",value:function(){var e="".concat(this.name,":").concat(this.chainId),t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"getCardanoRPCUrl",value:function(e){var t=this.namespace.rpcMap;if(t)return t[e]}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new no.default(n,_o("disableProviderPing")))}}]),e}(),Ro=function(){function e(t){(0,o.Z)(this,e),this.name="elrond",this.namespace=t.namespace,this.events=_o("events"),this.client=_o("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}return(0,s.Z)(e,[{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"request",value:function(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}},{key:"setDefaultChain",value:function(e,t){if(!this.httpProviders[e]){var n=t||bo("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(ao,"".concat(this.name,":").concat(this.chainId))}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r;t[n]=e.createHttpProvider(n,null==(r=e.namespace.rpcMap)?void 0:r[n])})),t}},{key:"getHttpProvider",value:function(){var e="".concat(this.name,":").concat(this.chainId),t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||bo(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new no.default(n,_o("disableProviderPing")))}}]),e}(),Mo=function(){function e(t){(0,o.Z)(this,e),this.name="multiversx",this.namespace=t.namespace,this.events=_o("events"),this.client=_o("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}return(0,s.Z)(e,[{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"request",value:function(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}},{key:"setDefaultChain",value:function(e,t){if(!this.httpProviders[e]){var n=t||bo("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(ao,"".concat(this.name,":").concat(this.chainId))}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r;t[n]=e.createHttpProvider(n,null==(r=e.namespace.rpcMap)?void 0:r[n])})),t}},{key:"getHttpProvider",value:function(){var e="".concat(this.name,":").concat(this.chainId),t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||bo(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new no.default(n,_o("disableProviderPing")))}}]),e}(),No=Object.defineProperty,jo=Object.defineProperties,Lo=Object.getOwnPropertyDescriptors,Do=Object.getOwnPropertySymbols,Bo=Object.prototype.hasOwnProperty,Uo=Object.prototype.propertyIsEnumerable,Fo=function(e,t,n){return t in e?No(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Zo=function(e,t){for(var n in t||(t={}))Bo.call(t,n)&&Fo(e,n,t[n]);if(Do){var r,i=(0,l.Z)(Do(t));try{for(i.s();!(r=i.n()).done;){n=r.value;Uo.call(t,n)&&Fo(e,n,t[n])}}catch(a){i.e(a)}finally{i.f()}}return e},zo=function(e,t){return jo(e,Lo(t))},Ho=function(){function e(t){(0,o.Z)(this,e),this.events=new(d()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(null===t||void 0===t?void 0:t.logger)<"u"&&"string"!=typeof(null===t||void 0===t?void 0:t.logger)?t.logger:(0,N.pino)((0,N.getDefaultLoggerOptions)({level:(null===t||void 0===t?void 0:t.logger)||ro})),this.disableProviderPing=(null===t||void 0===t?void 0:t.disableProviderPing)||!1}return(0,s.Z)(e,[{key:"request",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t,n){var a,o,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.validateChain(n),o=(0,r.Z)(a,2),s=o[0],u=o[1],this.session){e.next=3;break}throw new Error("Please call connect() before request()");case 3:return e.next=5,this.getProvider(s).request({request:Zo({},t),chainId:"".concat(s,":").concat(u),topic:this.session.topic});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"sendAsync",value:function(e,t,n){this.request(e,n).then((function(e){return t(null,e)})).catch((function(e){return t(e,void 0)}))}},{key:"enable",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.client){e.next=2;break}throw new Error("Sign Client not initialized");case 2:if(e.t0=this.session,e.t0){e.next=6;break}return e.next=6,this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});case 6:return e.next=8,this.requestAccounts();case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.session){e.next=2;break}throw new Error("Please call connect() before enable()");case 2:return e.next=4,this.client.disconnect({topic:null==(t=this.session)?void 0:t.topic,reason:$a("USER_DISCONNECTED")});case 4:return e.next=6,this.cleanup();case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"connect",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.client){e.next=2;break}throw new Error("Sign Client not initialized");case 2:return this.setNamespaces(t),e.next=5,this.cleanupPendingPairings();case 5:if(t.skipPairing){e.next=9;break}return e.next=8,this.pair(t.pairingTopic);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"isWalletConnect",get:function(){return!0}},{key:"pair",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r,a,o,s=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.shouldAbortPairingAttempt=!1,n=0;case 2:if(!this.shouldAbortPairingAttempt){e.next=4;break}throw new Error("Pairing aborted");case 4:if(!(n>=this.maxPairingAttempts)){e.next=6;break}throw new Error("Max auto pairing attempts reached");case 6:return e.next=8,this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});case 8:return r=e.sent,a=r.uri,o=r.approval,a&&(this.uri=a,this.events.emit("display_uri",a)),e.next=14,o().then((function(e){s.session=e,s.namespaces||(s.namespaces=Ao(e.namespaces),s.persist("namespaces",s.namespaces))})).catch((function(e){if(e.message!==Ca)throw e;n++}));case 14:if(!this.session){e.next=2;break}case 15:return e.abrupt("return",(this.onConnect(),this.session));case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setDefaultChain",value:function(e,t){try{if(!this.session)return;var n=this.validateChain(e),i=(0,r.Z)(n,2),a=i[0],o=i[1];this.getProvider(a).setDefaultChain(o,t)}catch(a){if(!/Please call connect/.test(a.message))throw a}}},{key:"cleanupPendingPairings",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t,n,r,a,o,s=arguments;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]?s[0]:{},this.logger.info("Cleaning up inactive pairings..."),!eo(n=this.client.pairing.getAll())){e.next=26;break}r=(0,l.Z)(n),e.prev=5,r.s();case 7:if((a=r.n()).done){e.next=17;break}if(o=a.value,!t.deletePairings){e.next=13;break}this.client.core.expirer.set(o.topic,0),e.next=15;break;case 13:return e.next=15,this.client.core.relayer.subscriber.unsubscribe(o.topic);case 15:e.next=7;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(5),r.e(e.t0);case 22:return e.prev=22,r.f(),e.finish(22);case 25:this.logger.info("Inactive pairings cleared: ".concat(n.length));case 26:case"end":return e.stop()}}),e,this,[[5,19,22,25]])})));return function(){return e.apply(this,arguments)}}()},{key:"abortPairingAttempt",value:function(){this.shouldAbortPairingAttempt=!0}},{key:"checkStorage",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFromStore("namespaces");case 2:return this.namespaces=e.sent,e.next=5,this.getFromStore("optionalNamespaces");case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0={};case 8:if(this.optionalNamespaces=e.t0,!this.client.session.length){e.next=12;break}t=this.client.session.keys.length-1,this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders();case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"initialize",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.trace("Initialized"),e.next=3,this.createClient();case 3:return e.next=5,this.checkStorage();case 5:this.registerEventListeners();case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"createClient",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.providerOpts.client,e.t0){e.next=5;break}return e.next=4,Ya.init({logger:this.providerOpts.logger||ro,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.com",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name});case 4:e.t0=e.sent;case 5:this.client=e.t0,this.logger.trace("SignClient Initialized");case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"createProviders",value:function(){var e=this;if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");var t=(0,u.Z)(new Set(Object.keys(this.session.namespaces).map((function(e){return Qa(e)}))));To("client",this.client),To("events",this.events),To("disableProviderPing",this.disableProviderPing),t.forEach((function(t){if(e.session){var n=function(e,t){var n=Object.keys(t.namespaces).filter((function(t){return t.includes(e)}));if(!n.length)return[];var r=[];return n.forEach((function(e){var n=t.namespaces[e].accounts;r.push.apply(r,(0,u.Z)(n))})),r}(t,e.session),r=wo(n),i=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=xo(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),n=xo(e);return so.exports.merge(t,n)}(e.namespaces,e.optionalNamespaces),a=zo(Zo({},i[t]),{accounts:n,chains:r});switch(t){case"eip155":e.rpcProviders[t]=new Co({namespace:a});break;case"solana":e.rpcProviders[t]=new Oo({namespace:a});break;case"cosmos":e.rpcProviders[t]=new Io({namespace:a});break;case"polkadot":e.rpcProviders[t]=new So({namespace:a});break;case"cip34":e.rpcProviders[t]=new Po({namespace:a});break;case"elrond":e.rpcProviders[t]=new Ro({namespace:a});break;case"multiversx":e.rpcProviders[t]=new Mo({namespace:a})}}}))}},{key:"registerEventListeners",value:function(){var e=this;if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",(function(t){e.events.emit("session_ping",t)})),this.client.on("session_event",(function(t){var n=t.params,r=n.event;if("accountsChanged"===r.name){var i=r.data;i&&eo(i)&&e.events.emit("accountsChanged",i.map(ko))}else"chainChanged"===r.name?e.onChainChanged(n.chainId):e.events.emit(r.name,r.data);e.events.emit("session_event",t)})),this.client.on("session_update",(function(t){var n,r=t.topic,i=t.params,a=i.namespaces,o=null==(n=e.client)?void 0:n.session.get(r);e.session=zo(Zo({},o),{namespaces:a}),e.onSessionUpdate(),e.events.emit("session_update",{topic:r,params:i})})),this.client.on("session_delete",function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.cleanup();case 2:e.events.emit("session_delete",n),e.events.emit("disconnect",zo(Zo({},$a("USER_DISCONNECTED")),{data:n.topic}));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.on(ao,(function(t){e.onChainChanged(t,!0)}))}},{key:"getProvider",value:function(e){if(!this.rpcProviders[e])throw new Error("Provider not found: ".concat(e));return this.rpcProviders[e]}},{key:"onSessionUpdate",value:function(){var e=this;Object.keys(this.rpcProviders).forEach((function(t){var n;e.getProvider(t).updateNamespace(null==(n=e.session)?void 0:n.namespaces[t])}))}},{key:"setNamespaces",value:function(e){var t=e.namespaces,n=e.optionalNamespaces,r=e.sessionProperties;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=r,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}},{key:"validateChain",value:function(e){var t=(null===e||void 0===e?void 0:e.split(":"))||["",""],n=(0,r.Z)(t,2),i=n[0],a=n[1];if(!this.namespaces||!Object.keys(this.namespaces).length)return[i,a];if(i&&!Object.keys(this.namespaces||{}).map((function(e){return Qa(e)})).includes(i))throw new Error("Namespace '".concat(i,"' is not configured. Please call connect() first with namespace config."));if(i&&a)return[i,a];var o=Qa(Object.keys(this.namespaces)[0]);return[o,this.rpcProviders[o].getDefaultChain()]}},{key:"requestAccounts",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t,n,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.validateChain(),n=(0,r.Z)(t,1),a=n[0],e.next=3,this.getProvider(a).requestAccounts();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onChainChanged",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.namespaces){var i=this.validateChain(e),a=(0,r.Z)(i,2),o=a[0],s=a[1];n||this.getProvider(o).setDefaultChain(s),(null!=(t=this.namespaces[o])?t:this.namespaces["".concat(o,":").concat(s)]).defaultChain=s,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s)}}},{key:"onConnect",value:function(){this.createProviders(),this.events.emit("connect",{session:this.session})}},{key:"cleanup",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),e.next=9,this.cleanupPendingPairings({deletePairings:!0});case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"persist",value:function(e,t){this.client.core.storage.setItem("".concat(io,"/").concat(e),t)}},{key:"getFromStore",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.core.storage.getItem("".concat(io,"/").concat(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}],[{key:"init",value:function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){var r;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new e(n),t.next=3,r.initialize();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}]),e}(),qo=Ho,Vo="".concat("wc","@2:").concat("ethereum_provider",":"),Wo=["eth_sendTransaction","personal_sign"],Go=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Yo=["chainChanged","accountsChanged"],Ko=["message","disconnect","connect"],Jo=Object.defineProperty,Qo=Object.defineProperties,Xo=Object.getOwnPropertyDescriptors,$o=Object.getOwnPropertySymbols,es=Object.prototype.hasOwnProperty,ts=Object.prototype.propertyIsEnumerable,ns=function(e,t,n){return t in e?Jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},rs=function(e,t){for(var n in t||(t={}))es.call(t,n)&&ns(e,n,t[n]);if($o){var r,i=(0,l.Z)($o(t));try{for(i.s();!(r=i.n()).done;){n=r.value;ts.call(t,n)&&ns(e,n,t[n])}}catch(a){i.e(a)}finally{i.f()}}return e},is=function(e,t){return Qo(e,Xo(t))};function as(e){return Number(e[0].split(":")[1])}function os(e){return"0x".concat(e.toString(16))}function ss(e){var t=e.chains,n=e.optionalChains,r=e.methods,i=e.optionalMethods,a=e.events,o=e.optionalEvents,s=e.rpcMap;if(!S(t))throw new Error("Invalid chains");var l={chains:t,methods:r||Wo,events:a||Yo,rpcMap:rs({},t.length?(0,c.Z)({},as(t),s[as(t)]):{})},f=null===a||void 0===a?void 0:a.filter((function(e){return!Yo.includes(e)})),d=null===r||void 0===r?void 0:r.filter((function(e){return!Wo.includes(e)}));if(!n&&!o&&!i&&(null==f||!f.length)&&(null==d||!d.length))return{required:t.length?l:void 0};var p=(null===f||void 0===f?void 0:f.length)&&(null===d||void 0===d?void 0:d.length)||!n,h={chains:(0,u.Z)(new Set(p?l.chains.concat(n||[]):n)),methods:(0,u.Z)(new Set(l.methods.concat(null!=i&&i.length?i:Go))),events:(0,u.Z)(new Set(l.events.concat(o||Ko))),rpcMap:s};return{required:t.length?l:void 0,optional:n.length?h:void 0}}var us=function(){function e(){var t=this;(0,o.Z)(this,e),this.events=new f.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Vo,this.on=function(e,n){return t.events.on(e,n),t},this.once=function(e,n){return t.events.once(e,n),t},this.removeListener=function(e,n){return t.events.removeListener(e,n),t},this.off=function(e,n){return t.events.off(e,n),t},this.parseAccount=function(e){return t.isCompatibleChainId(e)?t.parseAccountId(e).address:e},this.signer={},this.rpc={}}return(0,s.Z)(e,[{key:"request",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.signer.request(t,this.formatChainId(this.chainId));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendAsync",value:function(e,t){this.signer.sendAsync(e,t,this.formatChainId(this.chainId))}},{key:"connected",get:function(){return!!this.signer.client&&this.signer.client.core.relayer.connected}},{key:"connecting",get:function(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}},{key:"enable",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.session,e.t0){e.next=4;break}return e.next=4,this.connect();case 4:return e.next=6,this.request({method:"eth_requestAccounts"});case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"connect",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var n,r,o,s,u,l=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.signer.client){e.next=2;break}throw new Error("Provider not initialized. Call init() first");case 2:return this.loadConnectOpts(t),n=ss(this.rpc),r=n.required,o=n.optional,e.prev=4,e.next=7,new Promise(function(){var e=(0,a.Z)((0,i.Z)().mark((function e(n,a){var s;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l.rpc.showQrModal&&(null==(s=l.modal)||s.subscribeModal((function(e){!e.open&&!l.signer.session&&(l.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))}))),e.next=3,l.signer.connect(is(rs({namespaces:rs({},r&&(0,c.Z)({},l.namespace,r))},o&&{optionalNamespaces:(0,c.Z)({},l.namespace,o)}),{pairingTopic:null===t||void 0===t?void 0:t.pairingTopic})).then((function(e){n(e)})).catch((function(e){a(new Error(e.message))}));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}());case 7:if(s=e.sent){e.next=10;break}return e.abrupt("return");case 10:this.setChainIds(this.rpc.chains),u=E(s.namespaces,[this.namespace]),this.setAccounts(u),this.events.emit("connect",{chainId:os(this.chainId)}),e.next=18;break;case 15:throw e.prev=15,e.t0=e.catch(4),this.signer.logger.error(e.t0),e.t0;case 18:return e.prev=18,this.modal&&this.modal.closeModal(),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[4,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.session,!e.t0){e.next=4;break}return e.next=4,this.signer.disconnect();case 4:this.reset();case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"isWalletConnect",get:function(){return!0}},{key:"session",get:function(){return this.signer.session}},{key:"registerEventListeners",value:function(){var e=this;this.signer.on("session_event",(function(t){var n=t.params.event;"accountsChanged"===n.name?(e.accounts=e.parseAccounts(n.data),e.events.emit("accountsChanged",e.accounts)):"chainChanged"===n.name?e.setChainId(e.formatChainId(n.data)):e.events.emit(n.name,n.data),e.events.emit("session_event",t)})),this.signer.on("chainChanged",(function(t){var n=parseInt(t);e.chainId=n,e.events.emit("chainChanged",os(e.chainId)),e.persist()})),this.signer.on("session_update",(function(t){e.events.emit("session_update",t)})),this.signer.on("session_delete",(function(t){e.reset(),e.events.emit("session_delete",t),e.events.emit("disconnect",is(rs({},T("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))})),this.signer.on("display_uri",(function(t){var n,r;e.rpc.showQrModal&&(null==(n=e.modal)||n.closeModal(),null==(r=e.modal)||r.openModal({uri:t})),e.events.emit("display_uri",t)}))}},{key:"switchEthereumChain",value:function(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}},{key:"isCompatibleChainId",value:function(e){return"string"==typeof e&&e.startsWith("".concat(this.namespace,":"))}},{key:"formatChainId",value:function(e){return"".concat(this.namespace,":").concat(e)}},{key:"parseChainId",value:function(e){return Number(e.split(":")[1])}},{key:"setChainIds",value:function(e){var t=this,n=e.filter((function(e){return t.isCompatibleChainId(e)})).map((function(e){return t.parseChainId(e)}));n.length&&(this.chainId=n[0],this.events.emit("chainChanged",os(this.chainId)),this.persist())}},{key:"setChainId",value:function(e){if(this.isCompatibleChainId(e)){var t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}},{key:"parseAccountId",value:function(e){var t=e.split(":"),n=(0,r.Z)(t,3),i=n[0],a=n[1],o=n[2];return{chainId:"".concat(i,":").concat(a),address:o}}},{key:"setAccounts",value:function(e){var t=this;this.accounts=e.filter((function(e){return t.parseChainId(t.parseAccountId(e).chainId)===t.chainId})).map((function(e){return t.parseAccountId(e).address})),this.events.emit("accountsChanged",this.accounts)}},{key:"getRpcConfig",value:function(e){var t,n,r=this,i=null!=(t=null===e||void 0===e?void 0:e.chains)?t:[],a=null!=(n=null===e||void 0===e?void 0:e.optionalChains)?n:[],o=i.concat(a);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");var s=i.length?(null===e||void 0===e?void 0:e.methods)||Wo:[],u=i.length?(null===e||void 0===e?void 0:e.events)||Yo:[],c=(null===e||void 0===e?void 0:e.optionalMethods)||[],l=(null===e||void 0===e?void 0:e.optionalEvents)||[],f=(null===e||void 0===e?void 0:e.rpcMap)||this.buildRpcMap(o,e.projectId),d=(null===e||void 0===e?void 0:e.qrModalOptions)||void 0;return{chains:null===i||void 0===i?void 0:i.map((function(e){return r.formatChainId(e)})),optionalChains:a.map((function(e){return r.formatChainId(e)})),methods:s,events:u,optionalMethods:c,optionalEvents:l,rpcMap:f,showQrModal:!(null==e||!e.showQrModal),qrModalOptions:d,projectId:e.projectId,metadata:e.metadata}}},{key:"buildRpcMap",value:function(e,t){var n=this,r={};return e.forEach((function(e){r[e]=n.getRpcUrl(e,t)})),r}},{key:"initialize",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(t){var r,a,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?as(this.rpc.chains):as(this.rpc.optionalChains),e.next=4,qo.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions});case 4:return this.signer=e.sent,this.registerEventListeners(),e.next=8,this.loadPersistedSession();case 8:if(!this.rpc.showQrModal){e.next=28;break}return e.prev=9,e.next=12,n.e(199).then(n.bind(n,41199));case 12:a=e.sent,o=a.WalletConnectModal,r=o,e.next=20;break;case 17:throw e.prev=17,e.t0=e.catch(9),new Error("To use QR modal, please install @walletconnect/modal package");case 20:if(!r){e.next=28;break}e.prev=21,this.modal=new r(rs({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions)),e.next=28;break;case 25:throw e.prev=25,e.t1=e.catch(21),this.signer.logger.error(e.t1),new Error("Could not generate WalletConnectModal Instance");case 28:case"end":return e.stop()}}),e,this,[[9,17],[21,25]])})));return function(t){return e.apply(this,arguments)}}()},{key:"loadConnectOpts",value:function(e){var t=this;if(e){var n=e.chains,r=e.optionalChains,i=e.rpcMap;n&&S(n)&&(this.rpc.chains=n.map((function(e){return t.formatChainId(e)})),n.forEach((function(e){t.rpc.rpcMap[e]=(null===i||void 0===i?void 0:i[e])||t.getRpcUrl(e)}))),r&&S(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=null===r||void 0===r?void 0:r.map((function(e){return t.formatChainId(e)})),r.forEach((function(e){t.rpc.rpcMap[e]=(null===i||void 0===i?void 0:i[e])||t.getRpcUrl(e)})))}}},{key:"getRpcUrl",value:function(e,t){var n;return(null==(n=this.rpc.rpcMap)?void 0:n[e])||"".concat("https://rpc.walletconnect.com/v1/","?chainId=eip155:").concat(e,"&projectId=").concat(t||this.rpc.projectId)}},{key:"loadPersistedSession",value:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t,n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.session){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.signer.client.core.storage.getItem("".concat(this.STORAGE_KEY,"/chainId"));case 4:t=e.sent,n=this.session.namespaces["".concat(this.namespace,":").concat(t)]?this.session.namespaces["".concat(this.namespace,":").concat(t)]:this.session.namespaces[this.namespace],this.setChainIds(t?[this.formatChainId(t)]:null===n||void 0===n?void 0:n.accounts),this.setAccounts(null===n||void 0===n?void 0:n.accounts);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"reset",value:function(){this.chainId=1,this.accounts=[]}},{key:"persist",value:function(){this.session&&this.signer.client.core.storage.setItem("".concat(this.STORAGE_KEY,"/chainId"),this.chainId)}},{key:"parseAccounts",value:function(e){var t=this;return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map((function(e){return t.parseAccount(e)}))}}],[{key:"init",value:function(){var t=(0,a.Z)((0,i.Z)().mark((function t(n){var r;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new e,t.next=3,r.initialize(n);case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}]),e}(),cs=us},36835:function(e,t,n){"use strict";var r=n(38783)},27964:function(e,t,n){"use strict";var r=n(38416).default,i=n(27424).default,a=n(74704).default,o=n(861).default,s=n(82376),u=n(8271),c=n(94266),l=n(2214),f=Symbol("encodeFragmentIdentifier");function d(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function p(e,t){return t.encode?t.strict?s(e):encodeURIComponent(e):e}function h(e,t){return t.decode?u(e):e}function m(e){return Array.isArray(e)?e.sort():"object"===typeof e?m(Object.keys(e)).sort((function(e,t){return Number(e)-Number(t)})).map((function(t){return e[t]})):e}function v(e){var t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function y(e){var t=(e=v(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function b(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function g(e,t){d((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);var n=function(e){var t;switch(e.arrayFormat){case"index":return function(e,n,r){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return function(e,n,r){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return function(e,n,r){t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return function(t,n,r){var i="string"===typeof n&&n.includes(e.arrayFormatSeparator),a="string"===typeof n&&!i&&h(n,e).includes(e.arrayFormatSeparator);n=a?h(n,e):n;var o=i||a?n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)})):null===n?n:h(n,e);r[t]=o};case"bracket-separator":return function(t,n,r){var i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),i){var a=null===n?[]:n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)}));void 0!==r[t]?r[t]=[].concat(r[t],a):r[t]=a}else r[t]=n?h(n,e):n};default:return function(e,t,n){void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!==typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;var o,s=a(e.split("&"));try{for(s.s();!(o=s.n()).done;){var u=o.value;if(""!==u){var l=c(t.decode?u.replace(/\+/g," "):u,"="),f=i(l,2),p=f[0],v=f[1];v=void 0===v?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?v:h(v,t),n(h(p,t),v,r)}}}catch(_){s.e(_)}finally{s.f()}for(var y=0,g=Object.keys(r);y0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var n=c(e,"#"),r=i(n,2),a=r[0],o=r[1];return Object.assign({url:a.split("?")[0]||"",query:g(y(e),t)},t&&t.parseFragmentIdentifier&&o?{fragmentIdentifier:h(o,t)}:{})},t.stringifyUrl=function(e,n){n=Object.assign(r({encode:!0,strict:!0},f,!0),n);var i=v(e.url).split("?")[0]||"",a=t.extract(e.url),o=t.parse(a,{sort:!1}),s=Object.assign(o,e.query),u=t.stringify(s,n);u&&(u="?".concat(u));var c=function(e){var t="",n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(c="#".concat(n[f]?p(e.fragmentIdentifier,n):e.fragmentIdentifier)),"".concat(i).concat(u).concat(c)},t.pick=function(e,n,i){i=Object.assign(r({parseFragmentIdentifier:!0},f,!1),i);var a=t.parseUrl(e,i),o=a.url,s=a.query,u=a.fragmentIdentifier;return t.stringifyUrl({url:o,query:l(s,n),fragmentIdentifier:u},i)},t.exclude=function(e,n,r){var i=Array.isArray(n)?function(e){return!n.includes(e)}:function(e,t){return!n(e,t)};return t.pick(e,i,r)}},37532:function(e){"use strict";!function(t){function n(e){return parseInt(e)===e}function r(e){if(!n(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!r(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(n(e.length)&&r(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function a(e){return new Uint8Array(e)}function o(e,t,n,r,i){null==r&&null==i||(e=e.slice?e.slice(r,i):Array.prototype.slice.call(e,r,i)),t.set(e,n)}var s={toBytes:function(e){var t=[],n=0;for(e=encodeURI(e);n191&&r<224?(t.push(String.fromCharCode((31&r)<<6|63&e[n+1])),n+=2):(t.push(String.fromCharCode((15&r)<<12|(63&e[n+1])<<6|63&e[n+2])),n+=3)}return t.join("")}},u=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var t=[],n=0;n>4]+e[15&i])}return n.join("")}}}(),c={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],f=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],d=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],h=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],v=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],g=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],x=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],k=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],A=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],E=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function _(e){for(var t=[],n=0;n>2,this._Ke[n][t%4]=a[t],this._Kd[e-n][t%4]=a[t];for(var o,s=0,u=i;u>16&255]<<24^f[o>>8&255]<<16^f[255&o]<<8^f[o>>24&255]^l[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^f[o>>16&255]<<16^f[o>>24&255]<<24;for(t=i/2+1;t>2,p=u%4,this._Ke[d][p]=a[t],this._Kd[e-d][p]=a[t++],u++}for(var d=1;d>24&255]^k[o>>16&255]^A[o>>8&255]^E[255&o]},T.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,n=[0,0,0,0],r=_(e),i=0;i<4;i++)r[i]^=this._Ke[0][i];for(var o=1;o>24&255]^h[r[(i+1)%4]>>16&255]^m[r[(i+2)%4]>>8&255]^v[255&r[(i+3)%4]]^this._Ke[o][i];r=n.slice()}var s,u=a(16);for(i=0;i<4;i++)s=this._Ke[t][i],u[4*i]=255&(f[r[i]>>24&255]^s>>24),u[4*i+1]=255&(f[r[(i+1)%4]>>16&255]^s>>16),u[4*i+2]=255&(f[r[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(f[255&r[(i+3)%4]]^s);return u},T.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,n=[0,0,0,0],r=_(e),i=0;i<4;i++)r[i]^=this._Kd[0][i];for(var o=1;o>24&255]^b[r[(i+3)%4]>>16&255]^g[r[(i+2)%4]>>8&255]^w[255&r[(i+1)%4]]^this._Kd[o][i];r=n.slice()}var s,u=a(16);for(i=0;i<4;i++)s=this._Kd[t][i],u[4*i]=255&(d[r[i]>>24&255]^s>>24),u[4*i+1]=255&(d[r[(i+3)%4]>>16&255]^s>>16),u[4*i+2]=255&(d[r[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(d[255&r[(i+1)%4]]^s);return u};var S=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new T(t)};S.prototype.encrypt=function(e){if((e=i(e)).length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=a(e.length),n=a(16),r=0;r=0;--t)this._counter[t]=e%256,e>>=8},P.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},P.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function e(t,n){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",n instanceof P||(n=new P(n)),this._counter=n,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new T(t)};R.prototype.encrypt=function(e){for(var t=i(e,!0),n=0;n16)throw new Error("PKCS#7 padding byte out of range");for(var n=e.length-t,r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,l=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,h=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",r.copy(m[e])}function v(e){var t=e.match(i);if(!t)return!1;var n=+t[1],r=+t[2],o=+t[3];return r>=1&&r<=12&&o>=1&&o<=(2==r&&function(e){return e%4===0&&(e%100!==0||e%400===0)}(n)?29:a[r])}function y(e,t){var n=e.match(o);if(!n)return!1;var r=n[1],i=n[2],a=n[3],s=n[5];return(r<=23&&i<=59&&a<=59||23==r&&59==i&&60==a)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:l,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":h},m.full={date:v,time:y,"date-time":function(e){var t=e.split(b);return 2==t.length&&v(t[0])&&y(t[1],!0)},uri:function(e){return g.test(e)&&u.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":c,url:l,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":h};var b=/t|\s/i;var g=/\/|:/;var w=/[^\\]\\Z/;function x(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}},76374:function(e,t,n){"use strict";var r=n(28639),i=n(43863),a=n(31692),o=n(8461),s=n(23073),u=i.ucs2length,c=n(89806),l=a.Validation;function f(e,t,n){var r=p.call(this,e,t,n);return r>=0?{index:r,compiling:!0}:(r=this._compilations.length,this._compilations[r]={schema:e,root:t,baseId:n},{index:r,compiling:!1})}function d(e,t,n){var r=p.call(this,e,t,n);r>=0&&this._compilations.splice(r,1)}function p(e,t,n){for(var r=0;r=55296&&t<=56319&&i=t)throw new Error("Cannot access property/index "+r+" levels up, current level is "+t);return n[t-r]}if(r>t)throw new Error("Cannot access data "+r+" levels up, current level is "+t);if(a="data"+(t-r||""),!i)return a}for(var s=a,c=i.split("/"),l=0;l",b=p?">":"<",g=void 0;if(!d&&"number"!=typeof s&&void 0!==s)throw new Error(t+" must be number");if(!v&&void 0!==m&&"number"!=typeof m&&"boolean"!=typeof m)throw new Error(h+" must be number or boolean");if(v){var w=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+a,k="exclType"+a,A="exclIsNumber"+a,E="' + "+(S="op"+a)+" + '";i+=" var schemaExcl"+a+" = "+w+"; ",i+=" var "+x+"; var "+k+" = typeof "+(w="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var _;g=h;(_=_||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(g||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: '"+h+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var T=i;i=_.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+T+"]); ":i+=" validate.errors = ["+T+"]; return false; ":i+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+k+" == 'number' ? ( ("+x+" = "+r+" === undefined || "+w+" "+y+"= "+r+") ? "+f+" "+b+"= "+w+" : "+f+" "+b+" "+r+" ) : ( ("+x+" = "+w+" === true) ? "+f+" "+b+"= "+r+" : "+f+" "+b+" "+r+" ) || "+f+" !== "+f+") { var op"+a+" = "+x+" ? '"+y+"' : '"+y+"='; ",void 0===s&&(g=h,c=e.errSchemaPath+"/"+h,r=w,d=v)}else{E=y;if((A="number"==typeof m)&&d){var S="'"+E+"'";i+=" if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" ( "+r+" === undefined || "+m+" "+y+"= "+r+" ? "+f+" "+b+"= "+m+" : "+f+" "+b+" "+r+" ) || "+f+" !== "+f+") { "}else{A&&void 0===s?(x=!0,g=h,c=e.errSchemaPath+"/"+h,r=m,b+="="):(A&&(r=Math[p?"min":"max"](m,s)),m===(!A||r)?(x=!0,g=h,c=e.errSchemaPath+"/"+h,b+="="):(x=!1,E+="="));S="'"+E+"'";i+=" if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+f+" "+b+" "+r+" || "+f+" !== "+f+") { "}}g=g||t,(_=_||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(g||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+S+", limit: "+r+", exclusive: "+x+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be "+E+" ",i+=d?"' + "+r:r+"'"),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";T=i;return i=_.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+T+"]); ":i+=" validate.errors = ["+T+"]; return false; ":i+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { "),i}},16982:function(e){"use strict";e.exports=function(e,t,n){var r,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;if(d?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",r="schema"+a):r=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");i+="if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+f+".length "+("maxItems"==t?">":"<")+" "+r+") { ";var p=t,h=h||[];h.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxItems"==t?"more":"fewer",i+=" than ",i+=d?"' + "+r+" + '":""+s,i+=" items' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;return i=h.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},9429:function(e){"use strict";e.exports=function(e,t,n){var r,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;if(d?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",r="schema"+a):r=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");var p="maxLength"==t?">":"<";i+="if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),!1===e.opts.unicode?i+=" "+f+".length ":i+=" ucs2length("+f+") ",i+=" "+p+" "+r+") { ";var h=t,m=m||[];m.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(h||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be ",i+="maxLength"==t?"longer":"shorter",i+=" than ",i+=d?"' + "+r+" + '":""+s,i+=" characters' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;return i=m.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},68447:function(e){"use strict";e.exports=function(e,t,n){var r,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;if(d?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",r="schema"+a):r=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");i+="if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+r+") { ";var p=t,h=h||[];h.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxProperties"==t?"more":"fewer",i+=" than ",i+=d?"' + "+r+" + '":""+s,i+=" properties' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;return i=h.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},51389:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,u=e.util.copy(e),c="";u.level++;var l="valid"+u.level,f=u.baseId,d=!0,p=i;if(p)for(var h,m=-1,v=p.length-1;m0||!1===h:e.util.schemaHasRules(h,e.RULES.all))&&(d=!1,u.schema=h,u.schemaPath=a+"["+m+"]",u.errSchemaPath=o+"/"+m,r+=" "+e.validate(u)+" ",u.baseId=f,s&&(r+=" if ("+l+") { ",c+="}"));return s&&(r+=d?" if (true) { ":" "+c.slice(0,-1)+" "),r}},32746:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(a||""),f="valid"+i,d="errs__"+i,p=e.util.copy(e),h="";p.level++;var m="valid"+p.level,v=o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)}));if(v){var y=p.baseId;r+=" var "+d+" = errors; var "+f+" = false; ";var b=e.compositeRule;e.compositeRule=p.compositeRule=!0;var g=o;if(g)for(var w,x=-1,k=g.length-1;x0||!1===o:e.util.schemaHasRules(o,e.RULES.all);if(r+="var "+d+" = errors;var "+f+";",g){var w=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=o,p.schemaPath=s,p.errSchemaPath=u,r+=" var "+h+" = false; for (var "+m+" = 0; "+m+" < "+l+".length; "+m+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var x=l+"["+m+"]";p.dataPathArr[v]=m;var k=e.validate(p);p.baseId=b,e.util.varOccurences(k,y)<2?r+=" "+e.util.varReplace(k,y,x)+" ":r+=" var "+y+" = "+x+"; "+k+" ",r+=" if ("+h+") break; } ",e.compositeRule=p.compositeRule=w,r+=" if (!"+h+") {"}else r+=" if ("+l+".length == 0) {";var A=A||[];A.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var E=r;return r=A.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",g&&(r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r}},87688:function(e){"use strict";e.exports=function(e,t,n){var r,i,a=" ",o=e.level,s=e.dataLevel,u=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,d="data"+(s||""),p="valid"+o,h="errs__"+o,m=e.opts.$data&&u&&u.$data;m?(a+=" var schema"+o+" = "+e.util.getData(u.$data,s,e.dataPathArr)+"; ",i="schema"+o):i=u;var v,y,b,g,w,x=this,k="definition"+o,A=x.definition,E="";if(m&&A.$data){w="keywordValidate"+o;var _=A.validateSchema;a+=" var "+k+" = RULES.custom['"+t+"'].definition; var "+w+" = "+k+".validate;"}else{if(!(g=e.useCustomRule(x,u,e.schema,e)))return;i="validate.schema"+c,w=g.code,v=A.compile,y=A.inline,b=A.macro}var T=w+".errors",S="i"+o,C="ruleErr"+o,O=A.async;if(O&&!e.async)throw new Error("async keyword in sync schema");if(y||b||(a+=T+" = null;"),a+="var "+h+" = errors;var "+p+";",m&&A.$data&&(E+="}",a+=" if ("+i+" === undefined) { "+p+" = true; } else { ",_&&(E+="}",a+=" "+p+" = "+k+".validateSchema("+i+"); if ("+p+") { ")),y)A.statements?a+=" "+g.validate+" ":a+=" "+p+" = "+g.validate+"; ";else if(b){var I=e.util.copy(e);E="";I.level++;var P="valid"+I.level;I.schema=g.validate,I.schemaPath="";var R=e.compositeRule;e.compositeRule=I.compositeRule=!0;var M=e.validate(I).replace(/validate\.schema/g,w);e.compositeRule=I.compositeRule=R,a+=" "+M}else{(D=D||[]).push(a),a="",a+=" "+w+".call( ",e.opts.passContext?a+="this":a+="self",v||!1===A.schema?a+=" , "+d+" ":a+=" , "+i+" , "+d+" , validate.schema"+e.schemaPath+" ",a+=" , (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var N=s?"data"+(s-1||""):"parentData",j=s?e.dataPathArr[s]:"parentDataProperty",L=a+=" , "+N+" , "+j+" , rootData ) ";a=D.pop(),!1===A.errors?(a+=" "+p+" = ",O&&(a+="await "),a+=L+"; "):a+=O?" var "+(T="customErrors"+o)+" = null; try { "+p+" = await "+L+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+T+" = e.errors; else throw e; } ":" "+T+" = null; "+p+" = "+L+"; "}if(A.modifying&&(a+=" if ("+N+") "+d+" = "+N+"["+j+"];"),a+=""+E,A.valid)f&&(a+=" if (true) { ");else{var D;a+=" if ( ",void 0===A.valid?(a+=" !",a+=b?""+P:""+p):a+=" "+!A.valid+" ",a+=") { ",r=x.keyword,(D=D||[]).push(a),a="",(D=D||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(r||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+x.keyword+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should pass \""+x.keyword+"\" keyword validation' "),e.opts.verbose&&(a+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var B=a;a=D.pop(),!e.compositeRule&&f?e.async?a+=" throw new ValidationError(["+B+"]); ":a+=" validate.errors = ["+B+"]; return false; ":a+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var U=a;a=D.pop(),y?A.errors?"full"!=A.errors&&(a+=" for (var "+S+"="+h+"; "+S+"0||!1===b:e.util.schemaHasRules(b,e.RULES.all))&&(r+=" "+h+" = true; if ( "+l+e.util.getProperty(x)+" !== undefined ",y&&(r+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(x)+"') "),r+=") { ",d.schema=b,d.schemaPath=s+e.util.getProperty(x),d.errSchemaPath=u+"/"+e.util.escapeFragment(x),r+=" "+e.validate(d)+" ",d.baseId=j,r+=" } ",c&&(r+=" if ("+h+") { ",p+="}"))}return c&&(r+=" "+p+" if ("+f+" == errors) {"),r}},42785:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(a||""),f="valid"+i,d=e.opts.$data&&o&&o.$data;d&&(r+=" var schema"+i+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ");var p="i"+i,h="schema"+i;d||(r+=" var "+h+" = validate.schema"+s+";"),r+="var "+f+";",d&&(r+=" if (schema"+i+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+i+")) "+f+" = false; else {"),r+=f+" = false;for (var "+p+"=0; "+p+"<"+h+".length; "+p+"++) if (equal("+l+", "+h+"["+p+"])) { "+f+" = true; break; }",d&&(r+=" } "),r+=" if (!"+f+") { ";var m=m||[];m.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+i+" } ",!1!==e.opts.messages&&(r+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var v=r;return r=m.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",c&&(r+=" else { "),r}},72563:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(a||"");if(!1===e.opts.format)return c&&(r+=" if (true) { "),r;var f,d=e.opts.$data&&o&&o.$data;d?(r+=" var schema"+i+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",f="schema"+i):f=o;var p=e.opts.unknownFormats,h=Array.isArray(p);if(d){r+=" var "+(m="format"+i)+" = formats["+f+"]; var "+(v="isObject"+i)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(y="formatType"+i)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(r+=" var async"+i+" = "+m+".async; "),r+=" "+m+" = "+m+".validate; } if ( ",d&&(r+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),r+=" (","ignore"!=p&&(r+=" ("+f+" && !"+m+" ",h&&(r+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),r+=") || "),r+=" ("+m+" && "+y+" == '"+n+"' && !(typeof "+m+" == 'function' ? ",e.async?r+=" (async"+i+" ? await "+m+"("+l+") : "+m+"("+l+")) ":r+=" "+m+"("+l+") ",r+=" : "+m+".test("+l+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==p)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(r+=" if (true) { "),r;if(h&&p.indexOf(o)>=0)return c&&(r+=" if (true) { "),r;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,y=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var b=!0===m.async;m=m.validate}if(y!=n)return c&&(r+=" if (true) { "),r;if(b){if(!e.async)throw new Error("async format in sync schema");r+=" if (!(await "+(g="formats"+e.util.getProperty(o)+".validate")+"("+l+"))) { "}else{r+=" if (! ";var g="formats"+e.util.getProperty(o);v&&(g+=".validate"),r+="function"==typeof m?" "+g+"("+l+") ":" "+g+".test("+l+") ",r+=") { "}}var w=w||[];w.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",r+=d?""+f:""+e.util.toQuotedString(o),r+=" } ",!1!==e.opts.messages&&(r+=" , message: 'should match format \"",r+=d?"' + "+f+" + '":""+e.util.escapeQuotes(o),r+="\"' "),e.opts.verbose&&(r+=" , schema: ",r+=d?"validate.schema"+s:""+e.util.toQuotedString(o),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var x=r;return r=w.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",c&&(r+=" else { "),r}},84987:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(a||""),f="valid"+i,d="errs__"+i,p=e.util.copy(e);p.level++;var h="valid"+p.level,m=e.schema.then,v=e.schema.else,y=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all)),b=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0||!1===v:e.util.schemaHasRules(v,e.RULES.all)),g=p.baseId;if(y||b){var w;p.createErrors=!1,p.schema=o,p.schemaPath=s,p.errSchemaPath=u,r+=" var "+d+" = errors; var "+f+" = true; ";var x=e.compositeRule;e.compositeRule=p.compositeRule=!0,r+=" "+e.validate(p)+" ",p.baseId=g,p.createErrors=!0,r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=p.compositeRule=x,y?(r+=" if ("+h+") { ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(p)+" ",p.baseId=g,r+=" "+f+" = "+h+"; ",y&&b?r+=" var "+(w="ifClause"+i)+" = 'then'; ":w="'then'",r+=" } ",b&&(r+=" else { ")):r+=" if (!"+h+") { ",b&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(p)+" ",p.baseId=g,r+=" "+f+" = "+h+"; ",y&&b?r+=" var "+(w="ifClause"+i)+" = 'else'; ":w="'else'",r+=" } "),r+=" if (!"+f+") { var err = ",!1!==e.createErrors?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(r+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",c&&(r+=" else { ")}else c&&(r+=" if (true) { ");return r}},38690:function(e,t,n){"use strict";e.exports={$ref:n(16348),allOf:n(51389),anyOf:n(32746),$comment:n(26985),const:n(36922),contains:n(83925),dependencies:n(7023),enum:n(42785),format:n(72563),if:n(84987),items:n(73250),maximum:n(17851),minimum:n(17851),maxItems:n(16982),minItems:n(16982),maxLength:n(9429),minLength:n(9429),maxProperties:n(68447),minProperties:n(68447),multipleOf:n(46180),not:n(3922),oneOf:n(15033),pattern:n(74589),properties:n(9854),propertyNames:n(77551),required:n(85856),uniqueItems:n(91538),validate:n(23073)}},73250:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(a||""),f="valid"+i,d="errs__"+i,p=e.util.copy(e),h="";p.level++;var m="valid"+p.level,v="i"+i,y=p.dataLevel=e.dataLevel+1,b="data"+y,g=e.baseId;if(r+="var "+d+" = errors;var "+f+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){r+=" "+f+" = "+l+".length <= "+o.length+"; ";var x=u;u=e.errSchemaPath+"/additionalItems",r+=" if (!"+f+") { ";var k=k||[];k.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var A=r;r=k.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+A+"]); ":r+=" validate.errors = ["+A+"]; return false; ":r+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",u=x,c&&(h+="}",r+=" else { ")}var E=o;if(E)for(var _,T=-1,S=E.length-1;T0||!1===_:e.util.schemaHasRules(_,e.RULES.all)){r+=" "+m+" = true; if ("+l+".length > "+T+") { ";var C=l+"["+T+"]";p.schema=_,p.schemaPath=s+"["+T+"]",p.errSchemaPath=u+"/"+T,p.errorPath=e.util.getPathExpr(e.errorPath,T,e.opts.jsonPointers,!0),p.dataPathArr[y]=T;var O=e.validate(p);p.baseId=g,e.util.varOccurences(O,b)<2?r+=" "+e.util.varReplace(O,b,C)+" ":r+=" var "+b+" = "+C+"; "+O+" ",r+=" } ",c&&(r+=" if ("+m+") { ",h+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0||!1===w:e.util.schemaHasRules(w,e.RULES.all))){p.schema=w,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+m+" = true; if ("+l+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+l+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);C=l+"["+v+"]";p.dataPathArr[y]=v;O=e.validate(p);p.baseId=g,e.util.varOccurences(O,b)<2?r+=" "+e.util.varReplace(O,b,C)+" ":r+=" var "+b+" = "+C+"; "+O+" ",c&&(r+=" if (!"+m+") break; "),r+=" } } ",c&&(r+=" if ("+m+") { ",h+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){p.schema=o,p.schemaPath=s,p.errSchemaPath=u,r+=" for (var "+v+" = 0; "+v+" < "+l+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);C=l+"["+v+"]";p.dataPathArr[y]=v;O=e.validate(p);p.baseId=g,e.util.varOccurences(O,b)<2?r+=" "+e.util.varReplace(O,b,C)+" ":r+=" var "+b+" = "+C+"; "+O+" ",c&&(r+=" if (!"+m+") break; "),r+=" }"}return c&&(r+=" "+h+" if ("+d+" == errors) {"),r}},46180:function(e){"use strict";e.exports=function(e,t,n){var r,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;if(d?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",r="schema"+a):r=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");i+="var division"+a+";if (",d&&(i+=" "+r+" !== undefined && ( typeof "+r+" != 'number' || "),i+=" (division"+a+" = "+f+" / "+r+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+a+" !== parseInt(division"+a+") ",i+=" ) ",d&&(i+=" ) "),i+=" ) { ";var p=p||[];p.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be multiple of ",i+=d?"' + "+r:r+"'"),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var h=i;return i=p.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+h+"]); ":i+=" validate.errors = ["+h+"]; return false; ":i+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},3922:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(a||""),f="errs__"+i,d=e.util.copy(e);d.level++;var p="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=u,r+=" var "+f+" = errors; ";var h,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(h=d.opts.allErrors,d.opts.allErrors=!1),r+=" "+e.validate(d)+" ",d.createErrors=!0,h&&(d.opts.allErrors=h),e.compositeRule=d.compositeRule=m,r+=" if ("+p+") { ";var v=v||[];v.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var y=r;r=v.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(r+=" if (false) { ");return r}},15033:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(a||""),f="valid"+i,d="errs__"+i,p=e.util.copy(e),h="";p.level++;var m="valid"+p.level,v=p.baseId,y="prevValid"+i,b="passingSchemas"+i;r+="var "+d+" = errors , "+y+" = false , "+f+" = false , "+b+" = null; ";var g=e.compositeRule;e.compositeRule=p.compositeRule=!0;var w=o;if(w)for(var x,k=-1,A=w.length-1;k0||!1===x:e.util.schemaHasRules(x,e.RULES.all))?(p.schema=x,p.schemaPath=s+"["+k+"]",p.errSchemaPath=u+"/"+k,r+=" "+e.validate(p)+" ",p.baseId=v):r+=" var "+m+" = true; ",k&&(r+=" if ("+m+" && "+y+") { "+f+" = false; "+b+" = ["+b+", "+k+"]; } else { ",h+="}"),r+=" if ("+m+") { "+f+" = "+y+" = true; "+b+" = "+k+"; }";return e.compositeRule=p.compositeRule=g,r+=h+"if (!"+f+") { var err = ",!1!==e.createErrors?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+b+" } ",!1!==e.opts.messages&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}},74589:function(e){"use strict";e.exports=function(e,t,n){var r,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",r="schema"+a):r=s,i+="if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'string') || "),i+=" !"+(d?"(new RegExp("+r+"))":e.usePattern(s))+".test("+f+") ) { ";var p=p||[];p.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern: ",i+=d?""+r:""+e.util.toQuotedString(s),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match pattern \"",i+=d?"' + "+r+" + '":""+e.util.escapeQuotes(s),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+e.util.toQuotedString(s),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var h=i;return i=p.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+h+"]); ":i+=" validate.errors = ["+h+"]; return false; ":i+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},9854:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(a||""),f="errs__"+i,d=e.util.copy(e),p="";d.level++;var h="valid"+d.level,m="key"+i,v="idx"+i,y=d.dataLevel=e.dataLevel+1,b="data"+y,g="dataProperties"+i,w=Object.keys(o||{}).filter(M),x=e.schema.patternProperties||{},k=Object.keys(x).filter(M),A=e.schema.additionalProperties,E=w.length||k.length,_=!1===A,T="object"==typeof A&&Object.keys(A).length,S=e.opts.removeAdditional,C=_||T||S,O=e.opts.ownProperties,I=e.baseId,P=e.schema.required;if(P&&(!e.opts.$data||!P.$data)&&P.length8)r+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var N=w;if(N)for(var j=-1,L=N.length-1;j0||!1===X:e.util.schemaHasRules(X,e.RULES.all)){var $=e.util.getProperty(K),ee=(V=l+$,G&&void 0!==X.default);d.schema=X,d.schemaPath=s+$,d.errSchemaPath=u+"/"+e.util.escapeFragment(K),d.errorPath=e.util.getPath(e.errorPath,K,e.opts.jsonPointers),d.dataPathArr[y]=e.util.toQuotedString(K);W=e.validate(d);if(d.baseId=I,e.util.varOccurences(W,b)<2){W=e.util.varReplace(W,b,V);var te=V}else{te=b;r+=" var "+b+" = "+V+"; "}if(ee)r+=" "+W+" ";else{if(R&&R[K]){r+=" if ( "+te+" === undefined ",O&&(r+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(K)+"') "),r+=") { "+h+" = false; ";F=e.errorPath,z=u;var ne,re=e.util.escapeQuotes(K);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(F,K,e.opts.jsonPointers)),u=e.errSchemaPath+"/required",(ne=ne||[]).push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+re+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";H=r;r=ne.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+H+"]); ":r+=" validate.errors = ["+H+"]; return false; ":r+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=z,e.errorPath=F,r+=" } else { "}else c?(r+=" if ( "+te+" === undefined ",O&&(r+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(K)+"') "),r+=") { "+h+" = true; } else { "):(r+=" if ("+te+" !== undefined ",O&&(r+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(K)+"') "),r+=" ) { ");r+=" "+W+" } "}}c&&(r+=" if ("+h+") { ",p+="}")}}if(k.length){var ie=k;if(ie)for(var ae,oe=-1,se=ie.length-1;oe0||!1===X:e.util.schemaHasRules(X,e.RULES.all)){d.schema=X,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),r+=O?" "+g+" = "+g+" || Object.keys("+l+"); for (var "+v+"=0; "+v+"<"+g+".length; "+v+"++) { var "+m+" = "+g+"["+v+"]; ":" for (var "+m+" in "+l+") { ",r+=" if ("+e.usePattern(ae)+".test("+m+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);V=l+"["+m+"]";d.dataPathArr[y]=m;W=e.validate(d);d.baseId=I,e.util.varOccurences(W,b)<2?r+=" "+e.util.varReplace(W,b,V)+" ":r+=" var "+b+" = "+V+"; "+W+" ",c&&(r+=" if (!"+h+") break; "),r+=" } ",c&&(r+=" else "+h+" = true; "),r+=" } ",c&&(r+=" if ("+h+") { ",p+="}")}}}return c&&(r+=" "+p+" if ("+f+" == errors) {"),r}},77551:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(a||""),f="errs__"+i,d=e.util.copy(e);d.level++;var p="valid"+d.level;if(r+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=u;var h="key"+i,m="idx"+i,v="i"+i,y="' + "+h+" + '",b="data"+(d.dataLevel=e.dataLevel+1),g="dataProperties"+i,w=e.opts.ownProperties,x=e.baseId;w&&(r+=" var "+g+" = undefined; "),r+=w?" "+g+" = "+g+" || Object.keys("+l+"); for (var "+m+"=0; "+m+"<"+g+".length; "+m+"++) { var "+h+" = "+g+"["+m+"]; ":" for (var "+h+" in "+l+") { ",r+=" var startErrs"+i+" = errors; ";var k=h,A=e.compositeRule;e.compositeRule=d.compositeRule=!0;var E=e.validate(d);d.baseId=x,e.util.varOccurences(E,b)<2?r+=" "+e.util.varReplace(E,b,k)+" ":r+=" var "+b+" = "+k+"; "+E+" ",e.compositeRule=d.compositeRule=A,r+=" if (!"+p+") { for (var "+v+"=startErrs"+i+"; "+v+"0||!1===g:e.util.schemaHasRules(g,e.RULES.all))||(h[h.length]=v)}}else h=o;if(d||h.length){var w=e.errorPath,x=d||h.length>=e.opts.loopRequired,k=e.opts.ownProperties;if(c)if(r+=" var missing"+i+"; ",x){d||(r+=" var "+p+" = validate.schema"+s+"; ");var A="' + "+(O="schema"+i+"["+(T="i"+i)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,O,e.opts.jsonPointers)),r+=" var "+f+" = true; ",d&&(r+=" if (schema"+i+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+i+")) "+f+" = false; else {"),r+=" for (var "+T+" = 0; "+T+" < "+p+".length; "+T+"++) { "+f+" = "+l+"["+p+"["+T+"]] !== undefined ",k&&(r+=" && Object.prototype.hasOwnProperty.call("+l+", "+p+"["+T+"]) "),r+="; if (!"+f+") break; } ",d&&(r+=" } "),r+=" if (!"+f+") { ",(C=C||[]).push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+A+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var E=r;r=C.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var _=h;if(_)for(var T=-1,S=_.length-1;T 1) { ";var h=e.schema.items&&e.schema.items.type,m=Array.isArray(h);if(!h||"object"==h||"array"==h||m&&(h.indexOf("object")>=0||h.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+d+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var v="checkDataType"+(m?"s":"");i+=" if ("+e.util[v](h,"item",e.opts.strictNumbers,!0)+") continue; ",m&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",p&&(i+=" } "),i+=" if (!"+d+") { ";var y=y||[];y.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=p?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var b=i;i=y.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i}},23073:function(e){"use strict";e.exports=function(e,t,n){var r="",i=!0===e.schema.$async,a=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),o=e.self._getId(e.schema);if(e.opts.strictKeywords){var s=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(s){var u="unknown keyword: "+s;if("log"!==e.opts.strictKeywords)throw new Error(u);e.logger.warn(u)}}if(e.isTop&&(r+=" var validate = ",i&&(e.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(e.opts.sourceCode||e.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof e.schema||!a&&!e.schema.$ref){t="false schema";var c=e.level,l=e.dataLevel,f=e.schema[t],d=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),v="valid"+c;if(!1===e.schema){e.isTop?h=!0:r+=" var "+v+" = false; ",(J=J||[]).push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'boolean schema is false' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var y=r;r=J.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?r+=i?" return data; ":" validate.errors = null; return true; ":r+=" var "+v+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var b=e.isTop;c=e.level=0,l=e.dataLevel=0,m="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var g="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(g);e.logger.warn(g)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{c=e.level,m="data"+((l=e.dataLevel)||"");if(o&&(e.baseId=e.resolve.url(e.baseId,o)),i&&!e.async)throw new Error("async schema in sync schema");r+=" var errs_"+c+" = errors;"}v="valid"+c,h=!e.opts.allErrors;var w="",x="",k=e.schema.type,A=Array.isArray(k);if(k&&e.opts.nullable&&!0===e.schema.nullable&&(A?-1==k.indexOf("null")&&(k=k.concat("null")):"null"!=k&&(k=[k,"null"],A=!0)),A&&1==k.length&&(k=k[0],A=!1),e.schema.$ref&&a){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(a=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(r+=" "+e.RULES.all.$comment.code(e,"$comment")),k){if(e.opts.coerceTypes)var E=e.util.coerceToTypes(e.opts.coerceTypes,k);var _=e.RULES.types[k];if(E||A||!0===_||_&&!Q(_)){d=e.schemaPath+".type",p=e.errSchemaPath+"/type",d=e.schemaPath+".type",p=e.errSchemaPath+"/type";var T=A?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[T](k,m,e.opts.strictNumbers,!0)+") { ",E){var S="dataType"+c,C="coerced"+c;r+=" var "+S+" = typeof "+m+"; var "+C+" = undefined; ","array"==e.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+S+" = typeof "+m+"; if ("+e.util.checkDataType(e.schema.type,m,e.opts.strictNumbers)+") "+C+" = "+m+"; } "),r+=" if ("+C+" !== undefined) ; ";var O=E;if(O)for(var I,P=-1,R=O.length-1;P1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},e.prototype._dispatch=function(){var e=this,t=this._queue.shift();if(t){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},e}();t.default=i},50224:function(e,t,n){"use strict";t.WU=void 0;var r=n(44246);Object.defineProperty(t,"WU",{enumerable:!0,get:function(){return r.default}});var i=n(75884);var a=n(73398)},73398:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=void 0;var r=n(5052);t.withTimeout=function(e,t,n){var i=this;return void 0===n&&(n=new Error("timeout")),{acquire:function(){return new Promise((function(a,o){return r.__awaiter(i,void 0,void 0,(function(){var i,s;return r.__generator(this,(function(r){switch(r.label){case 0:return i=!1,setTimeout((function(){i=!0,o(n)}),t),[4,e.acquire()];case 1:return s=r.sent(),i?(Array.isArray(s)?s[1]:s)():a(s),[2]}}))}))}))},runExclusive:function(e){return r.__awaiter(this,void 0,void 0,(function(){var t,n;return r.__generator(this,(function(r){switch(r.label){case 0:t=function(){},r.label=1;case 1:return r.trys.push([1,,7,8]),[4,this.acquire()];case 2:return n=r.sent(),Array.isArray(n)?(t=n[1],[4,e(n[0])]):[3,4];case 3:return[2,r.sent()];case 4:return t=n,[4,e()];case 5:return[2,r.sent()];case 6:return[3,8];case 7:return t(),[7];case 8:return[2]}}))}))},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}},2470:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,a=s(e),o=a[0],u=a[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,o,u)),l=0,f=u>0?o-4:o;for(n=0;n>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[l++]=255&t);1===u&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;sc?c:s+o));1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],r=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=a[o],r[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,a,o=[],s=t;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},65109:function(e){"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={},r=0;r<32;r++){var i=t.charAt(r);if(void 0!==n[i])throw new TypeError(i+" is ambiguous");n[i]=r}function a(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function o(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=a(t)^r>>5}for(t=a(t),n=0;nt)return"Exceeds length limit";var r=e.toLowerCase(),i=e.toUpperCase();if(e!==r&&e!==i)return"Mixed-case string "+e;var s=(e=r).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var u=e.slice(0,s),c=e.slice(s+1);if(c.length<6)return"Data too short";var l=o(u);if("string"===typeof l)return l;for(var f=[],d=0;d=c.length||f.push(h)}return 1!==l?"Invalid checksum for "+e:{prefix:u,words:f}}function u(e,t,n,r){for(var i=0,a=0,o=(1<=n;)a-=n,s.push(i>>a&o);if(r)a>0&&s.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var i=o(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var s=e+"1",u=0;u>5!==0)throw new Error("Non 5-bit word");i=a(i)^c,s+=t.charAt(c)}for(u=0;u<6;++u)i=a(i);for(i^=1,u=0;u<6;++u){s+=t.charAt(i>>5*(5-u)&31)}return s},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},76791:function(e,t,n){var r;!function(i){"use strict";var a,o=1e6,s=1e6,u="[big.js] ",c=u+"Invalid ",l=c+"decimal places",f=c+"rounding mode",d=u+"Division by zero",p={},h=void 0,m=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function v(e,t,n,r){var i=e.c,a=e.e+t+1;if(a=5;else if(2===n)r=i[a]>5||5==i[a]&&(r||a<0||i[a+1]!==h||1&i[a-1]);else if(3===n)r=r||!!i[0];else if(r=!1,0!==n)throw Error(f);if(a<1)i.length=1,r?(e.e=-t,i[0]=1):i[0]=e.e=0;else{if(i.length=a--,r)for(;++i[a]>9;)i[a]=0,a--||(++e.e,i.unshift(1));for(a=i.length;!i[--a];)i.pop()}}else if(n<0||n>3||n!==~~n)throw Error(f);return e}function y(e,t,n,r){var i,a,s=e.constructor,u=!e.c[0];if(n!==h){if(n!==~~n||n<(3==t)||n>o)throw Error(3==t?c+"precision":l);for(n=r-(e=new s(e)).e,e.c.length>++r&&v(e,n,s.RM),2==t&&(r=e.e+n+1);e.c.length=s.PE))a=a.charAt(0)+(n>1?"."+a.slice(1):"")+(i<0?"e":"e+")+i;else if(i<0){for(;++i;)a="0"+a;a="0."+a}else if(i>0)if(++i>n)for(i-=n;i--;)a+="0";else i1&&(a=a.charAt(0)+"."+a.slice(1));return e.s<0&&(!u||4==t)?"-"+a:a}p.abs=function(){var e=new this.constructor(this);return e.s=1,e},p.cmp=function(e){var t,n=this,r=n.c,i=(e=new n.constructor(e)).c,a=n.s,o=e.s,s=n.e,u=e.e;if(!r[0]||!i[0])return r[0]?a:i[0]?-o:0;if(a!=o)return a;if(t=a<0,s!=u)return s>u^t?1:-1;for(o=(s=r.length)<(u=i.length)?s:u,a=-1;++ai[a]^t?1:-1;return s==u?0:s>u^t?1:-1},p.div=function(e){var t=this,n=t.constructor,r=t.c,i=(e=new n(e)).c,a=t.s==e.s?1:-1,s=n.DP;if(s!==~~s||s<0||s>o)throw Error(l);if(!i[0])throw Error(d);if(!r[0])return new n(0*a);var u,c,f,p,m,y=i.slice(),b=u=i.length,g=r.length,w=r.slice(0,u),x=w.length,k=e,A=k.c=[],E=0,_=s+(k.e=t.e-e.e)+1;for(k.s=a,a=_<0?0:_,y.unshift(0);x++x?1:-1;else for(m=-1,p=0;++mw[m]?1:-1;break}if(!(p<0))break;for(c=x==u?i:y;x;){if(w[--x]_&&v(k,s,n.RM,w[0]!==h),k},p.eq=function(e){return!this.cmp(e)},p.gt=function(e){return this.cmp(e)>0},p.gte=function(e){return this.cmp(e)>-1},p.lt=function(e){return this.cmp(e)<0},p.lte=function(e){return this.cmp(e)<1},p.minus=p.sub=function(e){var t,n,r,i,a=this,o=a.constructor,s=a.s,u=(e=new o(e)).s;if(s!=u)return e.s=-u,a.plus(e);var c=a.c.slice(),l=a.e,f=e.c,d=e.e;if(!c[0]||!f[0])return f[0]?(e.s=-u,e):new o(c[0]?a:0);if(s=l-d){for((i=s<0)?(s=-s,r=c):(d=l,r=f),r.reverse(),u=s;u--;)r.push(0);r.reverse()}else for(n=((i=c.length0)for(;u--;)c[t++]=0;for(u=t;n>s;){if(c[--n]0?(u=o,t=c):(i=-i,t=s),t.reverse();i--;)t.push(0);t.reverse()}for(s.length-c.length<0&&(t=c,c=s,s=t),i=c.length,a=0;i;s[i]%=10)a=(s[--i]=s[i]+c[i]+a)/10|0;for(a&&(s.unshift(a),++u),i=s.length;0===s[--i];)s.pop();return e.c=s,e.e=u,e},p.pow=function(e){var t=this,n=new t.constructor(1),r=n,i=e<0;if(e!==~~e||e<-1e6||e>s)throw Error(c+"exponent");for(i&&(e=-e);1&e&&(r=r.times(t)),e>>=1;)t=t.times(t);return i?n.div(r):r},p.round=function(e,t){var n=this.constructor;if(e===h)e=0;else if(e!==~~e||e<-o||e>o)throw Error(l);return v(new n(this),e,t===h?n.RM:t)},p.sqrt=function(){var e,t,n,r=this,i=r.constructor,a=r.s,o=r.e,s=new i(.5);if(!r.c[0])return new i(r);if(a<0)throw Error(u+"No square root");0===(a=Math.sqrt(r+""))||a===1/0?((t=r.c.join("")).length+o&1||(t+="0"),o=((o+1)/2|0)-(o<0||1&o),e=new i(((a=Math.sqrt(t))==1/0?"1e":(a=a.toExponential()).slice(0,a.indexOf("e")+1))+o)):e=new i(a),o=e.e+(i.DP+=4);do{n=e,e=s.times(n.plus(r.div(n)))}while(n.c.slice(0,o).join("")!==e.c.slice(0,o).join(""));return v(e,i.DP-=4,i.RM)},p.times=p.mul=function(e){var t,n=this,r=n.constructor,i=n.c,a=(e=new r(e)).c,o=i.length,s=a.length,u=n.e,c=e.e;if(e.s=n.s==e.s?1:-1,!i[0]||!a[0])return new r(0*e.s);for(e.e=u+c,ou;)s=t[c]+a[u]*i[c-u-1]+s,t[c--]=s%10,s=s/10|0;t[c]=(t[c]+s)%10}for(s?++e.e:t.shift(),u=t.length;!t[--u];)t.pop();return e.c=t,e},p.toExponential=function(e){return y(this,1,e,e)},p.toFixed=function(e){return y(this,2,e,this.e+e)},p.toPrecision=function(e){return y(this,3,e,e-1)},p.toString=function(){return y(this)},p.valueOf=p.toJSON=function(){return y(this,4)},a=function e(){function t(n){var r=this;if(!(r instanceof t))return n===h?e():new t(n);n instanceof t?(r.s=n.s,r.e=n.e,r.c=n.c.slice()):function(e,t){var n,r,i;if(0===t&&1/t<0)t="-0";else if(!m.test(t+=""))throw Error(c+"number");e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(n=t.indexOf("."))>-1&&(t=t.replace(".",""));(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length);for(i=t.length,r=0;r0&&"0"==t.charAt(--i););for(e.e=n-r-1,e.c=[],n=0;r<=i;)e.c[n++]=+t.charAt(r++)}}(r,n),r.constructor=t}return t.prototype=p,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.version="5.2.2",t}(),a.default=a.Big=a,void 0===(r=function(){return a}.call(t,n,t,e))||(e.exports=r)}()},58704:function(e,t,n){var r;!function(i){"use strict";var a,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",f=1e14,d=14,p=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,v=1e9;function y(e){var t=0|e;return e>0||e===t?t:t-1}function b(e){for(var t,n,r=1,i=e.length,a=e[0]+"";rc^n?1:-1;for(s=(u=i.length)<(c=a.length)?u:c,o=0;oa[o]^n?1:-1;return u==c?0:u>c^n?1:-1}function w(e,t,n,r){if(en||e!==u(e))throw Error(c+(r||"Argument")+("number"==typeof e?en?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function x(e){var t=e.c.length-1;return y(e.e/d)==t&&e.c[t]%2!=0}function k(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function A(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(++t>(r=e.length)){for(i=n,t-=r;--t;i+=n);e+=i}else tI?y.c=y.e=null:e.e=10;f/=10,c++);return void(c>I?y.c=y.e=null:(y.e=c,y.c=[e]))}v=String(e)}else{if(!o.test(v=String(e)))return i(y,v,h);y.s=45==v.charCodeAt(0)?(v=v.slice(1),-1):1}(c=v.indexOf("."))>-1&&(v=v.replace(".","")),(f=v.search(/e/i))>0?(c<0&&(c=f),c+=+v.slice(f+1),v=v.substring(0,f)):c<0&&(c=v.length)}else{if(w(t,2,j.length,"Base"),10==t&&L)return Z(y=new D(e),_+y.e+1,T);if(v=String(e),h="number"==typeof e){if(0*e!=0)return i(y,v,h,t);if(y.s=1/e<0?(v=v.slice(1),-1):1,D.DEBUG&&v.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else y.s=45===v.charCodeAt(0)?(v=v.slice(1),-1):1;for(n=j.slice(0,t),c=f=0,m=v.length;fc){c=m;continue}}else if(!s&&(v==v.toUpperCase()&&(v=v.toLowerCase())||v==v.toLowerCase()&&(v=v.toUpperCase()))){s=!0,f=-1,c=0;continue}return i(y,String(e),h,t)}h=!1,(c=(v=r(v,t,10,y.s)).indexOf("."))>-1?v=v.replace(".",""):c=v.length}for(f=0;48===v.charCodeAt(f);f++);for(m=v.length;48===v.charCodeAt(--m););if(v=v.slice(f,++m)){if(m-=f,h&&D.DEBUG&&m>15&&(e>p||e!==u(e)))throw Error(l+y.s*e);if((c=c-f-1)>I)y.c=y.e=null;else if(c=C)?k(u,o):A(u,o,"0");else if(a=(e=Z(new D(e),t,n)).e,s=(u=b(e.c)).length,1==r||2==r&&(t<=a||a<=S)){for(;ss){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=a-s)>0)for(a+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function U(e,t){for(var n,r=1,i=new D(e[0]);r=10;i/=10,r++);return(n=r+n*d-1)>I?e.c=e.e=null:n=10;c/=10,i++);if((a=t-i)<0)a+=d,o=t,m=(l=v[p=0])/y[i-o-1]%10|0;else if((p=s((a+1)/d))>=v.length){if(!r)break e;for(;v.length<=p;v.push(0));l=m=0,i=1,o=(a%=d)-d+1}else{for(l=c=v[p],i=1;c>=10;c/=10,i++);m=(o=(a%=d)-d+i)<0?0:l/y[i-o-1]%10|0}if(r=r||t<0||null!=v[p+1]||(o<0?l:l%y[i-o-1]),r=n<4?(m||r)&&(0==n||n==(e.s<0?3:2)):m>5||5==m&&(4==n||r||6==n&&(a>0?o>0?l/y[i-o]:0:v[p-1])%10&1||n==(e.s<0?8:7)),t<1||!v[0])return v.length=0,r?(t-=e.e+1,v[0]=y[(d-t%d)%d],e.e=-t||0):v[0]=e.e=0,e;if(0==a?(v.length=p,c=1,p--):(v.length=p+1,c=y[d-a],v[p]=o>0?u(l/y[i-o]%y[o])*c:0),r)for(;;){if(0==p){for(a=1,o=v[0];o>=10;o/=10,a++);for(o=v[0]+=c,c=1;o>=10;o/=10,c++);a!=c&&(e.e++,v[0]==f&&(v[0]=1));break}if(v[p]+=c,v[p]!=f)break;v[p--]=0,c=1}for(a=v.length;0===v[--a];v.pop());}e.e>I?e.c=e.e=null:e.e=C?k(t,n):A(t,n,"0"),e.s<0?"-"+t:t)}return D.clone=e,D.ROUND_UP=0,D.ROUND_DOWN=1,D.ROUND_CEIL=2,D.ROUND_FLOOR=3,D.ROUND_HALF_UP=4,D.ROUND_HALF_DOWN=5,D.ROUND_HALF_EVEN=6,D.ROUND_HALF_CEIL=7,D.ROUND_HALF_FLOOR=8,D.EUCLID=9,D.config=D.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(w(n=e[t],0,v,t),_=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(w(n=e[t],0,8,t),T=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(w(n[0],-v,0,t),w(n[1],0,v,t),S=n[0],C=n[1]):(w(n,-v,v,t),S=-(C=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)w(n[0],-v,-1,t),w(n[1],1,v,t),O=n[0],I=n[1];else{if(w(n,-v,v,t),!n)throw Error(c+t+" cannot be zero: "+n);O=-(I=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(c+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw P=!n,Error(c+"crypto unavailable");P=n}else P=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(w(n=e[t],0,9,t),R=n),e.hasOwnProperty(t="POW_PRECISION")&&(w(n=e[t],0,v,t),M=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(c+t+" not an object: "+n);N=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(c+t+" invalid: "+n);L="0123456789"==n.slice(0,10),j=n}}return{DECIMAL_PLACES:_,ROUNDING_MODE:T,EXPONENTIAL_AT:[S,C],RANGE:[O,I],CRYPTO:P,MODULO_MODE:R,POW_PRECISION:M,FORMAT:N,ALPHABET:j}},D.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!D.DEBUG)return!0;var t,n,r=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(r)){if((1===a||-1===a)&&i>=-v&&i<=v&&i===u(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(r[0]).length==t){for(t=0;t=f||n!==u(n))break e;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(c+"Invalid BigNumber: "+e)},D.maximum=D.max=function(){return U(arguments,a.lt)},D.minimum=D.min=function(){return U(arguments,a.gt)},D.random=function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return u(Math.random()*e)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(e){var n,r,i,a,o,l=0,f=[],p=new D(E);if(null==e?e=_:w(e,0,v),a=s(e/d),P)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(a*=2));l>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[l]=r[0],n[l+1]=r[1]):(f.push(o%1e14),l+=2);l=a/2}else{if(!crypto.randomBytes)throw P=!1,Error(c+"crypto unavailable");for(n=crypto.randomBytes(a*=7);l=9e15?crypto.randomBytes(7).copy(n,l):(f.push(o%1e14),l+=7);l=a/7}if(!P)for(;l=10;o/=10,l++);ln-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/n|0,o[i]%=n)}return o.reverse()}return function(r,i,a,o,s){var u,c,l,f,d,p,h,m,v=r.indexOf("."),y=_,g=T;for(v>=0&&(f=M,M=0,r=r.replace(".",""),p=(m=new D(i)).pow(r.length-v),M=f,m.c=t(A(b(p.c),p.e,"0"),10,a,e),m.e=m.c.length),l=f=(h=t(r,i,a,s?(u=j,e):(u=e,j))).length;0==h[--f];h.pop());if(!h[0])return u.charAt(0);if(v<0?--l:(p.c=h,p.e=l,p.s=o,h=(p=n(p,m,y,g,a)).c,d=p.r,l=p.e),v=h[c=l+y+1],f=a/2,d=d||c<0||null!=h[c+1],d=g<4?(null!=v||d)&&(0==g||g==(p.s<0?3:2)):v>f||v==f&&(4==g||d||6==g&&1&h[c-1]||g==(p.s<0?8:7)),c<1||!h[0])r=d?A(u.charAt(1),-y,u.charAt(0)):u.charAt(0);else{if(h.length=c,d)for(--a;++h[--c]>a;)h[c]=0,c||(++l,h=[1].concat(h));for(f=h.length;!h[--f];);for(v=0,r="";v<=f;r+=u.charAt(h[v++]));r=A(r,l,u.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,i,a,o,s=0,u=e.length,c=t%m,l=t/m|0;for(e=e.slice();u--;)s=((i=c*(a=e[u]%m)+(r=l*a+(o=e[u]/m|0)*c)%m*m+s)/n|0)+(r/m|0)+l*o,e[u]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]1;e.splice(0,1));}return function(r,i,a,o,s){var c,l,p,h,m,v,b,g,w,x,k,A,E,_,T,S,C,O=r.s==i.s?1:-1,I=r.c,P=i.c;if(!I||!I[0]||!P||!P[0])return new D(r.s&&i.s&&(I?!P||I[0]!=P[0]:P)?I&&0==I[0]||!P?0*O:O/0:NaN);for(w=(g=new D(O)).c=[],O=a+(l=r.e-i.e)+1,s||(s=f,l=y(r.e/d)-y(i.e/d),O=O/d|0),p=0;P[p]==(I[p]||0);p++);if(P[p]>(I[p]||0)&&l--,O<0)w.push(1),h=!0;else{for(_=I.length,S=P.length,p=0,O+=2,(m=u(s/(P[0]+1)))>1&&(P=e(P,m,s),I=e(I,m,s),S=P.length,_=I.length),E=S,k=(x=I.slice(0,S)).length;k=s/2&&T++;do{if(m=0,(c=t(P,x,S,k))<0){if(A=x[0],S!=k&&(A=A*s+(x[1]||0)),(m=u(A/T))>1)for(m>=s&&(m=s-1),b=(v=e(P,m,s)).length,k=x.length;1==t(v,x,b,k);)m--,n(v,S=10;O/=10,p++);Z(g,a+(g.e=p+l*d-1)+1,o,h)}else g.e=l,g.r=+h;return g}}(),i=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,o,s,u){var l,f=s?o:o.replace(i,"");if(r.test(f))a.s=isNaN(f)?null:f<0?-1:1;else{if(!s&&(f=f.replace(e,(function(e,t,n){return l="x"==(n=n.toLowerCase())?16:"b"==n?2:8,u&&u!=l?e:t})),u&&(l=u,f=f.replace(t,"$1").replace(n,"0.$1")),o!=f))return new D(f,l);if(D.DEBUG)throw Error(c+"Not a"+(u?" base "+u:"")+" number: "+o);a.s=null}a.c=a.e=null}}(),a.absoluteValue=a.abs=function(){var e=new D(this);return e.s<0&&(e.s=1),e},a.comparedTo=function(e,t){return g(this,new D(e,t))},a.decimalPlaces=a.dp=function(e,t){var n,r,i,a=this;if(null!=e)return w(e,0,v),null==t?t=T:w(t,0,8),Z(new D(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-y(this.e/d))*d,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},a.dividedBy=a.div=function(e,t){return n(this,new D(e,t),_,T)},a.dividedToIntegerBy=a.idiv=function(e,t){return n(this,new D(e,t),0,1)},a.exponentiatedBy=a.pow=function(e,t){var n,r,i,a,o,l,f,p,h=this;if((e=new D(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+z(e));if(null!=t&&(t=new D(t)),o=e.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return p=new D(Math.pow(+z(h),o?e.s*(2-x(e)):+z(e))),t?p.mod(t):p;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new D(NaN);(r=!l&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(e.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||o&&h.c[1]>=24e7:h.c[0]<8e13||o&&h.c[0]<=9999975e7)))return a=h.s<0&&x(e)?-0:0,h.e>-1&&(a=1/a),new D(l?1/a:a);M&&(a=s(M/d+2))}for(o?(n=new D(.5),l&&(e.s=1),f=x(e)):f=(i=Math.abs(+z(e)))%2,p=new D(E);;){if(f){if(!(p=p.times(h)).c)break;a?p.c.length>a&&(p.c.length=a):r&&(p=p.mod(t))}if(i){if(0===(i=u(i/2)))break;f=i%2}else if(Z(e=e.times(n),e.e+1,1),e.e>14)f=x(e);else{if(0===(i=+z(e)))break;f=i%2}h=h.times(h),a?h.c&&h.c.length>a&&(h.c.length=a):r&&(h=h.mod(t))}return r?p:(l&&(p=E.div(p)),t?p.mod(t):a?Z(p,M,T,undefined):p)},a.integerValue=function(e){var t=new D(this);return null==e?e=T:w(e,0,8),Z(t,t.e+1,e)},a.isEqualTo=a.eq=function(e,t){return 0===g(this,new D(e,t))},a.isFinite=function(){return!!this.c},a.isGreaterThan=a.gt=function(e,t){return g(this,new D(e,t))>0},a.isGreaterThanOrEqualTo=a.gte=function(e,t){return 1===(t=g(this,new D(e,t)))||0===t},a.isInteger=function(){return!!this.c&&y(this.e/d)>this.c.length-2},a.isLessThan=a.lt=function(e,t){return g(this,new D(e,t))<0},a.isLessThanOrEqualTo=a.lte=function(e,t){return-1===(t=g(this,new D(e,t)))||0===t},a.isNaN=function(){return!this.s},a.isNegative=function(){return this.s<0},a.isPositive=function(){return this.s>0},a.isZero=function(){return!!this.c&&0==this.c[0]},a.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(t=(e=new D(e,t)).s,!s||!t)return new D(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/d,c=e.e/d,l=o.c,p=e.c;if(!u||!c){if(!l||!p)return l?(e.s=-t,e):new D(p?o:NaN);if(!l[0]||!p[0])return p[0]?(e.s=-t,e):new D(l[0]?o:3==T?-0:0)}if(u=y(u),c=y(c),l=l.slice(),s=u-c){for((a=s<0)?(s=-s,i=l):(c=u,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=l.length)<(t=p.length))?s:t,s=t=0;t0)for(;t--;l[n++]=0);for(t=f-1;r>s;){if(l[--r]=0;){for(n=0,h=A[i]%w,v=A[i]/w|0,a=i+(o=u);a>i;)n=((c=h*(c=k[--o]%w)+(s=v*c+(l=k[o]/w|0)*h)%w*w+b[a]+n)/g|0)+(s/w|0)+v*l,b[a--]=c%g;b[a]=n}return n?++r:b.splice(0,1),F(e,b,r)},a.negated=function(){var e=new D(this);return e.s=-e.s||null,e},a.plus=function(e,t){var n,r=this,i=r.s;if(t=(e=new D(e,t)).s,!i||!t)return new D(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/d,o=e.e/d,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new D(i/0);if(!s[0]||!u[0])return u[0]?e:new D(s[0]?r:0*i)}if(a=y(a),o=y(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(t=u.length)<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/f|0,s[t]=f===s[t]?0:s[t]%f;return i&&(s=[i].concat(s),++o),F(e,s,o)},a.precision=a.sd=function(e,t){var n,r,i,a=this;if(null!=e&&e!==!!e)return w(e,1,v),null==t?t=T:w(t,0,8),Z(new D(a),e,t);if(!(n=a.c))return null;if(r=(i=n.length-1)*d+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},a.shiftedBy=function(e){return w(e,-9007199254740991,p),this.times("1e"+e)},a.squareRoot=a.sqrt=function(){var e,t,r,i,a,o=this,s=o.c,u=o.s,c=o.e,l=_+4,f=new D("0.5");if(1!==u||!s||!s[0])return new D(!u||u<0&&(!s||s[0])?NaN:s?o:1/0);if(0==(u=Math.sqrt(+z(o)))||u==1/0?(((t=b(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=y((c+1)/2)-(c<0||c%2),r=new D(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):r=new D(u+""),r.c[0])for((u=(c=r.e)+l)<3&&(u=0);;)if(a=r,r=f.times(a.plus(n(o,a,l,1))),b(a.c).slice(0,u)===(t=b(r.c)).slice(0,u)){if(r.e0&&m>0){for(a=m%s||s,f=h.substr(0,a);a0&&(f+=l+h.slice(a)),p&&(f="-"+f)}r=d?f+(n.decimalSeparator||"")+((u=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):f}return(n.prefix||"")+r+(n.suffix||"")},a.toFraction=function(e){var t,r,i,a,o,s,u,l,f,p,m,v,y=this,g=y.c;if(null!=e&&(!(u=new D(e)).isInteger()&&(u.c||1!==u.s)||u.lt(E)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+z(u));if(!g)return new D(y);for(t=new D(E),f=r=new D(E),i=l=new D(E),v=b(g),o=t.e=v.length-y.e-1,t.c[0]=h[(s=o%d)<0?d+s:s],e=!e||u.comparedTo(t)>0?o>0?t:f:u,s=I,I=1/0,u=new D(v),l.c[0]=0;p=n(u,t,0,1),1!=(a=r.plus(p.times(i))).comparedTo(e);)r=i,i=a,f=l.plus(p.times(a=f)),l=a,t=u.minus(p.times(a=t)),u=a;return a=n(e.minus(r),i,0,1),l=l.plus(a.times(f)),r=r.plus(a.times(i)),l.s=f.s=y.s,m=n(f,i,o*=2,T).minus(y).abs().comparedTo(n(l,r,o,T).minus(y).abs())<1?[f,i]:[l,r],I=s,m},a.toNumber=function(){return+z(this)},a.toPrecision=function(e,t){return null!=e&&w(e,1,v),B(this,e,t,2)},a.toString=function(e){var t,n=this,i=n.s,a=n.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=a<=S||a>=C?k(b(n.c),a):A(b(n.c),a,"0"):10===e&&L?t=A(b((n=Z(new D(n),_+a+1,T)).c),n.e,"0"):(w(e,2,j.length,"Base"),t=r(A(b(n.c),a,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},a.valueOf=a.toJSON=function(){return z(this)},a._isBigNumber=!0,null!=t&&D.set(t),D}(),a.default=a.BigNumber=a,void 0===(r=function(){return a}.call(t,n,t,e))||(e.exports=r)}()},45590:function(e,t){"use strict";var n;function r(e,t,r){if(!r||typeof r.value!==n.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+t+"> is not a method!");return{configurable:n.boolTrue,get:function(){var e=r.value.bind(this);return Object.defineProperty(this,t,{value:e,configurable:n.boolTrue,writable:n.boolTrue}),e}}}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.typeOfFunction="function",e.boolTrue=!0}(n||(n={})),t.bind=r,t.default=r},64166:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(46601).Buffer}catch(_){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,r){for(var i=0,a=Math.min(e.length,n),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===n)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var l=["","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 p(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var h=c-p|0;l+=(o=(i=0|e.words[h])*(a=0|t.words[p])+f)/67108864|0,f=67108863&o}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}a.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?l[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],p=d[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modn(p).toString(e);n=(h=h.idivn(p)).isZero()?m+n:l[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return r("undefined"!==typeof o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===t,c=new e(a),l=this.clone();if(u){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),c[s]=o;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,p=0|o[1],h=8191&p,m=p>>>13,v=0|o[2],y=8191&v,b=v>>>13,g=0|o[3],w=8191&g,x=g>>>13,k=0|o[4],A=8191&k,E=k>>>13,_=0|o[5],T=8191&_,S=_>>>13,C=0|o[6],O=8191&C,I=C>>>13,P=0|o[7],R=8191&P,M=P>>>13,N=0|o[8],j=8191&N,L=N>>>13,D=0|o[9],B=8191&D,U=D>>>13,F=0|s[0],Z=8191&F,z=F>>>13,H=0|s[1],q=8191&H,V=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,K=0|s[3],J=8191&K,Q=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,pe=0|s[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ve=(c+(r=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(d,Z)|0))<<13)|0;c=((a=Math.imul(d,z))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,z))+Math.imul(m,Z)|0,a=Math.imul(m,z);var ye=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((a=a+Math.imul(d,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,z))+Math.imul(b,Z)|0,a=Math.imul(b,z),r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,V)|0;var be=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,z))+Math.imul(x,Z)|0,a=Math.imul(x,z),r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,q)|0,a=a+Math.imul(b,V)|0,r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,Y)|0;var ge=(c+(r=r+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;c=((a=a+Math.imul(d,Q)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(A,Z),i=(i=Math.imul(A,z))+Math.imul(E,Z)|0,a=Math.imul(E,z),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,q)|0,a=a+Math.imul(x,V)|0,r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,Y)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Q)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,Q)|0;var we=(c+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,z))+Math.imul(S,Z)|0,a=Math.imul(S,z),r=r+Math.imul(A,q)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(E,q)|0,a=a+Math.imul(E,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Q)|0,r=r+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(d,ne)|0))<<13)|0;c=((a=a+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(O,Z),i=(i=Math.imul(O,z))+Math.imul(I,Z)|0,a=Math.imul(I,z),r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,V)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,Y)|0)+Math.imul(E,G)|0,a=a+Math.imul(E,Y)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Q)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,a=a+Math.imul(m,re)|0;var ke=(c+(r=r+Math.imul(f,ae)|0)|0)+((8191&(i=(i=i+Math.imul(f,oe)|0)+Math.imul(d,ae)|0))<<13)|0;c=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,Z),i=(i=Math.imul(R,z))+Math.imul(M,Z)|0,a=Math.imul(M,z),r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(I,q)|0,a=a+Math.imul(I,V)|0,r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(S,G)|0,a=a+Math.imul(S,Y)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,a=a+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0,r=r+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var Ae=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((a=a+Math.imul(d,ce)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,Z),i=(i=Math.imul(j,z))+Math.imul(L,Z)|0,a=Math.imul(L,z),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(M,q)|0,a=a+Math.imul(M,V)|0,r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(I,G)|0,a=a+Math.imul(I,Y)|0,r=r+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,Q)|0,r=r+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,a=a+Math.imul(x,re)|0,r=r+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(m,ue)|0,a=a+Math.imul(m,ce)|0;var Ee=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(B,Z),i=(i=Math.imul(B,z))+Math.imul(U,Z)|0,a=Math.imul(U,z),r=r+Math.imul(j,q)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(L,q)|0,a=a+Math.imul(L,V)|0,r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(M,G)|0,a=a+Math.imul(M,Y)|0,r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,Q)|0,r=r+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(E,ne)|0,a=a+Math.imul(E,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,r=r+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,a=a+Math.imul(b,ce)|0,r=r+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(m,fe)|0,a=a+Math.imul(m,de)|0;var _e=(c+(r=r+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,he)|0))<<13)|0;c=((a=a+Math.imul(d,me)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,V))+Math.imul(U,q)|0,a=Math.imul(U,V),r=r+Math.imul(j,G)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(L,G)|0,a=a+Math.imul(L,Y)|0,r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Q)|0,r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,a=a+Math.imul(S,re)|0,r=r+Math.imul(A,ae)|0,i=(i=i+Math.imul(A,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,a=a+Math.imul(x,ce)|0,r=r+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,fe)|0,a=a+Math.imul(b,de)|0;var Te=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,Y))+Math.imul(U,G)|0,a=Math.imul(U,Y),r=r+Math.imul(j,J)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,Q)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(I,ne)|0,a=a+Math.imul(I,re)|0,r=r+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,r=r+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,fe)|0,a=a+Math.imul(x,de)|0;var Se=(c+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;c=((a=a+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,Q))+Math.imul(U,J)|0,a=Math.imul(U,Q),r=r+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(M,ne)|0,a=a+Math.imul(M,re)|0,r=r+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,oe)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,oe)|0,r=r+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(S,ue)|0,a=a+Math.imul(S,ce)|0,r=r+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(E,fe)|0,a=a+Math.imul(E,de)|0;var Ce=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;c=((a=a+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,ee))+Math.imul(U,$)|0,a=Math.imul(U,ee),r=r+Math.imul(j,ne)|0,i=(i=i+Math.imul(j,re)|0)+Math.imul(L,ne)|0,a=a+Math.imul(L,re)|0,r=r+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,r=r+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(I,ue)|0,a=a+Math.imul(I,ce)|0,r=r+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(S,fe)|0,a=a+Math.imul(S,de)|0;var Oe=(c+(r=r+Math.imul(A,he)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(E,he)|0))<<13)|0;c=((a=a+Math.imul(E,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(B,ne),i=(i=Math.imul(B,re))+Math.imul(U,ne)|0,a=Math.imul(U,re),r=r+Math.imul(j,ae)|0,i=(i=i+Math.imul(j,oe)|0)+Math.imul(L,ae)|0,a=a+Math.imul(L,oe)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(M,ue)|0,a=a+Math.imul(M,ce)|0,r=r+Math.imul(O,fe)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(I,fe)|0,a=a+Math.imul(I,de)|0;var Ie=(c+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;c=((a=a+Math.imul(S,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,ae),i=(i=Math.imul(B,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),r=r+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(L,ue)|0,a=a+Math.imul(L,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(M,fe)|0,a=a+Math.imul(M,de)|0;var Pe=(c+(r=r+Math.imul(O,he)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(I,he)|0))<<13)|0;c=((a=a+Math.imul(I,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(U,ue)|0,a=Math.imul(U,ce),r=r+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,de)|0)+Math.imul(L,fe)|0,a=a+Math.imul(L,de)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(M,he)|0))<<13)|0;c=((a=a+Math.imul(M,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(B,fe),i=(i=Math.imul(B,de))+Math.imul(U,fe)|0,a=Math.imul(U,de);var Me=(c+(r=r+Math.imul(j,he)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(L,he)|0))<<13)|0;c=((a=a+Math.imul(L,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Ne=(c+(r=Math.imul(B,he))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(U,he)|0))<<13)|0;return c=((a=Math.imul(U,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=xe,u[6]=ke,u[7]=Ae,u[8]=Ee,u[9]=_e,u[10]=Te,u[11]=Se,u[12]=Ce,u[13]=Oe,u[14]=Ie,u[15]=Pe,u[16]=Re,u[17]=Me,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){return(new v).mulp(e,t,n)}function v(e,t){this.x=e,this.y=t}Math.imul||(h=p),a.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?h(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n.strip()}(this,e,t):m(this,e,t),n},v.prototype.makeRBT=function(e){for(var t=new Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},v.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[n]=67108863&a}return 0!==t&&(this.words[n]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new a(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-a|f>>>a,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];0!==(n=26-this._countBits(o))&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(i,d,f);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=d)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},a.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(l),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(u)):(n.isub(t),s.isub(i),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},a.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new A(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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)}b.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(g,b),g.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new w;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return y[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=o;0!==p.cmp(s);){for(var m=p,v=0;0!==m.cmp(s);v++)m=m.redSqr();r(v=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}u=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new E(e)},i(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},23883:function(e,t,n){var r;function i(e){this.rand=e}if(e.exports=function(e){return r||(r=new i(null)),r.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;no)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,n)}function c(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|m(e,t),r=s(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);var i=function(e){if(u.isBuffer(e)){var t=0|h(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||z(e.length)?s(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|h(e))}function d(e){for(var t=e.length<0?0:0|h(e.length),n=s(t),r=0;r=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(i)return r?-1:B(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=n;as&&(n=s-u),a=n;a>=0;a--){for(var f=!0,d=0;di&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function _(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128===(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[i+1],o=e[i+2],128===(192&a)&&128===(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128===(192&a)&&128===(192&o)&&128===(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?u.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else{if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(r,i),l=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return k(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,r,a){return t=+t,n>>>=0,a||N(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,a){return t=+t,n>>>=0,a||N(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||R(e,t,this.length);for(var r=this[e],i=1,a=0;++a>>=0,t>>>=0,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,n>>>=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function U(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function F(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!==e}var H=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},44680:function(e,t,n){"use strict";var r=n(28476),i=n(59962),a=i(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"===typeof n&&a(e,".prototype.")>-1?i(n):n}},59962:function(e,t,n){"use strict";var r=n(1199),i=n(28476),a=i("%Function.prototype.apply%"),o=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||r.call(o,a),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(d){c=null}e.exports=function(e){var t=s(r,o,arguments);u&&c&&(u(t,"length").configurable&&c(t,"length",{value:1+l(0,e.length-(arguments.length-1))}));return t};var f=function(){return s(r,a,arguments)};c?c(e.exports,"apply",{value:f}):e.exports.apply=f},2304:function(e,t,n){"use strict";var r=n(74704).default,i=n(56690).default,a=n(89728).default,o=n(2042).encodeText,s=function(){function e(t,n,r,a){i(this,e),this.name=t,this.code=n,this.codeBuf=o(this.code),this.alphabet=a,this.codec=r(a)}return a(e,[{key:"encode",value:function(e){return this.codec.encode(e)}},{key:"decode",value:function(e){var t,n=r(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(this.alphabet&&this.alphabet.indexOf(i)<0)throw new Error("invalid character '".concat(i,"' in '").concat(e,"'"))}}catch(a){n.e(a)}finally{n.f()}return this.codec.decode(e)}}]),e}();e.exports=s},45067:function(e,t,n){"use strict";var r=n(17391),i=n(2304),a=n(83833).rfc4648,o=n(2042),s=o.decodeText,u=o.encodeText,c=[["identity","\0",function(){return{encode:s,decode:u}},""],["base2","0",a(1),"01"],["base8","7",a(3),"01234567"],["base10","9",r,"0123456789"],["base16","f",a(4),"0123456789abcdef"],["base16upper","F",a(4),"0123456789ABCDEF"],["base32hex","v",a(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",a(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",a(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",a(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",a(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",a(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",a(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",a(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",a(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",r,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",r,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",r,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",r,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],l=c.reduce((function(e,t){return e[t[0]]=new i(t[0],t[1],t[2],t[3]),e}),{}),f=c.reduce((function(e,t){return e[t[1]]=l[t[0]],e}),{});e.exports={names:l,codes:f}},96332:function(e,t,n){"use strict";var r=n(45067),i=n(2042),a=i.encodeText,o=i.decodeText,s=i.concat;function u(e){if(Object.prototype.hasOwnProperty.call(r.names,e))return r.names[e];if(Object.prototype.hasOwnProperty.call(r.codes,e))return r.codes[e];throw new Error("Unsupported encoding: ".concat(e))}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");var n=u(e),r=n.name,i=n.codeBuf;return function(e,t){var n=u(e);n.decode(o(t))}(r,t),s([i,t],i.length+t.length)}).encode=function(e,t){var n=u(e),r=a(n.encode(t));return s([n.codeBuf,r],n.codeBuf.length+r.length)},t.decode=function(e){e instanceof Uint8Array&&(e=o(e));var t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),u(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=o(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return u(e[0]).name}catch(t){return!1}},t.encoding=u,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=o(e)),u(e[0])};var c=Object.freeze(r.names),l=Object.freeze(r.codes);t.names=c,t.codes=l},83833:function(e){"use strict";e.exports={rfc4648:function(e){return function(t){return{encode:function(n){return function(e,t,n){for(var r="="===t[t.length-1],i=(1<n;)a+=t[i&s>>(o-=n)];if(o&&(a+=t[i&s<=8&&(s-=8,o[c++]=255&u>>s)}if(s>=n||255&u<<8-s)throw new SyntaxError("Unexpected end of data");return o}(n,t,e)}}}}}},2042:function(e,t,n){"use strict";var r=n(74704).default,i=new TextDecoder,a=new TextEncoder;e.exports={decodeText:function(e){return i.decode(e)},encodeText:function(e){return a.encode(e)},concat:function(e,t){var n,i=new Uint8Array(t),a=0,o=r(e);try{for(o.s();!(n=o.n()).done;){var s=n.value;i.set(s,a),a+=s.length}}catch(u){o.e(u)}finally{o.f()}return i}}},44265:function(e){e.exports=function e(r,i){var a,o=0,s=0,u=i=i||0,c=r.length;do{if(u>=c||s>49)throw e.bytes=0,new RangeError("Could not decode varint");a=r[u++],o+=s<28?(a&n)<=t);return e.bytes=u-i,o};var t=128,n=127},55152:function(e){e.exports=function e(i,a,o){if(Number.MAX_SAFE_INTEGER&&i>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");a=a||[];var s=o=o||0;for(;i>=r;)a[o++]=255&i|t,i/=128;for(;i&n;)a[o++]=255&i|t,i>>>=7;return a[o]=0|i,e.bytes=o-s+1,a};var t=128,n=-128,r=Math.pow(2,31)},99917:function(e,t,n){e.exports={encode:n(55152),decode:n(44265),encodingLength:n(7807)}},7807:function(e){var t=Math.pow(2,7),n=Math.pow(2,14),r=Math.pow(2,21),i=Math.pow(2,28),a=Math.pow(2,35),o=Math.pow(2,42),s=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e 2 bytes.");var t=i.decode(e);if(!m(t))throw new Error("multihash unknown function code: 0x".concat(t.toString(16)));e=e.slice(i.decode.bytes);var n=i.decode(e);if(n<0)throw new Error("multihash invalid length: ".concat(n));if((e=e.slice(i.decode.bytes)).length!==n)throw new Error("multihash length inconsistent: 0x".concat(o(e,"base16")));return{code:t,name:c[t],length:n,digest:e}}function p(e){var t=e;if("string"===typeof e){if(void 0===a[e])throw new Error("Unrecognized hash function named: ".concat(e));t=a[e]}if("number"!==typeof t)throw new Error("Hash function code should be a number. Got: ".concat(t));if(void 0===c[t]&&!h(t))throw new Error("Unrecognized function code: ".concat(t));return t}function h(e){return e>0&&e<16}function m(e){return!!h(e)||!!c[e]}function v(e){d(e)}Object.freeze(c),e.exports={names:a,codes:c,toHexString:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return o(e,"base16")},fromHexString:function(e){return s(e,"base16")},toB58String:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return o(r.encode("base58btc",e)).slice(1)},fromB58String:function(e){var t=e instanceof Uint8Array?o(e):e;return r.decode("z"+t)},decode:d,encode:function(e,t,n){if(!e||void 0===t)throw new Error("multihash encode requires at least two args: digest, code");var r=p(t);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==n&&(n=e.length),n&&e.length!==n)throw new Error("digest length should be equal to specified length.");var a=i.encode(r),o=i.encode(n);return u([a,o,e],a.length+o.length+e.length)},coerceCode:p,isAppCode:h,validate:v,prefix:function(e){return v(e),e.subarray(0,2)},isValidCode:m}},92202:function(e,t,n){"use strict";var r=n(97599),i={checkCIDComponents:function(e){if(null==e)return"null values are not valid CIDs";if(0!==e.version&&1!==e.version)return"Invalid version, must be a number equal to 1 or 0";if("string"!==typeof e.codec)return"codec must be string";if(0===e.version){if("dag-pb"!==e.codec)return"codec must be 'dag-pb' for CIDv0";if("base58btc"!==e.multibaseName)return"multibaseName must be 'base58btc' for CIDv0"}if(!(e.multihash instanceof Uint8Array))return"multihash must be a Uint8Array";try{r.validate(e.multihash)}catch(n){var t=n.message;return t||(t="Multihash validation failed"),t}}};e.exports=i},57964:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default,a=n(97599),o=n(96332),s=n(15887),u=n(92202),c=n(45201).concat,l=n(74233).toString,f=n(52568).equals,d=s.nameToCode,p=Object.keys(d).reduce((function(e,t){return e[d[t]]=t,e}),{}),h=Symbol.for("@ipld/js-cid/CID"),m=function(e){function t(e,n,i,u){if(r(this,t),this.version,this.codec,this.multihash,Object.defineProperty(this,h,{value:!0}),t.isCID(e)){var c=e;return this.version=c.version,this.codec=c.codec,this.multihash=c.multihash,void(this.multibaseName=c.multibaseName||(0===c.version?"base58btc":"base32"))}if("string"===typeof e){var l=o.isEncoded(e);if(l){var f=o.decode(e);this.version=parseInt(f[0].toString(),16),this.codec=s.getCodec(f.slice(1)),this.multihash=s.rmPrefix(f.slice(1)),this.multibaseName=l}else this.version=0,this.codec="dag-pb",this.multihash=a.fromB58String(e),this.multibaseName="base58btc";return t.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(e instanceof Uint8Array){var d=parseInt(e[0].toString(),16);if(1===d){var m=e;this.version=d,this.codec=s.getCodec(m.slice(1)),this.multihash=s.rmPrefix(m.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";t.validateCID(this)}else this.version=e,"number"===typeof n&&(n=p[n]),this.codec=n,this.multihash=i,this.multibaseName=u||(0===e?"base58btc":"base32"),t.validateCID(this)}return i(t,[{key:"bytes",get:function(){var e=this._bytes;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");var t=s.getCodeVarint(this.codec);e=c([[1],t,this.multihash],1+t.byteLength+this.multihash.byteLength)}Object.defineProperty(this,"_bytes",{value:e})}return e}},{key:"prefix",get:function(){var e=s.getCodeVarint(this.codec),t=a.prefix(this.multihash);return c([[this.version],e,t],1+e.byteLength+t.byteLength)}},{key:"code",get:function(){return d[this.codec]}},{key:"toV0",value:function(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");var e=a.decode(this.multihash),n=e.name,r=e.length;if("sha2-256"!==n)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==r)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new t(0,this.codec,this.multihash)}},{key:"toV1",value:function(){return new t(1,this.codec,this.multihash,this.multibaseName)}},{key:"toBaseEncodedString",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.multibaseName;if(this.string&&0!==this.string.length&&t===this.multibaseName)return this.string;if(0===this.version){if("base58btc"!==t)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");e=a.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");e=l(o.encode(t,this.bytes))}return t===this.multibaseName&&Object.defineProperty(this,"string",{value:e}),e}},{key:e,value:function(){return"CID("+this.toString()+")"}},{key:"toString",value:function(e){return this.toBaseEncodedString(e)}},{key:"toJSON",value:function(){return{codec:this.codec,version:this.version,hash:this.multihash}}},{key:"equals",value:function(e){return this.codec===e.codec&&this.version===e.version&&f(this.multihash,e.multihash)}}],[{key:"validateCID",value:function(e){var t=u.checkCIDComponents(e);if(t)throw new Error(t)}},{key:"isCID",value:function(e){return e instanceof t||Boolean(e&&e[h])}}]),t}(Symbol.for("nodejs.util.inspect.custom"));m.codecs=d,e.exports=m},97438:function(e){var t=function(){"use strict";function e(t,r,i,a){"object"===typeof r&&(i=r.depth,a=r.prototype,r.filter,r=r.circular);var o=[],s=[],u="undefined"!=typeof Buffer;return"undefined"==typeof r&&(r=!0),"undefined"==typeof i&&(i=1/0),function t(i,c){if(null===i)return null;if(0==c)return i;var l,f;if("object"!=typeof i)return i;if(e.__isArray(i))l=[];else if(e.__isRegExp(i))l=new RegExp(i.source,n(i)),i.lastIndex&&(l.lastIndex=i.lastIndex);else if(e.__isDate(i))l=new Date(i.getTime());else{if(u&&Buffer.isBuffer(i))return l=Buffer.allocUnsafe?Buffer.allocUnsafe(i.length):new Buffer(i.length),i.copy(l),l;"undefined"==typeof a?(f=Object.getPrototypeOf(i),l=Object.create(f)):(l=Object.create(a),f=a)}if(r){var d=o.indexOf(i);if(-1!=d)return s[d];o.push(i),s.push(l)}for(var p in i){var h;f&&(h=Object.getOwnPropertyDescriptor(f,p)),h&&null==h.set||(l[p]=t(i[p],c-1))}return l}(t,i)}function t(e){return Object.prototype.toString.call(e)}function n(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return e.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},e.__objToStr=t,e.__isDate=function(e){return"object"===typeof e&&"[object Date]"===t(e)},e.__isArray=function(e){return"object"===typeof e&&"[object Array]"===t(e)},e.__isRegExp=function(e){return"object"===typeof e&&"[object RegExp]"===t(e)},e.__getRegExpFlags=n,e}();e.exports&&(e.exports=t)},83061:function(e,t,n){"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t1&&(i-=1)),[360*i,100*a,100*c]},o.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[o.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(n,r))),100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},o.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-i)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-i-t)/(1-t)||0),100*t]},o.rgb.keyword=function(e){var t=i[e];if(t)return t;var n,a,o,s=1/0;for(var u in r)if(r.hasOwnProperty(u)){var c=r[u],l=(a=e,o=c,Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2)+Math.pow(a[2]-o[2],2));l.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},o.rgb.lab=function(e){var t=o.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},o.hsl.rgb=function(e){var t,n,r,i,a,o=e[0]/360,s=e[1]/100,u=e[2]/100;if(0===s)return[a=255*u,a,a];t=2*u-(n=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var c=0;c<3;c++)(r=o+1/3*-(c-1))<0&&r++,r>1&&r--,a=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[c]=255*a;return i},o.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=a<=1?a:2-a,[t,100*(0===r?2*i/(a+i):2*n/(r+n)),100*((r+n)/2)]},o.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),u=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,u,o];case 1:return[s,r,o];case 2:return[o,r,u];case 3:return[o,s,r];case 4:return[u,o,r];case 5:return[r,o,s]}},o.hsv.hsl=function(e){var t,n,r,i=e[0],a=e[1]/100,o=e[2]/100,s=Math.max(o,.01);return r=(2-a)*o,n=a*s,[i,100*(n=(n/=(t=(2-a)*s)<=1?t:2-t)||0),100*(r/=2)]},o.hwb.rgb=function(e){var t,n,r,i,a,o,s,u=e[0]/360,c=e[1]/100,l=e[2]/100,f=c+l;switch(f>1&&(c/=f,l/=f),r=6*u-(t=Math.floor(6*u)),0!==(1&t)&&(r=1-r),i=c+r*((n=1-l)-c),t){default:case 6:case 0:a=n,o=i,s=c;break;case 1:a=i,o=n,s=c;break;case 2:a=c,o=n,s=i;break;case 3:a=c,o=i,s=n;break;case 4:a=i,o=c,s=n;break;case 5:a=n,o=c,s=i}return[255*a,255*o,255*s]},o.cmyk.rgb=function(e){var t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},o.xyz.rgb=function(e){var t,n,r,i=e[0]/100,a=e[1]/100,o=e[2]/100;return n=-.9689*i+1.8758*a+.0415*o,r=.0557*i+-.204*a+1.057*o,t=(t=3.2406*i+-1.5372*a+-.4986*o)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},o.xyz.lab=function(e){var t=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},o.lab.xyz=function(e){var t,n,r,i=e[0];t=e[1]/500+(n=(i+16)/116),r=n-e[2]/200;var a=Math.pow(n,3),o=Math.pow(t,3),s=Math.pow(r,3);return n=a>.008856?a:(n-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},o.lab.lch=function(e){var t,n=e[0],r=e[1],i=e[2];return(t=360*Math.atan2(i,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+i*i),t]},o.lch.lab=function(e){var t,n=e[0],r=e[1];return t=e[2]/360*2*Math.PI,[n,r*Math.cos(t),r*Math.sin(t)]},o.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];if(0===(i=Math.round(i/50)))return 30;var a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(a+=60),a},o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])},o.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},o.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},o.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},o.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},o.rgb.hcg=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.max(Math.max(n,r),i),o=Math.min(Math.min(n,r),i),s=a-o;return t=s<=0?0:a===n?(r-i)/s%6:a===r?2+(i-n)/s:4+(n-r)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?o/(1-s):0)]},o.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,i=0;return(r=n<.5?2*t*n:2*t*(1-n))<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},o.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var i,a=[0,0,0],o=t%1*6,s=o%1,u=1-s;switch(Math.floor(o)){case 0:a[0]=1,a[1]=s,a[2]=0;break;case 1:a[0]=u,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=s;break;case 3:a[0]=0,a[1]=u,a[2]=1;break;case 4:a[0]=s,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=u}return i=(1-n)*r,[255*(n*a[0]+i),255*(n*a[1]+i),255*(n*a[2]+i)]},o.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},o.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},o.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},o.hwb.hcg=function(e){var t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]},o.gray.hwb=function(e){return[0,100,e[0]]},o.gray.cmyk=function(e){return[0,0,0,e[0]]},o.gray.lab=function(e){return[e[0],0,0]},o.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},o.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},35111:function(e,t,n){var r=n(94860),i=n(15103),a={};Object.keys(r).forEach((function(e){a[e]={},Object.defineProperty(a[e],"channels",{value:r[e].channels}),Object.defineProperty(a[e],"labels",{value:r[e].labels});var t=i(e);Object.keys(t).forEach((function(n){var r=t[n];a[e][n]=function(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"===typeof n)for(var r=n.length,i=0;i1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)}))})),e.exports=a},25926:function(e){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},15103:function(e,t,n){var r=n(94860);function i(e){var t=function(){for(var e={},t=Object.keys(r),n=t.length,i=0;in?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){return this.values.hsl[2]+=this.values.hsl[2]*e,this.setValues("hsl",this.values.hsl),this},darken:function(e){return this.values.hsl[2]-=this.values.hsl[2]*e,this.setValues("hsl",this.values.hsl),this},saturate:function(e){return this.values.hsl[1]+=this.values.hsl[1]*e,this.setValues("hsl",this.values.hsl),this},desaturate:function(e){return this.values.hsl[1]-=this.values.hsl[1]*e,this.setValues("hsl",this.values.hsl),this},whiten:function(e){return this.values.hwb[1]+=this.values.hwb[1]*e,this.setValues("hwb",this.values.hwb),this},blacken:function(e){return this.values.hwb[2]+=this.values.hwb[2]*e,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){return this.setValues("alpha",this.values.alpha-this.values.alpha*e),this},opaquer:function(e){return this.setValues("alpha",this.values.alpha+this.values.alpha*e),this},rotate:function(e){var t=this.values.hsl[0];return t=(t=(t+e)%360)<0?360+t:t,this.values.hsl[0]=t,this.setValues("hsl",this.values.hsl),this},mix:function(e,t){var n=this,r=e,i=void 0===t?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,u=1-s;return this.rgb(s*n.red()+u*r.red(),s*n.green()+u*r.green(),s*n.blue()+u*r.blue()).alpha(n.alpha()*i+r.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var e=new o;return e.values=r(this.values),e}},o.prototype.getValues=function(e){for(var t={},n=0;n-1};function c(e){if("string"!==typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!==typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function m(e){var t=new FileReader,n=h(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"===typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"===typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;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?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=h(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function x(e){var t=new d;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t}function k(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},y.call(g.prototype),y.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},k.error=function(){var e=new k(null,{status:0,statusText:""});return e.type="error",e};var A=[301,302,303,307,308];k.redirect=function(e,t){if(-1===A.indexOf(t))throw new RangeError("Invalid status code");return new k(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(_){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new Promise((function(r,a){var o=new g(e,n);if(o.signal&&o.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:x(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;r(new k(t,e))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",u)}),s.send("undefined"===typeof o._bodyInit?null:o._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=d,e.Request=g,e.Response=k),t.Headers=d,t.Request=g,t.Response=k,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},43672:function(e){var t=1e3,n=60*t,r=60*n,i=24*r,a=7*i,o=365.25*i;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,u){u=u||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var u=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*o;case"weeks":case"week":case"w":return u*a;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*r;case"minutes":case"minute":case"mins":case"min":case"m":return u*n;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(e);if("number"===c&&isFinite(e))return u.long?function(e){var a=Math.abs(e);if(a>=i)return s(e,a,i,"day");if(a>=r)return s(e,a,r,"hour");if(a>=n)return s(e,a,n,"minute");if(a>=t)return s(e,a,t,"second");return e+" ms"}(e):function(e){var a=Math.abs(e);if(a>=i)return Math.round(e/i)+"d";if(a>=r)return Math.round(e/r)+"h";if(a>=n)return Math.round(e/n)+"m";if(a>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},44054:function(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(n){}!e&&"undefined"!==typeof process&&"env"in process&&(e={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/6hnvSmry5GBrjanXK4WTHbqjFKTqBwcodwY8QnQU3ojt",REACT_APP_PORTIS_ID:"",REACT_APP_FORTMATIC_KEY:"",REACT_APP_GOOGLE_ANALYTICS_ID:"G-8RHNLJ21N1"}.DEBUG);return e},t.useColors=function(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=function(){var e=!1;return function(){e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=n(87175)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},87175:function(e,t,n){var r=n(861).default;e.exports=function(e){function t(e){var n,r,a,o=null;function s(){for(var e=arguments.length,r=new Array(e),i=0;i(s=(o=Math.ceil(d/v))>s?o+1:s+1)&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for((s=c.length)-(a=l.length)<0&&(a=s,r=l,l=c,c=r),n=0;a;)n=(c[--a]=c[a]+l[a]+n)/m|0,c[a]%=m;for(n&&(c.unshift(n),++i),s=c.length;0==c[--s];)c.pop();return t.d=c,t.e=i,u?I(t,d):t}function x(e,t,n){if(e!==~~e||en)throw Error(l+e)}function k(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;te.e^a.s<0?1:-1;for(t=0,n=(r=a.d.length)<(i=e.d.length)?r:i;te.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*v;if(t=e.d[t])for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return A(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this.constructor;return I(A(this,new t(e),0,1),t.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return _(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return 0===this.s},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(void 0===e)e=new r(10);else if((e=new r(e)).s<1||e.eq(a))throw Error(c+"NaN");if(n.s<1)throw Error(c+(n.s?"NaN":"-Infinity"));return n.eq(a)?new r(0):(u=!1,t=A(C(n,o),C(e,o),o),u=!0,I(t,i))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?P(t,e):w(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(!(e=new r(e)).s)throw Error(c+"NaN");return n.s?(u=!1,t=A(n,e,0,1).times(e),u=!0,n.minus(t)):I(new r(n),i)},g.naturalExponential=g.exp=function(){return E(this)},g.naturalLogarithm=g.ln=function(){return C(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?w(t,e):P(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(l+e);if(t=_(i)+1,n=(r=i.d.length-1)*v+1,r=i.d[r]){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(c+"NaN")}for(e=_(s),u=!1,0==(i=Math.sqrt(+s))||i==1/0?(((t=k(s.d)).length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=d((e+1)/2)-(e<0||e%2),r=new l(t=i==1/0?"5e"+e:(t=i.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new l(i.toString()),i=o=(n=l.precision)+3;;)if(r=(a=r).plus(A(s,a,o+2)).times(.5),k(a.d).slice(0,o)===(t=k(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&"4999"==t){if(I(a,n+1,0),a.times(a).eq(s)){r=a;break}}else if("9999"!=t)break;o+=4}return u=!0,I(r,n)},g.times=g.mul=function(e){var t,n,r,i,a,o,s,c,l,f=this,d=f.constructor,p=f.d,h=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,n=f.e+e.e,(c=p.length)<(l=h.length)&&(a=p,p=h,h=a,o=c,c=l,l=o),a=[],r=o=c+l;r--;)a.push(0);for(r=l;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+h[r]*p[i-r-1]+t,a[i--]=s%m|0,t=s/m|0;a[i]=(a[i]+t)%m|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,u?I(e,d.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(x(e,0,o),void 0===t?t=r.rounding:x(t,0,8),I(n,e+_(n)+1,t))},g.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=R(r,!0):(x(e,0,o),void 0===t?t=i.rounding:x(t,0,8),n=R(r=I(new i(r),e+1,t),!0,e+1)),n},g.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return void 0===e?R(i):(x(e,0,o),void 0===t?t=a.rounding:x(t,0,8),n=R((r=I(new a(i),e+_(i)+1,t)).abs(),!1,e+_(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return I(new t(e),_(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,i,o,s,l=this,f=l.constructor,p=+(e=new f(e));if(!e.s)return new f(a);if(!(l=new f(l)).s){if(e.s<1)throw Error(c+"Infinity");return l}if(l.eq(a))return l;if(r=f.precision,e.eq(a))return I(l,r);if(s=(t=e.e)>=(n=e.d.length-1),o=l.s,s){if((n=p<0?-p:p)<=y){for(i=new f(a),t=Math.ceil(r/v+4),u=!1;n%2&&M((i=i.times(l)).d,t),0!==(n=d(n/2));)M((l=l.times(l)).d,t);return u=!0,e.s<0?new f(a).div(i):I(i,r)}}else if(o<0)throw Error(c+"NaN");return o=o<0&&1&e.d[Math.max(t,n)]?-1:1,l.s=1,u=!1,i=e.times(C(l,r+12)),u=!0,(i=E(i)).s=o,i},g.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return void 0===e?r=R(i,(n=_(i))<=a.toExpNeg||n>=a.toExpPos):(x(e,1,o),void 0===t?t=a.rounding:x(t,0,8),r=R(i=I(new a(i),e,t),e<=(n=_(i))||n<=a.toExpNeg,e)),r},g.toSignificantDigits=g.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(x(e,1,o),void 0===t?t=n.rounding:x(t,0,8)),I(new n(this),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=_(e),n=e.constructor;return R(e,t<=n.toExpNeg||t>=n.toExpPos)};var A=function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%m|0,r=n/m|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]1;)e.shift()}return function(r,i,a,o){var s,u,l,f,d,p,h,y,b,g,w,x,k,A,E,T,S,C,O=r.constructor,P=r.s==i.s?1:-1,R=r.d,M=i.d;if(!r.s)return new O(r);if(!i.s)throw Error(c+"Division by zero");for(u=r.e-i.e,S=M.length,E=R.length,y=(h=new O(P)).d=[],l=0;M[l]==(R[l]||0);)++l;if(M[l]>(R[l]||0)&&--u,(x=null==a?a=O.precision:o?a+(_(r)-_(i))+1:a)<0)return new O(0);if(x=x/v+2|0,l=0,1==S)for(f=0,M=M[0],x++;(l1&&(M=e(M,f),R=e(R,f),S=M.length,E=R.length),A=S,g=(b=R.slice(0,S)).length;g=m/2&&++T;do{f=0,(s=t(M,b,S,g))<0?(w=b[0],S!=g&&(w=w*m+(b[1]||0)),(f=w/T|0)>1?(f>=m&&(f=m-1),1==(s=t(d=e(M,f),b,p=d.length,g=b.length))&&(f--,n(d,S16)throw Error(f+_(e));if(!e.s)return new d(a);for(null==t?(u=!1,s=h):s=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),l+=5;for(s+=Math.log(p(2,l))/Math.LN10*2+5|0,n=r=i=new d(a),d.precision=s;;){if(r=I(r.times(e),s),n=n.times(++c),k((o=i.plus(A(r,n,s))).d).slice(0,s)===k(i.d).slice(0,s)){for(;l--;)i=I(i.times(i),s);return d.precision=h,null==t?(u=!0,I(i,h)):i}i=o}}function _(e){for(var t=e.e*v,n=e.d[0];n>=10;n/=10)t++;return t}function T(e,t,n){if(t>e.LN10.sd())throw u=!0,n&&(e.precision=n),Error(c+"LN10 precision limit exceeded");return I(new e(e.LN10),t)}function S(e){for(var t="";e--;)t+="0";return t}function C(e,t){var n,r,i,o,s,l,f,d,p,h=1,m=e,v=m.d,y=m.constructor,b=y.precision;if(m.s<1)throw Error(c+(m.s?"NaN":"-Infinity"));if(m.eq(a))return new y(0);if(null==t?(u=!1,d=b):d=t,m.eq(10))return null==t&&(u=!0),T(y,d);if(d+=10,y.precision=d,r=(n=k(v)).charAt(0),o=_(m),!(Math.abs(o)<15e14))return f=T(y,d+2,b).times(o+""),m=C(new y(r+"."+n.slice(1)),d-10).plus(f),y.precision=b,null==t?(u=!0,I(m,b)):m;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=k((m=m.times(e)).d)).charAt(0),h++;for(o=_(m),r>1?(m=new y("0."+n),o++):m=new y(r+"."+n.slice(1)),l=s=m=A(m.minus(a),m.plus(a),d),p=I(m.times(m),d),i=3;;){if(s=I(s.times(p),d),k((f=l.plus(A(s,new y(i),d))).d).slice(0,d)===k(l.d).slice(0,d))return l=l.times(2),0!==o&&(l=l.plus(T(y,d+2,b).times(o+""))),l=A(l,new y(h),d),y.precision=b,null==t?(u=!0,I(l,b)):l;l=f,i+=2}}function O(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(i=t.length;48===t.charCodeAt(i-1);)--i;if(t=t.slice(r,i)){if(i-=r,n=n-r-1,e.e=d(n/v),e.d=[],r=(n+1)%v,n<0&&(r+=v),rb||e.e<-b))throw Error(f+n)}else e.s=0,e.e=0,e.d=[0];return e}function I(e,t,n){var r,i,a,o,s,c,l,h,y=e.d;for(o=1,a=y[0];a>=10;a/=10)o++;if((r=t-o)<0)r+=v,i=t,l=y[h=0];else{if((h=Math.ceil((r+1)/v))>=(a=y.length))return e;for(l=a=y[h],o=1;a>=10;a/=10)o++;i=(r%=v)-v+o}if(void 0!==n&&(s=l/(a=p(10,o-i-1))%10|0,c=t<0||void 0!==y[h+1]||l%a,c=n<4?(s||c)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||c||6==n&&(r>0?i>0?l/p(10,o-i):0:y[h-1])%10&1||n==(e.s<0?8:7))),t<1||!y[0])return c?(a=_(e),y.length=1,t=t-a-1,y[0]=p(10,(v-t%v)%v),e.e=d(-t/v)||0):(y.length=1,y[0]=e.e=e.s=0),e;if(0==r?(y.length=h,a=1,h--):(y.length=h+1,a=p(10,v-r),y[h]=i>0?(l/p(10,o-i)%p(10,i)|0)*a:0),c)for(;;){if(0==h){(y[0]+=a)==m&&(y[0]=1,++e.e);break}if(y[h]+=a,y[h]!=m)break;y[h--]=0,a=1}for(r=y.length;0===y[--r];)y.pop();if(u&&(e.e>b||e.e<-b))throw Error(f+_(e));return e}function P(e,t){var n,r,i,a,o,s,c,l,f,d,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),u?I(t,h):t;if(c=e.d,d=t.d,r=t.e,l=e.e,c=c.slice(),o=l-r){for((f=o<0)?(n=c,o=-o,s=d.length):(n=d,r=l,s=c.length),o>(i=Math.max(Math.ceil(h/v),s)+2)&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for((f=(i=c.length)<(s=d.length))&&(s=i),i=0;i0;--i)c[s++]=0;for(i=d.length;i>o;){if(c[--i]0?a=a.charAt(0)+"."+a.slice(1)+S(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+S(-i-1)+a,n&&(r=n-o)>0&&(a+=S(r))):i>=o?(a+=S(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+S(r))):((r=i+1)0&&(i+1===o&&(a+="."),a+=S(r))),e.s<0?"-"+a:a}function M(e,t){if(e.length>t)return e.length=t,!0}function N(e){if(!e||"object"!==typeof e)throw Error(c+"Object expected");var t,n,r,i=["precision",1,o,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t=i[t+1]&&r<=i[t+2]))throw Error(l+n+": "+r);this[n]=r}if(void 0!==(r=e[n="LN10"])){if(r!=Math.LN10)throw Error(l+n+": "+r);this[n]=new this(r)}return this}s=function e(t){var n,r,i;function a(e){var t=this;if(!(t instanceof a))return new a(e);if(t.constructor=a,e instanceof a)return t.s=e.s,t.e=e.e,void(t.d=(e=e.d)?e.slice():e);if("number"===typeof e){if(0*e!==0)throw Error(l+e);if(e>0)t.s=1;else{if(!(e<0))return t.s=0,t.e=0,void(t.d=[0]);e=-e,t.s=-1}return e===~~e&&e<1e7?(t.e=0,void(t.d=[e])):O(t,e.toString())}if("string"!==typeof e)throw Error(l+e);if(45===e.charCodeAt(0)?(e=e.slice(1),t.s=-1):t.s=1,!h.test(e))throw Error(l+e);O(t,e)}if(a.prototype=g,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=e,a.config=a.set=N,void 0===t&&(t={}),t)for(i=["precision","rounding","toExpNeg","toExpPos","LN10"],n=0;n2?arguments[2]:{},a=r(t);i&&(a=o.call(a,Object.getOwnPropertySymbols(t)));for(var s=0;s0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var n=e._getDoubles(),r=a(t,1,this._bitLength),i=(1<=o;l--)u=(u<<1)+r[l];c.push(u)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),p=i;p>0;p--){for(o=0;o=0;c--){for(var l=0;c>=0&&0===o[c];c--)l++;if(c>=0&&l++,u=u.dblp(l),c<0)break;var f=o[c];s(0!==f),u="affine"===e.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,n,r,i){var s,u,c,l=this._wnafT1,f=this._wnafT2,d=this._wnafT3,p=0;for(s=0;s=1;s-=2){var m=s-1,v=s;if(1===l[m]&&1===l[v]){var y=[t[m],null,null,t[v]];0===t[m].y.cmp(t[v].y)?(y[1]=t[m].add(t[v]),y[2]=t[m].toJ().mixedAdd(t[v].neg())):0===t[m].y.cmp(t[v].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[v]),y[2]=t[m].add(t[v].neg())):(y[1]=t[m].toJ().mixedAdd(t[v]),y[2]=t[m].toJ().mixedAdd(t[v].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],g=o(n[m],n[v]);for(p=Math.max(g[0].length,p),d[m]=new Array(p),d[v]=new Array(p),u=0;u=0;s--){for(var E=0;s>=0;){var _=!0;for(u=0;u=0&&E++,k=k.dblp(E),s<0)break;for(u=0;u0?c=f[u][T-1>>1]:T<0&&(c=f[u][-T-1>>1].neg()),k="affine"===c.type?k.mixedAdd(c):k.add(c))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=r.redAdd(t),o=a.redSub(n),s=r.redSub(t),u=i.redMul(o),c=a.redMul(s),l=i.redMul(s),f=o.redMul(a);return this.curve.point(u,c,f,l)},c.prototype._projDbl=function(){var e,t,n,r,i,a,o=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(r=this.curve._mulA(s)).redAdd(u);this.zOne?(e=o.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(r.redSub(u)),n=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),a=c.redSub(i).redISub(i),e=o.redSub(s).redISub(u).redMul(a),t=c.redMul(r.redSub(u)),n=c.redMul(a))}else r=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),a=r.redSub(i).redSub(i),e=this.curve._mulC(o.redISub(r)).redMul(a),t=this.curve._mulC(r).redMul(s.redISub(u)),n=r.redMul(a);return this.curve.point(e,t,n)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(t),o=i.redSub(r),s=i.redAdd(r),u=n.redAdd(t),c=a.redMul(o),l=s.redMul(u),f=a.redMul(u),d=o.redMul(s);return this.curve.point(c,l,d,f)},c.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),u=i.redSub(s),c=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),f=r.redMul(u).redMul(l);return this.curve.twisted?(t=r.redMul(c).redMul(o.redSub(this.curve._mulA(a))),n=u.redMul(c)):(t=r.redMul(c).redMul(o.redSub(a)),n=this.curve._mulC(u).redMul(c)),this.curve.point(f,t,n)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},c.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},49022:function(e,t,n){"use strict";var r=t;r.base=n(7242),r.short=n(14463),r.mont=n(92620),r.edwards=n(76971)},92620:function(e,t,n){"use strict";var r=n(64166),i=n(80273),a=n(7242),o=n(42115);function s(e){a.call(this,"mont",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,n){a.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(t,16),this.z=new r(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,a),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},i(u,a.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(n),o=i.redMul(r),s=t.z.redMul(a.redAdd(o).redSqr()),u=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},14463:function(e,t,n){"use strict";var r=n(42115),i=n(64166),a=n(80273),o=n(7242),s=r.assert;function u(e){o.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,n,r){o.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(n,16),r&&(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 l(e,t,n,r){o.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(n,16),this.z=new i(r,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}a(u,o),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=(t=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(e.lambda)n=new i(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))?n=a[0]:(n=a[1],s(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:n,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(n)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),n=new i(2).toRed(t).redInvm(),r=n.redNeg(),a=new i(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(a).fromRed(),r.redSub(a).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,n,r,a,o,s,u,c,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,p=this.n.clone(),h=new i(1),m=new i(0),v=new i(0),y=new i(1),b=0;0!==d.cmpn(0);){var g=p.div(d);c=p.sub(g.mul(d)),l=v.sub(g.mul(h));var w=y.sub(g.mul(m));if(!r&&c.cmp(f)<0)t=u.neg(),n=h,r=c.neg(),a=l;else if(r&&2===++b)break;u=c,p=d,d=c,v=h,h=l,y=m,m=w}o=c.neg(),s=l;var x=r.sqr().add(a.sqr());return o.sqr().add(s.sqr()).cmp(x)>=0&&(o=t,s=n),r.negative&&(r=r.neg(),a=a.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:r,b:a},{a:o,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=i.mul(n.a),s=a.mul(r.a),u=i.mul(n.b),c=a.mul(r.b);return{k1:e.sub(o).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var a=r.fromRed().isOdd();return(t&&!a||!t&&a)&&(r=r.redNeg()),this.point(e,r)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},c.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(l,o.BasePoint),u.prototype.jpoint=function(e,t,n){return new l(this,e,t,n)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=a.redSub(o);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=r.redMul(c),d=u.redSqr().redIAdd(l).redISub(f).redISub(f),p=u.redMul(f.redISub(d)).redISub(a.redMul(l)),h=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,p,h)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=n.redSub(r),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),c=u.redMul(o),l=n.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),d=s.redMul(l.redISub(f)).redISub(i.redMul(c)),p=this.z.redMul(o);return this.curve.jpoint(f,d,p)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},51455:function(e,t,n){"use strict";var r,i=t,a=n(37553),o=n(49022),s=n(42115).assert;function u(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var n=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:n}),n}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(36418)}catch(l){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},59679:function(e,t,n){"use strict";var r=n(64166),i=n(31355),a=n(42115),o=n(51455),s=n(23883),u=a.assert,c=n(57891),l=n(66058);function f(e){if(!(this instanceof f))return new f(e);"string"===typeof e&&(u(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new c(this,e)},f.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new r(2));;){var o=new r(t.generate(n));if(!(o.cmp(a)>0))return o.iaddn(1),this.keyFromPrivate(o)}},f.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,n,a){"object"===typeof n&&(a=n,n=null),a||(a={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new r(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),u=e.toArray("be",o),c=new i({hash:this.hash,entropy:s,nonce:u,pers:a.pers,persEnc:a.persEnc||"utf8"}),f=this.n.sub(new r(1)),d=0;;d++){var p=a.k?a.k(d):new r(c.generate(this.n.byteLength()));if(!((p=this._truncateToN(p,!0)).cmpn(1)<=0||p.cmp(f)>=0)){var h=this.g.mul(p);if(!h.isInfinity()){var m=h.getX(),v=m.umod(this.n);if(0!==v.cmpn(0)){var y=p.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var b=(h.getY().isOdd()?1:0)|(0!==m.cmp(v)?2:0);return a.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),b^=1),new l({r:v,s:y,recoveryParam:b})}}}}}},f.prototype.verify=function(e,t,n,i){e=this._truncateToN(new r(e,16)),n=this.keyFromPublic(n,i);var a=(t=new l(t,"hex")).r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,u=o.invm(this.n),c=u.mul(e).umod(this.n),f=u.mul(a).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,n.getPublic(),f)).isInfinity()&&s.eqXToP(a):!(s=this.g.mulAdd(c,n.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(a)},f.prototype.recoverPubKey=function(e,t,n,i){u((3&n)===n,"The recovery param is more than two bits"),t=new l(t,i);var a=this.n,o=new r(e),s=t.r,c=t.s,f=1&n,d=n>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var p=t.r.invm(a),h=a.sub(o).mul(p).umod(a),m=c.mul(p).umod(a);return this.g.mulAdd(h,s,m)},f.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new l(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},57891:function(e,t,n){"use strict";var r=n(64166),i=n(42115).assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=a,a.fromPublic=function(e,t,n){return t instanceof a?t:new a(e,{pub:t,pubEnc:n})},a.fromPrivate=function(e,t,n){return t instanceof a?t:new a(e,{priv:t,privEnc:n})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"===typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},a.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},66058:function(e,t,n){"use strict";var r=n(64166),i=n(42115),a=i.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(a(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,a=0,o=t.place;a>>=0;return!(i<=127)&&(t.place=o,i)}function c(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}e.exports=o,o.prototype._importDER=function(e,t){e=i.toArray(e,t);var n=new s;if(48!==e[n.place++])return!1;var a=u(e,n);if(!1===a)return!1;if(a+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var o=u(e,n);if(!1===o)return!1;var c=e.slice(n.place,o+n.place);if(n.place+=o,2!==e[n.place++])return!1;var l=u(e,n);if(!1===l)return!1;if(e.length!==l+n.place)return!1;var f=e.slice(n.place,l+n.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new r(c),this.s=new r(f),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=c(t),n=c(n);!n[0]&&!(128&n[1]);)n=n.slice(1);var r=[2];l(r,t.length),(r=r.concat(t)).push(2),l(r,n.length);var a=r.concat(n),o=[48];return l(o,a.length),o=o.concat(a),i.encode(o,e)}},52709:function(e,t,n){"use strict";var r=n(37553),i=n(51455),a=n(42115),o=a.assert,s=a.parseBytes,u=n(44513),c=n(49528);function l(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}e.exports=l,l.prototype.sign=function(e,t){e=s(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),i=this.g.mul(r),a=this.encodePoint(i),o=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),u=r.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:a})},l.prototype.verify=function(e,t,n){e=s(e),t=this.makeSignature(t);var r=this.keyFromPublic(n),i=this.hashInt(t.Rencoded(),r.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(r.pub().mul(i)).eq(a)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(i>>1)-1?(i>>1)-u:u,a.isubn(s)):s=0,r[o]=s,a.iushrn(1)}return r},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var o,s,u=e.andln(3)+i&3,c=t.andln(3)+a&3;3===u&&(u=-1),3===c&&(c=-1),o=0===(1&u)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==c?u:-u,n[0].push(o),s=0===(1&c)?0:3!==(r=t.andln(7)+a&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*i===o+1&&(i=1-i),2*a===s+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return n},r.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new i(e,"hex","le")}},27753:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,a=n(56690).default,o=n(89728).default,s=n(66115).default,u=n(41588).default,c=n(73808).default,l=n(61655).default,f=n(26389).default,d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBlockTracker=void 0;var p=d(n(4609)),h=function(e,t){return e+t},m=["sync","latest"],v=function(e){l(n,e);var t=f(n);function n(e){var r;return a(this,n),(r=t.call(this))._blockResetDuration=e.blockResetDuration||2e4,r._currentBlock=null,r._isRunning=!1,r._onNewListener=r._onNewListener.bind(s(r)),r._onRemoveListener=r._onRemoveListener.bind(s(r)),r._resetCurrentBlock=r._resetCurrentBlock.bind(s(r)),r._setupInternalEvents(),r}return o(n,[{key:"destroy",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._cancelBlockResetTimeout(),e.next=3,this._maybeEnd();case 3:u(c(n.prototype),"removeAllListeners",this).call(this);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"isRunning",value:function(){return this._isRunning}},{key:"getCurrentBlock",value:function(){return this._currentBlock}},{key:"getLatestBlock",value:function(){var e=i(r().mark((function e(){var t,n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._currentBlock){e.next=2;break}return e.abrupt("return",this._currentBlock);case 2:return e.next=4,new Promise((function(e){return n.once("latest",e)}));case 4:return t=e.sent,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeAllListeners",value:function(e){return e?u(c(n.prototype),"removeAllListeners",this).call(this,e):u(c(n.prototype),"removeAllListeners",this).call(this),this._setupInternalEvents(),this._onRemoveListener(),this}},{key:"_setupInternalEvents",value:function(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}},{key:"_onNewListener",value:function(e){m.includes(e)&&this._maybeStart()}},{key:"_onRemoveListener",value:function(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}},{key:"_maybeStart",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isRunning){e.next=2;break}return e.abrupt("return");case 2:return this._isRunning=!0,this._cancelBlockResetTimeout(),e.next=6,this._start();case 6:this.emit("_started");case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_maybeEnd",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._isRunning){e.next=2;break}return e.abrupt("return");case 2:return this._isRunning=!1,this._setupBlockResetTimeout(),e.next=6,this._end();case 6:this.emit("_ended");case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_getBlockTrackerEventCount",value:function(){var e=this;return m.map((function(t){return e.listenerCount(t)})).reduce(h)}},{key:"_newPotentialLatest",value:function(e){var t=this._currentBlock;t&&y(e)<=y(t)||this._setCurrentBlock(e)}},{key:"_setCurrentBlock",value:function(e){var t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}},{key:"_setupBlockResetTimeout",value:function(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}},{key:"_cancelBlockResetTimeout",value:function(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}},{key:"_resetCurrentBlock",value:function(){this._currentBlock=null}}]),n}(p.default);function y(e){return Number.parseInt(e,16)}t.BaseBlockTracker=v},82956:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,a=n(56690).default,o=n(89728).default,s=n(61655).default,u=n(26389).default,c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PollingBlockTracker=void 0;var l=c(n(39702)),f=c(n(32768)),d=n(27753),p=n(41098),h=(0,p.createModuleLogger)(p.projectLogger,"polling-block-tracker"),m=(0,l.default)(),v=function(e){s(n,e);var t=u(n);function n(){var e,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,n),!i.provider)throw new Error("PollingBlockTracker - no provider specified.");return(e=t.call(this,{blockResetDuration:null!==(r=i.blockResetDuration)&&void 0!==r?r:i.pollingInterval}))._provider=i.provider,e._pollingInterval=i.pollingInterval||2e4,e._retryTimeout=i.retryTimeout||e._pollingInterval/10,e._keepEventLoopActive=void 0===i.keepEventLoopActive||i.keepEventLoopActive,e._setSkipCacheFlag=i.setSkipCacheFlag||!1,e}return o(n,[{key:"checkForLatestBlock",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._updateLatestBlock();case 2:return e.next=4,this.getLatestBlock();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_start",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._synchronize();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_end",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"_synchronize",value:function(){var e=i(r().mark((function e(){var t,n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isRunning){e.next=20;break}return e.prev=1,e.next=4,this._updateLatestBlock();case 4:return n=y(this._pollingInterval,!this._keepEventLoopActive),this.emit("_waitingForNextIteration"),e.next=8,n;case 8:e.next=18;break;case 10:e.prev=10,e.t0=e.catch(1),i=new Error("PollingBlockTracker - encountered an error while attempting to update latest block:\n".concat(null!==(t=e.t0.stack)&&void 0!==t?t:e.t0));try{this.emit("error",i)}catch(r){console.error(i)}return a=y(this._retryTimeout,!this._keepEventLoopActive),this.emit("_waitingForNextIteration"),e.next=18,a;case 18:e.next=0;break;case 20:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"_updateLatestBlock",value:function(){var e=i(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchLatestBlock();case 2:t=e.sent,this._newPotentialLatest(t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_fetchLatestBlock",value:function(){var e=i(r().mark((function e(){var t,n,i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={jsonrpc:"2.0",id:m(),method:"eth_blockNumber",params:[]},this._setSkipCacheFlag&&(t.skipCache=!0),h("Making request",t),e.next=5,(0,f.default)((function(e){return i._provider.sendAsync(t,e)}))();case 5:if(n=e.sent,h("Got response",n),!n.error){e.next=9;break}throw new Error("PollingBlockTracker - encountered error fetching block:\n".concat(n.error.message));case 9:return e.abrupt("return",n.result);case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(d.BaseBlockTracker);function y(e,t){return new Promise((function(n){var r=setTimeout(n,e);r.unref&&t&&r.unref()}))}t.PollingBlockTracker=v},33996:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,a=n(56690).default,o=n(89728).default,s=n(61655).default,u=n(26389).default,c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscribeBlockTracker=void 0;var l=c(n(39702)),f=n(27753),d=(0,l.default)(),p=function(e){s(n,e);var t=u(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,n),!r.provider)throw new Error("SubscribeBlockTracker - no provider specified.");return(e=t.call(this,r))._provider=r.provider,e._subscriptionId=null,e}return o(n,[{key:"checkForLatestBlock",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getLatestBlock();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_start",value:function(){var e=i(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==this._subscriptionId&&null!==this._subscriptionId){e.next=15;break}return e.prev=1,e.next=4,this._call("eth_blockNumber");case 4:return t=e.sent,e.next=7,this._call("eth_subscribe","newHeads");case 7:this._subscriptionId=e.sent,this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),this.emit("error",e.t0);case 15:case"end":return e.stop()}}),e,this,[[1,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"_end",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this._subscriptionId||void 0===this._subscriptionId){e.next=10;break}return e.prev=1,e.next=4,this._call("eth_unsubscribe",this._subscriptionId);case 4:this._subscriptionId=null,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),this.emit("error",e.t0);case 10:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(){return e.apply(this,arguments)}}()},{key:"_call",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0?t.on("sync",w):n>0&&0===r&&t.removeListener("sync",w)}}},61409:function(e,t,n){var r=n(17061).default,i=n(17156).default,a=n(56690).default,o=n(89728).default,s=n(61655).default,u=n(26389).default,c=n(78630),l=n(94492),f=n(24424),d=n(15261),p=(d.bnToHex,d.hexToInt),h=d.incrementHexInt,m=d.minBlockRef,v=d.blockRefIsNumber,y=function(e){"use strict";s(n,e);var t=u(n);function n(e){var r,i=e.provider,o=e.params;return a(this,n),(r=t.call(this)).type="log",r.ethQuery=new c(i),r.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},o),r.params.address&&(Array.isArray(r.params.address)||(r.params.address=[r.params.address]),r.params.address=r.params.address.map((function(e){return e.toLowerCase()}))),r}return o(n,[{key:"initialize",value:function(){var e=i(r().mark((function e(t){var n,i,a,o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.currentBlock,i=this.params.fromBlock,["latest","pending"].includes(i)&&(i=n),"earliest"===i&&(i="0x0"),this.params.fromBlock=i,a=m(this.params.toBlock,n),o=Object.assign({},this.params,{toBlock:a}),e.next=9,this._fetchLogs(o);case 9:s=e.sent,this.addInitialResults(s);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"update",value:function(){var e=i(r().mark((function e(t){var n,i,a,o,s,u,c,l=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.oldBlock,i=t.newBlock,a=i,o=n?h(n):i,s=Object.assign({},this.params,{fromBlock:o,toBlock:a}),e.next=6,this._fetchLogs(s);case 6:u=e.sent,c=u.filter((function(e){return l.matchLog(e)})),this.addResults(c);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_fetchLogs",value:function(){var e=i(r().mark((function e(t){var n,i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l((function(e){return i.ethQuery.getLogs(t,e)}))();case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"matchLog",value:function(e){if(p(this.params.fromBlock)>=p(e.blockNumber))return!1;if(v(this.params.toBlock)&&p(this.params.toBlock)<=p(e.blockNumber))return!1;var t=e.address&&e.address.toLowerCase();return!(this.params.address&&t&&!this.params.address.includes(t))&&this.params.topics.every((function(t,n){var r=e.topics[n];if(!r)return!1;r=r.toLowerCase();var i=Array.isArray(t)?t:[t];return!!i.includes(null)||(i=i.map((function(e){return e.toLowerCase()}))).includes(r)}))}}]),n}(f);e.exports=y},94492:function(e,t,n){"use strict";var r=n(42122).default,i=function(e,t,n,r){return function(){for(var i=this,a=arguments.length,o=new Array(a),s=0;s=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return t.call(this,e,i,a)}return i(n)}(c);function f(e,t){if("[Circular]"!==t)return t}t.EthereumProviderError=l},1479:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.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}},t.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."}}},71846:function(e,t,n){"use strict";var r=n(27424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;var i=n(44409),a=n(17638),o=n(1479);function s(e,t){var n=c(t),o=r(n,2),s=o[0],u=o[1];return new i.EthereumRpcError(e,s||a.getMessageFromCode(e),u)}function u(e,t){var n=c(t),o=r(n,2),s=o[0],u=o[1];return new i.EthereumProviderError(e,s||a.getMessageFromCode(e),u)}function c(e){if(e){if("string"===typeof e)return[e];if("object"===typeof e&&!Array.isArray(e)){var t=e.message,n=e.data;if(t&&"string"!==typeof t)throw new Error("Must specify string message.");return[t||void 0,n]}}return[]}t.ethErrors={rpc:{parse:function(e){return s(o.errorCodes.rpc.parse,e)},invalidRequest:function(e){return s(o.errorCodes.rpc.invalidRequest,e)},invalidParams:function(e){return s(o.errorCodes.rpc.invalidParams,e)},methodNotFound:function(e){return s(o.errorCodes.rpc.methodNotFound,e)},internal:function(e){return s(o.errorCodes.rpc.internal,e)},server:function(e){if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");var t=e.code;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:function(e){return s(o.errorCodes.rpc.invalidInput,e)},resourceNotFound:function(e){return s(o.errorCodes.rpc.resourceNotFound,e)},resourceUnavailable:function(e){return s(o.errorCodes.rpc.resourceUnavailable,e)},transactionRejected:function(e){return s(o.errorCodes.rpc.transactionRejected,e)},methodNotSupported:function(e){return s(o.errorCodes.rpc.methodNotSupported,e)},limitExceeded:function(e){return s(o.errorCodes.rpc.limitExceeded,e)}},provider:{userRejectedRequest:function(e){return u(o.errorCodes.provider.userRejectedRequest,e)},unauthorized:function(e){return u(o.errorCodes.provider.unauthorized,e)},unsupportedMethod:function(e){return u(o.errorCodes.provider.unsupportedMethod,e)},disconnected:function(e){return u(o.errorCodes.provider.disconnected,e)},chainDisconnected:function(e){return u(o.errorCodes.provider.chainDisconnected,e)},custom:function(e){if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");var t=e.code,n=e.message,r=e.data;if(!n||"string"!==typeof n)throw new Error('"message" must be a nonempty string');return new i.EthereumProviderError(t,n,r)}}}},98689:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;var r=n(44409);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return r.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return r.EthereumProviderError}});var i=n(17638);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return i.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}});var a=n(71846);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return a.ethErrors}});var o=n(1479);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return o.errorCodes}})},17638:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var r=n(1479),i=n(44409),a=r.errorCodes.rpc.internal,o="Unspecified error message. This is a bug, please report it.",s={code:a,message:u(a)};function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;if(Number.isInteger(e)){var i=e.toString();if(d(r.errorValues,i))return r.errorValues[i].message;if(l(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function c(e){if(!Number.isInteger(e))return!1;var t=e.toString();return!!r.errorValues[t]||!!l(e)}function l(e){return e>=-32099&&e<=-32e3}function f(e){return e&&"object"===typeof e&&!Array.isArray(e)?Object.assign({},e):e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=u,t.isValidCode=c,t.serializeError=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.fallbackError,o=void 0===a?s:a,l=r.shouldIncludeStack,p=void 0!==l&&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(e instanceof i.EthereumRpcError)return e.serialize();var h={};if(e&&"object"===typeof e&&!Array.isArray(e)&&d(e,"code")&&c(e.code)){var m=e;h.code=m.code,m.message&&"string"===typeof m.message?(h.message=m.message,d(m,"data")&&(h.data=m.data)):(h.message=u(h.code),h.data={originalError:f(e)})}else{h.code=o.code;var v=null===(t=e)||void 0===t?void 0:t.message;h.message=v&&"string"===typeof v?v:o.message,h.data={originalError:f(e)}}var y=null===(n=e)||void 0===n?void 0:n.stack;return p&&e&&y&&"string"===typeof y&&(h.stack=y),h}},85125:function(e,t,n){"use strict";n.r(t),n.d(t,{BaseContract:function(){return o.VZ},BigNumber:function(){return s.O$},Contract:function(){return o.CH},ContractFactory:function(){return o.lV},FixedNumber:function(){return u.xs},Signer:function(){return c.E},VoidSigner:function(){return c.b},Wallet:function(){return l.Wallet},Wordlist:function(){return y.D},constants:function(){return r},errors:function(){return M.ErrorCode},ethers:function(){return a},getDefaultProvider:function(){return m.getDefaultProvider},logger:function(){return K},providers:function(){return m},utils:function(){return i},version:function(){return Y},wordlists:function(){return v.E}});var r={};n.r(r),n.d(r,{AddressZero:function(){return f.d},EtherSymbol:function(){return h},HashZero:function(){return p.R},MaxInt256:function(){return d.PS},MaxUint256:function(){return d.Bz},MinInt256:function(){return d.$B},NegativeOne:function(){return d.tL},One:function(){return d.fh},Two:function(){return d.Py},WeiPerEther:function(){return d.Ce},Zero:function(){return d._Y}});var i={};n.r(i),n.d(i,{AbiCoder:function(){return b.R},ConstructorFragment:function(){return g.Xg},ErrorFragment:function(){return g.IC},EventFragment:function(){return g.QV},FormatTypes:function(){return g.pc},Fragment:function(){return g.HY},FunctionFragment:function(){return g.YW},HDNode:function(){return I.HDNode},Indexed:function(){return x.Hk},Interface:function(){return x.vU},LogDescription:function(){return x.CC},Logger:function(){return M.Logger},ParamType:function(){return g._R},RLP:function(){return U},SigningKey:function(){return F.SigningKey},SupportedAlgorithm:function(){return G.p},TransactionDescription:function(){return x.vk},TransactionTypes:function(){return q.TransactionTypes},UnicodeNormalizationForm:function(){return z.Uj},Utf8ErrorFuncs:function(){return z.te},Utf8ErrorReason:function(){return z.Uw},_TypedDataEncoder:function(){return O.E},_fetchData:function(){return W._fetchData},_toEscapedUtf8String:function(){return z.U$},accessListify:function(){return q.accessListify},arrayify:function(){return _.arrayify},base58:function(){return E.Base58},base64:function(){return A},checkProperties:function(){return B.checkProperties},checkResultErrors:function(){return w.BR},commify:function(){return V.commify},computeAddress:function(){return q.computeAddress},computeHmac:function(){return N.Gy},computePublicKey:function(){return F.computePublicKey},concat:function(){return _.concat},deepCopy:function(){return B.deepCopy},defaultAbiCoder:function(){return b.$},defaultPath:function(){return I.defaultPath},defineReadOnly:function(){return B.defineReadOnly},dnsEncode:function(){return T.Kn},entropyToMnemonic:function(){return I.entropyToMnemonic},fetchJson:function(){return W.fetchJson},formatBytes32String:function(){return H.s},formatEther:function(){return V.formatEther},formatUnits:function(){return V.formatUnits},getAccountPath:function(){return I.getAccountPath},getAddress:function(){return k.getAddress},getContractAddress:function(){return k.getContractAddress},getCreate2Address:function(){return k.getCreate2Address},getIcapAddress:function(){return k.getIcapAddress},getJsonWalletAddress:function(){return P.Rb},getStatic:function(){return B.getStatic},hashMessage:function(){return S.r},hexConcat:function(){return _.hexConcat},hexDataLength:function(){return _.hexDataLength},hexDataSlice:function(){return _.hexDataSlice},hexStripZeros:function(){return _.hexStripZeros},hexValue:function(){return _.hexValue},hexZeroPad:function(){return _.hexZeroPad},hexlify:function(){return _.hexlify},id:function(){return C.id},isAddress:function(){return k.isAddress},isBytes:function(){return _.isBytes},isBytesLike:function(){return _.isBytesLike},isHexString:function(){return _.isHexString},isValidMnemonic:function(){return I.isValidMnemonic},isValidName:function(){return T.r1},joinSignature:function(){return _.joinSignature},keccak256:function(){return R.keccak256},mnemonicToEntropy:function(){return I.mnemonicToEntropy},mnemonicToSeed:function(){return I.mnemonicToSeed},namehash:function(){return T.VM},nameprep:function(){return Z.Ll},parseBytes32String:function(){return H.F},parseEther:function(){return V.parseEther},parseTransaction:function(){return q.parse},parseUnits:function(){return V.parseUnits},poll:function(){return W.poll},randomBytes:function(){return L.O},recoverAddress:function(){return q.recoverAddress},recoverPublicKey:function(){return F.recoverPublicKey},resolveProperties:function(){return B.resolveProperties},ripemd160:function(){return N.bP},serializeTransaction:function(){return q.serialize},sha256:function(){return N.JQ},sha512:function(){return N.o},shallowCopy:function(){return B.shallowCopy},shuffled:function(){return D.y},solidityKeccak256:function(){return j.keccak256},solidityPack:function(){return j.pack},soliditySha256:function(){return j.sha256},splitSignature:function(){return _.splitSignature},stripZeros:function(){return _.stripZeros},toUtf8Bytes:function(){return z.Y0},toUtf8CodePoints:function(){return z.XL},toUtf8String:function(){return z.ZN},verifyMessage:function(){return l.verifyMessage},verifyTypedData:function(){return l.verifyTypedData},zeroPad:function(){return _.zeroPad}});var a={};n.r(a),n.d(a,{BaseContract:function(){return o.VZ},BigNumber:function(){return s.O$},Contract:function(){return o.CH},ContractFactory:function(){return o.lV},FixedNumber:function(){return u.xs},Signer:function(){return c.E},VoidSigner:function(){return c.b},Wallet:function(){return l.Wallet},Wordlist:function(){return y.D},constants:function(){return r},errors:function(){return M.ErrorCode},getDefaultProvider:function(){return m.getDefaultProvider},logger:function(){return K},providers:function(){return m},utils:function(){return i},version:function(){return Y},wordlists:function(){return v.E}});var o=n(39707),s=n(19560),u=n(57042),c=n(72388),l=n(56204),f=n(81895),d=n(6321),p=n(44160),h="\u039e",m=n(53182),v=n(53771),y=n(10581),b=n(86388),g=n(7550),w=n(62),x=n(99456),k=n(28552),A=n(29515),E=n(44247),_=n(52009),T=n(68565),S=n(88836),C=n(93358),O=n(26454),I=n(42989),P=n(9764),R=n(11291),M=n(2735),N=n(43984),j=n(46684),L=n(75722),D=n(54327),B=n(54812),U=n(80807),F=n(64760),Z=n(4491),z=n(91953),H=n(18825),q=n(65958),V=n(18383),W=n(28786),G=n(8427),Y="ethers/5.7.2",K=new M.Logger(Y);try{var J=window;null==J._ethers&&(J._ethers=a)}catch(Q){}},96749:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var o=n(93487);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return o.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return o.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return o.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return o.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return o.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return o.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return o.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return o.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return o.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return o.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return o.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return o.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return o.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return o.TransactionDescription}});var s=n(28552);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return s.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return s.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return s.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return s.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}});var u=a(n(29515));t.base64=u;var c=n(44247);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return c.Base58}});var l=n(52009);Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return l.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return l.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return l.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return l.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return l.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return l.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return l.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return l.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return l.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return l.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return l.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return l.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return l.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return l.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return l.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return l.stripZeros}});var f=n(85843);Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return f.namehash}});var d=n(42989);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var p=n(56216);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return p.getJsonWalletAddress}});var h=n(11291);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var m=n(2735);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return m.Logger}});var v=n(24517);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return v.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return v.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return v.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return v.sha512}});var y=n(46684);Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return y.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return y.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return y.sha256}});var b=n(65683);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return b.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return b.shuffled}});var g=n(54812);Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return g.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return g.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return g.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return g.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return g.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return g.shallowCopy}});var w=a(n(80807));t.RLP=w;var x=n(64760);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return x.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return x.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return x.SigningKey}});var k=n(52185);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return k.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return k.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return k.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return k._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return k.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return k.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return k.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return k.Utf8ErrorFuncs}});var A=n(65958);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return A.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return A.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return A.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return A.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return A.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return A.TransactionTypes}});var E=n(18383);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var _=n(56204);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return _.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return _.verifyTypedData}});var T=n(28786);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return T._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return T.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return T.poll}});var S=n(24517);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return S.SupportedAlgorithm}});var C=n(52185);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return C.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return C.Utf8ErrorReason}})},20548:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,o){if("function"!==typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||e,o),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){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(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=a[e];if(void 0===u)return!1;if("function"===typeof u)r(u,this,t);else{var c=u.length,l=h(u,c);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},89806:function(e){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!==i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;0!==i--;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}},8461:function(e){"use strict";e.exports=function(e,t){t||(t={}),"function"===typeof t&&(t={cmp:t});var n,r="boolean"===typeof t.cycles&&t.cycles,i=t.cmp&&(n=t.cmp,function(e){return function(t,r){var i={key:t,value:e[t]},a={key:r,value:e[r]};return n(i,a)}}),a=[];return function e(t){if(t&&t.toJSON&&"function"===typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!==typeof t)return JSON.stringify(t);var n,o;if(Array.isArray(t)){for(o="[",n=0;nl.depthLimit)return void s(t,e,r,o);if("undefined"!==typeof l.edgesLimit&&i+1>l.edgesLimit)return void s(t,e,r,o);if(a.push(e),Array.isArray(e))for(f=0;ft?1:0}function l(e,t,n,o){"undefined"===typeof o&&(o=a());var s,u=f(e,"",0,[],void 0,0,o)||e;try{s=0===i.length?JSON.stringify(u,t,n):JSON.stringify(u,d(t),n)}catch(l){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function f(e,i,a,o,u,l,d){var p;if(l+=1,"object"===typeof e&&null!==e){for(p=0;pd.depthLimit)return void s(t,e,i,u);if("undefined"!==typeof d.edgesLimit&&a+1>d.edgesLimit)return void s(t,e,i,u);if(o.push(e),Array.isArray(e))for(p=0;p0)for(var r=0;r=3&&(o=n),"[object Array]"===i.call(e)?function(e,t,n){for(var r=0,i=e.length;r1&&"boolean"!==typeof t)throw new o('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=_(e,0,1),n=_(e,-1);if("%"===t&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return E(e,S,(function(e,t,n,i){r[r.length]=n?E(i,C,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",a=O("%"+r+"%",t),s=a.name,c=a.value,l=!1,f=a.alias;f&&(r=f[0],A(n,k([0,1],f)));for(var d=1,p=!0;d=n.length){var b=u(c,h);c=(p=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:c[h]}else p=x(c,h),c=c[h];p&&!l&&(v[s]=c)}}return c}},56103:function(e,t,n){"use strict";var r=n(28476)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(i){r=null}e.exports=r},82926:function(e,t,n){"use strict";var r=n(28476)("%Object.defineProperty%",!0),i=function(){if(r)try{return r({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},87593:function(e){"use strict";var t={foo:{}},n=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof n)}},95520:function(e,t,n){"use strict";var r="undefined"!==typeof Symbol&&Symbol,i=n(80541);e.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&i())))}},80541:function(e){"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},48857:function(e,t,n){"use strict";var r=n(80541);e.exports=function(){return r()&&!!Symbol.toStringTag}},37838:function(e,t,n){"use strict";var r=n(1199);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},37553:function(e,t,n){var r=t;r.utils=n(67657),r.common=n(43345),r.sha=n(90395),r.ripemd=n(85751),r.hmac=n(79161),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},43345:function(e,t,n){"use strict";var r=n(67657),i=n(65701);function a(){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}t.BlockHash=a,a.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},67657:function(e,t,n){"use strict";var r=n(65701),i=n(80273);function a(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i>6|192,n[r++]=63&o|128):a(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i>>0}return o},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=a>>>16&255,n[i+2]=a>>>8&255,n[i+3]=255&a):(n[i+3]=a>>>24,n[i+2]=a>>>16&255,n[i+1]=a>>>8&255,n[i]=255&a)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],a=r+e[t+1]>>>0,o=(a>>0,e[t+1]=a},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,a,o,s){var u=0,c=t;return u+=(c=c+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,i,a,o,s){return t+r+a+s>>>0},t.sum64_5_hi=function(e,t,n,r,i,a,o,s,u,c){var l=0,f=t;return l+=(f=f+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,i,a,o,s,u,c){return t+r+a+s+c>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},31355:function(e,t,n){"use strict";var r=n(37553),i=n(42679),a=n(65701);function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),n=i.toArray(e.nonce,e.nonceEnc||"hex"),r=i.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}e.exports=o,o.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},o.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=n,n=t,t=null),n&&(n=i.toArray(n,r||"hex"),this._update(n));for(var a=[];a.length>1,l=-7,f=n?i-1:0,d=n?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=c}return(p?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,c=8*a-i-1,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(o=o<0;e[n+p]=255&o,p+=h,o/=256,c-=8);e[n+p-h]|=128*m}},80273:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},95021:function(e,t,n){"use strict";var r=n(48857)(),i=n(44680)("Object.prototype.toString"),a=function(e){return!(r&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,e.exports=s?a:o},8866:function(e){"use strict";var t,n,r=Function.prototype.toString,i="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof i&&"function"===typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},i((function(){throw 42}),null,t)}catch(p){p!==n&&(i=null)}else i=null;var a=/^\s*class\b/,o=function(e){try{var t=r.call(e);return a.test(t)}catch(n){return!1}},s=function(e){try{return!o(e)&&(r.call(e),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"===typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"===typeof document){var d=document.all;u.call(d)===u.call(document.all)&&(f=function(e){if((l||!e)&&("undefined"===typeof e||"object"===typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(n){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;try{i(e,null,t)}catch(r){if(r!==n)return!1}return!o(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if(c)return s(e);if(o(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},7469:function(e,t,n){"use strict";var r,i=Object.prototype.toString,a=Function.prototype.toString,o=/^\s*(?:function)?\*/,s=n(48857)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!==typeof e)return!1;if(o.test(a.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if("undefined"===typeof r){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&u(t)}return u(e)===r}},72105:function(e,t,n){"use strict";var r=n(45767),i=n(93645),a=n(44680),o=a("Object.prototype.toString"),s=n(48857)(),u=n(56103),c="undefined"===typeof globalThis?n.g:globalThis,l=i(),f=a("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n-1}return!!u&&function(e){var t=!1;return r(p,(function(n,r){if(!t)try{t=n.call(e)===r}catch(i){}})),t}(e)}},83929:function(e,t,n){n(48093),e.exports=self.fetch.bind(self)},14593:function(e){e.exports=["#01888C","#FC7500","#034F5D","#F73F01","#FC1960","#C7144C","#F3C100","#1598F2","#2465E1","#F19E02"]},619:function(e,t,n){var r,i=n(6346),a=n(47668),o=n(32901),s=n(14593);function u(e,t,n,i,a){var o=e.rect(0,0,n,n);o.rotate(360*r.random());var s=n/a*r.random()+i*n/a;o.translate(s),o.rotate(180*r.random()),o.attr("fill",c(t)),o.attr("stroke","none")}function c(e){r.random();var t=Math.floor(e.length*r.random());return e.splice(t,1)[0]}e.exports=function(e,t){r=new i(t);var n=a(e),f=n.paper,d=n.container,p=function(e,t){var n=30*t.random()-l/2;return e.map((function(e){var t=o(e);return t.rotate(n),t.hexString()}))}(s.slice(),r),h=f.rect(0,0,e,e);h.attr("fill",c(p)),h.attr("stroke","none");for(var m=0;m<3;m++)u(f,p,e,m,3);return d};var l=30},47668:function(e,t,n){var r=n(67983);e.exports=function(e){var t=document.createElement("div");return t.style.borderRadius="50px",t.style.overflow="hidden",t.style.padding="0px",t.style.margin="0px",t.style.width=e+"px",t.style.height=e+"px",t.style.display="inline-block",{paper:r(t,100,100),container:t}}},37676:function(e,t,n){var r;!function(){"use strict";var i="input is invalid type",a="object"===typeof window,o=a?window:{};o.JS_SHA3_NO_WINDOW&&(a=!1);var s=!a&&"object"===typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node?o=n.g:s&&(o=self);var u=!o.JS_SHA3_NO_COMMON_JS&&e.exports,c=n.amdO,l=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,f="0123456789abcdef".split(""),d=[4,1024,262144,67108864],p=[0,8,16,24],h=[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],m=[224,256,384,512],v=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],b={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var g=function(e,t,n){return function(r){return new N(e,t,e).update(r)[n]()}},w=function(e,t,n){return function(r,i){return new N(e,t,i).update(r)[n]()}},x=function(e,t,n){return function(t,r,i,a){return T["cshake"+e].update(t,r,i,a)[n]()}},k=function(e,t,n){return function(t,r,i,a){return T["kmac"+e].update(t,r,i,a)[n]()}},A=function(e,t,n,r){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function j(e,t,n){N.call(this,e,t,n)}N.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(i);if(null===e)throw new Error(i);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var r,a,o=this.blocks,s=this.byteCount,u=e.length,c=this.blockCount,f=0,d=this.s;f>2]|=e[f]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(o[r>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=s){for(this.start=r-s,this.block=o[c],r=0;r>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},N.prototype.encodeString=function(e){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(i);if(null===e)throw new Error(i);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}var r=0,a=e.length;if(t)r=a;else for(var o=0;o=57344?r+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),r+=4)}return r+=this.encode(8*r),this.update(e),r},N.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];o%t===0&&(L(n),a=0)}return i&&(e=n[a],s+=f[e>>4&15]+f[15&e],i>1&&(s+=f[e>>12&15]+f[e>>8&15]),i>2&&(s+=f[e>>20&15]+f[e>>16&15])),s},N.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n===0&&L(r)}return a&&(e=s<<2,t=r[o],u[e]=255&t,a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u},j.prototype=new N,j.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var L=function(e){var t,n,r,i,a,o,s,u,c,l,f,d,p,m,v,y,b,g,w,x,k,A,E,_,T,S,C,O,I,P,R,M,N,j,L,D,B,U,F,Z,z,H,q,V,W,G,Y,K,J,Q,X,$,ee,te,ne,re,ie,ae,oe,se,ue,ce,le;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(o<<1|s>>>31),n=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(u<<1|c>>>31),n=a^(c<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(l<<1|f>>>31),n=s^(f<<1|l>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(d<<1|p>>>31),n=c^(p<<1|d>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=l^(i<<1|a>>>31),n=f^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],v=e[1],G=e[11]<<4|e[10]>>>28,Y=e[10]<<4|e[11]>>>28,O=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,q=e[41]<<18|e[40]>>>14,j=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,K=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,P=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,B=e[15]<<6|e[14]>>>26,g=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Q=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,M=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,_=e[6]<<28|e[7]>>>4,T=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,k=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,S=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,Z=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=m^~y&g,e[1]=v^~b&w,e[10]=_^~S&O,e[11]=T^~C&I,e[20]=j^~D&U,e[21]=L^~B&F,e[30]=V^~G&K,e[31]=W^~Y&J,e[40]=te^~re&ae,e[41]=ne^~ie&oe,e[2]=y^~g&x,e[3]=b^~w&k,e[12]=S^~O&P,e[13]=C^~I&R,e[22]=D^~U&Z,e[23]=B^~F&z,e[32]=G^~K&Q,e[33]=Y^~J&X,e[42]=re^~ae&se,e[43]=ie^~oe&ue,e[4]=g^~x&A,e[5]=w^~k&E,e[14]=O^~P&M,e[15]=I^~R&N,e[24]=U^~Z&H,e[25]=F^~z&q,e[34]=K^~Q&$,e[35]=J^~X&ee,e[44]=ae^~se&ce,e[45]=oe^~ue&le,e[6]=x^~A&m,e[7]=k^~E&v,e[16]=P^~M&_,e[17]=R^~N&T,e[26]=Z^~H&j,e[27]=z^~q&L,e[36]=Q^~$&V,e[37]=X^~ee&W,e[46]=se^~ce&te,e[47]=ue^~le&ne,e[8]=A^~m&y,e[9]=E^~v&b,e[18]=M^~_&S,e[19]=N^~T&C,e[28]=H^~j&D,e[29]=q^~L&B,e[38]=$^~V&G,e[39]=ee^~W&Y,e[48]=ce^~te&re,e[49]=le^~ne&ie,e[0]^=h[r],e[1]^=h[r+1]};if(u)e.exports=T;else{for(C=0;Cc.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return o(r)}return a(c,[{key:"toDebugString",value:function(){var e,t=["BigInt["],n=r(this);try{for(n.s();!(e=n.n()).done;){var i=e.value;t.push((i?(i>>>0).toString(16):i)+", ")}}catch(a){n.e(a)}finally{n.f()}return t.push("]"),t.join("")}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;if(2>e||36this.length&&(n=this.length);for(var r=32767&e,i=e>>>15,a=0,o=t,s=0;s>>15,d=c.__imul(l,r),p=c.__imul(l,i),h=c.__imul(f,r),m=o+d+a;a=m>>>30,m&=1073741823,a+=(m+=((32767&p)<<15)+((32767&h)<<15))>>>30,o=c.__imul(f,i)+(p>>>15)+(h>>>15),this.__setDigit(s,1073741823&m)}if(0!=a||0!==o)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(e,t,n){for(var r=0,i=0;i>>15,this.__setHalfDigit(t+i,32767&a)}return r}},{key:"__inplaceSub",value:function(e,t,n){var r=0;if(1&t){t>>=1;for(var i=this.__digit(t),a=32767&i,o=0;o>>1;o++){var s=e.__digit(o),u=(i>>>15)-(32767&s)-r;r=1&u>>>15,this.__setDigit(t+o,(32767&u)<<15|32767&a),r=1&(a=(32767&(i=this.__digit(t+o+1)))-(s>>>15)-r)>>>15}var c=e.__digit(o),l=(i>>>15)-(32767&c)-r;if(r=1&l>>>15,this.__setDigit(t+o,(32767&l)<<15|32767&a),t+o+1>=this.length)throw new RangeError("out of bounds");0==(1&n)&&(r=1&(a=(32767&(i=this.__digit(t+o+1)))-(c>>>15)-r)>>>15,this.__setDigit(t+e.length,1073709056&i|32767&a))}else{t>>=1;for(var f=0;f>>15)-(p>>>15)-(r=1&h>>>15);r=1&m>>>15,this.__setDigit(t+f,(32767&m)<<15|32767&h)}var v=this.__digit(t+f),y=e.__digit(f),b=(32767&v)-(32767&y)-r;r=1&b>>>15;var g=0;0==(1&n)&&(r=1&(g=(v>>>15)-(y>>>15)-r)>>>15),this.__setDigit(t+f,(32767&g)<<15|32767&b)}return r}},{key:"__inplaceRightShift",value:function(e){if(0!==e){for(var t=this.__digit(0)>>>e,n=this.length-1,r=0;r>>e}this.__setDigit(n,t)}}},{key:"__digit",value:function(e){return this[e]}},{key:"__unsignedDigit",value:function(e){return this[e]>>>0}},{key:"__setDigit",value:function(e,t){this[e]=0|t}},{key:"__setDigitGrow",value:function(e,t){this[e]=0|t}},{key:"__halfDigitLength",value:function(){var e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}},{key:"__halfDigit",value:function(e){return 32767&this[e>>>1]>>>15*(1&e)}},{key:"__setHalfDigit",value:function(e,t){var n=e>>>1,r=this.__digit(n),i=1&e?32767&r|t<<15:1073709056&r|32767&t;this.__setDigit(n,i)}}],[{key:"BigInt",value:function(e){var t=Number.isFinite;if("number"==typeof e){if(0===e)return c.__zero();if(c.__isOneDigitInt(e))return 0>e?c.__oneDigit(-e,!0):c.__oneDigit(e,!1);if(!t(e)||f(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return c.__fromDouble(e)}if("string"==typeof e){var n=c.__fromString(e);if(null===n)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return n}if("boolean"==typeof e)return!0===e?c.__oneDigit(1,!1):c.__zero();if("object"==typeof e){if(e.constructor===c)return e;var r=c.__toPrimitive(e);return c.BigInt(r)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(e){var t=e.length;if(0===t)return 0;if(1===t){var n=e.__unsignedDigit(0);return e.sign?-n:n}var r=e.__digit(t-1),i=c.__clz30(r),a=30*t-i;if(1024>>=12;var d=l-12,p=12<=l?0:s<<20+l,h=20+l;for(0>>30-d,p=s<>>30-h,h-=30;var m=c.__decideRounding(e,h,u,s);if((1===m||0===m&&1==(1&p))&&0===(p=p+1>>>0)&&0!=++f>>>20&&(f=0,1023<++o))return e.sign?-1/0:1/0;var v=e.sign?-2147483648:0;return o=o+1023<<20,c.__kBitConversionInts[1]=v|o|f,c.__kBitConversionInts[0]=p,c.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(e){if(0===e.length)return e;var t=e.__copy();return t.sign=!e.sign,t}},{key:"bitwiseNot",value:function(e){return e.sign?c.__absoluteSubOne(e).__trim():c.__absoluteAddOne(e,!0)}},{key:"exponentiate",value:function(e,t){if(t.sign)throw new RangeError("Exponent must be positive");if(0===t.length)return c.__oneDigit(1,!1);if(0===e.length)return e;if(1===e.length&&1===e.__digit(0))return e.sign&&0==(1&t.__digit(0))?c.unaryMinus(e):e;if(1=c.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===e.length&&2===e.__digit(0)){var r=1+(0|n/30),i=new c(r,e.sign&&0!=(1&n));i.__initializeDigits();var a=1<>=1;0!==n;n>>=1)s=c.multiply(s,s),0!=(1&n)&&(o=null===o?s:c.multiply(o,s));return o}},{key:"multiply",value:function(e,t){if(0===e.length)return e;if(0===t.length)return t;var n=e.length+t.length;30<=e.__clzmsd()+t.__clzmsd()&&n--;var r=new c(n,e.sign!==t.sign);r.__initializeDigits();for(var i=0;ic.__absoluteCompare(e,t))return c.__zero();var n,r=e.sign!==t.sign,i=t.__unsignedDigit(0);if(1===t.length&&32767>=i){if(1===i)return r===e.sign?e:c.unaryMinus(e);n=c.__absoluteDivSmall(e,i,null)}else n=c.__absoluteDivLarge(e,t,!0,!1);return n.sign=r,n.__trim()}},{key:"remainder",value:function(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>c.__absoluteCompare(e,t))return e;var n=t.__unsignedDigit(0);if(1===t.length&&32767>=n){if(1===n)return c.__zero();var r=c.__absoluteModSmall(e,n);return 0===r?c.__zero():c.__oneDigit(r,e.sign)}var i=c.__absoluteDivLarge(e,t,!1,!0);return i.sign=e.sign,i.__trim()}},{key:"add",value:function(e,t){var n=e.sign;return n===t.sign?c.__absoluteAdd(e,t,n):0<=c.__absoluteCompare(e,t)?c.__absoluteSub(e,t,n):c.__absoluteSub(t,e,!n)}},{key:"subtract",value:function(e,t){var n=e.sign;return n===t.sign?0<=c.__absoluteCompare(e,t)?c.__absoluteSub(e,t,n):c.__absoluteSub(t,e,!n):c.__absoluteAdd(e,t,n)}},{key:"leftShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?c.__rightShiftByAbsolute(e,t):c.__leftShiftByAbsolute(e,t)}},{key:"signedRightShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?c.__leftShiftByAbsolute(e,t):c.__rightShiftByAbsolute(e,t)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(e,t){return 0>c.__compareToBigInt(e,t)}},{key:"lessThanOrEqual",value:function(e,t){return 0>=c.__compareToBigInt(e,t)}},{key:"greaterThan",value:function(e,t){return 0(e=f(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return c.__zero();if(e>=c.__kMaxLengthBits)return t;var n=0|(e+29)/30;if(t.length(e=f(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return c.__zero();if(t.sign){if(e>c.__kMaxLengthBits)throw new RangeError("BigInt too big");return c.__truncateAndSubFromPowerOfTwo(e,t,!1)}if(e>=c.__kMaxLengthBits)return t;var n=0|(e+29)/30;if(t.length>>r)return t}return c.__truncateToNBits(e,t)}},{key:"ADD",value:function(e,t){if(e=c.__toPrimitive(e),t=c.__toPrimitive(t),"string"==typeof e)return"string"!=typeof t&&(t=t.toString()),e+t;if("string"==typeof t)return e.toString()+t;if(e=c.__toNumeric(e),t=c.__toNumeric(t),c.__isBigInt(e)&&c.__isBigInt(t))return c.add(e,t);if("number"==typeof e&&"number"==typeof t)return e+t;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(e,t){return c.__compare(e,t,0)}},{key:"LE",value:function(e,t){return c.__compare(e,t,1)}},{key:"GT",value:function(e,t){return c.__compare(e,t,2)}},{key:"GE",value:function(e,t){return c.__compare(e,t,3)}},{key:"EQ",value:function(e,t){for(;;){if(c.__isBigInt(e))return c.__isBigInt(t)?c.equal(e,t):c.EQ(t,e);if("number"==typeof e){if(c.__isBigInt(t))return c.__equalToNumber(t,e);if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else if("string"==typeof e){if(c.__isBigInt(t))return null!==(e=c.__fromString(e))&&c.equal(e,t);if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else if("boolean"==typeof e){if(c.__isBigInt(t))return c.__equalToNumber(t,+e);if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else if("symbol"==typeof e){if(c.__isBigInt(t))return!1;if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else{if("object"!=typeof e)return e==t;if("object"==typeof t&&t.constructor!==c)return e==t;e=c.__toPrimitive(e)}}}},{key:"NE",value:function(e,t){return!c.EQ(e,t)}},{key:"__zero",value:function(){return new c(0,!1)}},{key:"__oneDigit",value:function(e,t){var n=new c(1,t);return n.__setDigit(0,e),n}},{key:"__decideRounding",value:function(e,t,n,r){if(0t)i=-t-1;else{if(0===n)return-1;n--,r=e.__digit(n),i=29}var a=1<>>20)-1023,r=1+(0|n/30),i=new c(r,0>e),a=1048575&c.__kBitConversionInts[1]|1048576,o=c.__kBitConversionInts[0],s=20,u=n%30,l=0;if(20>u){var f=s-u;l=f+32,t=a>>>f,a=a<<32-f|o>>>f,o<<=32-f}else if(20===u)l=32,t=a,a=o,o=0;else{var d=u-s;l=32-d,t=a<>>32-d,a=o<>>2,a=a<<30|o>>>2,o<<=30):t=0,i.__setDigit(p,t);return i.__trim()}},{key:"__isWhitespace",value:function(e){return!!(13>=e&&9<=e)||(159>=e?32==e:131071>=e?160==e||5760==e:196607>=e?10>=(e&=131071)||40==e||41==e||47==e||95==e||4096==e:65279==e)}},{key:"__fromString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0,r=e.length,i=0;if(i===r)return c.__zero();for(var a=e.charCodeAt(i);c.__isWhitespace(a);){if(++i===r)return c.__zero();a=e.charCodeAt(i)}if(43===a){if(++i===r)return null;a=e.charCodeAt(i),n=1}else if(45===a){if(++i===r)return null;a=e.charCodeAt(i),n=-1}if(0===t){if(t=10,48===a){if(++i===r)return c.__zero();if(88===(a=e.charCodeAt(i))||120===a){if(t=16,++i===r)return null;a=e.charCodeAt(i)}else if(79===a||111===a){if(t=8,++i===r)return null;a=e.charCodeAt(i)}else if(66===a||98===a){if(t=2,++i===r)return null;a=e.charCodeAt(i)}}}else if(16===t&&48===a){if(++i===r)return c.__zero();if(88===(a=e.charCodeAt(i))||120===a){if(++i===r)return null;a=e.charCodeAt(i)}}if(0!=n&&10!==t)return null;for(;48===a;){if(++i===r)return c.__zero();a=e.charCodeAt(i)}var o=r-i,s=c.__kMaxBitsPerChar[t],u=c.__kBitsPerCharTableMultiplier-1;if(o>1073741824/s)return null;var l=new c(0|(29+(s*o+u>>>c.__kBitsPerCharTableShift))/30,!1),f=10>t?t:10,d=10>=c.__kBitsPerCharTableShift;var p=[],h=[],m=!1;do{for(var v=0,y=0;;){var b=void 0;if(a-48>>>0>>0>>0>>0>>c.__kBitsPerCharTableShift)/30;l.__inplaceMultiplyAdd(k,x,_)}while(!g)}if(i!==r){if(!c.__isWhitespace(a))return null;for(i++;i>>u-(a-=30))}if(0!==i){if(r>=e.length)throw new Error("implementation bug");e.__setDigit(r++,i)}for(;r>>1)+(85&r))>>>2)+(51&r))>>>4)+(15&r),a=t-1,o=e.__digit(n-1),s=0|(30*n-c.__clz30(o)+i-1)/i;if(e.sign&&s++,268435456>>v,d=30-v;d>=i;)u[l--]=c.__kConversionChars[f&a],f>>>=i,d-=i}var y=(f|o<>>i-d;0!==f;)u[l--]=c.__kConversionChars[f&a],f>>>=i;if(e.sign&&(u[l--]="-"),-1!=l)throw new Error("implementation bug");return u.join("")}},{key:"__toStringGeneric",value:function(e,t,n){var r=e.length;if(0===r)return"";if(1===r){var i=e.__unsignedDigit(0).toString(t);return!1===n&&e.sign&&(i="-"+i),i}var a,o,s=30*r-c.__clz30(e.__digit(r-1)),u=c.__kMaxBitsPerChar[t]-1,l=s*c.__kBitsPerCharTableMultiplier,f=1+(l=0|(l+=u-1)/u)>>1,d=c.exponentiate(c.__oneDigit(t,!1),c.__oneDigit(f,!1)),p=d.__unsignedDigit(0);if(1===d.length&&32767>=p){(a=new c(e.length,!1)).__initializeDigits();for(var h=0,m=2*e.length-1;0<=m;m--){var v=h<<15|e.__halfDigit(m);a.__setHalfDigit(m,0|v/p),h=0|v%p}o=h.toString(t)}else{var y=c.__absoluteDivLarge(e,d,!0,!0);a=y.quotient;var b=y.remainder.__trim();o=c.__toStringGeneric(b,t,!0)}a.__trim();for(var g=c.__toStringGeneric(a,t,!0);o.lengthr?c.__absoluteLess(n):0}},{key:"__compareToNumber",value:function(e,t){if(c.__isOneDigitInt(t)){var r=e.sign,i=0>t;if(r!==i)return c.__unequalSign(r);if(0===e.length){if(i)throw new Error("implementation bug");return 0===t?0:-1}if(1a?c.__absoluteGreater(r):ot)return c.__unequalSign(n);if(0===t)throw new Error("implementation bug: should be handled elsewhere");if(0===e.length)return-1;c.__kBitConversionDouble[0]=t;var r=2047&c.__kBitConversionInts[1]>>>20;if(2047==r)throw new Error("implementation bug: handled elsewhere");var i=r-1023;if(0>i)return c.__absoluteGreater(n);var a=e.length,o=e.__digit(a-1),s=c.__clz30(o),u=30*a-s,l=i+1;if(ul)return c.__absoluteGreater(n);var f=1048576|1048575&c.__kBitConversionInts[1],d=c.__kBitConversionInts[0],p=20,h=29-s;if(h!==(0|(u-1)%30))throw new Error("implementation bug");var m,v=0;if(20>h){var y=p-h;v=y+32,m=f>>>y,f=f<<32-y|d>>>y,d<<=32-y}else if(20===h)v=32,m=f,f=d,d=0;else{var b=h-p;v=32-b,m=f<>>32-b,f=d<>>=0)>(m>>>=0))return c.__absoluteGreater(n);if(o>>2,f=f<<30|d>>>2,d<<=30):m=0;var w=e.__unsignedDigit(g);if(w>m)return c.__absoluteGreater(n);if(wt&&e.__unsignedDigit(0)===n(t):0===c.__compareToDouble(e,t)}},{key:"__comparisonResultToBool",value:function(e,t){return 0===t?0>e:1===t?0>=e:2===t?0t;case 3:return e>=t}if(c.__isBigInt(e)&&"string"==typeof t)return null!==(t=c.__fromString(t))&&c.__comparisonResultToBool(c.__compareToBigInt(e,t),n);if("string"==typeof e&&c.__isBigInt(t))return null!==(e=c.__fromString(e))&&c.__comparisonResultToBool(c.__compareToBigInt(e,t),n);if(e=c.__toNumeric(e),t=c.__toNumeric(t),c.__isBigInt(e)){if(c.__isBigInt(t))return c.__comparisonResultToBool(c.__compareToBigInt(e,t),n);if("number"!=typeof t)throw new Error("implementation bug");return c.__comparisonResultToBool(c.__compareToNumber(e,t),n)}if("number"!=typeof e)throw new Error("implementation bug");if(c.__isBigInt(t))return c.__comparisonResultToBool(c.__compareToNumber(t,e),2^n);if("number"!=typeof t)throw new Error("implementation bug");return 0===n?et:3===n?e>=t:void 0}},{key:"__absoluteAdd",value:function(e,t,n){if(e.length>>30,i.__setDigit(o,1073741823&s)}for(;o>>30,i.__setDigit(o,1073741823&u)}return o>>30,r.__setDigit(a,1073741823&o)}for(;a>>30,r.__setDigit(a,1073741823&s)}return r.__trim()}},{key:"__absoluteAddOne",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.length;null===n?n=new c(r,t):n.sign=t;for(var i=1,a=0;a>>30,n.__setDigit(a,1073741823&o)}return 0!=i&&n.__setDigitGrow(r,1),n}},{key:"__absoluteSubOne",value:function(e,t){for(var n=e.length,r=new c(t=t||n,!1),i=1,a=0;a>>30,r.__setDigit(a,1073741823&o)}if(0!=i)throw new Error("implementation bug");for(var s=n;s2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,a=i;if(r2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,a=i;r2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,a=i;if(r2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,a=i;if(rr?0:e.__unsignedDigit(r)>t.__unsignedDigit(r)?1:-1}},{key:"__multiplyAccumulate",value:function(e,t,n,r){if(0!==t){for(var i,a=32767&t,o=t>>>15,s=0,u=0,l=0;l>>15,h=c.__imul(d,a),m=c.__imul(d,o),v=c.__imul(p,a);s=(i+=u+h+s)>>>30,i&=1073741823,s+=(i+=((32767&m)<<15)+((32767&v)<<15))>>>30,u=c.__imul(p,o)+(m>>>15)+(v>>>15),n.__setDigit(r,1073741823&i)}for(;0!=s||0!==u;r++){var y=n.__digit(r);y+=s+u,u=0,s=y>>>30,n.__setDigit(r,1073741823&y)}}}},{key:"__internalMultiplyAdd",value:function(e,t,n,r,i){for(var a=n,o=0,s=0;s>>15,t),d=l+((32767&f)<<15)+o+a;a=d>>>30,o=f>>>15,i.__setDigit(s,1073741823&d)}if(i.length>r)for(i.__setDigit(r++,a+o);r2&&void 0!==arguments[2]?arguments[2]:null;null===n&&(n=new c(e.length,!1));for(var r,i=0,a=2*e.length-1;0<=a;a-=2){var o=0|(r=(i<<15|e.__halfDigit(a))>>>0)/t,s=0|(r=((i=0|r%t)<<15|e.__halfDigit(a-1))>>>0)/t;i=0|r%t,n.__setDigit(a>>>1,o<<15|s)}return n}},{key:"__absoluteModSmall",value:function(e,t){for(var n=0,r=2*e.length-1;0<=r;r--)n=0|((n<<15|e.__halfDigit(r))>>>0)%t;return n}},{key:"__absoluteDivLarge",value:function(e,t,n,r){var i=t.__halfDigitLength(),a=t.length,o=e.__halfDigitLength()-i,s=null;n&&(s=new c(o+2>>>1,!1)).__initializeDigits();var u=new c(i+2>>>1,!1);u.__initializeDigits();var l=c.__clz15(t.__halfDigit(i-1));0>>0;f=0|y/p;for(var b=0|y%p,g=t.__halfDigit(i-2),w=d.__halfDigit(m+i-2);c.__imul(f,g)>>>0>(b<<16|w)>>>0&&(f--,!(32767<(b+=p))););}c.__internalMultiplyAdd(t,f,0,a,u);var x=d.__inplaceSub(u,m,i+1);0!==x&&(x=d.__inplaceAdd(t,m,i),d.__setHalfDigit(m+i,32767&d.__halfDigit(m+i)+x),f--),n&&(1&m?h=f<<15:s.__setDigit(m>>>1,h|f))}if(r)return d.__inplaceRightShift(l),n?{quotient:s,remainder:d}:d;if(n)return s;throw new Error("unreachable")}},{key:"__clz15",value:function(e){return c.__clz30(e)-15}},{key:"__specialLeftShift",value:function(e,t,n){var r=e.length,i=new c(r+n,!1);if(0===t){for(var a=0;a>>30-t}return 0n)throw new RangeError("BigInt too big");var r=0|n/30,i=n%30,a=e.length,o=0!==i&&0!=e.__digit(a-1)>>>30-i,s=a+r+(o?1:0),u=new c(s,e.sign);if(0===i){for(var l=0;l>>30-i}if(o)u.__setDigit(a+r,f);else if(0!==f)throw new Error("implementation bug")}return u.__trim()}},{key:"__rightShiftByAbsolute",value:function(e,t){var n=e.length,r=e.sign,i=c.__toShiftAmount(t);if(0>i)return c.__rightShiftByMaximum(r);var a=0|i/30,o=i%30,s=n-a;if(0>=s)return c.__rightShiftByMaximum(r);var u=!1;if(r)if(0!=(e.__digit(a)&(1<>>o,h=n-a-1,m=0;m>>o}f.__setDigit(h,p)}return u&&(f=c.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(e){return e?c.__oneDigit(1,!0):c.__zero()}},{key:"__toShiftAmount",value:function(e){if(1c.__kMaxLengthBits?-1:t}},{key:"__toPrimitive",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";if("object"!=typeof e)return e;if(e.constructor===c)return e;if("undefined"!=typeof Symbol&&"symbol"==typeof Symbol.toPrimitive){var n=e[Symbol.toPrimitive];if(n){var r=n(t);if("object"!=typeof r)return r;throw new TypeError("Cannot convert object to primitive value")}}var i=e.valueOf;if(i){var a=i.call(e);if("object"!=typeof a)return a}var o=e.toString;if(o){var s=o.call(e);if("object"!=typeof s)return s}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(e){return c.__isBigInt(e)?e:+e}},{key:"__isBigInt",value:function(e){return"object"==typeof e&&null!==e&&e.constructor===c}},{key:"__truncateToNBits",value:function(e,t){for(var n=0|(e+29)/30,r=new c(n,t.sign),i=n-1,a=0;a>>s}return r.__setDigit(i,o),r.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(e,t,n){for(var r=Math.min,i=0|(e+29)/30,a=new c(i,n),o=0,s=i-1,u=0,l=r(s,t.length);o>>30,a.__setDigit(o,1073741823&f)}for(;o>>m)-u,d&=v-1}return a.__setDigit(s,d),a.__trim()}},{key:"__digitPow",value:function(e,t){for(var n=1;0>>=1,e*=e;return n}},{key:"__isOneDigitInt",value:function(e){return(1073741823&e)===e}}]),c}(c(Array));return d.__kMaxLength=33554432,d.__kMaxLengthBits=d.__kMaxLength<<5,d.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],d.__kBitsPerCharTableShift=5,d.__kBitsPerCharTableMultiplier=1<>>0)/t)},d.__imul=e||function(e,t){return 0|e*t},d}()},17418:function(e,t,n){var r=n(66665).stringify,i=n(33606);e.exports=function(e){return{parse:i(e),stringify:r}},e.exports.parse=i(),e.exports.stringify=r},33606:function(e,t,n){var r=null,i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,a=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(void 0!==e&&null!==e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,"undefined"!==typeof e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error('Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed '.concat(e.constructorAction));t.constructorAction=e.constructorAction}if("undefined"!==typeof e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error('Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed '.concat(e.protoAction));t.protoAction=e.protoAction}}var o,s,u,c,l={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},f=function(e){throw{name:"SyntaxError",message:e,at:o,text:u}},d=function(e){return e&&e!==s&&f("Expected '"+e+"' instead of '"+s+"'"),s=u.charAt(o),o+=1,s},p=function(){var e,i="";for("-"===s&&(i="-",d("-"));s>="0"&&s<="9";)i+=s,d();if("."===s)for(i+=".";d()&&s>="0"&&s<="9";)i+=s;if("e"===s||"E"===s)for(i+=s,d(),"-"!==s&&"+"!==s||(i+=s,d());s>="0"&&s<="9";)i+=s,d();if(e=+i,isFinite(e))return null==r&&(r=n(58704)),i.length>15?t.storeAsString?i:t.useNativeBigInt?BigInt(i):new r(i):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new r(e):e;f("Bad number")},h=function(){var e,t,n,r="";if('"'===s)for(var i=o;d();){if('"'===s)return o-1>i&&(r+=u.substring(i,o-1)),d(),r;if("\\"===s){if(o-1>i&&(r+=u.substring(i,o-1)),d(),"u"===s){for(n=0,t=0;t<4&&(e=parseInt(d(),16),isFinite(e));t+=1)n=16*n+e;r+=String.fromCharCode(n)}else{if("string"!==typeof l[s])break;r+=l[s]}i=o}}f("Bad string")},m=function(){for(;s&&s<=" ";)d()},v=function(){var e=[];if("["===s){if(d("["),m(),"]"===s)return d("]"),e;for(;s;){if(e.push(c()),m(),"]"===s)return d("]"),e;d(","),m()}}f("Bad array")},y=function(){var e,n=Object.create(null);if("{"===s){if(d("{"),m(),"}"===s)return d("}"),n;for(;s;){if(e=h(),m(),d(":"),!0===t.strict&&Object.hasOwnProperty.call(n,e)&&f('Duplicate key "'+e+'"'),!0===i.test(e)?"error"===t.protoAction?f("Object contains forbidden prototype property"):"ignore"===t.protoAction?c():n[e]=c():!0===a.test(e)?"error"===t.constructorAction?f("Object contains forbidden constructor property"):"ignore"===t.constructorAction?c():n[e]=c():n[e]=c(),m(),"}"===s)return d("}"),n;d(","),m()}}f("Bad object")};return c=function(){switch(m(),s){case"{":return y();case"[":return v();case'"':return h();case"-":return p();default:return s>="0"&&s<="9"?p():function(){switch(s){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}f("Unexpected '"+s+"'")}()}},function(e,t){var n;return u=e+"",o=0,s=" ",n=c(),m(),s&&f("Syntax error"),"function"===typeof t?function e(n,r){var i,a=n[r];return a&&"object"===typeof a&&Object.keys(a).forEach((function(t){void 0!==(i=e(a,t))?a[t]=i:delete a[t]})),t.call(n,r,a)}({"":n},""):n}}},66665:function(e,t,n){var r=n(58704),i=e.exports;!function(){"use strict";var e,t,n,a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return a.lastIndex=0,a.test(e)?'"'+e.replace(a,(function(e){var t=o[e];return"string"===typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function u(i,a){var o,c,l,f,d,p=e,h=a[i],m=null!=h&&(h instanceof r||r.isBigNumber(h));switch(h&&"object"===typeof h&&"function"===typeof h.toJSON&&(h=h.toJSON(i)),"function"===typeof n&&(h=n.call(a,i,h)),typeof h){case"string":return m?h:s(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":case"bigint":return String(h);case"object":if(!h)return"null";if(e+=t,d=[],"[object Array]"===Object.prototype.toString.apply(h)){for(f=h.length,o=0;o=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return t.call(this,e,i,a)}return i(n)}(c);function f(e,t){if("[Circular]"!==t)return t}t.EthereumProviderError=l},3902:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.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}},t.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."}}},52653:function(e,t,n){"use strict";var r=n(27424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;var i=n(77163),a=n(97376),o=n(3902);function s(e,t){var n=c(t),o=r(n,2),s=o[0],u=o[1];return new i.EthereumRpcError(e,s||a.getMessageFromCode(e),u)}function u(e,t){var n=c(t),o=r(n,2),s=o[0],u=o[1];return new i.EthereumProviderError(e,s||a.getMessageFromCode(e),u)}function c(e){if(e){if("string"===typeof e)return[e];if("object"===typeof e&&!Array.isArray(e)){var t=e.message,n=e.data;if(t&&"string"!==typeof t)throw new Error("Must specify string message.");return[t||void 0,n]}}return[]}t.ethErrors={rpc:{parse:function(e){return s(o.errorCodes.rpc.parse,e)},invalidRequest:function(e){return s(o.errorCodes.rpc.invalidRequest,e)},invalidParams:function(e){return s(o.errorCodes.rpc.invalidParams,e)},methodNotFound:function(e){return s(o.errorCodes.rpc.methodNotFound,e)},internal:function(e){return s(o.errorCodes.rpc.internal,e)},server:function(e){if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");var t=e.code;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:function(e){return s(o.errorCodes.rpc.invalidInput,e)},resourceNotFound:function(e){return s(o.errorCodes.rpc.resourceNotFound,e)},resourceUnavailable:function(e){return s(o.errorCodes.rpc.resourceUnavailable,e)},transactionRejected:function(e){return s(o.errorCodes.rpc.transactionRejected,e)},methodNotSupported:function(e){return s(o.errorCodes.rpc.methodNotSupported,e)},limitExceeded:function(e){return s(o.errorCodes.rpc.limitExceeded,e)}},provider:{userRejectedRequest:function(e){return u(o.errorCodes.provider.userRejectedRequest,e)},unauthorized:function(e){return u(o.errorCodes.provider.unauthorized,e)},unsupportedMethod:function(e){return u(o.errorCodes.provider.unsupportedMethod,e)},disconnected:function(e){return u(o.errorCodes.provider.disconnected,e)},chainDisconnected:function(e){return u(o.errorCodes.provider.chainDisconnected,e)},custom:function(e){if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");var t=e.code,n=e.message,r=e.data;if(!n||"string"!==typeof n)throw new Error('"message" must be a nonempty string');return new i.EthereumProviderError(t,n,r)}}}},57666:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;var r=n(77163);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return r.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return r.EthereumProviderError}});var i=n(97376);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return i.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}});var a=n(52653);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return a.ethErrors}});var o=n(3902);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return o.errorCodes}})},97376:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var r=n(3902),i=n(77163),a=r.errorCodes.rpc.internal,o="Unspecified error message. This is a bug, please report it.",s={code:a,message:u(a)};function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;if(Number.isInteger(e)){var i=e.toString();if(d(r.errorValues,i))return r.errorValues[i].message;if(l(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function c(e){if(!Number.isInteger(e))return!1;var t=e.toString();return!!r.errorValues[t]||!!l(e)}function l(e){return e>=-32099&&e<=-32e3}function f(e){return e&&"object"===typeof e&&!Array.isArray(e)?Object.assign({},e):e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=u,t.isValidCode=c,t.serializeError=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.fallbackError,o=void 0===a?s:a,l=r.shouldIncludeStack,p=void 0!==l&&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(e instanceof i.EthereumRpcError)return e.serialize();var h={};if(e&&"object"===typeof e&&!Array.isArray(e)&&d(e,"code")&&c(e.code)){var m=e;h.code=m.code,m.message&&"string"===typeof m.message?(h.message=m.message,d(m,"data")&&(h.data=m.data)):(h.message=u(h.code),h.data={originalError:f(e)})}else{h.code=o.code;var v=null===(t=e)||void 0===t?void 0:t.message;h.message=v&&"string"===typeof v?v:o.message,h.data={originalError:f(e)}}var y=null===(n=e)||void 0===n?void 0:n.stack;return p&&e&&y&&"string"===typeof y&&(h.stack=y),h}},39702:function(e){e.exports=function(e){var t=(e=e||{}).max||Number.MAX_SAFE_INTEGER,n="undefined"!==typeof e.start?e.start:Math.floor(Math.random()*t);return function(){return n%=t,n++}}},23523:function(e){"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,i,a,o,s,u,c,l,f){if(a&&"object"==typeof a&&!Array.isArray(a)){for(var d in r(a,o,s,u,c,l,f),a){var p=a[d];if(Array.isArray(p)){if(d in t.arrayKeywords)for(var h=0;h>>31),h=d^(o<<1|a>>>31),m=e[0]^p,v=e[1]^h,y=e[10]^p,b=e[11]^h,g=e[20]^p,w=e[21]^h,x=e[30]^p,k=e[31]^h,A=e[40]^p,E=e[41]^h;p=r^(s<<1|u>>>31),h=i^(u<<1|s>>>31);var _=e[2]^p,T=e[3]^h,S=e[12]^p,C=e[13]^h,O=e[22]^p,I=e[23]^h,P=e[32]^p,R=e[33]^h,M=e[42]^p,N=e[43]^h;p=a^(c<<1|l>>>31),h=o^(l<<1|c>>>31);var j=e[4]^p,L=e[5]^h,D=e[14]^p,B=e[15]^h,U=e[24]^p,F=e[25]^h,Z=e[34]^p,z=e[35]^h,H=e[44]^p,q=e[45]^h;p=s^(f<<1|d>>>31),h=u^(d<<1|f>>>31);var V=e[6]^p,W=e[7]^h,G=e[16]^p,Y=e[17]^h,K=e[26]^p,J=e[27]^h,Q=e[36]^p,X=e[37]^h,$=e[46]^p,ee=e[47]^h;p=c^(r<<1|i>>>31),h=l^(i<<1|r>>>31);var te=e[8]^p,ne=e[9]^h,re=e[18]^p,ie=e[19]^h,ae=e[28]^p,oe=e[29]^h,se=e[38]^p,ue=e[39]^h,ce=e[48]^p,le=e[49]^h,fe=m,de=v,pe=b<<4|y>>>28,he=y<<4|b>>>28,me=g<<3|w>>>29,ve=w<<3|g>>>29,ye=k<<9|x>>>23,be=x<<9|k>>>23,ge=A<<18|E>>>14,we=E<<18|A>>>14,xe=_<<1|T>>>31,ke=T<<1|_>>>31,Ae=C<<12|S>>>20,Ee=S<<12|C>>>20,_e=O<<10|I>>>22,Te=I<<10|O>>>22,Se=R<<13|P>>>19,Ce=P<<13|R>>>19,Oe=M<<2|N>>>30,Ie=N<<2|M>>>30,Pe=L<<30|j>>>2,Re=j<<30|L>>>2,Me=D<<6|B>>>26,Ne=B<<6|D>>>26,je=F<<11|U>>>21,Le=U<<11|F>>>21,De=Z<<15|z>>>17,Be=z<<15|Z>>>17,Ue=q<<29|H>>>3,Fe=H<<29|q>>>3,Ze=V<<28|W>>>4,ze=W<<28|V>>>4,He=Y<<23|G>>>9,qe=G<<23|Y>>>9,Ve=K<<25|J>>>7,We=J<<25|K>>>7,Ge=Q<<21|X>>>11,Ye=X<<21|Q>>>11,Ke=ee<<24|$>>>8,Je=$<<24|ee>>>8,Qe=te<<27|ne>>>5,Xe=ne<<27|te>>>5,$e=re<<20|ie>>>12,et=ie<<20|re>>>12,tt=oe<<7|ae>>>25,nt=ae<<7|oe>>>25,rt=se<<8|ue>>>24,it=ue<<8|se>>>24,at=ce<<14|le>>>18,ot=le<<14|ce>>>18;e[0]=fe^~Ae&je,e[1]=de^~Ee&Le,e[10]=Ze^~$e&me,e[11]=ze^~et&ve,e[20]=xe^~Me&Ve,e[21]=ke^~Ne&We,e[30]=Qe^~pe&_e,e[31]=Xe^~he&Te,e[40]=Pe^~He&tt,e[41]=Re^~qe&nt,e[2]=Ae^~je&Ge,e[3]=Ee^~Le&Ye,e[12]=$e^~me&Se,e[13]=et^~ve&Ce,e[22]=Me^~Ve&rt,e[23]=Ne^~We&it,e[32]=pe^~_e&De,e[33]=he^~Te&Be,e[42]=He^~tt&ye,e[43]=qe^~nt&be,e[4]=je^~Ge&at,e[5]=Le^~Ye&ot,e[14]=me^~Se&Ue,e[15]=ve^~Ce&Fe,e[24]=Ve^~rt&ge,e[25]=We^~it&we,e[34]=_e^~De&Ke,e[35]=Te^~Be&Je,e[44]=tt^~ye&Oe,e[45]=nt^~be&Ie,e[6]=Ge^~at&fe,e[7]=Ye^~ot&de,e[16]=Se^~Ue&Ze,e[17]=Ce^~Fe&ze,e[26]=rt^~ge&xe,e[27]=it^~we&ke,e[36]=De^~Ke&Qe,e[37]=Be^~Je&Xe,e[46]=ye^~Oe&Pe,e[47]=be^~Ie&Re,e[8]=at^~fe&Ae,e[9]=ot^~de&Ee,e[18]=Ue^~Ze&$e,e[19]=Fe^~ze&et,e[28]=ge^~xe&Me,e[29]=we^~ke&Ne,e[38]=Ke^~Qe&pe,e[39]=Je^~Xe&he,e[48]=Oe^~Pe&He,e[49]=Ie^~Re&qe,e[0]^=n[2*t],e[1]^=n[2*t+1]}}},17788:function(e,t,n){var r=n(63090);function i(){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}i.prototype.initialize=function(e,t){for(var n=0;n<50;++n)this.state[n]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(r.p1600(this.state),this.count=0);return t},i.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i},86771:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",i=1,a=2,o=1/0,s=9007199254740991,u="[object Arguments]",c="[object Array]",l="[object Boolean]",f="[object Date]",d="[object Error]",p="[object Function]",h="[object GeneratorFunction]",m="[object Map]",v="[object Number]",y="[object Object]",b="[object Promise]",g="[object RegExp]",w="[object Set]",x="[object String]",k="[object Symbol]",A="[object WeakMap]",E="[object ArrayBuffer]",_="[object DataView]",T=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,S=/^\w*$/,C=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,I=/\\(\\)?/g,P=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[u]=M[c]=M[E]=M[l]=M[_]=M[f]=M[d]=M[p]=M[m]=M[v]=M[y]=M[g]=M[w]=M[x]=M[A]=!1;var N="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,j="object"==typeof self&&self&&self.Object===Object&&self,L=N||j||Function("return this")(),D=t&&!t.nodeType&&t,B=D&&e&&!e.nodeType&&e,U=B&&B.exports===D&&N.process,F=function(){try{return U&&U.binding("util")}catch(e){}}(),Z=F&&F.isTypedArray;function z(e,t){for(var n=-1,r=e?e.length:0,i=Array(r);++n-1},Te.prototype.set=function(e,t){var n=this.__data__,r=Pe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Se.prototype.clear=function(){this.__data__={hash:new _e,map:new(de||Te),string:new _e}},Se.prototype.delete=function(e){return We(this,e).delete(e)},Se.prototype.get=function(e){return We(this,e).get(e)},Se.prototype.has=function(e){return We(this,e).has(e)},Se.prototype.set=function(e,t){return We(this,e).set(e,t),this},Ce.prototype.add=Ce.prototype.push=function(e){return this.__data__.set(e,r),this},Ce.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.clear=function(){this.__data__=new Te},Oe.prototype.delete=function(e){return this.__data__.delete(e)},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Te){var r=n.__data__;if(!de||r.length<199)return r.push([e,t]),this;n=this.__data__=new Se(r)}return n.set(e,t),this};var Re,Me,Ne=(Re=function(e,t){return e&&Le(e,t,ht)},function(e,t){if(null==e)return e;if(!st(e))return Re(e,t);for(var n=e.length,r=Me?n:-1,i=Object(e);(Me?r--:++r0&&n(s)?t>1?je(s,t-1,n,r,i):H(i,s):r||(i[i.length]=s)}return i}var Le=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===n(a[u],u,a))break}return t}}();function De(e,t){for(var n=0,r=(t=Qe(t,e)?[t]:qe(t)).length;null!=e&&nc))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var d=-1,p=!0,h=o&i?new Ce:void 0;for(s.set(e,t),s.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=s}function lt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ft(e){return!!e&&"object"==typeof e}function dt(e){return"symbol"==typeof e||ft(e)&&re.call(e)==k}var pt=Z?function(e){return function(t){return e(t)}}(Z):function(e){return ft(e)&&ct(e.length)&&!!M[re.call(e)]};function ht(e){return st(e)?Ie(e):ze(e)}function mt(e){return e}e.exports=function(e,t){return je(function(e,t){var n=ot(e)?z:He;return n(e,Ze(t))}(e,t),1)}},23108:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",i=1,a=2,o=9007199254740991,s="[object Arguments]",u="[object Array]",c="[object AsyncFunction]",l="[object Boolean]",f="[object Date]",d="[object Error]",p="[object Function]",h="[object GeneratorFunction]",m="[object Map]",v="[object Number]",y="[object Null]",b="[object Object]",g="[object Promise]",w="[object Proxy]",x="[object RegExp]",k="[object Set]",A="[object String]",E="[object Symbol]",_="[object Undefined]",T="[object WeakMap]",S="[object ArrayBuffer]",C="[object DataView]",O=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,P={};P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P[s]=P[u]=P[S]=P[l]=P[C]=P[f]=P[d]=P[p]=P[m]=P[v]=P[b]=P[x]=P[k]=P[A]=P[T]=!1;var R="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,M="object"==typeof self&&self&&self.Object===Object&&self,N=R||M||Function("return this")(),j=t&&!t.nodeType&&t,L=j&&e&&!e.nodeType&&e,D=L&&L.exports===j,B=D&&R.process,U=function(){try{return B&&B.binding&&B.binding("util")}catch(e){}}(),F=U&&U.isTypedArray;function Z(e,t){for(var n=-1,r=null==e?0:e.length;++nc))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var d=-1,p=!0,h=n&a?new Te:void 0;for(s.set(e,t),s.set(t,e);++d-1},Ee.prototype.set=function(e,t){var n=this.__data__,r=Oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},_e.prototype.clear=function(){this.size=0,this.__data__={hash:new Ae,map:new(fe||Ee),string:new Ae}},_e.prototype.delete=function(e){var t=De(this,e).delete(e);return this.size-=t?1:0,t},_e.prototype.get=function(e){return De(this,e).get(e)},_e.prototype.has=function(e){return De(this,e).has(e)},_e.prototype.set=function(e,t){var n=De(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Te.prototype.add=Te.prototype.push=function(e){return this.__data__.set(e,r),this},Te.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.clear=function(){this.__data__=new Ee,this.size=0},Se.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ee){var r=n.__data__;if(!fe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _e(r)}return n.set(e,t),this.size=n.size,this};var Ue=se?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Je(e){return null!=e&&"object"==typeof e}var Qe=F?function(e){return function(t){return e(t)}}(F):function(e){return Je(e)&&Ye(e.length)&&!!P[Ie(e)]};function Xe(e){return null!=(t=e)&&Ye(t.length)&&!Ge(t)?Ce(e):Ne(e);var t}e.exports=function(e,t){return Re(e,t)}},81725:function(e,t,n){var r=n(70781)(n(24393),"DataView");e.exports=r},69748:function(e,t,n){var r=n(56545),i=n(69843),a=n(86266),o=n(17364),s=n(74156);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tl))return!1;var d=u.get(e),p=u.get(t);if(d&&p)return d==t&&p==e;var h=-1,m=!0,v=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++h-1&&e%1==0&&e-1}},73316:function(e,t,n){var r=n(69194);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},79e3:function(e,t,n){var r=n(69748),i=n(95745),a=n(18579);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||i),string:new r}}},37240:function(e,t,n){var r=n(16911);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},63414:function(e,t,n){var r=n(16911);e.exports=function(e){return r(this,e).get(e)}},17140:function(e,t,n){var r=n(16911);e.exports=function(e){return r(this,e).has(e)}},85429:function(e,t,n){var r=n(16911);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},258:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},22093:function(e){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},83679:function(e,t,n){var r=n(92736);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},11353:function(e,t,n){var r=n(70781)(Object,"create");e.exports=r},8723:function(e,t,n){var r=n(9698)(Object.keys,Object);e.exports=r},3481:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},47785:function(e,t,n){e=n.nmd(e);var r=n(32692),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&r.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(t){}}();e.exports=s},78186:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9698:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},25313:function(e,t,n){var r=n(81686),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},23653:function(e,t,n){var r=n(95745);e.exports=function(){this.__data__=new r,this.size=0}},43359:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},92571:function(e){e.exports=function(e){return this.__data__.get(e)}},31698:function(e){e.exports=function(e){return this.__data__.has(e)}},85883:function(e,t,n){var r=n(95745),i=n(18579),a=n(13109);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var o=n.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(o)}return n.set(e,t),this.size=n.size,this}},3002:function(e,t,n){var r=n(83679),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(a,"$1"):n||e)})),t}));e.exports=o},60925:function(e,t,n){var r=n(72060);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},92043:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},54161:function(e,t,n){var r=n(46476);e.exports=function(e){return r(e,4)}},83194:function(e){e.exports=function(e){return function(){return e}}},60979:function(e,t,n){var r=n(33088),i=n(83666),a=n(73271),o=n(67086),s=Object.prototype,u=s.hasOwnProperty,c=r((function(e,t){e=Object(e);var n=-1,r=t.length,c=r>2?t[2]:void 0;for(c&&a(t[0],t[1],c)&&(r=1);++n-1&&e%1==0&&e<=9007199254740991}},15874:function(e,t,n){var r=n(37094),i=n(36902),a=n(47785),o=a&&a.isMap,s=o?i(o):r;e.exports=s},91845:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},89752:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},41859:function(e,t,n){var r=n(18711),i=n(36902),a=n(47785),o=a&&a.isSet,s=o?i(o):r;e.exports=s},72060:function(e,t,n){var r=n(18665),i=n(89752);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},53153:function(e,t,n){var r=n(77499),i=n(36902),a=n(47785),o=a&&a.isTypedArray,s=o?i(o):r;e.exports=s},56385:function(e,t,n){var r=n(83200),i=n(23409),a=n(2114);e.exports=function(e){return a(e)?r(e):i(e)}},67086:function(e,t,n){var r=n(83200),i=n(89130),a=n(2114);e.exports=function(e){return a(e)?r(e,!0):i(e)}},16031:function(e,t,n){var r;e=n.nmd(e),function(){var i,a="Expected a function",o="__lodash_hash_undefined__",s="__lodash_placeholder__",u=16,c=32,l=64,f=128,d=256,p=1/0,h=9007199254740991,m=NaN,v=4294967295,y=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",c],["partialRight",l],["rearg",d]],b="[object Arguments]",g="[object Array]",w="[object Boolean]",x="[object Date]",k="[object Error]",A="[object Function]",E="[object GeneratorFunction]",_="[object Map]",T="[object Number]",S="[object Object]",C="[object Promise]",O="[object RegExp]",I="[object Set]",P="[object String]",R="[object Symbol]",M="[object WeakMap]",N="[object ArrayBuffer]",j="[object DataView]",L="[object Float32Array]",D="[object Float64Array]",B="[object Int8Array]",U="[object Int16Array]",F="[object Int32Array]",Z="[object Uint8Array]",z="[object Uint8ClampedArray]",H="[object Uint16Array]",q="[object Uint32Array]",V=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Y=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,J=RegExp(Y.source),Q=RegExp(K.source),X=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,ae=RegExp(ie.source),oe=/^\s+/,se=/\s/,ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ve=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,be=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,Ae=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",_e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Te="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Oe="\\ufe0e\\ufe0f",Ie="\\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",Pe="['\u2019]",Re="["+Ee+"]",Me="["+Ie+"]",Ne="["+_e+"]",je="\\d+",Le="["+Te+"]",De="["+Se+"]",Be="[^"+Ee+Ie+je+Te+Se+Ce+"]",Ue="\\ud83c[\\udffb-\\udfff]",Fe="[^"+Ee+"]",Ze="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+Ce+"]",qe="\\u200d",Ve="(?:"+De+"|"+Be+")",We="(?:"+He+"|"+Be+")",Ge="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ye="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ke="(?:"+Ne+"|"+Ue+")"+"?",Je="["+Oe+"]?",Qe=Je+Ke+("(?:"+qe+"(?:"+[Fe,Ze,ze].join("|")+")"+Je+Ke+")*"),Xe="(?:"+[Le,Ze,ze].join("|")+")"+Qe,$e="(?:"+[Fe+Ne+"?",Ne,Ze,ze,Re].join("|")+")",et=RegExp(Pe,"g"),tt=RegExp(Ne,"g"),nt=RegExp(Ue+"(?="+Ue+")|"+$e+Qe,"g"),rt=RegExp([He+"?"+De+"+"+Ge+"(?="+[Me,He,"$"].join("|")+")",We+"+"+Ye+"(?="+[Me,He+Ve,"$"].join("|")+")",He+"?"+Ve+"+"+Ge,He+"+"+Ye,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",je,Xe].join("|"),"g"),it=RegExp("["+qe+Ee+_e+Oe+"]"),at=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["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"],st=-1,ut={};ut[L]=ut[D]=ut[B]=ut[U]=ut[F]=ut[Z]=ut[z]=ut[H]=ut[q]=!0,ut[b]=ut[g]=ut[N]=ut[w]=ut[j]=ut[x]=ut[k]=ut[A]=ut[_]=ut[T]=ut[S]=ut[O]=ut[I]=ut[P]=ut[M]=!1;var ct={};ct[b]=ct[g]=ct[N]=ct[j]=ct[w]=ct[x]=ct[L]=ct[D]=ct[B]=ct[U]=ct[F]=ct[_]=ct[T]=ct[S]=ct[O]=ct[I]=ct[P]=ct[R]=ct[Z]=ct[z]=ct[H]=ct[q]=!0,ct[k]=ct[A]=ct[M]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,pt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ht="object"==typeof self&&self&&self.Object===Object&&self,mt=pt||ht||Function("return this")(),vt=t&&!t.nodeType&&t,yt=vt&&e&&!e.nodeType&&e,bt=yt&&yt.exports===vt,gt=bt&&pt.process,wt=function(){try{var e=yt&&yt.require&&yt.require("util").types;return e||gt&>.binding&>.binding("util")}catch(t){}}(),xt=wt&&wt.isArrayBuffer,kt=wt&&wt.isDate,At=wt&&wt.isMap,Et=wt&&wt.isRegExp,_t=wt&&wt.isSet,Tt=wt&&wt.isTypedArray;function St(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ct(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i-1}function Nt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function rn(e,t){for(var n=e.length;n--&&Ht(t,e[n],0)>-1;);return n}var an=Yt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"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"}),on=Yt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+lt[e]}function un(e){return it.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function ln(e,t){return function(n){return e(t(n))}}function fn(e,t){for(var n=-1,r=e.length,i=0,a=[];++n",""":'"',"'":"'"});var bn=function e(t){var n=(t=null==t?mt:bn.defaults(mt.Object(),t,bn.pick(mt,ot))).Array,r=t.Date,se=t.Error,Ee=t.Function,_e=t.Math,Te=t.Object,Se=t.RegExp,Ce=t.String,Oe=t.TypeError,Ie=n.prototype,Pe=Ee.prototype,Re=Te.prototype,Me=t["__core-js_shared__"],Ne=Pe.toString,je=Re.hasOwnProperty,Le=0,De=function(){var e=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Be=Re.toString,Ue=Ne.call(Te),Fe=mt._,Ze=Se("^"+Ne.call(je).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ze=bt?t.Buffer:i,He=t.Symbol,qe=t.Uint8Array,Ve=ze?ze.allocUnsafe:i,We=ln(Te.getPrototypeOf,Te),Ge=Te.create,Ye=Re.propertyIsEnumerable,Ke=Ie.splice,Je=He?He.isConcatSpreadable:i,Qe=He?He.iterator:i,Xe=He?He.toStringTag:i,$e=function(){try{var e=fa(Te,"defineProperty");return e({},"",{}),e}catch(t){}}(),nt=t.clearTimeout!==mt.clearTimeout&&t.clearTimeout,it=r&&r.now!==mt.Date.now&&r.now,lt=t.setTimeout!==mt.setTimeout&&t.setTimeout,pt=_e.ceil,ht=_e.floor,vt=Te.getOwnPropertySymbols,yt=ze?ze.isBuffer:i,gt=t.isFinite,wt=Ie.join,Ft=ln(Te.keys,Te),Yt=_e.max,gn=_e.min,wn=r.now,xn=t.parseInt,kn=_e.random,An=Ie.reverse,En=fa(t,"DataView"),_n=fa(t,"Map"),Tn=fa(t,"Promise"),Sn=fa(t,"Set"),Cn=fa(t,"WeakMap"),On=fa(Te,"create"),In=Cn&&new Cn,Pn={},Rn=Da(En),Mn=Da(_n),Nn=Da(Tn),jn=Da(Sn),Ln=Da(Cn),Dn=He?He.prototype:i,Bn=Dn?Dn.valueOf:i,Un=Dn?Dn.toString:i;function Fn(e){if(ts(e)&&!qo(e)&&!(e instanceof qn)){if(e instanceof Hn)return e;if(je.call(e,"__wrapped__"))return Ba(e)}return new Hn(e)}var Zn=function(){function e(){}return function(t){if(!es(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function zn(){}function Hn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function qn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ur(e,t,n,r,a,o){var s,u=1&t,c=2&t,l=4&t;if(n&&(s=a?n(e,r,a,o):n(e)),s!==i)return s;if(!es(e))return e;var f=qo(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&je.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!u)return Oi(e,s)}else{var d=ha(e),p=d==A||d==E;if(Yo(e))return Ai(e,u);if(d==S||d==b||p&&!a){if(s=c||p?{}:va(e),!u)return c?function(e,t){return Ii(e,pa(e),t)}(e,function(e,t){return e&&Ii(t,Rs(t),e)}(s,e)):function(e,t){return Ii(e,da(e),t)}(e,ir(s,e))}else{if(!ct[d])return a?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case N:return Ei(e);case w:case x:return new r(+e);case j:return function(e,t){var n=t?Ei(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case D:case B:case U:case F:case Z:case z:case H:case q:return _i(e,n);case _:return new r;case T:case P:return new r(e);case O:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new r;case R:return i=e,Bn?Te(Bn.call(i)):{}}var i}(e,d,u)}}o||(o=new Kn);var h=o.get(e);if(h)return h;o.set(e,s),os(e)?e.forEach((function(r){s.add(ur(r,t,n,r,e,o))})):ns(e)&&e.forEach((function(r,i){s.set(i,ur(r,t,n,i,e,o))}));var m=f?i:(l?c?ia:ra:c?Rs:Ps)(e);return Ot(m||e,(function(r,i){m&&(r=e[i=r]),tr(s,i,ur(r,t,n,i,e,o))})),s}function cr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Te(e);r--;){var a=n[r],o=t[a],s=e[a];if(s===i&&!(a in e)||!o(s))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new Oe(a);return Ia((function(){e.apply(i,n)}),t)}function fr(e,t,n,r){var i=-1,a=Mt,o=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=jt(t,$t(n))),r?(a=Nt,o=!1):t.length>=200&&(a=tn,o=!1,t=new Yn(t));e:for(;++i-1},Wn.prototype.set=function(e,t){var n=this.__data__,r=nr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(_n||Wn),string:new Vn}},Gn.prototype.delete=function(e){var t=ca(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return ca(this,e).get(e)},Gn.prototype.has=function(e){return ca(this,e).has(e)},Gn.prototype.set=function(e,t){var n=ca(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,o),this},Yn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!_n||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var dr=Mi(wr),pr=Mi(xr,!0);function hr(e,t){var n=!0;return dr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function mr(e,t,n){for(var r=-1,a=e.length;++r0&&n(s)?t>1?yr(s,t-1,n,r,i):Lt(i,s):r||(i[i.length]=s)}return i}var br=Ni(),gr=Ni(!0);function wr(e,t){return e&&br(e,t,Ps)}function xr(e,t){return e&&gr(e,t,Ps)}function kr(e,t){return Rt(t,(function(t){return Qo(e[t])}))}function Ar(e,t){for(var n=0,r=(t=gi(t,e)).length;null!=e&&nt}function Sr(e,t){return null!=e&&je.call(e,t)}function Cr(e,t){return null!=e&&t in Te(e)}function Or(e,t,r){for(var a=r?Nt:Mt,o=e[0].length,s=e.length,u=s,c=n(s),l=1/0,f=[];u--;){var d=e[u];u&&t&&(d=jt(d,$t(t))),l=gn(d.length,l),c[u]=!r&&(t||o>=120&&d.length>=120)?new Yn(u&&d):i}d=e[0];var p=-1,h=c[0];e:for(;++p=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Vr(e,t,n){for(var r=-1,i=t.length,a={};++r-1;)s!==e&&Ke.call(s,u,1),Ke.call(e,u,1);return e}function Gr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ba(i)?Ke.call(e,i,1):fi(e,i)}}return e}function Yr(e,t){return e+ht(kn()*(t-e+1))}function Kr(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=ht(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Pa(Ta(e,t,ru),e+"")}function Qr(e){return Qn(Fs(e))}function Xr(e,t){var n=Fs(e);return Na(n,sr(t,0,n.length))}function $r(e,t,n,r){if(!es(e))return e;for(var a=-1,o=(t=gi(t,e)).length,s=o-1,u=e;null!=u&&++aa?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var o=n(a);++i>>1,o=e[a];null!==o&&!us(o)&&(n?o<=t:o=200){var c=t?null:Ki(e);if(c)return dn(c);o=!1,i=tn,u=new Yn}else u=t?[]:s;e:for(;++r=r?e:ri(e,t,n)}var ki=nt||function(e){return mt.clearTimeout(e)};function Ai(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function Ei(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function _i(e,t){var n=t?Ei(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ti(e,t){if(e!==t){var n=e!==i,r=null===e,a=e===e,o=us(e),s=t!==i,u=null===t,c=t===t,l=us(t);if(!u&&!l&&!o&&e>t||o&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!a)return 1;if(!r&&!o&&!l&&e1?n[a-1]:i,s=a>2?n[2]:i;for(o=e.length>3&&"function"==typeof o?(a--,o):i,s&&ga(n[0],n[1],s)&&(o=a<3?i:o,a=1),t=Te(t);++r-1?a[o?t[s]:s]:i}}function Ui(e){return na((function(t){var n=t.length,r=n,o=Hn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Oe(a);if(o&&!u&&"wrapper"==oa(s))var u=new Hn([],!0)}for(r=u?r:n;++r1&&w.reverse(),p&&lu))return!1;var l=o.get(e),f=o.get(t);if(l&&f)return l==t&&f==e;var d=-1,p=!0,h=2&n?new Yn:i;for(o.set(e,t),o.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ue,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ot(y,(function(n){var r="_."+n[0];t&n[1]&&!Mt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(le):[]}(r),n)))}function Ma(e){var t=0,n=0;return function(){var r=wn(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Na(e,t){var n=-1,r=e.length,a=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,io(e,n)}));function fo(e){var t=Fn(e);return t.__chain__=!0,t}function po(e,t){return t(e)}var ho=na((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,a=function(t){return or(t,e)};return!(t>1||this.__actions__.length)&&r instanceof qn&&ba(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:po,args:[a],thisArg:i}),new Hn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(a)}));var mo=Pi((function(e,t,n){je.call(e,n)?++e[n]:ar(e,n,1)}));var vo=Bi(za),yo=Bi(Ha);function bo(e,t){return(qo(e)?Ot:dr)(e,ua(t,3))}function go(e,t){return(qo(e)?It:pr)(e,ua(t,3))}var wo=Pi((function(e,t,n){je.call(e,n)?e[n].push(t):ar(e,n,[t])}));var xo=Jr((function(e,t,r){var i=-1,a="function"==typeof t,o=Wo(e)?n(e.length):[];return dr(e,(function(e){o[++i]=a?St(t,e,r):Ir(e,t,r)})),o})),ko=Pi((function(e,t,n){ar(e,n,t)}));function Ao(e,t){return(qo(e)?jt:Ur)(e,ua(t,3))}var Eo=Pi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var _o=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ga(e,t[0],t[1])?t=[]:n>2&&ga(t[0],t[1],t[2])&&(t=[t[0]]),qr(e,yr(t,1),[])})),To=it||function(){return mt.Date.now()};function So(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Qi(e,f,i,i,i,i,t)}function Co(e,t){var n;if("function"!=typeof t)throw new Oe(a);return e=hs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Oo=Jr((function(e,t,n){var r=1;if(n.length){var i=fn(n,sa(Oo));r|=c}return Qi(e,r,t,n,i)})),Io=Jr((function(e,t,n){var r=3;if(n.length){var i=fn(n,sa(Io));r|=c}return Qi(t,r,e,n,i)}));function Po(e,t,n){var r,o,s,u,c,l,f=0,d=!1,p=!1,h=!0;if("function"!=typeof e)throw new Oe(a);function m(t){var n=r,a=o;return r=o=i,f=t,u=e.apply(a,n)}function v(e){var n=e-l;return l===i||n>=t||n<0||p&&e-f>=s}function y(){var e=To();if(v(e))return b(e);c=Ia(y,function(e){var n=t-(e-l);return p?gn(n,s-(e-f)):n}(e))}function b(e){return c=i,h&&r?m(e):(r=o=i,u)}function g(){var e=To(),n=v(e);if(r=arguments,o=this,l=e,n){if(c===i)return function(e){return f=e,c=Ia(y,t),d?m(e):u}(l);if(p)return ki(c),c=Ia(y,t),m(l)}return c===i&&(c=Ia(y,t)),u}return t=vs(t)||0,es(n)&&(d=!!n.leading,s=(p="maxWait"in n)?Yt(vs(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),g.cancel=function(){c!==i&&ki(c),f=0,r=l=o=c=i},g.flush=function(){return c===i?u:b(To())},g}var Ro=Jr((function(e,t){return lr(e,1,t)})),Mo=Jr((function(e,t,n){return lr(e,vs(t)||0,n)}));function No(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Oe(a);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(No.Cache||Gn),n}function jo(e){if("function"!=typeof e)throw new Oe(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}No.Cache=Gn;var Lo=wi((function(e,t){var n=(t=1==t.length&&qo(t[0])?jt(t[0],$t(ua())):jt(yr(t,1),$t(ua()))).length;return Jr((function(r){for(var i=-1,a=gn(r.length,n);++i=t})),Ho=Pr(function(){return arguments}())?Pr:function(e){return ts(e)&&je.call(e,"callee")&&!Ye.call(e,"callee")},qo=n.isArray,Vo=xt?$t(xt):function(e){return ts(e)&&_r(e)==N};function Wo(e){return null!=e&&$o(e.length)&&!Qo(e)}function Go(e){return ts(e)&&Wo(e)}var Yo=yt||vu,Ko=kt?$t(kt):function(e){return ts(e)&&_r(e)==x};function Jo(e){if(!ts(e))return!1;var t=_r(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!is(e)}function Qo(e){if(!es(e))return!1;var t=_r(e);return t==A||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xo(e){return"number"==typeof e&&e==hs(e)}function $o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function es(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ts(e){return null!=e&&"object"==typeof e}var ns=At?$t(At):function(e){return ts(e)&&ha(e)==_};function rs(e){return"number"==typeof e||ts(e)&&_r(e)==T}function is(e){if(!ts(e)||_r(e)!=S)return!1;var t=We(e);if(null===t)return!0;var n=je.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Ue}var as=Et?$t(Et):function(e){return ts(e)&&_r(e)==O};var os=_t?$t(_t):function(e){return ts(e)&&ha(e)==I};function ss(e){return"string"==typeof e||!qo(e)&&ts(e)&&_r(e)==P}function us(e){return"symbol"==typeof e||ts(e)&&_r(e)==R}var cs=Tt?$t(Tt):function(e){return ts(e)&&$o(e.length)&&!!ut[_r(e)]};var ls=Wi(Br),fs=Wi((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Wo(e))return ss(e)?mn(e):Oi(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=ha(e);return(t==_?cn:t==I?dn:Fs)(e)}function ps(e){return e?(e=vs(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function hs(e){var t=ps(e),n=t%1;return t===t?n?t-n:t:0}function ms(e){return e?sr(hs(e),0,v):0}function vs(e){if("number"==typeof e)return e;if(us(e))return m;if(es(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=es(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=ye.test(e);return n||ge.test(e)?dt(e.slice(2),n?2:8):ve.test(e)?m:+e}function ys(e){return Ii(e,Rs(e))}function bs(e){return null==e?"":ci(e)}var gs=Ri((function(e,t){if(Aa(t)||Wo(t))Ii(t,Ps(t),e);else for(var n in t)je.call(t,n)&&tr(e,n,t[n])})),ws=Ri((function(e,t){Ii(t,Rs(t),e)})),xs=Ri((function(e,t,n,r){Ii(t,Rs(t),e,r)})),ks=Ri((function(e,t,n,r){Ii(t,Ps(t),e,r)})),As=na(or);var Es=Jr((function(e,t){e=Te(e);var n=-1,r=t.length,a=r>2?t[2]:i;for(a&&ga(t[0],t[1],a)&&(r=1);++n1),t})),Ii(e,ia(e),n),r&&(n=ur(n,7,ea));for(var i=t.length;i--;)fi(n,t[i]);return n}));var Ls=na((function(e,t){return null==e?{}:function(e,t){return Vr(e,t,(function(t,n){return Ss(e,n)}))}(e,t)}));function Ds(e,t){if(null==e)return{};var n=jt(ia(e),(function(e){return[e]}));return t=ua(t),Vr(e,n,(function(e,n){return t(e,n[0])}))}var Bs=Ji(Ps),Us=Ji(Rs);function Fs(e){return null==e?[]:en(e,Ps(e))}var Zs=Li((function(e,t,n){return t=t.toLowerCase(),e+(n?zs(t):t)}));function zs(e){return Js(bs(e).toLowerCase())}function Hs(e){return(e=bs(e))&&e.replace(xe,an).replace(tt,"")}var qs=Li((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Vs=Li((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ws=ji("toLowerCase");var Gs=Li((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ys=Li((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Ks=Li((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=ji("toUpperCase");function Qs(e,t,n){return e=bs(e),(t=n?i:t)===i?function(e){return at.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(fe)||[]}(e):e.match(t)||[]}var Xs=Jr((function(e,t){try{return St(e,i,t)}catch(n){return Jo(n)?n:new se(n)}})),$s=na((function(e,t){return Ot(t,(function(t){t=La(t),ar(e,t,Oo(e[t],e))})),e}));function eu(e){return function(){return e}}var tu=Ui(),nu=Ui(!0);function ru(e){return e}function iu(e){return jr("function"==typeof e?e:ur(e,1))}var au=Jr((function(e,t){return function(n){return Ir(n,e,t)}})),ou=Jr((function(e,t){return function(n){return Ir(e,n,t)}}));function su(e,t,n){var r=Ps(t),i=kr(t,r);null!=n||es(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=kr(t,Ps(t)));var a=!(es(n)&&"chain"in n)||!!n.chain,o=Qo(e);return Ot(i,(function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=Oi(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Lt([this.value()],arguments))})})),e}function uu(){}var cu=Hi(jt),lu=Hi(Pt),fu=Hi(Ut);function du(e){return wa(e)?Gt(La(e)):function(e){return function(t){return Ar(t,e)}}(e)}var pu=Vi(),hu=Vi(!0);function mu(){return[]}function vu(){return!1}var yu=zi((function(e,t){return e+t}),0),bu=Yi("ceil"),gu=zi((function(e,t){return e/t}),1),wu=Yi("floor");var xu=zi((function(e,t){return e*t}),1),ku=Yi("round"),Au=zi((function(e,t){return e-t}),0);return Fn.after=function(e,t){if("function"!=typeof t)throw new Oe(a);return e=hs(e),function(){if(--e<1)return t.apply(this,arguments)}},Fn.ary=So,Fn.assign=gs,Fn.assignIn=ws,Fn.assignInWith=xs,Fn.assignWith=ks,Fn.at=As,Fn.before=Co,Fn.bind=Oo,Fn.bindAll=$s,Fn.bindKey=Io,Fn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qo(e)?e:[e]},Fn.chain=fo,Fn.chunk=function(e,t,r){t=(r?ga(e,t,r):t===i)?1:Yt(hs(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var o=0,s=0,u=n(pt(a/t));oa?0:a+n),(r=r===i||r>a?a:hs(r))<0&&(r+=a),r=n>r?0:ms(r);n>>0)?(e=bs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=ci(t))&&un(e)?xi(mn(e),0,n):e.split(t,n):[]},Fn.spread=function(e,t){if("function"!=typeof e)throw new Oe(a);return t=null==t?0:Yt(hs(t),0),Jr((function(n){var r=n[t],i=xi(n,0,t);return r&&Lt(i,r),St(e,this,i)}))},Fn.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Fn.take=function(e,t,n){return e&&e.length?ri(e,0,(t=n||t===i?1:hs(t))<0?0:t):[]},Fn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ri(e,(t=r-(t=n||t===i?1:hs(t)))<0?0:t,r):[]},Fn.takeRightWhile=function(e,t){return e&&e.length?pi(e,ua(t,3),!1,!0):[]},Fn.takeWhile=function(e,t){return e&&e.length?pi(e,ua(t,3)):[]},Fn.tap=function(e,t){return t(e),e},Fn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Oe(a);return es(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Po(e,t,{leading:r,maxWait:t,trailing:i})},Fn.thru=po,Fn.toArray=ds,Fn.toPairs=Bs,Fn.toPairsIn=Us,Fn.toPath=function(e){return qo(e)?jt(e,La):us(e)?[e]:Oi(ja(bs(e)))},Fn.toPlainObject=ys,Fn.transform=function(e,t,n){var r=qo(e),i=r||Yo(e)||cs(e);if(t=ua(t,4),null==n){var a=e&&e.constructor;n=i?r?new a:[]:es(e)&&Qo(a)?Zn(We(e)):{}}return(i?Ot:wr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Fn.unary=function(e){return So(e,1)},Fn.union=eo,Fn.unionBy=to,Fn.unionWith=no,Fn.uniq=function(e){return e&&e.length?li(e):[]},Fn.uniqBy=function(e,t){return e&&e.length?li(e,ua(t,2)):[]},Fn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?li(e,i,t):[]},Fn.unset=function(e,t){return null==e||fi(e,t)},Fn.unzip=ro,Fn.unzipWith=io,Fn.update=function(e,t,n){return null==e?e:di(e,t,bi(n))},Fn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:di(e,t,bi(n),r)},Fn.values=Fs,Fn.valuesIn=function(e){return null==e?[]:en(e,Rs(e))},Fn.without=ao,Fn.words=Qs,Fn.wrap=function(e,t){return Do(bi(t),e)},Fn.xor=oo,Fn.xorBy=so,Fn.xorWith=uo,Fn.zip=co,Fn.zipObject=function(e,t){return vi(e||[],t||[],tr)},Fn.zipObjectDeep=function(e,t){return vi(e||[],t||[],$r)},Fn.zipWith=lo,Fn.entries=Bs,Fn.entriesIn=Us,Fn.extend=ws,Fn.extendWith=xs,su(Fn,Fn),Fn.add=yu,Fn.attempt=Xs,Fn.camelCase=Zs,Fn.capitalize=zs,Fn.ceil=bu,Fn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=vs(n))===n?n:0),t!==i&&(t=(t=vs(t))===t?t:0),sr(vs(e),t,n)},Fn.clone=function(e){return ur(e,4)},Fn.cloneDeep=function(e){return ur(e,5)},Fn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:i)},Fn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:i)},Fn.conformsTo=function(e,t){return null==t||cr(e,t,Ps(t))},Fn.deburr=Hs,Fn.defaultTo=function(e,t){return null==e||e!==e?t:e},Fn.divide=gu,Fn.endsWith=function(e,t,n){e=bs(e),t=ci(t);var r=e.length,a=n=n===i?r:sr(hs(n),0,r);return(n-=t.length)>=0&&e.slice(n,a)==t},Fn.eq=Fo,Fn.escape=function(e){return(e=bs(e))&&Q.test(e)?e.replace(K,on):e},Fn.escapeRegExp=function(e){return(e=bs(e))&&ae.test(e)?e.replace(ie,"\\$&"):e},Fn.every=function(e,t,n){var r=qo(e)?Pt:hr;return n&&ga(e,t,n)&&(t=i),r(e,ua(t,3))},Fn.find=vo,Fn.findIndex=za,Fn.findKey=function(e,t){return Zt(e,ua(t,3),wr)},Fn.findLast=yo,Fn.findLastIndex=Ha,Fn.findLastKey=function(e,t){return Zt(e,ua(t,3),xr)},Fn.floor=wu,Fn.forEach=bo,Fn.forEachRight=go,Fn.forIn=function(e,t){return null==e?e:br(e,ua(t,3),Rs)},Fn.forInRight=function(e,t){return null==e?e:gr(e,ua(t,3),Rs)},Fn.forOwn=function(e,t){return e&&wr(e,ua(t,3))},Fn.forOwnRight=function(e,t){return e&&xr(e,ua(t,3))},Fn.get=Ts,Fn.gt=Zo,Fn.gte=zo,Fn.has=function(e,t){return null!=e&&ma(e,t,Sr)},Fn.hasIn=Ss,Fn.head=Va,Fn.identity=ru,Fn.includes=function(e,t,n,r){e=Wo(e)?e:Fs(e),n=n&&!r?hs(n):0;var i=e.length;return n<0&&(n=Yt(i+n,0)),ss(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ht(e,t,n)>-1},Fn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:hs(n);return i<0&&(i=Yt(r+i,0)),Ht(e,t,i)},Fn.inRange=function(e,t,n){return t=ps(t),n===i?(n=t,t=0):n=ps(n),function(e,t,n){return e>=gn(t,n)&&e=-9007199254740991&&e<=h},Fn.isSet=os,Fn.isString=ss,Fn.isSymbol=us,Fn.isTypedArray=cs,Fn.isUndefined=function(e){return e===i},Fn.isWeakMap=function(e){return ts(e)&&ha(e)==M},Fn.isWeakSet=function(e){return ts(e)&&"[object WeakSet]"==_r(e)},Fn.join=function(e,t){return null==e?"":wt.call(e,t)},Fn.kebabCase=qs,Fn.last=Ka,Fn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var a=r;return n!==i&&(a=(a=hs(n))<0?Yt(r+a,0):gn(a,r-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,a):zt(e,Vt,a,!0)},Fn.lowerCase=Vs,Fn.lowerFirst=Ws,Fn.lt=ls,Fn.lte=fs,Fn.max=function(e){return e&&e.length?mr(e,ru,Tr):i},Fn.maxBy=function(e,t){return e&&e.length?mr(e,ua(t,2),Tr):i},Fn.mean=function(e){return Wt(e,ru)},Fn.meanBy=function(e,t){return Wt(e,ua(t,2))},Fn.min=function(e){return e&&e.length?mr(e,ru,Br):i},Fn.minBy=function(e,t){return e&&e.length?mr(e,ua(t,2),Br):i},Fn.stubArray=mu,Fn.stubFalse=vu,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=xu,Fn.nth=function(e,t){return e&&e.length?Hr(e,hs(t)):i},Fn.noConflict=function(){return mt._===this&&(mt._=Fe),this},Fn.noop=uu,Fn.now=To,Fn.pad=function(e,t,n){e=bs(e);var r=(t=hs(t))?hn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return qi(ht(i),n)+e+qi(pt(i),n)},Fn.padEnd=function(e,t,n){e=bs(e);var r=(t=hs(t))?hn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var a=kn();return gn(e+a*(t-e+ft("1e-"+((a+"").length-1))),t)}return Yr(e,t)},Fn.reduce=function(e,t,n){var r=qo(e)?Dt:Kt,i=arguments.length<3;return r(e,ua(t,4),n,i,dr)},Fn.reduceRight=function(e,t,n){var r=qo(e)?Bt:Kt,i=arguments.length<3;return r(e,ua(t,4),n,i,pr)},Fn.repeat=function(e,t,n){return t=(n?ga(e,t,n):t===i)?1:hs(t),Kr(bs(e),t)},Fn.replace=function(){var e=arguments,t=bs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Fn.result=function(e,t,n){var r=-1,a=(t=gi(t,e)).length;for(a||(a=1,e=i);++rh)return[];var n=v,r=gn(e,v);t=ua(t),e-=v;for(var i=Qt(r,t);++n=o)return e;var u=n-hn(r);if(u<1)return r;var c=s?xi(s,0,u).join(""):e.slice(0,u);if(a===i)return c+r;if(s&&(u+=c.length-u),as(a)){if(e.slice(u).search(a)){var l,f=c;for(a.global||(a=Se(a.source,bs(me.exec(a))+"g")),a.lastIndex=0;l=a.exec(f);)var d=l.index;c=c.slice(0,d===i?u:d)}}else if(e.indexOf(ci(a),u)!=u){var p=c.lastIndexOf(a);p>-1&&(c=c.slice(0,p))}return c+r},Fn.unescape=function(e){return(e=bs(e))&&J.test(e)?e.replace(Y,yn):e},Fn.uniqueId=function(e){var t=++Le;return bs(e)+t},Fn.upperCase=Ks,Fn.upperFirst=Js,Fn.each=bo,Fn.eachRight=go,Fn.first=Va,su(Fn,function(){var e={};return wr(Fn,(function(t,n){je.call(Fn.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Fn.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Fn[e].placeholder=Fn})),Ot(["drop","take"],(function(e,t){qn.prototype[e]=function(n){n=n===i?1:Yt(hs(n),0);var r=this.__filtered__&&!t?new qn(this):this.clone();return r.__filtered__?r.__takeCount__=gn(n,r.__takeCount__):r.__views__.push({size:gn(n,v),type:e+(r.__dir__<0?"Right":"")}),r},qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;qn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ua(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ot(["head","last"],(function(e,t){var n="take"+(t?"Right":"");qn.prototype[e]=function(){return this[n](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");qn.prototype[e]=function(){return this.__filtered__?new qn(this):this[n](1)}})),qn.prototype.compact=function(){return this.filter(ru)},qn.prototype.find=function(e){return this.filter(e).head()},qn.prototype.findLast=function(e){return this.reverse().find(e)},qn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new qn(this):this.map((function(n){return Ir(n,e,t)}))})),qn.prototype.reject=function(e){return this.filter(jo(ua(e)))},qn.prototype.slice=function(e,t){e=hs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=hs(t))<0?n.dropRight(-t):n.take(t-e)),n)},qn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qn.prototype.toArray=function(){return this.take(v)},wr(qn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),a=Fn[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);a&&(Fn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,u=t instanceof qn,c=s[0],l=u||qo(t),f=function(e){var t=a.apply(Fn,Lt([e],s));return r&&d?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var d=this.__chain__,p=!!this.__actions__.length,h=o&&!d,m=u&&!p;if(!o&&l){t=m?t:new qn(this);var v=e.apply(t,s);return v.__actions__.push({func:po,args:[f],thisArg:i}),new Hn(v,d)}return h&&m?e.apply(this,s):(v=this.thru(f),h?r?v.value()[0]:v.value():v)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ie[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Fn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(qo(i)?i:[],e)}return this[n]((function(n){return t.apply(qo(n)?n:[],e)}))}})),wr(qn.prototype,(function(e,t){var n=Fn[t];if(n){var r=n.name+"";je.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}})),Pn[Fi(i,2).name]=[{name:"wrapper",func:i}],qn.prototype.clone=function(){var e=new qn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},qn.prototype.reverse=function(){if(this.__filtered__){var e=new qn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qo(e),r=t<0,i=n?e.length:0,a=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Fn.prototype.plant=function(e){for(var t,n=this;n instanceof zn;){var r=Ba(n);r.__index__=0,r.__values__=i,t?a.__wrapped__=r:t=r;var a=r;n=n.__wrapped__}return a.__wrapped__=e,t},Fn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof qn){var t=e;return this.__actions__.length&&(t=new qn(this)),(t=t.reverse()).__actions__.push({func:po,args:[$a],thisArg:i}),new Hn(t,this.__chain__)}return this.thru($a)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,Qe&&(Fn.prototype[Qe]=function(){return this}),Fn}();mt._=bn,(r=function(){return bn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},92736:function(e,t,n){var r=n(13109);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},34445:function(e,t,n){var r=n(61125),i=n(80171),a=n(98939),o=n(60925);e.exports=function(e){return a(e)?r(o(e)):i(e)}},72554:function(e){e.exports=function(){return[]}},95535:function(e){e.exports=function(){return!1}},11822:function(e,t,n){var r=n(21612);e.exports=function(e){return null==e?"":r(e)}},2985:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default,a=n(97450),o=Symbol("max"),s=Symbol("length"),u=Symbol("lengthCalculator"),c=Symbol("allowStale"),l=Symbol("maxAge"),f=Symbol("dispose"),d=Symbol("noDisposeOnSet"),p=Symbol("lruList"),h=Symbol("cache"),m=Symbol("updateAgeOnGet"),v=function(){return 1},y=function(){function e(t){if(r(this,e),"number"===typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!==typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[o]=t.max||1/0;var n=t.length||v;if(this[u]="function"!==typeof n?v:n,this[c]=t.stale||!1,t.maxAge&&"number"!==typeof t.maxAge)throw new TypeError("maxAge must be a number");this[l]=t.maxAge||0,this[f]=t.dispose,this[d]=t.noDisposeOnSet||!1,this[m]=t.updateAgeOnGet||!1,this.reset()}return i(e,[{key:"max",get:function(){return this[o]},set:function(e){if("number"!==typeof e||e<0)throw new TypeError("max must be a non-negative number");this[o]=e||1/0,w(this)}},{key:"allowStale",get:function(){return this[c]},set:function(e){this[c]=!!e}},{key:"maxAge",get:function(){return this[l]},set:function(e){if("number"!==typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,w(this)}},{key:"lengthCalculator",get:function(){return this[u]},set:function(e){var t=this;"function"!==typeof e&&(e=v),e!==this[u]&&(this[u]=e,this[s]=0,this[p].forEach((function(e){e.length=t[u](e.value,e.key),t[s]+=e.length}))),w(this)}},{key:"length",get:function(){return this[s]}},{key:"itemCount",get:function(){return this[p].length}},{key:"rforEach",value:function(e,t){t=t||this;for(var n=this[p].tail;null!==n;){var r=n.prev;A(this,e,n,t),n=r}}},{key:"forEach",value:function(e,t){t=t||this;for(var n=this[p].head;null!==n;){var r=n.next;A(this,e,n,t),n=r}}},{key:"keys",value:function(){return this[p].toArray().map((function(e){return e.key}))}},{key:"values",value:function(){return this[p].toArray().map((function(e){return e.value}))}},{key:"reset",value:function(){var e=this;this[f]&&this[p]&&this[p].length&&this[p].forEach((function(t){return e[f](t.key,t.value)})),this[h]=new Map,this[p]=new a,this[s]=0}},{key:"dump",value:function(){var e=this;return this[p].map((function(t){return!g(e,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}})).toArray().filter((function(e){return e}))}},{key:"dumpLru",value:function(){return this[p]}},{key:"set",value:function(e,t,n){if((n=n||this[l])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,i=this[u](t,e);if(this[h].has(e)){if(i>this[o])return x(this,this[h].get(e)),!1;var a=this[h].get(e).value;return this[f]&&(this[d]||this[f](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[s]+=i-a.length,a.length=i,this.get(e),w(this),!0}var c=new k(e,t,i,r,n);return c.length>this[o]?(this[f]&&this[f](e,t),!1):(this[s]+=c.length,this[p].unshift(c),this[h].set(e,this[p].head),w(this),!0)}},{key:"has",value:function(e){if(!this[h].has(e))return!1;var t=this[h].get(e).value;return!g(this,t)}},{key:"get",value:function(e){return b(this,e,!0)}},{key:"peek",value:function(e){return b(this,e,!1)}},{key:"pop",value:function(){var e=this[p].tail;return e?(x(this,e),e.value):null}},{key:"del",value:function(e){x(this,this[h].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var a=i-t;a>0&&this.set(r.k,r.v,a)}}}},{key:"prune",value:function(){var e=this;this[h].forEach((function(t,n){return b(e,n,!1)}))}}]),e}(),b=function(e,t,n){var r=e[h].get(t);if(r){var i=r.value;if(g(e,i)){if(x(e,r),!e[c])return}else n&&(e[m]&&(r.value.now=Date.now()),e[p].unshiftNode(r));return i.value}},g=function(e,t){if(!t||!t.maxAge&&!e[l])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},w=function(e){if(e[s]>e[o])for(var t=e[p].tail;e[s]>e[o]&&null!==t;){var n=t.prev;x(e,t),t=n}},x=function(e,t){if(t){var n=t.value;e[f]&&e[f](n.key,n.value),e[s]-=n.length,e[h].delete(n.key),e[p].removeNode(t)}},k=i((function e(t,n,i,a,o){r(this,e),this.key=t,this.value=n,this.length=i,this.now=a,this.maxAge=o||0})),A=function(e,t,n,r){var i=n.value;g(e,i)&&(x(e,n),e[c]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=y},23240:function(e,t,n){"use strict";var r=n(17061).default;e.exports=function(e){e.prototype[Symbol.iterator]=r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.value;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}}),e,this)}))}},97450:function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"===typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,a=this.head;null!==a&&ithis.length&&(t=this.length);for(var i=this.length,a=this.tail;null!==a&&i>t;i--)a=a.prev;for(;null!==a&&i>e;i--,a=a.prev)n.push(a.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.init_by_array=function(e,t){var n,r,i;for(this.init_seed(19650218),n=1,r=0,i=this.N>t?this.N:t;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(1664525*((4294901760&a)>>>16)<<16)+1664525*(65535&a))+e[r]+r,this.mt[n]>>>=0,r++,++n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),r>=t&&(r=0)}for(i=this.N-1;i;i--){a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(1566083941*((4294901760&a)>>>16)<<16)+1566083941*(65535&a))-n,this.mt[n]>>>=0,++n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648},t.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^t[1&e];for(;n>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},t.prototype.random_int31=function(){return this.random_int()>>>1},t.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},t.prototype.random=function(){return this.random_int()*(1/4294967296)},t.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},t.prototype.random_long=function(){return(67108864*(this.random_int()>>>5)+(this.random_int()>>>6))*(1/9007199254740992)},e.exports=t},65701:function(e){function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},42679:function(e,t){"use strict";var n=t;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",n=0;n>8,o=255&i;a?n.push(a,o):n.push(o)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}},13265:function(e,t,n){"use strict";var r=n(74704).default,i=n(56690).default,a=n(89728).default,o=n(47700).encodeText,s=function(){function e(t,n,r,a){i(this,e),this.name=t,this.code=n,this.codeBuf=o(this.code),this.alphabet=a,this.codec=r(a)}return a(e,[{key:"encode",value:function(e){return this.codec.encode(e)}},{key:"decode",value:function(e){var t,n=r(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(this.alphabet&&this.alphabet.indexOf(i)<0)throw new Error("invalid character '".concat(i,"' in '").concat(e,"'"))}}catch(a){n.e(a)}finally{n.f()}return this.codec.decode(e)}}]),e}();e.exports=s},39278:function(e,t,n){"use strict";var r=n(17391),i=n(13265),a=n(71460).rfc4648,o=n(47700),s=o.decodeText,u=o.encodeText,c=[["identity","\0",function(){return{encode:s,decode:u}},""],["base2","0",a(1),"01"],["base8","7",a(3),"01234567"],["base10","9",r,"0123456789"],["base16","f",a(4),"0123456789abcdef"],["base16upper","F",a(4),"0123456789ABCDEF"],["base32hex","v",a(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",a(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",a(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",a(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",a(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",a(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",a(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",a(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",a(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",r,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",r,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",r,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",r,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],l=c.reduce((function(e,t){return e[t[0]]=new i(t[0],t[1],t[2],t[3]),e}),{}),f=c.reduce((function(e,t){return e[t[1]]=l[t[0]],e}),{});e.exports={names:l,codes:f}},51038:function(e,t,n){"use strict";var r=n(39278),i=n(47700),a=i.encodeText,o=i.decodeText,s=i.concat;function u(e){if(Object.prototype.hasOwnProperty.call(r.names,e))return r.names[e];if(Object.prototype.hasOwnProperty.call(r.codes,e))return r.codes[e];throw new Error("Unsupported encoding: ".concat(e))}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");var n=u(e),r=n.name,i=n.codeBuf;return function(e,t){var n=u(e);n.decode(o(t))}(r,t),s([i,t],i.length+t.length)}).encode=function(e,t){var n=u(e),r=a(n.encode(t));return s([n.codeBuf,r],n.codeBuf.length+r.length)},t.decode=function(e){e instanceof Uint8Array&&(e=o(e));var t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),u(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=o(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return u(e[0]).name}catch(t){return!1}},t.encoding=u,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=o(e)),u(e[0])},t.names=Object.freeze(r.names),t.codes=Object.freeze(r.codes)},71460:function(e){"use strict";e.exports={rfc4648:function(e){return function(t){return{encode:function(n){return function(e,t,n){for(var r="="===t[t.length-1],i=(1<n;)a+=t[i&s>>(o-=n)];if(o&&(a+=t[i&s<=8&&(s-=8,o[c++]=255&u>>s)}if(s>=n||255&u<<8-s)throw new SyntaxError("Unexpected end of data");return o}(n,t,e)}}}}}},47700:function(e,t,n){"use strict";var r=n(74704).default,i=n(47770),a=i.TextEncoder,o=new(0,i.TextDecoder),s=new a;e.exports={decodeText:function(e){return o.decode(e)},encodeText:function(e){return s.encode(e)},concat:function(e,t){var n,i=new Uint8Array(t),a=0,o=r(e);try{for(o.s();!(n=o.n()).done;){var s=n.value;i.set(s,a),a+=s.length}}catch(u){o.e(u)}finally{o.f()}return i}}},64295:function(e,t,n){"use strict";var r=n(74704).default;e.exports=function(e,t){t||(t=e.reduce((function(e,t){return e+t.length}),0));var n,i=new Uint8Array(t),a=0,o=r(e);try{for(o.s();!(n=o.n()).done;){var s=n.value;i.set(s,a),a+=s.length}}catch(u){o.e(u)}finally{o.f()}return i}},93430:function(e,t,n){"use strict";var r=n(39278).names,i=new(0,n(47770).TextEncoder);e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";if("utf8"===t||"utf-8"===t)return i.encode(e);if("ascii"===t)return function(e){for(var t=new Uint8Array(e.length),n=0;n1&&void 0!==arguments[1]?arguments[1]:"utf8";if("utf8"===t||"utf-8"===t)return i.decode(e);if("ascii"===t)return function(e){for(var t="",n=0;n=c||s>49)throw e.bytes=0,new RangeError("Could not decode varint");a=r[u++],o+=s<28?(a&n)<=t);return e.bytes=u-i,o};var t=128,n=127},68656:function(e){e.exports=function e(i,a,o){if(Number.MAX_SAFE_INTEGER&&i>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");a=a||[];var s=o=o||0;for(;i>=r;)a[o++]=255&i|t,i/=128;for(;i&n;)a[o++]=255&i|t,i>>>=7;return a[o]=0|i,e.bytes=o-s+1,a};var t=128,n=-128,r=Math.pow(2,31)},47837:function(e,t,n){e.exports={encode:n(68656),decode:n(82651),encodingLength:n(15948)}},15948:function(e){var t=Math.pow(2,7),n=Math.pow(2,14),r=Math.pow(2,21),i=Math.pow(2,28),a=Math.pow(2,35),o=Math.pow(2,42),s=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e1&&void 0!==arguments[1]?arguments[1]:"utf8",n=r[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return n.decoder.decode("".concat(n.prefix).concat(e))}},61202:function(e,t,n){"use strict";var r=n(61579);e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8",n=r[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return n.encoder.encode(e).substring(1)}},61579:function(e,t,n){"use strict";var r=n(42122).default,i=n(9998).bases;function a(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}var o=a("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),s=a("ascii","a",(function(e){for(var t="a",n=0;n=c||s>49)throw e.bytes=0,new RangeError("Could not decode varint");a=r[u++],o+=s<28?(a&n)<=t);return e.bytes=u-i,o};var t=128,n=127},29599:function(e){e.exports=function e(i,a,o){if(Number.MAX_SAFE_INTEGER&&i>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");a=a||[];var s=o=o||0;for(;i>=r;)a[o++]=255&i|t,i/=128;for(;i&n;)a[o++]=255&i|t,i>>>=7;return a[o]=0|i,e.bytes=o-s+1,a};var t=128,n=-128,r=Math.pow(2,31)},44734:function(e,t,n){e.exports={encode:n(29599),decode:n(49842),encodingLength:n(18995)}},18995:function(e){var t=Math.pow(2,7),n=Math.pow(2,14),r=Math.pow(2,21),i=Math.pow(2,28),a=Math.pow(2,35),o=Math.pow(2,42),s=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e 2 bytes.");var t=i.decode(e);if(!m(t))throw new Error("multihash unknown function code: 0x".concat(t.toString(16)));e=e.slice(i.decode.bytes);var n=i.decode(e);if(n<0)throw new Error("multihash invalid length: ".concat(n));if((e=e.slice(i.decode.bytes)).length!==n)throw new Error("multihash length inconsistent: 0x".concat(o(e,"base16")));return{code:t,name:c[t],length:n,digest:e}}function p(e){var t=e;if("string"===typeof e){if(void 0===a[e])throw new Error("Unrecognized hash function named: ".concat(e));t=a[e]}if("number"!==typeof t)throw new Error("Hash function code should be a number. Got: ".concat(t));if(void 0===c[t]&&!h(t))throw new Error("Unrecognized function code: ".concat(t));return t}function h(e){return e>0&&e<16}function m(e){return!!h(e)||!!c[e]}function v(e){d(e)}e.exports={names:a,codes:Object.freeze(c),toHexString:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return o(e,"base16")},fromHexString:function(e){return s(e,"base16")},toB58String:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return o(r.encode("base58btc",e)).slice(1)},fromB58String:function(e){var t=e instanceof Uint8Array?o(e):e;return r.decode("z"+t)},decode:d,encode:function(e,t,n){if(!e||void 0===t)throw new Error("multihash encode requires at least two args: digest, code");var r=p(t);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==n&&(n=e.length),n&&e.length!==n)throw new Error("digest length should be equal to specified length.");var a=i.encode(r),o=i.encode(n);return u([a,o,e],a.length+o.length+e.length)},coerceCode:p,isAppCode:h,validate:v,prefix:function(e){return v(e),e.subarray(0,2)},isValidCode:m}},25636:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=r(n(21247)),a=r(n(55948));i.default.DefaultOpts.ImageClass=a.default,e.exports=i.default},69287:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(21247)),a=n(54161),o=function(){function e(e,t){void 0===t&&(t={}),this._src=e,this._opts=t,this._opts.filters=a(i.default.DefaultOpts.filters)}return e.prototype.maxColorCount=function(e){return this._opts.colorCount=e,this},e.prototype.maxDimension=function(e){return this._opts.maxDimension=e,this},e.prototype.addFilter=function(e){return this._opts.filters.push(e),this},e.prototype.removeFilter=function(e){var t=this._opts.filters.indexOf(e);return t>0&&this._opts.filters.splice(t),this},e.prototype.clearFilters=function(){return this._opts.filters=[],this},e.prototype.quality=function(e){return this._opts.quality=e,this},e.prototype.useImageClass=function(e){return this._opts.ImageClass=e,this},e.prototype.useGenerator=function(e){return this._opts.generator=e,this},e.prototype.useQuantizer=function(e){return this._opts.quantizer=e,this},e.prototype.build=function(){return new i.default(this._src,this._opts)},e.prototype.getPalette=function(e){return this.build().getPalette(e)},e.prototype.getSwatches=function(e){return this.build().getPalette(e)},e}();t.default=o},42956:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Swatch=void 0;var r=n(16241),i=n(60823),a=function(){function e(e,t){this._rgb=e,this._population=t}return e.applyFilter=function(e,t){return"function"===typeof t?i(e,(function(e){var n=e.r,r=e.g,i=e.b;return t(n,r,i,255)})):e},Object.defineProperty(e.prototype,"r",{get:function(){return this._rgb[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._rgb[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this._rgb[2]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rgb",{get:function(){return this._rgb},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hsl",{get:function(){if(!this._hsl){var e=this._rgb,t=e[0],n=e[1],i=e[2];this._hsl=r.rgbToHsl(t,n,i)}return this._hsl},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hex",{get:function(){if(!this._hex){var e=this._rgb,t=e[0],n=e[1],i=e[2];this._hex=r.rgbToHex(t,n,i)}return this._hex},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"population",{get:function(){return this._population},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return{rgb:this.rgb,population:this.population}},e.prototype.getRgb=function(){return this._rgb},e.prototype.getHsl=function(){return this.hsl},e.prototype.getPopulation=function(){return this._population},e.prototype.getHex=function(){return this.hex},e.prototype.getYiq=function(){if(!this._yiq){var e=this._rgb;this._yiq=(299*e[0]+587*e[1]+114*e[2])/1e3}return this._yiq},Object.defineProperty(e.prototype,"titleTextColor",{get:function(){return this._titleTextColor||(this._titleTextColor=this.getYiq()<200?"#fff":"#000"),this._titleTextColor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bodyTextColor",{get:function(){return this._bodyTextColor||(this._bodyTextColor=this.getYiq()<150?"#fff":"#000"),this._bodyTextColor},enumerable:!1,configurable:!0}),e.prototype.getTitleTextColor=function(){return this.titleTextColor},e.prototype.getBodyTextColor=function(){return this.bodyTextColor},e}();t.Swatch=a},59550:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r){return r>=125&&!(e>250&&t>250&&n>250)}},7547:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineFilters=void 0;var r=n(59550);Object.defineProperty(t,"Default",{enumerable:!0,get:function(){return r.default}}),t.combineFilters=function(e){return Array.isArray(e)&&0!==e.length?function(t,n,r,i){if(0===i)return!1;for(var a=0;a=s&&p<=u&&h>=i&&h<=a&&!function(e,t){return e.Vibrant===t||e.DarkVibrant===t||e.LightVibrant===t||e.Muted===t||e.DarkMuted===t||e.LightMuted===t}(e,t)){var m=function(e,t,n,r,i,a,o){function s(e,t){return 1-Math.abs(e-t)}return function(){for(var e=[],t=0;tf)&&(l=t,f=m)}})),l}t.default=function(e,t){t=a({},t,o);var n=function(e){var t=0;return e.forEach((function(e){t=Math.max(t,e.getPopulation())})),t}(e),u=function(e,t,n){var r={};return r.Vibrant=s(r,e,t,n.targetNormalLuma,n.minNormalLuma,n.maxNormalLuma,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.LightVibrant=s(r,e,t,n.targetLightLuma,n.minLightLuma,1,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.DarkVibrant=s(r,e,t,n.targetDarkLuma,0,n.maxDarkLuma,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.Muted=s(r,e,t,n.targetNormalLuma,n.minNormalLuma,n.maxNormalLuma,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r.LightMuted=s(r,e,t,n.targetLightLuma,n.minLightLuma,1,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r.DarkMuted=s(r,e,t,n.targetDarkLuma,0,n.maxDarkLuma,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r}(e,n,t);return function(e,t,n){if(null===e.Vibrant&&null===e.DarkVibrant&&null===e.LightVibrant){if(null===e.DarkVibrant&&null!==e.DarkMuted){var a=e.DarkMuted.getHsl(),o=a[0],s=a[1],u=a[2];u=n.targetDarkLuma,e.DarkVibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}if(null===e.LightVibrant&&null!==e.LightMuted){var c=e.LightMuted.getHsl();o=c[0],s=c[1],u=c[2],u=n.targetDarkLuma,e.DarkVibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}}if(null===e.Vibrant&&null!==e.DarkVibrant){var l=e.DarkVibrant.getHsl();o=l[0],s=l[1],u=l[2],u=n.targetNormalLuma,e.Vibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}else if(null===e.Vibrant&&null!==e.LightVibrant){var f=e.LightVibrant.getHsl();o=f[0],s=f[1],u=f[2],u=n.targetNormalLuma,e.Vibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}if(null===e.DarkVibrant&&null!==e.Vibrant){var d=e.Vibrant.getHsl();o=d[0],s=d[1],u=d[2],u=n.targetDarkLuma,e.DarkVibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}if(null===e.LightVibrant&&null!==e.Vibrant){var p=e.Vibrant.getHsl();o=p[0],s=p[1],u=p[2],u=n.targetLightLuma,e.LightVibrant=new r.Swatch(i.hslToRgb(o,s,u),0)}if(null===e.Muted&&null!==e.Vibrant){var h=e.Vibrant.getHsl();o=h[0],s=h[1],u=h[2],u=n.targetMutesSaturation,e.Muted=new r.Swatch(i.hslToRgb(o,s,u),0)}if(null===e.DarkMuted&&null!==e.DarkVibrant){var m=e.DarkVibrant.getHsl();o=m[0],s=m[1],u=m[2],u=n.targetMutesSaturation,e.DarkMuted=new r.Swatch(i.hslToRgb(o,s,u),0)}if(null===e.LightMuted&&null!==e.LightVibrant){var v=e.LightVibrant.getHsl();o=v[0],s=v[1],u=v[2],u=n.targetMutesSaturation,e.LightMuted=new r.Swatch(i.hslToRgb(o,s,u),0)}}(u,0,t),u}},44379:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(61677);Object.defineProperty(t,"Default",{enumerable:!0,get:function(){return r.default}})},66802:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageBase=void 0;var n=function(){function e(){}return e.prototype.scaleDown=function(e){var t=this.getWidth(),n=this.getHeight(),r=1;if(e.maxDimension>0){var i=Math.max(t,n);i>e.maxDimension&&(r=e.maxDimension/i)}else r=1/e.quality;r<1&&this.resize(t*r,n*r,r)},e.prototype.applyFilter=function(e){var t=this.getImageData();if("function"===typeof e)for(var n=t.data,r=n.length/4,i=void 0,a=0;a0))break;var i=r.split(),a=i[0],o=i[1];if(e.push(a),o&&o.count()>0&&e.push(o),e.size()===n)break;n=e.size()}}t.default=function(e,t){if(0===e.length||t.colorCount<2||t.colorCount>256)throw new Error("Wrong MMCQ parameters");var n=a.default.build(e),r=n.hist,u=(Object.keys(r).length,new o.default((function(e,t){return e.count()-t.count()})));u.push(n),s(u,.75*t.colorCount);var c=new o.default((function(e,t){return e.count()*e.volume()-t.count()*t.volume()}));return c.contents=u.contents,s(c,t.colorCount-c.size()),function(e){var t=[];for(;e.size();){var n=e.pop(),r=n.avg();r[0],r[1],r[2];t.push(new i.Swatch(r,n.count()))}return t}(c)}},43425:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._comparator=e,this.contents=[],this._sorted=!1}return e.prototype._sort=function(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)},e.prototype.push=function(e){this.contents.push(e),this._sorted=!1},e.prototype.peek=function(e){return this._sort(),e="number"===typeof e?e:this.contents.length-1,this.contents[e]},e.prototype.pop=function(){return this._sort(),this.contents.pop()},e.prototype.size=function(){return this.contents.length},e.prototype.map=function(e){return this._sort(),this.contents.map(e)},e}();t.default=n},40083:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16241),i=function(){function e(e,t,n,r,i,a,o){this._volume=-1,this._count=-1,this.dimension={r1:e,r2:t,g1:n,g2:r,b1:i,b2:a},this.hist=o}return e.build=function(t,n){var i,a,o,s,u,c,l,f,d,p=1<<3*r.SIGBITS,h=new Uint32Array(p);i=o=u=0,a=s=c=Number.MAX_VALUE;for(var m=t.length/4,v=0;v>=r.RSHIFT,f>>=r.RSHIFT,d>>=r.RSHIFT,h[r.getColorIndex(l,f,d)]+=1,l>i&&(i=l),lo&&(o=f),fu&&(u=d),d>=r.RSHIFT,n>>=r.RSHIFT,i>>=r.RSHIFT,t>=o&&t<=s&&n>=u&&n<=c&&i>=l&&i<=f},e.prototype.split=function(){var e=this.hist,t=this.dimension,n=t.r1,i=t.r2,a=t.g1,o=t.g2,s=t.b1,u=t.b2,c=this.count();if(!c)return[];if(1===c)return[this.clone()];var l,f,d=i-n+1,p=o-a+1,h=u-s+1,m=Math.max(d,p,h),v=null;l=f=0;var y=null;if(m===d){y="r",v=new Uint32Array(i+1);for(var b=n;b<=i;b++){l=0;for(var g=a;g<=o;g++)for(var w=s;w<=u;w++){l+=e[r.getColorIndex(b,g,w)]}f+=l,v[b]=f}}else if(m===p){y="g",v=new Uint32Array(o+1);for(g=a;g<=o;g++){l=0;for(b=n;b<=i;b++)for(w=s;w<=u;w++){l+=e[r.getColorIndex(b,g,w)]}f+=l,v[g]=f}}else{y="b",v=new Uint32Array(u+1);for(w=s;w<=u;w++){l=0;for(b=n;b<=i;b++)for(g=a;g<=o;g++){l+=e[r.getColorIndex(b,g,w)]}f+=l,v[w]=f}}for(var x=-1,k=new Uint32Array(v.length),A=0;Af/2&&(x=A),k[A]=f-E}var _=this;return function(e){var t=e+"1",n=e+"2",r=_.dimension[t],i=_.dimension[n],a=_.clone(),o=_.clone(),s=x-r,u=i-x;for(s<=u?(i=Math.min(i-1,~~(x+u/2)),i=Math.max(0,i)):(i=Math.max(r,~~(x-1-s/2)),i=Math.min(_.dimension[n],i));!v[i];)i++;for(var c=k[i];!c&&v[i-1];)c=k[--i];return a.dimension[n]=i,o.dimension[t]=i+1,[a,o]}(y)},e}();t.default=i},16241:function(e,t){"use strict";function n(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return null===t?null:[t[1],t[2],t[3]].map((function(e){return parseInt(e,16)}))}function r(e,t,n){return t/=255,n/=255,e=(e/=255)>.04045?Math.pow((e+.005)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.005)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.005)/1.055,2.4):n/12.92,[.4124*(e*=100)+.3576*(t*=100)+.1805*(n*=100),.2126*e+.7152*t+.0722*n,.0193*e+.1192*t+.9505*n]}function i(e,t,n){return t/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(t=t>.008856?Math.pow(t,1/3):7.787*t+16/116)-16,500*(e-t),200*(t-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]}function a(e,t,n){var a=r(e,t,n);return i(a[0],a[1],a[2])}function o(e,t){var n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2],u=n-a,c=r-o,l=i-s,f=Math.sqrt(r*r+i*i),d=a-n,p=Math.sqrt(o*o+s*s)-f,h=Math.sqrt(u*u+c*c+l*l),m=Math.sqrt(h)>Math.sqrt(Math.abs(d))+Math.sqrt(Math.abs(p))?Math.sqrt(h*h-d*d-p*p):0;return d/=1,p/=1*(1+.045*f),m/=1*(1+.015*f),Math.sqrt(d*d+p*p+m*m)}function s(e,t){return o(a.apply(void 0,e),a.apply(void 0,t))}Object.defineProperty(t,"__esModule",{value:!0}),t.getColorIndex=t.getColorDiffStatus=t.hexDiff=t.rgbDiff=t.deltaE94=t.rgbToCIELab=t.xyzToCIELab=t.rgbToXyz=t.hslToRgb=t.rgbToHsl=t.rgbToHex=t.hexToRgb=t.defer=t.RSHIFT=t.SIGBITS=t.DELTAE94_DIFF_STATUS=void 0,t.DELTAE94_DIFF_STATUS={NA:0,PERFECT:1,CLOSE:2,GOOD:10,SIMILAR:50},t.SIGBITS=5,t.RSHIFT=8-t.SIGBITS,t.defer=function(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}},t.hexToRgb=n,t.rgbToHex=function(e,t,n){return"#"+((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1,7)},t.rgbToHsl=function(e,t,n){e/=255,t/=255,n/=255;var r,i,a=Math.max(e,t,n),o=Math.min(e,t,n),s=(a+o)/2;if(a===o)r=i=0;else{var u=a-o;switch(i=s>.5?u/(2-a-o):u/(a+o),a){case e:r=(t-n)/u+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0===t)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,u=2*n-s;r=o(u,s,e+1/3),i=o(u,s,e),a=o(u,s,e-1/3)}return[255*r,255*i,255*a]},t.rgbToXyz=r,t.xyzToCIELab=i,t.rgbToCIELab=a,t.deltaE94=o,t.rgbDiff=s,t.hexDiff=function(e,t){return s(n(e),n(t))},t.getColorDiffStatus=function(e){return e-1e3&&e<1e3||k.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"===typeof e){var r=e<0?-T(-e):T(e);if(r!==e){var i=String(r),a=b.call(t,i.length+1);return g.call(i,n,"$&_")+"."+g.call(g.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(t,n,"$&_")}var j=n(24654),L=j.custom,D=z(L)?L:null;function B(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function U(e){return g.call(String(e),/"/g,""")}function F(e){return"[object Array]"===V(e)&&(!P||!("object"===typeof e&&P in e))}function Z(e){return"[object RegExp]"===V(e)&&(!P||!("object"===typeof e&&P in e))}function z(e){if(I)return e&&"object"===typeof e&&e instanceof Symbol;if("symbol"===typeof e)return!0;if(!e||"object"!==typeof e||!O)return!1;try{return O.call(e),!0}catch(t){}return!1}e.exports=function e(t,n,r,i){var s=n||{};if(q(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(s,"maxStringLength")&&("number"===typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!q(s,"customInspect")||s.customInspect;if("boolean"!==typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(s,"numericSeparator")&&"boolean"!==typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=s.numericSeparator;if("undefined"===typeof t)return"undefined";if(null===t)return"null";if("boolean"===typeof t)return t?"true":"false";if("string"===typeof t)return G(t,s);if("number"===typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return m?N(t,w):w}if("bigint"===typeof t){var k=String(t)+"n";return m?N(t,k):k}var T="undefined"===typeof s.depth?5:s.depth;if("undefined"===typeof r&&(r=0),r>=T&&T>0&&"object"===typeof t)return F(t)?"[Array]":"[Object]";var C=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"===typeof e.indent&&e.indent>0))return null;n=E.call(Array(e.indent+1)," ")}return{base:n,prev:E.call(Array(t+1),n)}}(s,r);if("undefined"===typeof i)i=[];else if(W(i,t)>=0)return"[Circular]";function L(t,n,a){if(n&&(i=_.call(i)).push(n),a){var o={depth:s.depth};return q(s,"quoteStyle")&&(o.quoteStyle=s.quoteStyle),e(t,o,r+1,i)}return e(t,s,r+1,i)}if("function"===typeof t&&!Z(t)){var H=function(e){if(e.name)return e.name;var t=y.call(v.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),Y=$(t,L);return"[Function"+(H?": "+H:" (anonymous)")+"]"+(Y.length>0?" { "+E.call(Y,", ")+" }":"")}if(z(t)){var ee=I?g.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!==typeof t||I?ee:K(ee)}if(function(e){if(!e||"object"!==typeof e)return!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"===typeof e.nodeName&&"function"===typeof e.getAttribute}(t)){for(var te="<"+x.call(String(t.nodeName)),ne=t.attributes||[],re=0;re"}if(F(t)){if(0===t.length)return"[]";var ie=$(t,L);return C&&!function(e){for(var t=0;t=0)return!1;return!0}(ie)?"["+X(ie,C)+"]":"[ "+E.call(ie,", ")+" ]"}if(function(e){return"[object Error]"===V(e)&&(!P||!("object"===typeof e&&P in e))}(t)){var ae=$(t,L);return"cause"in Error.prototype||!("cause"in t)||R.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+E.call(ae,", ")+" }":"{ ["+String(t)+"] "+E.call(A.call("[cause]: "+L(t.cause),ae),", ")+" }"}if("object"===typeof t&&u){if(D&&"function"===typeof t[D]&&j)return j(t,{depth:T-r});if("symbol"!==u&&"function"===typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!==typeof e)return!1;try{a.call(e);try{c.call(e)}catch(te){return!0}return e instanceof Map}catch(t){}return!1}(t)){var oe=[];return o&&o.call(t,(function(e,n){oe.push(L(n,t,!0)+" => "+L(e,t))})),Q("Map",a.call(t),oe,C)}if(function(e){if(!c||!e||"object"!==typeof e)return!1;try{c.call(e);try{a.call(e)}catch(t){return!0}return e instanceof Set}catch(n){}return!1}(t)){var se=[];return l&&l.call(t,(function(e){se.push(L(e,t))})),Q("Set",c.call(t),se,C)}if(function(e){if(!f||!e||"object"!==typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(te){return!0}return e instanceof WeakMap}catch(t){}return!1}(t))return J("WeakMap");if(function(e){if(!d||!e||"object"!==typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(te){return!0}return e instanceof WeakSet}catch(t){}return!1}(t))return J("WeakSet");if(function(e){if(!p||!e||"object"!==typeof e)return!1;try{return p.call(e),!0}catch(t){}return!1}(t))return J("WeakRef");if(function(e){return"[object Number]"===V(e)&&(!P||!("object"===typeof e&&P in e))}(t))return K(L(Number(t)));if(function(e){if(!e||"object"!==typeof e||!S)return!1;try{return S.call(e),!0}catch(t){}return!1}(t))return K(L(S.call(t)));if(function(e){return"[object Boolean]"===V(e)&&(!P||!("object"===typeof e&&P in e))}(t))return K(h.call(t));if(function(e){return"[object String]"===V(e)&&(!P||!("object"===typeof e&&P in e))}(t))return K(L(String(t)));if(!function(e){return"[object Date]"===V(e)&&(!P||!("object"===typeof e&&P in e))}(t)&&!Z(t)){var ue=$(t,L),ce=M?M(t)===Object.prototype:t instanceof Object||t.constructor===Object,le=t instanceof Object?"":"null prototype",fe=!ce&&P&&Object(t)===t&&P in t?b.call(V(t),8,-1):le?"Object":"",de=(ce||"function"!==typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fe||le?"["+E.call(A.call([],fe||[],le||[]),": ")+"] ":"");return 0===ue.length?de+"{}":C?de+"{"+X(ue,C)+"}":de+"{ "+E.call(ue,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function q(e,t){return H.call(e,t)}function V(e){return m.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return G(b.call(e,0,t.maxStringLength),t)+r}return B(g.call(g.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Y),"single",t)}function Y(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function K(e){return"Object("+e+")"}function J(e){return e+" { ? }"}function Q(e,t,n,r){return e+" ("+t+") {"+(r?X(n,r):E.call(n,", "))+"}"}function X(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+E.call(e,","+n)+"\n"+t.prev}function $(e,t){var n=F(e),r=[];if(n){r.length=e.length;for(var i=0;i0&&!i.call(e,0))for(var m=0;m0)for(var v=0;v=0&&"[object Function]"===t.call(e.callee)),r}},53083:function(e,t,n){"use strict";var r=n(73714),i=n(44680),a=i("Object.prototype.propertyIsEnumerable"),o=i("Array.prototype.push");e.exports=function(e){var t=r(e),n=[];for(var i in t)a(t,i)&&o(n,t[i]);return n}},37512:function(e,t,n){"use strict";var r=n(89959),i=n(59962),a=n(53083),o=n(82220),s=n(8877),u=i(o(),Object);r(u,{getPolyfill:o,implementation:a,shim:s}),e.exports=u},82220:function(e,t,n){"use strict";var r=n(53083);e.exports=function(){return"function"===typeof Object.values?Object.values:r}},8877:function(e,t,n){"use strict";var r=n(82220),i=n(89959);e.exports=function(){var e=r();return i(Object,{values:e},{values:function(){return Object.values!==e}}),e}},73856:function(e,t,n){"use strict";n.r(t),n.d(t,{Component:function(){return k},Fragment:function(){return x},cloneElement:function(){return q},createContext:function(){return V},createElement:function(){return b},createRef:function(){return w},h:function(){return b},hydrate:function(){return H},isValidElement:function(){return o},options:function(){return i},render:function(){return z},toChildArray:function(){return O}});var r,i,a,o,s,u,c,l,f,d={},p=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function y(e){var t=e.parentNode;t&&t.removeChild(e)}function b(e,t,n){var i,a,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?a=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return g(e,s,i,a,null)}function g(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++a:o};return null==o&&null!=i.vnode&&i.vnode(s),s}function w(){return{current:null}}function x(e){return e.children}function k(e,t){this.props=e,this.context=t}function A(e,t){if(null==t)return e.__?A(e.__,e.__.__k.indexOf(e)+1):null;for(var n;tt&&s.sort(l));T.__r=0}function S(e,t,n,r,i,a,o,s,u,c,l){var f,h,v,y,b,w,k,E,_,T=0,S=r&&r.__k||p,O=S.length,R=O,M=t.length;for(n.__k=[],f=0;f0?g(y.type,y.props,y.key,y.ref?y.ref:null,y.__v):y)?(y.__=n,y.__b=n.__b+1,-1===(E=P(y,S,k=f+T,R))?v=d:(v=S[E]||d,S[E]=void 0,R--),L(e,y,v,i,a,o,s,u,c,l),b=y.__e,(h=y.ref)&&v.ref!=h&&(v.ref&&U(v.ref,null,y),l.push(h,y.__c||b,y)),null!=b&&(null==w&&(w=b),(_=v===d||null===v.__v)?-1==E&&T--:E!==k&&(E===k+1?T++:E>k?R>M-k?T+=E-k:T--:T=E(null!=u?1:0))for(;o>=0||s=0){if((u=t[o])&&i==u.key&&a===u.type)return o;o--}if(s2&&(u.children=arguments.length>3?r.call(arguments,2):n),g(e.type,u,i||e.key,a||e.ref,null)}function V(e,t){var n={__c:t="__cC"+f++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,_(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=p.slice,i={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&null!=a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},a=0,o=function(e){return null!=e&&void 0===e.constructor},k.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof e&&(e=e(v({},n),this.props)),e&&v(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),_(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_(this))},k.prototype.render=x,s=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},T.__r=0,f=0},98944:function(e,t,n){"use strict";n.r(t),n.d(t,{useCallback:function(){return E},useContext:function(){return _},useDebugValue:function(){return T},useEffect:function(){return g},useErrorBoundary:function(){return S},useId:function(){return C},useImperativeHandle:function(){return k},useLayoutEffect:function(){return w},useMemo:function(){return A},useReducer:function(){return b},useRef:function(){return x},useState:function(){return y}});var r,i,a,o,s=n(73856),u=0,c=[],l=[],f=s.options.__b,d=s.options.__r,p=s.options.diffed,h=s.options.__c,m=s.options.unmount;function v(e,t){s.options.__h&&s.options.__h(i,e,u||t),u=0;var n=i.__H||(i.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:l}),n.__[e]}function y(e){return u=1,b(j,e)}function b(e,t,n){var a=v(r++,2);if(a.t=e,!a.__c&&(a.__=[n?n(t):j(void 0,t),function(e){var t=a.__N?a.__N[0]:a.__[0],n=a.t(t,e);t!==n&&(a.__N=[n,a.__[1]],a.__c.setState({}))}],a.__c=i,!i.u)){var o=function(e,t,n){if(!a.__c.__H)return!0;var r=a.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var i=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}})),!(!i&&a.__c.props===e)&&(!s||s.call(this,e,t,n))};i.u=!0;var s=i.shouldComponentUpdate,u=i.componentWillUpdate;i.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,o(e,t,n),s=r}u&&u.call(this,e,t,n)},i.shouldComponentUpdate=o}return a.__N||a.__}function g(e,t){var n=v(r++,3);!s.options.__s&&N(n.__H,t)&&(n.__=e,n.i=t,i.__H.__h.push(n))}function w(e,t){var n=v(r++,4);!s.options.__s&&N(n.__H,t)&&(n.__=e,n.i=t,i.__h.push(n))}function x(e){return u=5,A((function(){return{current:e}}),[])}function k(e,t,n){u=6,w((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function A(e,t){var n=v(r++,7);return N(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function E(e,t){return u=8,A((function(){return e}),t)}function _(e){var t=i.context[e.__c],n=v(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__}function T(e,t){s.options.useDebugValue&&s.options.useDebugValue(t?t(e):e)}function S(e){var t=v(r++,10),n=y();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function C(){var e=v(r++,11);if(!e.__){for(var t=i.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function O(){for(var e;e=c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(R),e.__H.__h.forEach(M),e.__H.__h=[]}catch(i){e.__H.__h=[],s.options.__e(i,e.__v)}}s.options.__b=function(e){i=null,f&&f(e)},s.options.__r=function(e){d&&d(e),r=0;var t=(i=e.__c).__H;t&&(a===i?(t.__h=[],i.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=l,e.__N=e.i=void 0}))):(t.__h.forEach(R),t.__h.forEach(M),t.__h=[],r=0)),a=i},s.options.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&o===s.options.requestAnimationFrame||((o=s.options.requestAnimationFrame)||P)(O)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==l&&(e.__=e.__V),e.i=void 0,e.__V=l}))),a=i=null},s.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(R),e.__h=e.__h.filter((function(e){return!e.__||M(e)}))}catch(a){t.some((function(e){e.__h&&(e.__h=[])})),t=[],s.options.__e(a,e.__v)}})),h&&h(e,t)},s.options.unmount=function(e){m&&m(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{R(e)}catch(e){t=e}})),n.__H=void 0,t&&s.options.__e(t,n.__v))};var I="function"==typeof requestAnimationFrame;function P(e){var t,n=function(){clearTimeout(r),I&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);I&&(t=requestAnimationFrame(n))}function R(e){var t=i,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),i=t}function M(e){var t=i;e.__c=e.__(),i=t}function N(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function j(e,t){return"function"==typeof t?t(e):t}},61729:function(e,t,n){"use strict";var r=n(79165);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},75192:function(e,t,n){e.exports=n(61729)()},79165:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5609:function(e){"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC1738",i="RFC3986";e.exports={default:i,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:r,RFC3986:i}},74776:function(e,t,n){"use strict";var r=n(2816),i=n(67668),a=n(5609);e.exports={formats:a,parse:i,stringify:r}},67668:function(e,t,n){"use strict";var r=n(49837),i=Object.prototype.hasOwnProperty,a=Array.isArray,o={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"===typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,n,r){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(a),c=s?a.slice(0,s.index):a,l=[];if(c){if(!n.plainObjects&&i.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var f=0;n.depth>0&&null!==(s=o.exec(a))&&f=0;--a){var o,s=e[a];if("[]"===s&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(c,10);n.parseArrays||""!==c?!isNaN(l)&&s!==c&&String(l)===c&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(o=[])[l]=i:"__proto__"!==c&&(o[c]=i):o={0:i}}i=o}return i}(l,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return o;if(null!==e.decoder&&void 0!==e.decoder&&"function"!==typeof e.decoder)throw new TypeError("Decoder has to be a function.");if("undefined"!==typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t="undefined"===typeof e.charset?o.charset:e.charset;return{allowDots:"undefined"===typeof e.allowDots?o.allowDots:!!e.allowDots,allowPrototypes:"boolean"===typeof e.allowPrototypes?e.allowPrototypes:o.allowPrototypes,allowSparse:"boolean"===typeof e.allowSparse?e.allowSparse:o.allowSparse,arrayLimit:"number"===typeof e.arrayLimit?e.arrayLimit:o.arrayLimit,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:o.charsetSentinel,comma:"boolean"===typeof e.comma?e.comma:o.comma,decoder:"function"===typeof e.decoder?e.decoder:o.decoder,delimiter:"string"===typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:o.delimiter,depth:"number"===typeof e.depth||!1===e.depth?+e.depth:o.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"===typeof e.interpretNumericEntities?e.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"===typeof e.parameterLimit?e.parameterLimit:o.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"===typeof e.plainObjects?e.plainObjects:o.plainObjects,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:o.strictNullHandling}}(t);if(""===e||null===e||"undefined"===typeof e)return n.plainObjects?Object.create(null):{};for(var l="string"===typeof e?function(e,t){var n,c={__proto__:null},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,d=l.split(t.delimiter,f),p=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(v=a(v)?[v]:v),i.call(c,m)?c[m]=r.combine(c[m],v):c[m]=v}return c}(e,n):e,f=n.plainObjects?Object.create(null):{},d=Object.keys(l),p=0;p0?A.join(",")||null:void 0}];else if(u(d))C=d;else{var I=Object.keys(A);C=m?I.sort(m):I}for(var P=o&&u(A)&&1===A.length?n+"[]":n,R=0;R0?x+w:""}},49837:function(e,t,n){"use strict";var r=n(5609),i=Object.prototype.hasOwnProperty,a=Array.isArray,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r1;){var t=e.pop(),n=t.obj[t.prop];if(a(n)){for(var r=[],i=0;i=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||a===r.RFC1738&&(40===l||41===l)?u+=s.charAt(c):l<128?u+=o[l]:l<2048?u+=o[192|l>>6]+o[128|63&l]:l<55296||l>=57344?u+=o[224|l>>12]+o[128|l>>6&63]+o[128|63&l]:(c+=1,l=65536+((1023&l)<<10|1023&s.charCodeAt(c)),u+=o[240|l>>18]+o[128|l>>12&63]+o[128|l>>6&63]+o[128|63&l])}return u},isBuffer:function(e){return!(!e||"object"!==typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(a(e)){for(var n=[],r=0;r0&&u>s&&(u=s);for(var c=0;c=0?(l=h.substr(0,m),f=h.substr(m+1)):(l=h,f=""),d=decodeURIComponent(l),p=decodeURIComponent(f),t(a,d)?Array.isArray(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a}},33033:function(e){"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,i){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"===typeof e?Object.keys(e).map((function(i){var a=encodeURIComponent(t(i))+r;return Array.isArray(e[i])?e[i].map((function(e){return a+encodeURIComponent(t(e))})).join(n):a+encodeURIComponent(t(e[i]))})).join(n):i?encodeURIComponent(t(i))+r+encodeURIComponent(t(e)):""}},52902:function(e,t,n){"use strict";t.decode=t.parse=n(29605),t.encode=t.stringify=n(33033)},75960:function(e){"use strict";function t(e){try{return JSON.stringify(e)}catch(t){return'"[Circular]"'}}e.exports=function(e,n,r){var i=r&&r.stringify||t;if("object"===typeof e&&null!==e){var a=n.length+1;if(1===a)return e;var o=new Array(a);o[0]=i(e);for(var s=1;s-1?f:0,e.charCodeAt(p+1)){case 100:case 102:if(l>=u)break;if(null==n[l])break;f=u)break;if(null==n[l])break;f=u)break;if(void 0===n[l])break;f",f=p+2,p++;break}c+=i(n[l]),f=p+2,p++;break;case 115:if(l>=u)break;f',(ee=te.firstChild).style.behavior="url(#default#VML)",!ee||"object"!=typeof ee.adj)return t.type=v;te=null}function ne(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)e[c](n)&&(t[n]=ne(e[n]));return t}t.svg=!(t.vml="VML"==t.type),t._Paper=d,t.fn=r=d.prototype=t.prototype,t._id=0,t.is=function(e,t){return"finite"==(t=k.call(t))?!M[c](+e):"array"==t?e instanceof Array:"null"==t&&null===e||t==typeof e&&null!==e||"object"==t&&e===Object(e)||"array"==t&&Array.isArray&&Array.isArray(e)||P.call(e).slice(8,-1).toLowerCase()==t},t.angle=function(e,n,r,i,a,o){if(null==a){var s=e-r,u=n-i;return s||u?(180+180*A.atan2(-u,-s)/C+360)%360:0}return t.angle(e,n,a,o)-t.angle(r,i,a,o)},t.rad=function(e){return e%360*C/180},t.deg=function(e){return Math.round(180*e/C%360*1e3)/1e3},t.snapTo=function(e,n,r){if(r=t.is(r,"finite")?r:10,t.is(e,I)){for(var i=e.length;i--;)if(T(e[i]-n)<=r)return e[i]}else{var a=n%(e=+e);if(ae-r)return n-a+e}return n},t.createUUID=(i=/[xy]/g,a=function(e){var t=16*A.random()|0;return("x"==e?t:3&t|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,a).toUpperCase()}),t.setWindow=function(n){e("raphael.setWindow",t,l.win,n),l.win=n,l.doc=l.win.document,t._engine.initWin&&t._engine.initWin(l.win)};var re=function(e){if(t.vml){var n,r=/^\s+|\s+$/g;try{var i=new ActiveXObject("htmlfile");i.write(""),i.close(),n=i.body}catch(e){n=createPopup().document.body}var a=n.createTextRange();re=ce((function(e){try{n.style.color=b(e).replace(r,v);var t=a.queryCommandValue("ForeColor");return"#"+("000000"+(t=(255&t)<<16|65280&t|(16711680&t)>>>16).toString(16)).slice(-6)}catch(e){return"none"}}))}else{var o=l.doc.createElement("i");o.title="Rapha\xebl Colour Picker",o.style.display="none",l.doc.body.appendChild(o),re=ce((function(e){return o.style.color=e,l.doc.defaultView.getComputedStyle(o,v).getPropertyValue("color")}))}return re(e)},ie=function(){return"hsb("+[this.h,this.s,this.b]+")"},ae=function(){return"hsl("+[this.h,this.s,this.l]+")"},oe=function(){return this.hex},se=function(e,n,r){if(null==n&&t.is(e,"object")&&"r"in e&&"g"in e&&"b"in e&&(r=e.b,n=e.g,e=e.r),null==n&&t.is(e,"string")){var i=t.getRGB(e);e=i.r,n=i.g,r=i.b}return(e>1||n>1||r>1)&&(e/=255,n/=255,r/=255),[e,n,r]},ue=function(e,n,r,i){var a={r:e*=255,g:n*=255,b:r*=255,hex:t.rgb(e,n,r),toString:oe};return t.is(i,"finite")&&(a.opacity=i),a};function ce(e,t,n){return function r(){var i=Array.prototype.slice.call(arguments,0),a=i.join("\u2400"),o=r.cache=r.cache||{},s=r.count=r.count||[];return o[c](a)?(function(e,t){for(var n=0,r=e.length;n=1e3&&delete o[s.shift()],s.push(a),o[a]=e[p](t,i),n?n(o[a]):o[a])}}function le(){return this.hex}function fe(e,t){for(var n=[],r=0,i=e.length;i-2*!t>r;r+=2){var a=[{x:+e[r-2],y:+e[r-1]},{x:+e[r],y:+e[r+1]},{x:+e[r+2],y:+e[r+3]},{x:+e[r+4],y:+e[r+5]}];t?r?i-4==r?a[3]={x:+e[0],y:+e[1]}:i-2==r&&(a[2]={x:+e[0],y:+e[1]},a[3]={x:+e[2],y:+e[3]}):a[0]={x:+e[i-2],y:+e[i-1]}:i-4==r?a[3]=a[2]:r||(a[0]={x:+e[r],y:+e[r+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n}t.color=function(e){var n;return t.is(e,"object")&&"h"in e&&"s"in e&&"b"in e?(n=t.hsb2rgb(e),e.r=n.r,e.g=n.g,e.b=n.b,e.hex=n.hex):t.is(e,"object")&&"h"in e&&"s"in e&&"l"in e?(n=t.hsl2rgb(e),e.r=n.r,e.g=n.g,e.b=n.b,e.hex=n.hex):(t.is(e,"string")&&(e=t.getRGB(e)),t.is(e,"object")&&"r"in e&&"g"in e&&"b"in e?(n=t.rgb2hsl(e),e.h=n.h,e.s=n.s,e.l=n.l,n=t.rgb2hsb(e),e.v=n.b):(e={hex:"none"}).r=e.g=e.b=e.h=e.s=e.v=e.l=-1),e.toString=oe,e},t.hsb2rgb=function(e,t,n,r){var i,a,o,s,u;return this.is(e,"object")&&"h"in e&&"s"in e&&"b"in e&&(n=e.b,t=e.s,r=e.o,e=e.h),s=(u=n*t)*(1-T((e=(e*=360)%360/60)%2-1)),i=a=o=n-u,ue(i+=[u,s,0,0,s,u][e=~~e],a+=[s,u,u,s,0,0][e],o+=[0,0,s,u,u,s][e],r)},t.hsl2rgb=function(e,t,n,r){var i,a,o,s,u;return this.is(e,"object")&&"h"in e&&"s"in e&&"l"in e&&(n=e.l,t=e.s,e=e.h),(e>1||t>1||n>1)&&(e/=360,t/=100,n/=100),s=(u=2*t*(n<.5?n:1-n))*(1-T((e=(e*=360)%360/60)%2-1)),i=a=o=n-u/2,ue(i+=[u,s,0,0,s,u][e=~~e],a+=[s,u,u,s,0,0][e],o+=[0,0,s,u,u,s][e],r)},t.rgb2hsb=function(e,t,n){var r,i;return e=(n=se(e,t,n))[0],t=n[1],n=n[2],{h:((0==(i=(r=E(e,t,n))-_(e,t,n))?null:r==e?(t-n)/i:r==t?(n-e)/i+2:(e-t)/i+4)+360)%6*60/360,s:0==i?0:i/r,b:r,toString:ie}},t.rgb2hsl=function(e,t,n){var r,i,a,o;return e=(n=se(e,t,n))[0],t=n[1],n=n[2],r=((i=E(e,t,n))+(a=_(e,t,n)))/2,{h:((0==(o=i-a)?null:i==e?(t-n)/o:i==t?(n-e)/o+2:(e-t)/o+4)+360)%6*60/360,s:0==o?0:r<.5?o/(2*r):o/(2-2*r),l:r,toString:ae}},t._path2string=function(){return this.join(",").replace(H,"$1")},t._preload=function(e,t){var n=l.doc.createElement("img");n.style.cssText="position:absolute;left:-9999em;top:-9999em",n.onload=function(){t.call(this),this.onload=null,l.doc.body.removeChild(this)},n.onerror=function(){l.doc.body.removeChild(this)},l.doc.body.appendChild(n),n.src=e},t.getRGB=ce((function(e){if(!e||(e=b(e)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:le};if("none"==e)return{r:-1,g:-1,b:-1,hex:"none",toString:le};!z[c](e.toLowerCase().substring(0,2))&&"#"!=e.charAt()&&(e=re(e));var n,r,i,a,o,s,u=e.match(R);return u?(u[2]&&(i=D(u[2].substring(5),16),r=D(u[2].substring(3,5),16),n=D(u[2].substring(1,3),16)),u[3]&&(i=D((o=u[3].charAt(3))+o,16),r=D((o=u[3].charAt(2))+o,16),n=D((o=u[3].charAt(1))+o,16)),u[4]&&(s=u[4][g](Z),n=L(s[0]),"%"==s[0].slice(-1)&&(n*=2.55),r=L(s[1]),"%"==s[1].slice(-1)&&(r*=2.55),i=L(s[2]),"%"==s[2].slice(-1)&&(i*=2.55),"rgba"==u[1].toLowerCase().slice(0,4)&&(a=L(s[3])),s[3]&&"%"==s[3].slice(-1)&&(a/=100)),u[5]?(s=u[5][g](Z),n=L(s[0]),"%"==s[0].slice(-1)&&(n*=2.55),r=L(s[1]),"%"==s[1].slice(-1)&&(r*=2.55),i=L(s[2]),"%"==s[2].slice(-1)&&(i*=2.55),("deg"==s[0].slice(-3)||"\xb0"==s[0].slice(-1))&&(n/=360),"hsba"==u[1].toLowerCase().slice(0,4)&&(a=L(s[3])),s[3]&&"%"==s[3].slice(-1)&&(a/=100),t.hsb2rgb(n,r,i,a)):u[6]?(s=u[6][g](Z),n=L(s[0]),"%"==s[0].slice(-1)&&(n*=2.55),r=L(s[1]),"%"==s[1].slice(-1)&&(r*=2.55),i=L(s[2]),"%"==s[2].slice(-1)&&(i*=2.55),("deg"==s[0].slice(-3)||"\xb0"==s[0].slice(-1))&&(n/=360),"hsla"==u[1].toLowerCase().slice(0,4)&&(a=L(s[3])),s[3]&&"%"==s[3].slice(-1)&&(a/=100),t.hsl2rgb(n,r,i,a)):((u={r:n,g:r,b:i,toString:le}).hex="#"+(16777216|i|r<<8|n<<16).toString(16).slice(1),t.is(a,"finite")&&(u.opacity=a),u)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:le}}),t),t.hsb=ce((function(e,n,r){return t.hsb2rgb(e,n,r).hex})),t.hsl=ce((function(e,n,r){return t.hsl2rgb(e,n,r).hex})),t.rgb=ce((function(e,t,n){function r(e){return e+.5|0}return"#"+(16777216|r(n)|r(t)<<8|r(e)<<16).toString(16).slice(1)})),t.getColor=function(e){var t=this.getColor.start=this.getColor.start||{h:0,s:1,b:e||.75},n=this.hsb2rgb(t.h,t.s,t.b);return t.h+=.075,t.h>1&&(t.h=0,t.s-=.2,t.s<=0&&(this.getColor.start={h:0,s:1,b:t.b})),n.hex},t.getColor.reset=function(){delete this.start},t.parsePathString=function(e){if(!e)return null;var n=de(e);if(n.arr)return ge(n.arr);var r={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},i=[];return t.is(e,I)&&t.is(e[0],I)&&(i=ge(e)),i.length||b(e).replace(q,(function(e,t,n){var a=[],o=t.toLowerCase();if(n.replace(W,(function(e,t){t&&a.push(+t)})),"m"==o&&a.length>2&&(i.push([t][h](a.splice(0,2))),o="l",t="m"==t?"l":"L"),"r"==o)i.push([t][h](a));else for(;a.length>=r[o]&&(i.push([t][h](a.splice(0,r[o]))),r[o]););})),i.toString=t._path2string,n.arr=ge(i),i},t.parseTransformString=ce((function(e){if(!e)return null;var n=[];return t.is(e,I)&&t.is(e[0],I)&&(n=ge(e)),n.length||b(e).replace(V,(function(e,t,r){var i=[];k.call(t),r.replace(W,(function(e,t){t&&i.push(+t)})),n.push([t][h](i))})),n.toString=t._path2string,n}),this,(function(e){if(!e)return e;for(var t=[],n=0;n1?1:u<0?0:u)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,p=0;p<12;p++){var h=c*l[p]+c,m=pe(h,e,n,i,o),v=pe(h,t,r,a,s),y=m*m+v*v;d+=f[p]*A.sqrt(y)}return c*d}function me(e,t,n,r,i,a,o,s){if(!(E(e,n)<_(i,o)||_(e,n)>E(i,o)||E(t,r)<_(a,s)||_(t,r)>E(a,s))){var u=(e-n)*(a-s)-(t-r)*(i-o);if(u){var c=((e*r-t*n)*(i-o)-(e-n)*(i*s-a*o))/u,l=((e*r-t*n)*(a-s)-(t-r)*(i*s-a*o))/u,f=+c.toFixed(2),d=+l.toFixed(2);if(!(f<+_(e,n).toFixed(2)||f>+E(e,n).toFixed(2)||f<+_(i,o).toFixed(2)||f>+E(i,o).toFixed(2)||d<+_(t,r).toFixed(2)||d>+E(t,r).toFixed(2)||d<+_(a,s).toFixed(2)||d>+E(a,s).toFixed(2)))return{x:c,y:l}}}}function ve(e,n,r){var i=t.bezierBBox(e),a=t.bezierBBox(n);if(!t.isBBoxIntersect(i,a))return r?0:[];for(var o=he.apply(0,e),s=he.apply(0,n),u=E(~~(o/5),1),c=E(~~(s/5),1),l=[],f=[],d={},p=r?0:[],h=0;h=0&&S<=1.001&&C>=0&&C<=1.001&&(r?p++:p.push({x:A.x,y:A.y,t1:_(S,1),t2:_(C,1)}))}}return p}function ye(e,n,r){e=t._path2curve(e),n=t._path2curve(n);for(var i,a,o,s,u,c,l,f,d,p,h=r?0:[],m=0,v=e.length;mb||y=e.x&&t<=e.x2&&n>=e.y&&n<=e.y2},t.isBBoxIntersect=function(e,n){var r=t.isPointInsideBBox;return r(n,e.x,e.y)||r(n,e.x2,e.y)||r(n,e.x,e.y2)||r(n,e.x2,e.y2)||r(e,n.x,n.y)||r(e,n.x2,n.y)||r(e,n.x,n.y2)||r(e,n.x2,n.y2)||(e.xn.x||n.xe.x)&&(e.yn.y||n.ye.y)},t.pathIntersection=function(e,t){return ye(e,t)},t.pathIntersectionNumber=function(e,t){return ye(e,t,1)},t.isPointInsidePath=function(e,n,r){var i=t.pathBBox(e);return t.isPointInsideBBox(i,n,r)&&ye(e,[["M",n,r],["H",i.x2+10]],1)%2==1},t._removedFactory=function(t){return function(){e("raphael.log",null,"Rapha\xebl: you are calling to method \u201c"+t+"\u201d of removed object",t)}};var be=t.pathBBox=function(e){var t=de(e);if(t.bbox)return ne(t.bbox);if(!e)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var n,r=0,i=0,a=[],o=[],s=0,u=(e=Se(e)).length;s1&&(r*=w=A.sqrt(w),i*=w);var x=r*r,k=i*i,E=(o==s?-1:1)*A.sqrt(T((x*k-x*b*b-k*y*y)/(x*b*b+k*y*y))),_=E*r*b/i+(t+u)/2,S=E*-i*y/r+(n+c)/2,O=A.asin(((n-S)/i).toFixed(9)),I=A.asin(((c-S)/i).toFixed(9));(O=t<_?C-O:O)<0&&(O=2*C+O),(I=u<_?C-I:I)<0&&(I=2*C+I),s&&O>I&&(O-=2*C),!s&&I>O&&(I-=2*C)}var P=I-O;if(T(P)>d){var R=I,M=u,N=c;I=O+d*(s&&I>O?1:-1),m=e(u=_+r*A.cos(I),c=S+i*A.sin(I),r,i,a,0,s,M,N,[I,R,_,S])}P=I-O;var j=A.cos(O),L=A.sin(O),D=A.cos(I),B=A.sin(I),U=A.tan(P/4),F=4/3*r*U,Z=4/3*i*U,z=[t,n],H=[t+F*L,n-Z*j],q=[u+F*B,c-Z*D],V=[u,c];if(H[0]=2*z[0]-H[0],H[1]=2*z[1]-H[1],l)return[H,q,V][h](m);for(var W=[],G=0,Y=(m=[H,q,V][h](m).join()[g](",")).length;G"1e12"&&(d=.5),T(h)>"1e12"&&(h=.5),d>0&&d<1&&(u=_e(e,t,n,r,i,a,o,s,d),v.push(u.x),m.push(u.y)),h>0&&h<1&&(u=_e(e,t,n,r,i,a,o,s,h),v.push(u.x),m.push(u.y)),c=a-2*r+t-(s-2*a+r),f=t-r,d=(-(l=2*(r-t)-2*(a-r))+A.sqrt(l*l-4*c*f))/2/c,h=(-l-A.sqrt(l*l-4*c*f))/2/c,T(d)>"1e12"&&(d=.5),T(h)>"1e12"&&(h=.5),d>0&&d<1&&(u=_e(e,t,n,r,i,a,o,s,d),v.push(u.x),m.push(u.y)),h>0&&h<1&&(u=_e(e,t,n,r,i,a,o,s,h),v.push(u.x),m.push(u.y)),{min:{x:_[p](0,v),y:_[p](0,m)},max:{x:E[p](0,v),y:E[p](0,m)}}})),Se=t._path2curve=ce((function(e,t){var n=!t&&de(e);if(!t&&n.curve)return ge(n.curve);for(var r=xe(e),i=t&&xe(t),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=function(e,t,n){var r,i;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"][h](Ee[p](0,[t.x,t.y][h](e.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*t.x-t.bx,i=2*t.y-t.by):(r=t.x,i=t.y),e=["C",r,i][h](e.slice(1));break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"][h](Ae(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"][h](Ae(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"][h](ke(t.x,t.y,e[1],e[2]));break;case"H":e=["C"][h](ke(t.x,t.y,e[1],t.y));break;case"V":e=["C"][h](ke(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"][h](ke(t.x,t.y,t.X,t.Y))}return e},u=function(e,t){if(e[t].length>7){e[t].shift();for(var n=e[t];n.length;)l[t]="A",i&&(f[t]="A"),e.splice(t++,0,["C"][h](n.splice(0,6)));e.splice(t,1),y=E(r.length,i&&i.length||0)}},c=function(e,t,n,a,o){e&&t&&"M"==e[o][0]&&"M"!=t[o][0]&&(t.splice(o,0,["M",a.x,a.y]),n.bx=0,n.by=0,n.x=e[o][1],n.y=e[o][2],y=E(r.length,i&&i.length||0))},l=[],f=[],d="",m="",v=0,y=E(r.length,i&&i.length||0);v.01;)c=he(e,t,n,r,i,a,o,s,f+=(ci){if(n&&!d.start){if(f+=["C"+(l=Ge(o,s,u[1],u[2],u[3],u[4],u[5],u[6],i-p)).start.x,l.start.y,l.m.x,l.m.y,l.x,l.y],a)return f;d.start=f,f=["M"+l.x,l.y+"C"+l.n.x,l.n.y,l.end.x,l.end.y,u[5],u[6]].join(),p+=c,o=+u[5],s=+u[6];continue}if(!e&&!n)return{x:(l=Ge(o,s,u[1],u[2],u[3],u[4],u[5],u[6],i-p)).x,y:l.y,alpha:l.alpha}}p+=c,o=+u[5],s=+u[6]}f+=u.shift()+u}return d.end=f,(l=e?p:n?d:t.findDotsAtSegment(o,s,u[0],u[1],u[2],u[3],u[4],u[5],1)).alpha&&(l={x:l.x,y:l.y,alpha:l.alpha}),l}},Ke=Ye(1),Je=Ye(),Qe=Ye(0,1);t.getTotalLength=Ke,t.getPointAtLength=Je,t.getSubpath=function(e,t,n){if(this.getTotalLength(e)-n<1e-6)return Qe(e,t).end;var r=Qe(e,n,1);return t?Qe(r,t).end:r},He.getTotalLength=function(){var e=this.getPath();if(e)return this.node.getTotalLength?this.node.getTotalLength():Ke(e)},He.getPointAtLength=function(e){var t=this.getPath();if(t)return Je(t,e)},He.getPath=function(){var e,n=t._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return n&&(e=n(this)),e},He.getSubpath=function(e,n){var r=this.getPath();if(r)return t.getSubpath(r,e,n)};var Xe=t.easing_formulas={linear:function(e){return e},"<":function(e){return S(e,1.7)},">":function(e){return S(e,.48)},"<>":function(e){var t=.48-e/1.04,n=A.sqrt(.1734+t*t),r=n-t,i=-n-t,a=S(T(r),1/3)*(r<0?-1:1)+S(T(i),1/3)*(i<0?-1:1)+.5;return 3*(1-a)*a*a+a*a*a},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},elastic:function(e){return e==!!e?e:S(2,-10*e)*A.sin(2*C*(e-.075)/.3)+1},bounce:function(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375}};Xe.easeIn=Xe["ease-in"]=Xe["<"],Xe.easeOut=Xe["ease-out"]=Xe[">"],Xe.easeInOut=Xe["ease-in-out"]=Xe["<>"],Xe["back-in"]=Xe.backIn,Xe["back-out"]=Xe.backOut;var $e=[],et=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,16)},tt=function n(){for(var r=+new Date,i=0;i<$e.length;i++){var a=$e[i];if(!a.el.removed&&!a.paused){var o,s,u=r-a.start,l=a.ms,f=a.easing,d=a.from,p=a.diff,m=a.to,v=(a.t,a.el),b={},g={};if(a.initstatus?(u=(a.initstatus*a.anim.top-a.prev)/(a.percent-a.prev)*l,a.status=a.initstatus,delete a.initstatus,a.stop&&$e.splice(i--,1)):a.status=(a.prev+(a.percent-a.prev)*(u/l))/a.anim.top,!(u<0))if(u1&&!a.next){for(s in m)m[c](s)&&(g[s]=a.totalOrigin[s]);a.el.attr(g),at(a.anim,a.el,a.anim.percents[0],null,a.totalOrigin,a.repeat-1)}a.next&&!a.stop&&at(a.anim,a.el,a.next,null,a.totalOrigin,a.repeat)}}}$e.length&&et(n)},nt=function(e){return e>255?255:e<0?0:e};function rt(e,t,n,r,i,a){var o=3*t,s=3*(r-t)-o,u=1-o-s,c=3*n,l=3*(i-n)-c,f=1-c-l;function d(e){return((u*e+s)*e+o)*e}return function(e,t){var n=function(e,t){var n,r,i,a,c,l;for(i=e,l=0;l<8;l++){if(a=d(i)-e,T(a)(r=1))return r;for(;na?n=i:r=i,i=(r-n)/2+n}return i}(e,t);return((f*n+l)*n+c)*n}(e,1/(200*a))}function it(e,t){var n=[],r={};if(this.ms=t,this.times=1,e){for(var i in e)e[c](i)&&(r[L(i)]=e[i],n.push(L(i)));n.sort(Y)}this.anim=r,this.top=n[n.length-1],this.percents=n}function at(n,r,i,a,s,u){i=L(i);var l,f,d,p,m,v,y=n.ms,w={},x={},k={};if(a)for(E=0,_=$e.length;E<_;E++){var A=$e[E];if(A.el.id==r.id&&A.anim==n){A.percent!=i?($e.splice(E,1),d=1):f=A,r.attr(A.totalOrigin);break}}else a=+x;for(var E=0,_=n.percents.length;E<_;E++){if(n.percents[E]==i||n.percents[E]>a*n.top){i=n.percents[E],m=n.percents[E-1]||0,y=y/n.top*(i-m),p=n.percents[E+1],l=n.anim[i];break}a&&r.attr(n.anim[n.percents[E]])}if(l){if(f)f.initstatus=a,f.start=new Date-f.ms*a;else{for(var T in l)if(l[c](T)&&(F[c](T)||r.paper.customAttributes[c](T)))switch(w[T]=r.attr(T),null==w[T]&&(w[T]=U[T]),x[T]=l[T],F[T]){case O:k[T]=(x[T]-w[T])/y;break;case"colour":w[T]=t.getRGB(w[T]);var S=t.getRGB(x[T]);k[T]={r:(S.r-w[T].r)/y,g:(S.g-w[T].g)/y,b:(S.b-w[T].b)/y};break;case"path":var C=Se(w[T],x[T]),I=C[1];for(w[T]=C[0],k[T]=[],E=0,_=w[T].length;E<_;E++){k[T][E]=[0];for(var P=1,R=w[T][E].length;Pu&&(u=f)}!e[u+="%"].callback&&(e[u].callback=i)}return new it(e,n)},He.animate=function(e,n,r,i){if(this.removed)return i&&i.call(this),this;var a=e instanceof it?e:t.animation(e,n,r,i);return at(a,this,a.percents[0],null,this.attr()),this},He.setTime=function(e,t){return e&&null!=t&&this.status(e,_(t,e.ms)/e.ms),this},He.status=function(e,t){var n,r,i=[],a=0;if(null!=t)return at(e,this,-1,_(t,1)),this;for(n=$e.length;a1)for(var r=0,i=n.length;r.5)-1;u(d-.5,2)+u(p-.5,2)>.25&&(p=a.sqrt(.25-u(d-.5,2))*i+.5)&&.5!=p&&(p=p.toFixed(5)-1e-5*i)}return f}))).split(/\s*\-\s*/),"linear"==c){var w=i.shift();if(w=-r(w),isNaN(w))return null;var x=[0,0,a.cos(e.rad(w)),a.sin(e.rad(w))],k=1/(o(s(x[2]),s(x[3]))||1);x[2]*=k,x[3]*=k,x[2]<0&&(x[0]=-x[2],x[2]=0),x[3]<0&&(x[1]=-x[3],x[3]=0)}var A=e._parseDots(i);if(!A)return null;if(l=l.replace(/[\(\)\s,\xb0#]/g,"_"),t.gradient&&l!=t.gradient.id&&(m.defs.removeChild(t.gradient),delete t.gradient),!t.gradient){g=v(c+"Gradient",{id:l}),t.gradient=g,v(g,"radial"==c?{fx:d,fy:p}:{x1:x[0],y1:x[1],x2:x[2],y2:x[3],gradientTransform:t.matrix.invert()}),m.defs.appendChild(g);for(var E=0,_=A.length;E<_;E++)g.appendChild(v("stop",{offset:A[E].offset?A[E].offset:E?"100%":"0%","stop-color":A[E].color||"#fff","stop-opacity":isFinite(A[E].opacity)?A[E].opacity:1}))}}return v(h,{fill:b(l),opacity:1,"fill-opacity":1}),y.fill=f,y.opacity=1,y.fillOpacity=1,1},b=function(e){if((t=document.documentMode)&&(9===t||10===t))return"url('#"+e+"')";var t,n=document.location;return"url('"+n.protocol+"//"+n.host+n.pathname+n.search+"#"+e+"')"},g=function(e){var t=e.getBBox(1);v(e.pattern,{patternTransform:e.matrix.invert()+" translate("+t.x+","+t.y+")"})},w=function(r,i,a){if("path"==r.type){for(var o,s,u,c,l,d=n(i).toLowerCase().split("-"),p=r.paper,y=a?"end":"start",b=r.node,g=r.attrs,w=g["stroke-width"],x=d.length,k="classic",A=3,E=3,_=5;x--;)switch(d[x]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":k=d[x];break;case"wide":E=5;break;case"narrow":E=2;break;case"long":A=5;break;case"short":A=2}if("open"==k?(A+=2,E+=2,_+=2,u=1,c=a?4:1,l={fill:"none",stroke:g.stroke}):(c=u=A/2,l={fill:g.stroke,stroke:"none"}),r._.arrows?a?(r._.arrows.endPath&&m[r._.arrows.endPath]--,r._.arrows.endMarker&&m[r._.arrows.endMarker]--):(r._.arrows.startPath&&m[r._.arrows.startPath]--,r._.arrows.startMarker&&m[r._.arrows.startMarker]--):r._.arrows={},"none"!=k){var T="raphael-marker-"+k,S="raphael-marker-"+y+k+A+E+"-obj"+r.id;e._g.doc.getElementById(T)?m[T]++:(p.defs.appendChild(v(v("path"),{"stroke-linecap":"round",d:h[k],id:T})),m[T]=1);var C,O=e._g.doc.getElementById(S);O?(m[S]++,C=O.getElementsByTagName("use")[0]):(O=v(v("marker"),{id:S,markerHeight:E,markerWidth:A,orient:"auto",refX:c,refY:E/2}),C=v(v("use"),{"xlink:href":"#"+T,transform:(a?"rotate(180 "+A/2+" "+E/2+") ":f)+"scale("+A/_+","+E/_+")","stroke-width":(1/((A/_+E/_)/2)).toFixed(4)}),O.appendChild(C),p.defs.appendChild(O),m[S]=1),v(C,l);var I=u*("diamond"!=k&&"oval"!=k);a?(o=r._.arrows.startdx*w||0,s=e.getTotalLength(g.path)-I*w):(o=I*w,s=e.getTotalLength(g.path)-(r._.arrows.enddx*w||0)),(l={})["marker-"+y]="url(#"+S+")",(s||o)&&(l.d=e.getSubpath(g.path,o,s)),v(b,l),r._.arrows[y+"Path"]=T,r._.arrows[y+"Marker"]=S,r._.arrows[y+"dx"]=I,r._.arrows[y+"Type"]=k,r._.arrows[y+"String"]=i}else a?(o=r._.arrows.startdx*w||0,s=e.getTotalLength(g.path)-o):(o=0,s=e.getTotalLength(g.path)-(r._.arrows.enddx*w||0)),r._.arrows[y+"Path"]&&v(b,{d:e.getSubpath(g.path,o,s)}),delete r._.arrows[y+"Path"],delete r._.arrows[y+"Marker"],delete r._.arrows[y+"dx"],delete r._.arrows[y+"Type"],delete r._.arrows[y+"String"];for(l in m)if(m[t](l)&&!m[l]){var P=e._g.doc.getElementById(l);P&&P.parentNode.removeChild(P)}}},x={"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},k=function(e,t,r){if(t=x[n(t).toLowerCase()]){for(var i=e.attrs["stroke-width"]||"1",a={round:i,square:i,butt:0}[e.attrs["stroke-linecap"]||r["stroke-linecap"]]||0,o=[],s=t.length;s--;)o[s]=t[s]*i+(s%2?1:-1)*a;v(e.node,{"stroke-dasharray":o.join(",")})}else v(e.node,{"stroke-dasharray":"none"})},A=function(r,a){var u=r.node,l=r.attrs,d=u.style.visibility;for(var h in u.style.visibility="hidden",a)if(a[t](h)){if(!e._availableAttrs[t](h))continue;var m=a[h];switch(l[h]=m,h){case"blur":r.blur(m);break;case"title":var b=u.getElementsByTagName("title");if(b.length&&(b=b[0]))b.firstChild.nodeValue=m;else{b=v("title");var x=e._g.doc.createTextNode(m);b.appendChild(x),u.appendChild(b)}break;case"href":case"target":var A=u.parentNode;if("a"!=A.tagName.toLowerCase()){var _=v("a");A.insertBefore(_,u),_.appendChild(u),A=_}"target"==h?A.setAttributeNS(p,"show","blank"==m?"new":m):A.setAttributeNS(p,h,m);break;case"cursor":u.style.cursor=m;break;case"transform":r.transform(m);break;case"arrow-start":w(r,m);break;case"arrow-end":w(r,m,1);break;case"clip-rect":var T=n(m).split(c);if(4==T.length){r.clip&&r.clip.parentNode.parentNode.removeChild(r.clip.parentNode);var S=v("clipPath"),C=v("rect");S.id=e.createUUID(),v(C,{x:T[0],y:T[1],width:T[2],height:T[3]}),S.appendChild(C),r.paper.defs.appendChild(S),v(u,{"clip-path":"url(#"+S.id+")"}),r.clip=C}if(!m){var O=u.getAttribute("clip-path");if(O){var I=e._g.doc.getElementById(O.replace(/(^url\(#|\)$)/g,f));I&&I.parentNode.removeChild(I),v(u,{"clip-path":f}),delete r.clip}}break;case"path":"path"==r.type&&(v(u,{d:m?l.path=e._pathToAbsolute(m):"M0,0"}),r._.dirty=1,r._.arrows&&("startString"in r._.arrows&&w(r,r._.arrows.startString),"endString"in r._.arrows&&w(r,r._.arrows.endString,1)));break;case"width":if(u.setAttribute(h,m),r._.dirty=1,!l.fx)break;h="x",m=l.x;case"x":l.fx&&(m=-l.x-(l.width||0));case"rx":if("rx"==h&&"rect"==r.type)break;case"cx":u.setAttribute(h,m),r.pattern&&g(r),r._.dirty=1;break;case"height":if(u.setAttribute(h,m),r._.dirty=1,!l.fy)break;h="y",m=l.y;case"y":l.fy&&(m=-l.y-(l.height||0));case"ry":if("ry"==h&&"rect"==r.type)break;case"cy":u.setAttribute(h,m),r.pattern&&g(r),r._.dirty=1;break;case"r":"rect"==r.type?v(u,{rx:m,ry:m}):u.setAttribute(h,m),r._.dirty=1;break;case"src":"image"==r.type&&u.setAttributeNS(p,"href",m);break;case"stroke-width":1==r._.sx&&1==r._.sy||(m/=o(s(r._.sx),s(r._.sy))||1),u.setAttribute(h,m),l["stroke-dasharray"]&&k(r,l["stroke-dasharray"],a),r._.arrows&&("startString"in r._.arrows&&w(r,r._.arrows.startString),"endString"in r._.arrows&&w(r,r._.arrows.endString,1));break;case"stroke-dasharray":k(r,m,a);break;case"fill":var P=n(m).match(e._ISURL);if(P){S=v("pattern");var R=v("image");S.id=e.createUUID(),v(S,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),v(R,{x:0,y:0,"xlink:href":P[1]}),S.appendChild(R),function(t){e._preload(P[1],(function(){var e=this.offsetWidth,n=this.offsetHeight;v(t,{width:e,height:n}),v(R,{width:e,height:n})}))}(S),r.paper.defs.appendChild(S),v(u,{fill:"url(#"+S.id+")"}),r.pattern=S,r.pattern&&g(r);break}var M=e.getRGB(m);if(M.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=n(m).charAt())&&y(r,m)){if("opacity"in l||"fill-opacity"in l){var N=e._g.doc.getElementById(u.getAttribute("fill").replace(/^url\(#|\)$/g,f));if(N){var j=N.getElementsByTagName("stop");v(j[j.length-1],{"stop-opacity":("opacity"in l?l.opacity:1)*("fill-opacity"in l?l["fill-opacity"]:1)})}}l.gradient=m,l.fill="none";break}}else delete a.gradient,delete l.gradient,!e.is(l.opacity,"undefined")&&e.is(a.opacity,"undefined")&&v(u,{opacity:l.opacity}),!e.is(l["fill-opacity"],"undefined")&&e.is(a["fill-opacity"],"undefined")&&v(u,{"fill-opacity":l["fill-opacity"]});M[t]("opacity")&&v(u,{"fill-opacity":M.opacity>1?M.opacity/100:M.opacity});case"stroke":M=e.getRGB(m),u.setAttribute(h,M.hex),"stroke"==h&&M[t]("opacity")&&v(u,{"stroke-opacity":M.opacity>1?M.opacity/100:M.opacity}),"stroke"==h&&r._.arrows&&("startString"in r._.arrows&&w(r,r._.arrows.startString),"endString"in r._.arrows&&w(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=n(m).charAt())&&y(r,m);break;case"opacity":l.gradient&&!l[t]("stroke-opacity")&&v(u,{"stroke-opacity":m>1?m/100:m});case"fill-opacity":if(l.gradient){(N=e._g.doc.getElementById(u.getAttribute("fill").replace(/^url\(#|\)$/g,f)))&&(j=N.getElementsByTagName("stop"),v(j[j.length-1],{"stop-opacity":m}));break}default:"font-size"==h&&(m=i(m,10)+"px");var L=h.replace(/(\-.)/g,(function(e){return e.substring(1).toUpperCase()}));u.style[L]=m,r._.dirty=1,u.setAttribute(h,m)}}E(r,a),u.style.visibility=d},E=function(r,a){if("text"==r.type&&(a[t]("text")||a[t]("font")||a[t]("font-size")||a[t]("x")||a[t]("y"))){var o=r.attrs,s=r.node,u=s.firstChild?i(e._g.doc.defaultView.getComputedStyle(s.firstChild,f).getPropertyValue("font-size"),10):10;if(a[t]("text")){for(o.text=a.text;s.firstChild;)s.removeChild(s.firstChild);for(var c,l=n(a.text).split("\n"),d=[],p=0,h=l.length;p"));var Y=W.getBoundingClientRect();S.W=m.w=(Y.right-Y.left)/100,S.H=m.h=(Y.bottom-Y.top)/100,S.X=m.x,S.Y=m.y+S.H/2,("x"in u||"y"in u)&&(S.path.v=e.format("m{0},{1}l{2},{1}",a(m.x*b),a(m.y*b),a(m.x*b)+1));for(var K=["x","y","text","font","font-family","font-weight","font-style","font-size"],J=0,Q=K.length;J.25&&(n=i.sqrt(.25-s(t-.5,2))*(2*(n>.5)-1)+.5),c=t+f+n),d}))).split(/\s*\-\s*/),"linear"==u){var l=a.shift();if(l=-r(l),isNaN(l))return null}var p=e._parseDots(a);if(!p)return null;if(t=t.shape||t.node,p.length){t.removeChild(o),o.on=!0,o.method="none",o.color=p[0].color,o.color2=p[p.length-1].color;for(var h=[],m=0,v=p.length;m')}}catch(e){A=function(e){return t.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},e._engine.initWin(e._g.win),e._engine.create=function(){var t=e._getContainer.apply(0,arguments),n=t.container,r=t.height,i=t.width,a=t.x,o=t.y;if(!n)throw new Error("VML container not found.");var s=new e._Paper,u=s.canvas=e._g.doc.createElement("div"),c=u.style;return a=a||0,o=o||0,i=i||512,r=r||342,s.width=i,s.height=r,i==+i&&(i+="px"),r==+r&&(r+="px"),s.coordsize=216e5+f+216e5,s.coordorigin="0 0",s.span=e._g.doc.createElement("span"),s.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",u.appendChild(s.span),c.cssText=e.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",i,r),1==n?(e._g.doc.body.appendChild(u),c.left=a+"px",c.top=o+"px",c.position="absolute"):n.firstChild?n.insertBefore(u,n.firstChild):n.appendChild(u),s.renderfix=function(){},s},e.prototype.clear=function(){e.eve("raphael.clear",this),this.canvas.innerHTML=d,this.span=e._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},e.prototype.remove=function(){for(var t in e.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[t]="function"==typeof this[t]?e._removedFactory(t):null;return!0};var O=e.st;for(var I in C)C[t](I)&&!O[t](I)&&(O[I]=function(e){return function(){var t=arguments;return this.forEach((function(n){n[e].apply(n,t)}))}}(I))}}.apply(t,r))||(e.exports=i)}])},46225:function(e,t,n){"use strict";var r,i=n(47313),a=(r=i)&&"object"===typeof r&&"default"in r?r.default:r,o=new(n(61663)),s=o.getBrowser(),u=(o.getCPU(),o.getDevice()),c=o.getEngine(),l=o.getOS(),f=o.getUA(),d=function(e){return e||(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none")},p=function(){return!("undefined"===typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},h=function(e){var t=p();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};function m(e){return m="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function v(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var E="mobile",_="tablet",T="smarttv",S="console",C="wearable",O=void 0,I={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},P={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},R={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},M=function(e,t,n,r){return function(e){for(var t=1;t1)&&!window.MSStream}(),ye=B(),be=h("iPhone"),ge=h("iPod"),we=function(){var e=p(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"===typeof t&&/electron/.test(t)}(),xe=j(),ke=D()&&!j(),Ae=l.name===P.Windows,Ee=l.name===P.MAC_OS,_e=s.name===I.MIUI,Te=s.name===I.SamsungBrowser;t.tq=q},30534:function(e,t,n){"use strict";var r=n(47313),i=n(62224);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n